.drama-page {
    --drama-surface: var(--dx-base2-color, #17171e);
    --drama-surface-strong: var(--dx-base3-color, #1e1e27);
    --drama-line: var(--dx-border-color, #353742);
    --drama-text: #f4f4f6;
    --drama-muted: var(--dx-font2-color, #8a8b8c);
    --drama-primary: var(--dx-primary-color, #ff2f6d);
    color: var(--drama-text);
    padding-bottom: 48px;
}

.drama-page *, .drama-page *::before, .drama-page *::after { box-sizing: border-box; }
.drama-page ul, .drama-page ol { margin: 0; padding: 0; list-style: none; }
.drama-page a { text-decoration: none; }

.drama-page-head { padding: 14px 0 22px; }
.drama-page-head h1, .drama-detail-title { margin: 0; font-weight: 800; line-height: 1.25; }
.drama-page-head h1 { font-size: clamp(24px, 3vw, 34px); }
.drama-page-head p { margin: 8px 0 0; color: #aaaab5; font-size: 15px; }

.drama-list-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.drama-list-bar__count { color: var(--drama-muted); font-size: 13px; }
.drama-tabs { display: flex; gap: 7px; }
.drama-tabs__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 38px;
    padding: 0 20px;
    border: 1px solid var(--drama-line);
    border-radius: 999px;
    background: var(--drama-surface);
    color: #b8b8c2;
    font-size: 14px;
    font-weight: 650;
}
.drama-tabs__item:hover { border-color: var(--drama-primary); color: #fff; }
.drama-tabs__item.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--drama-primary), #ff5a3d);
    color: #fff;
    box-shadow: 0 6px 18px rgba(255, 47, 109, .2);
}

.drama-list-feedback:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--drama-muted);
    font-size: 14px;
}
.drama-list-feedback button {
    padding: 4px 14px;
    border: 1px solid var(--drama-line);
    border-radius: 999px;
    background: var(--drama-surface);
    color: var(--drama-text);
    cursor: pointer;
}
.drama-tabs__item:focus-visible,
.drama-list-feedback button:focus-visible {
    outline: 2px solid var(--drama-primary);
    outline-offset: 3px;
}
[data-drama-results][aria-busy="true"] { opacity: .65; }

.drama-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px 16px;
}
.drama-card {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: var(--drama-surface);
    color: inherit;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.drama-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 47, 109, .45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .42);
}
.drama-card__poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    background: linear-gradient(145deg, #292934, #101014);
}
.drama-card__poster::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .72));
    pointer-events: none;
}
.drama-card__poster img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.drama-card:hover .drama-card__poster img { transform: scale(1.025); }
.drama-card__state {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--drama-primary), #ff713d);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.drama-card__eps {
    position: absolute;
    bottom: 9px;
    left: 10px;
    z-index: 2;
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    text-shadow: 0 1px 4px #000;
}
.drama-card__play {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity .2s ease;
}
.drama-card:hover .drama-card__play { opacity: 1; }
.drama-card__play > span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 47, 109, .94);
    color: #fff;
    box-shadow: 0 7px 22px rgba(0, 0, 0, .4);
}
.drama-card__info { padding: 11px 12px 13px; }
.drama-card__info h2 {
    margin: 0;
    overflow: hidden;
    color: var(--drama-text);
    font-size: 15px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drama-card__info p {
    display: -webkit-box;
    min-height: 36px;
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--drama-muted);
    font-size: 12px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.drama-empty {
    padding: 60px 20px;
    border: 1px dashed var(--drama-line);
    border-radius: 14px;
    background: var(--drama-surface);
    color: var(--drama-muted);
    text-align: center;
}
.drama-empty strong { display: block; margin-bottom: 7px; color: var(--drama-text); font-size: 17px; }
.drama-empty p { margin: 0; }

.drama-detail-title { margin: 8px 0 20px; font-size: clamp(21px, 2.7vw, 31px); }
.drama-hero {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: clamp(22px, 3vw, 38px);
    margin-bottom: 34px;
}
.drama-hero__cover {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 9 / 16;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: linear-gradient(145deg, #292934, #101014);
}
.drama-hero__cover img { width: 100%; height: 100%; object-fit: cover; }
.drama-hero__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 11px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--drama-primary), #ff713d);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.drama-hero__body { display: flex; min-width: 0; flex-direction: column; }
.drama-info-block { margin-bottom: 22px; }
.drama-info-block h2, .drama-player-heading h2, .drama-episodes h2 { margin: 0 0 10px; font-size: 17px; font-weight: 720; }
.drama-synopsis p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #b8b8c2;
    font-size: 14px;
    line-height: 1.85;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}
.drama-synopsis p.is-open { display: block; overflow: visible; }
.drama-synopsis button {
    margin-top: 10px;
    padding: 5px 13px;
    border: 1px solid rgba(255, 47, 109, .35);
    border-radius: 999px;
    background: rgba(255, 47, 109, .1);
    color: #ff739c;
    cursor: pointer;
    font-size: 12px;
}
.drama-muted { color: var(--drama-muted); }
.drama-meta { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 14px; }
.drama-meta dt { color: var(--drama-muted); }
.drama-meta dd { margin: 0; color: #d8d8df; }
.drama-watch-button {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    justify-content: center;
    height: 42px;
    margin-top: auto;
    padding: 0 25px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--drama-primary), #ff5a3d);
    color: #fff;
    font-weight: 700;
}

.drama-player-section { margin: 0 0 30px; }
.drama-player-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.drama-player-heading h2 { margin-bottom: 0; }
.drama-player-heading p { margin: 0; color: var(--drama-muted); font-size: 13px; }
.drama-player-heading p.is-error { color: #ff8290; }
.drama-player-shell {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: #000;
}
.drama-player-shell video { display: block; width: 100%; height: 100%; background: #000; object-fit: contain; }

.drama-episodes { margin-bottom: 40px; }
.drama-episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px; }
.drama-episode {
    position: relative;
    display: flex;
    min-width: 0;
    height: 52px;
    padding: 7px 10px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--drama-line);
    border-radius: 9px;
    background: var(--drama-surface);
    color: #c3c3cc;
    cursor: pointer;
    text-align: left;
}
.drama-episode span { font-size: 13px; font-weight: 650; }
.drama-episode small { width: 100%; overflow: hidden; color: var(--drama-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.drama-episode em { position: absolute; top: 7px; right: 8px; color: var(--drama-muted); font-size: 10px; font-style: normal; }
.drama-episode:hover { border-color: var(--drama-primary); color: #fff; }
.drama-episode.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--drama-primary), #ff5a3d);
    color: #fff;
}
.drama-episode.is-active small, .drama-episode.is-active em { color: rgba(255, 255, 255, .78); }

@media (max-width: 1199px) {
    .drama-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .drama-page { padding-inline: 12px !important; padding-bottom: 34px; }
    .drama-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
    .drama-card__info { padding: 9px 9px 11px; }
    .drama-card__info h2 { font-size: 14px; }
    .drama-list-bar { align-items: flex-start; }
    .drama-list-bar__count { width: 100%; }
    .drama-hero { grid-template-columns: 1fr; gap: 20px; }
    .drama-hero__cover { margin-inline: auto; max-width: min(72vw, 300px); }
    .drama-watch-button { margin-top: 3px; }
    .drama-player-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .drama-player-shell { margin-inline: -12px; width: calc(100% + 24px); border-radius: 0; }
    .drama-episode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    .drama-episode { height: 48px; padding: 6px 8px; }
    .drama-episode em { display: none; }
}
@media (max-width: 340px) {
    .drama-tabs__item { min-width: 70px; padding-inline: 15px; }
    .drama-episode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .drama-page *, .drama-page *::before, .drama-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
