/* Korean style template - full redesign */
:root {
    --kr-bg: #0c0c0f;
    --kr-bg-card: #16161d;
    --kr-bg-elevated: #1c1c26;
    --kr-text: #f1f1f4;
    --kr-text-muted: #8b8b9a;
    --kr-accent: #e85d75;
    --kr-accent-soft: rgba(232, 93, 117, 0.25);
    --kr-border: #2a2a36;
    --kr-radius: 12px;
    --kr-font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.kr-body {
    font-family: var(--kr-font);
    background: var(--kr-bg);
    color: var(--kr-text);
    line-height: 1.5;
    min-height: 100vh;
}

.kr-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* Header - fixed, glass-style */
.kr-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(12, 12, 15, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--kr-border);
    transition: background 0.2s;
}

.kr-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.kr-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--kr-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.kr-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kr-nav-link {
    padding: 8px 14px;
    color: var(--kr-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.kr-nav-link:hover { color: var(--kr-text); background: var(--kr-accent-soft); }
.kr-nav-link.is-active { color: var(--kr-accent); background: var(--kr-accent-soft); }

.kr-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kr-search {
    display: flex;
    align-items: center;
    background: var(--kr-bg-card);
    border: 1px solid var(--kr-border);
    border-radius: 20px;
    overflow: hidden;
    padding: 0 4px 0 14px;
}

.kr-search-input {
    width: 140px;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--kr-text);
    font-size: 13px;
    font-family: var(--kr-font);
}

.kr-search-input::placeholder { color: var(--kr-text-muted); }
.kr-search-btn {
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--kr-text-muted);
    cursor: pointer;
    font-size: 14px;
}

.kr-menu-btn {
    display: none;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--kr-text);
    font-size: 1.2rem;
    cursor: pointer;
}

.kr-main { flex: 1; padding-top: 56px; }

/* Page container */
.kr-page { padding-bottom: 48px; }

/* Hero - full width, gradient overlay */
.kr-hero {
    position: relative;
    height: 70vh;
    min-height: 380px;
    background: var(--kr-bg) var(--kr-hero-bg) center/cover no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 0 24px 80px;
}

.kr-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--kr-bg) 0%, transparent 50%, rgba(0,0,0,0.4) 100%);
}

.kr-hero-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.kr-hero-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--kr-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.kr-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.kr-hero-meta {
    color: var(--kr-text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.kr-hero-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.kr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--kr-font);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border: none;
    cursor: pointer;
}

.kr-btn-primary { background: var(--kr-accent); color: #fff; }
.kr-btn-primary:hover { background: #d94d65; }
.kr-btn-ghost { background: rgba(255,255,255,0.1); color: var(--kr-text); border: 1px solid var(--kr-border); }
.kr-btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* Horizontal scroll rows - key differentiator */
.kr-row {
    padding: 24px 0;
    max-width: 100%;
    overflow: hidden;
}

.kr-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 12px;
}

.kr-row-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.kr-row-more {
    font-size: 0.85rem;
    color: var(--kr-accent);
    text-decoration: none;
    font-weight: 500;
}

.kr-row-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 24px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.kr-row-scroll::-webkit-scrollbar { display: none; }

.kr-row-inner {
    display: flex;
    gap: 16px;
    padding: 4px 0;
    width: max-content;
}

/* Card in row - poster ratio 2/3 */
.kr-card {
    flex-shrink: 0;
    width: 160px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.kr-card:hover { transform: scale(1.03); }

.kr-card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--kr-radius);
    overflow: hidden;
    background: var(--kr-bg-card);
}

.kr-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kr-card-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.75);
    font-size: 11px;
    border-radius: 4px;
}

.kr-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* List page - grid */
.kr-list-page { padding: 24px 24px 48px; }

.kr-list-head { margin-bottom: 24px; }

.kr-list-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.kr-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.kr-list-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.kr-list-card:hover { transform: translateY(-4px); }

.kr-list-card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--kr-radius);
    overflow: hidden;
    background: var(--kr-bg-card);
}

.kr-list-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kr-list-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s;
    color: #fff;
    font-size: 2rem;
}

.kr-list-card:hover .kr-list-card-play { opacity: 1; }

.kr-list-card-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 2px 8px;
    background: var(--kr-accent);
    font-size: 11px;
    border-radius: 4px;
}

.kr-list-card-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kr-list-card-meta {
    font-size: 0.8rem;
    color: var(--kr-text-muted);
    margin-top: 2px;
}

/* Pagination */
.kr-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.kr-pag-prev, .kr-pag-next {
    padding: 8px 16px;
    background: var(--kr-bg-card);
    color: var(--kr-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--kr-border);
}

.kr-pag-num { color: var(--kr-text-muted); font-size: 0.9rem; }

/* Detail - two column */
.kr-detail-page { padding: 24px 24px 48px; }

.kr-detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.kr-detail-poster-wrap { position: sticky; top: 80px; height: fit-content; }

.kr-detail-poster {
    display: block;
    position: relative;
    border-radius: var(--kr-radius);
    overflow: hidden;
    background: var(--kr-bg-card);
    aspect-ratio: 2/3;
}

.kr-detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kr-detail-poster-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s;
    color: #fff;
    font-size: 3rem;
}

.kr-detail-poster:hover .kr-detail-poster-play { opacity: 1; }

.kr-detail-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 4px 10px;
    background: var(--kr-accent);
    font-size: 12px;
    border-radius: 4px;
}

.kr-detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.kr-detail-meta, .kr-detail-cast {
    color: var(--kr-text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.kr-detail-actions { margin: 20px 0; }

.kr-detail-ep { margin: 20px 0; }

.kr-detail-ep-line {
    display: block;
    font-size: 0.8rem;
    color: var(--kr-text-muted);
    margin-bottom: 8px;
}

.kr-detail-ep-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kr-detail-ep-item {
    padding: 6px 12px;
    background: var(--kr-bg-card);
    border: 1px solid var(--kr-border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--kr-text);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.kr-detail-ep-item:hover { border-color: var(--kr-accent); background: var(--kr-accent-soft); }

.kr-detail-plot { margin-top: 24px; }

.kr-detail-plot-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.kr-detail-plot-content {
    font-size: 0.9rem;
    color: var(--kr-text-muted);
    line-height: 1.7;
}

/* Play page */
.kr-play-page { padding: 0 0 48px; }

.kr-play-area {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    background: #000;
}

.kr-player-box {
    width: 100%;
    height: 100%;
}

.kr-play-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--kr-border);
}

.kr-play-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-right: 12px;
}

.kr-play-ep {
    font-size: 0.9rem;
    color: var(--kr-accent);
    margin-right: auto;
}

.kr-play-nav { display: flex; gap: 8px; }

.kr-play-lines {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    gap: 8px;
}

.kr-play-line {
    padding: 6px 14px;
    background: var(--kr-bg-card);
    border: 1px solid var(--kr-border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--kr-text-muted);
    text-decoration: none;
}

.kr-play-line.is-active { border-color: var(--kr-accent); color: var(--kr-accent); }

.kr-play-ep-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kr-play-ep-line-label {
    width: 100%;
    font-size: 0.8rem;
    color: var(--kr-text-muted);
    margin-bottom: 4px;
}

.kr-play-ep-item {
    padding: 6px 12px;
    background: var(--kr-bg-card);
    border: 1px solid var(--kr-border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--kr-text);
    text-decoration: none;
}

.kr-play-ep-item.is-active { border-color: var(--kr-accent); background: var(--kr-accent-soft); color: var(--kr-accent); }

.kr-play-plot {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Empty */
.kr-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--kr-text-muted);
}

/* Footer */
.kr-footer {
    margin-top: auto;
    padding: 20px 24px;
    border-top: 1px solid var(--kr-border);
    text-align: center;
    background: var(--kr-bg-card);
}

.kr-footer-text { font-size: 0.85rem; color: var(--kr-text-muted); }

/* Responsive */
@media (max-width: 900px) {
    .kr-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--kr-bg-elevated);
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--kr-border);
    }
    .kr-nav.is-open { display: flex; }
    .kr-menu-btn { display: block; }
    .kr-detail-layout { grid-template-columns: 1fr; }
    .kr-detail-poster-wrap { position: static; max-width: 280px; margin: 0 auto 24px; }
}

@media (max-width: 600px) {
    .kr-hero { height: 50vh; min-height: 280px; padding-bottom: 40px; }
    .kr-row-inner { gap: 12px; }
    .kr-card { width: 130px; }
    .kr-list-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
