:root {
    --bg: #000;
    --surface: #141414;
    --surface-soft: #1c1c1e;
    --glass: rgba(35, 35, 38, 0.72);
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --blue: #0a84ff;
    --green: #30d158;
    --yellow: #ffd60a;
    --red: #ff453a;
    --line: rgba(255, 255, 255, 0.12);
    --page-pad: clamp(20px, 4vw, 64px);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    padding-bottom: 110px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background: #3a3a3c;
}

.dplayer-notice,
.dplayer-notice-list {
    display: none !important;
}

/* 顶部栏 */
.navbar-custom {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    height: 92px;
    padding: max(18px, env(safe-area-inset-top)) var(--page-pad) 12px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent);
    transition: background 0.25s ease, backdrop-filter 0.25s ease;
}

.navbar-custom.scrolled {
    background: rgba(12, 12, 12, 0.74);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-title {
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 750;
    letter-spacing: -1.4px;
    cursor: pointer;
}

.brand {
    justify-self: center;
    display: flex;
    align-items: baseline;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.8px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.brand-kand {
    color: #fff;
}

.brand-cn {
    margin-left: 3px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.68em;
    letter-spacing: 0;
}

.nav-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-button,
.profile-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.icon-button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}

.profile-avatar {
    flex: 0 0 auto;
    position: relative;
    padding: 0;
    overflow: hidden !important;
    clip-path: circle(50% at 50% 50%);
    -webkit-clip-path: circle(50% at 50% 50%);
    contain: paint;
    isolation: isolate;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    background: linear-gradient(145deg, #f0a850, #7653d6 48%, #2bb0b5);
    border: 2px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.navbar-custom .profile-avatar > img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
    clip-path: circle(50% at 50% 50%);
    -webkit-clip-path: circle(50% at 50% 50%);
}

/* 主视觉 */
.hero-shell,
.carousel,
.carousel-inner,
.carousel-item {
    width: 100%;
    height: min(78svh, 900px);
    min-height: 620px;
    background: #111;
}

.carousel-item {
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
}

.hero-bg-fallback {
    background: radial-gradient(circle at 50% 32%, #272727 0, #111 42%, #000 100%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 110px var(--page-pad) 68px;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.08) 34%, rgba(0, 0, 0, 0.3) 58%, #000 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.16), transparent 35%, transparent 65%, rgba(0, 0, 0, 0.16));
}

.hero-content {
    width: min(680px, 100%);
    text-align: center;
    animation: heroReveal 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heroReveal {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-tag {
    display: inline-flex;
    padding: 5px 11px;
    margin-bottom: 10px;
    border-radius: 9px;
    background: rgba(28, 28, 30, 0.68);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.2px;
}

.hero-title {
    margin: 0;
    color: #fff;
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 850;
    line-height: 0.98;
    letter-spacing: -3px;
    text-wrap: balance;
    text-shadow: 0 5px 26px rgba(0, 0, 0, 0.5);
}

.hero-meta {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    font-weight: 560;
}

.hero-meta i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
}

.hero-desc {
    max-width: 600px;
    margin: 12px auto 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 15px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-btns {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.btn-play,
.btn-add {
    height: 58px;
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.btn-play:active,
.btn-add:active {
    transform: scale(0.96);
}

.btn-play {
    min-width: 220px;
    padding: 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 30px;
    background: #fff;
    color: #000;
    font-size: 19px;
    font-weight: 700;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}

.btn-add {
    width: 58px;
    border-radius: 50%;
    background: rgba(58, 58, 60, 0.78);
    color: #fff;
    font-size: 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-indicators {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 28px;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

.hero-indicators button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transition: width 0.2s ease, border-radius 0.2s ease, background 0.2s ease;
}

.hero-indicators button.active {
    width: 24px;
    border-radius: 5px;
    background: #fff;
}

/* 搜索浮层 */
.search-section {
    position: fixed;
    z-index: 1500;
    top: max(82px, calc(env(safe-area-inset-top) + 58px));
    left: 50%;
    width: min(620px, calc(100% - 32px));
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -16px) scale(0.97);
    transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-section.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

.search-box-wrapper {
    height: 58px;
    display: flex;
    align-items: center;
    border-radius: 30px;
    background: rgba(42, 42, 45, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.17);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
}

.search-icon {
    padding-left: 21px;
    color: var(--muted);
    font-size: 17px;
}

.search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 13px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 17px;
}

.search-input::placeholder {
    color: #8e8e93;
}

.search-close {
    width: 38px;
    height: 38px;
    margin-right: 10px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #d1d1d6;
}

/* 内容区域 */
.content-shell,
.search-results {
    position: relative;
    z-index: 20;
    background: #000;
}

.content-shell {
    padding-top: 22px;
}

.content-shell-no-hero {
    padding-top: 132px;
}

.section-container {
    width: 100%;
    margin: 0 0 38px;
    padding: 0 var(--page-pad);
}

.section-header,
.search-results-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-eyebrow {
    margin-bottom: 3px;
    color: #6e6e73;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1.6px;
}

.section-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    font-size: clamp(23px, 3vw, 32px);
    font-weight: 730;
    line-height: 1.08;
    letter-spacing: -0.8px;
}

.section-title i {
    color: #8e8e93;
    font-size: 0.54em;
}

.section-title-link {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.section-title-link i {
    transition: transform 0.2s ease, color 0.2s ease;
}

.section-title-link:hover i {
    color: #fff;
    transform: translateX(3px);
}

/* 分类汇总页 */
.collection-page {
    position: relative;
    z-index: 20;
    min-height: 100vh;
    margin-bottom: 0;
    padding-top: 132px;
    padding-bottom: 120px;
    background: #000;
}

.collection-hero {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.collection-back {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    background: #1c1c1e;
    color: #fff;
}

.collection-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 760;
    line-height: 0.98;
    letter-spacing: -2.5px;
}

.collection-hero p {
    margin: 12px 0 0;
    color: #8e8e93;
    font-size: 15px;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px 16px;
}

.collection-card {
    min-width: 0;
    cursor: pointer;
    transition: transform 0.22s ease;
}

.collection-card:hover {
    transform: scale(1.025);
}

.collection-card .poster-wrap {
    aspect-ratio: 2 / 3;
}

.collection-loading {
    min-height: 110px;
    display: grid;
    place-items: center;
}

.hot-row-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 50%;
    background: #1c1c1e;
    color: #fff;
    cursor: pointer;
}

.nav-btn:disabled {
    opacity: 0.3;
}

.hot-row {
    margin: 0 calc(var(--page-pad) * -1);
    padding: 0 var(--page-pad) 8px;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--page-pad);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.hot-row::-webkit-scrollbar {
    display: none;
}

.hot-row.grabbing,
.hot-row:active {
    cursor: grabbing;
    scroll-snap-type: none;
}

.hot-card {
    flex: 0 0 clamp(270px, 31vw, 410px);
    min-width: 0;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.22s ease;
}

.hot-card:hover,
.result-card:hover {
    transform: scale(1.025);
}

.feature-card {
    flex-basis: clamp(310px, 39vw, 520px);
}

.short-card {
    flex-basis: clamp(150px, 17vw, 220px);
}

.short-card .poster-wrap,
.collection-card.short-card .poster-wrap {
    aspect-ratio: 2 / 3;
}

.short-rank {
    position: absolute;
    z-index: 3;
    top: 10px;
    left: 10px;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(18, 18, 20, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 18px;
    background: #1c1c1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3);
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.hot-card:hover .poster-wrap img,
.result-card:hover .poster-wrap img {
    transform: scale(1.035);
}

.card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.88) 100%);
    pointer-events: none;
}

.card-copy {
    position: absolute;
    z-index: 2;
    left: 16px;
    right: 16px;
    bottom: 14px;
}

.movie-name {
    overflow: hidden;
    color: #fff;
    font-size: 17px;
    font-weight: 680;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 8px #000;
}

.movie-date {
    margin-top: 4px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rating-badge {
    position: absolute;
    z-index: 3;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(28, 28, 30, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 650;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.rating-badge i {
    color: var(--yellow);
}

/* 搜索结果 */
.search-results {
    min-height: 100vh;
    padding-top: max(174px, calc(env(safe-area-inset-top) + 150px));
}

.search-results-header {
    align-items: flex-start;
}

.clear-search {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #1c1c1e;
    color: #fff;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.result-card {
    min-width: 0;
    cursor: pointer;
    transition: transform 0.22s ease;
}

.poster-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 18px;
    background: radial-gradient(circle at 25% 20%, #36363a, #131315 62%);
    color: var(--muted);
    text-align: center;
}

.poster-fallback i {
    font-size: 30px;
}

.loading-state,
.empty-state {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.apple-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state i {
    margin-bottom: 18px;
    color: #48484a;
    font-size: 42px;
}

.empty-state p {
    margin: 0 0 4px;
    color: #f2f2f7;
    font-size: 20px;
    font-weight: 650;
}

.empty-state span {
    font-size: 14px;
}

/* 影片详情与播放页 */
.detail-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: none;
    overflow-y: auto;
    background: #000;
}

.detail-overlay.active {
    display: block;
    animation: detailUp 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-overlay.is-playing {
    scrollbar-width: none;
}

.detail-overlay.is-playing::-webkit-scrollbar {
    display: none;
}

@keyframes detailUp {
    from { opacity: 0; transform: translateY(36px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-page {
    min-height: 100%;
    background: #000;
}

.detail-hero {
    position: relative;
    min-height: 690px;
    height: min(78svh, 880px);
    overflow: hidden;
    background-position: center 20%;
    background-repeat: no-repeat;
    background-size: cover;
}

.detail-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.08) 18%, transparent 38%, rgba(0, 0, 0, 0.45) 66%, #000 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 60%);
}

.detail-topbar {
    position: absolute;
    z-index: 5;
    top: max(24px, env(safe-area-inset-top));
    left: var(--page-pad);
    right: var(--page-pad);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.detail-round-btn,
.player-control-btn,
.source-error-btn {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.detail-round-btn {
    width: 48px;
    height: 48px;
    background: rgba(42, 42, 45, 0.62);
    color: #fff;
    font-size: 18px;
}

.detail-copy {
    position: absolute;
    z-index: 3;
    left: var(--page-pad);
    bottom: 38px;
    width: min(680px, calc(100% - var(--page-pad) * 2));
}

.detail-label {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(28, 28, 30, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.detail-title {
    margin: 0;
    color: #fff;
    font-size: clamp(46px, 7vw, 80px);
    font-weight: 850;
    line-height: 0.98;
    letter-spacing: -3px;
    text-shadow: 0 5px 28px rgba(0, 0, 0, 0.52);
}

.detail-meta-line,
.detail-tech-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.detail-meta-line {
    margin-top: 13px;
    gap: 9px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    font-weight: 540;
}

.detail-meta-line i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.58);
}

.detail-actions {
    margin-top: 21px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.detail-play-btn,
.detail-add-btn,
.detail-download-btn {
    height: 58px;
    border: 0;
    cursor: pointer;
}

.detail-play-btn {
    min-width: 230px;
    padding: 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 30px;
    background: #fff;
    color: #000;
    font-size: 18px;
    font-weight: 720;
}

.detail-play-btn:disabled {
    opacity: 0.62;
    cursor: wait;
}

.detail-add-btn,
.detail-download-btn {
    width: 58px;
    border-radius: 50%;
    background: rgba(58, 58, 60, 0.78);
    color: #fff;
    font-size: 21px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.detail-download-btn {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(92, 92, 96, 0.78), rgba(48, 48, 52, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 24px rgba(0, 0, 0, 0.24);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.detail-download-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-download-btn:hover {
    background: linear-gradient(180deg, rgba(118, 118, 122, 0.88), rgba(60, 60, 64, 0.82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 28px rgba(0, 0, 0, 0.28);
}

.detail-download-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.24);
}

.download-overlay {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.download-sheet {
    width: min(860px, 100%);
    max-height: min(820px, calc(100svh - 48px));
    padding: 25px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 30px;
    background: rgba(24, 24, 27, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.download-sheet-header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.download-sheet-header h2 { margin: 3px 0 5px; color: #fff; font-size: 25px; }
.download-sheet-header p { margin: 0; color: var(--muted); font-size: 13px; }
.download-sheet-header > button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.download-tabs {
    flex: 0 0 auto;
    min-height: 48px;
    margin: 18px 0 12px;
    padding: 5px 2px 7px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.download-tabs::-webkit-scrollbar { display: none; }
.download-tabs button {
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
    line-height: 20px;
    white-space: nowrap;
}
.download-tabs button.active { background: #fff; color: #000; }
.download-tabs span { margin-left: 3px; opacity: 0.58; }

.download-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.download-result {
    padding: 13px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.065);
}
.download-result > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.download-result strong { overflow: hidden; color: #fff; font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.download-result small { color: var(--muted); font-size: 11px; }
.download-result > button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}
.download-result > a {
    padding: 9px 12px;
    border-radius: 18px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.download-more {
    flex: 0 0 auto;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    font-size: 13px;
    font-weight: 650;
}

.download-loading,
.download-error,
.download-empty {
    min-height: 300px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 13px;
    color: var(--muted);
    text-align: center;
}
.download-loading { display: flex; }
.download-error i,
.download-empty i { color: #666; font-size: 32px; }
.download-error p,
.download-empty p { margin: 0; }
.download-error button,
.download-empty button { padding: 9px 15px; border: 0; border-radius: 18px; background: #fff; color: #000; }

.detail-overview {
    max-width: 650px;
    margin: 17px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    line-height: 1.46;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-tech-line {
    margin-top: 13px;
    gap: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.detail-tech-line span:not(:first-child) {
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    font-weight: 700;
}

.detail-unavailable {
    margin-top: 12px;
    color: #ff9f0a;
    font-size: 13px;
}

.episode-section {
    padding: 28px var(--page-pad) 120px;
    background: #000;
}

.episode-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.episode-heading h2,
.now-playing-strip h2 {
    margin: 2px 0 0;
    color: #fff;
    font-size: clamp(27px, 4vw, 38px);
    font-weight: 730;
    letter-spacing: -1px;
}

.episode-heading-meta > span {
    color: #8e8e93;
    font-size: 13px;
}

.episode-heading-meta,
.player-episode-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.episode-range-picker {
    position: relative;
    z-index: 12;
}

.episode-range-trigger {
    min-width: 112px;
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    background: #1c1c1e;
    color: #fff;
    font-size: 13px;
    font-weight: 650;
}

.episode-range-trigger i {
    color: #8e8e93;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.episode-range-trigger i.open {
    transform: rotate(180deg);
}

.episode-range-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    right: 0;
    width: 154px;
    max-height: min(330px, 52vh);
    padding: 7px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgba(30, 30, 32, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.episode-range-menu button {
    width: 100%;
    height: 42px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #d1d1d6;
    font-size: 13px;
    text-align: left;
}

.episode-range-menu button.active {
    background: #fff;
    color: #000;
    font-weight: 700;
}

.episode-loading {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    color: #8e8e93;
    font-size: 14px;
}

.episode-list-vertical {
    width: min(760px, 100%);
    display: grid;
    gap: 8px;
}

.episode-list-item {
    width: 100%;
    min-height: 68px;
    padding: 10px 14px 10px 10px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    background: #151517;
    color: #fff;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.episode-list-item:hover,
.episode-list-item.active {
    border-color: rgba(255, 255, 255, 0.18);
    background: #232325;
}

.episode-list-number {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #2c2c2e;
    color: #fff;
    font-size: 16px;
    font-weight: 740;
}

.episode-list-item.active .episode-list-number {
    background: #fff;
    color: #000;
}

.episode-list-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.episode-list-copy strong,
.episode-list-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-list-copy strong {
    font-size: 15px;
    font-weight: 650;
}

.episode-list-copy small {
    color: #8e8e93;
    font-size: 11px;
}

.episode-list-play {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2c2c2e;
    color: #fff;
    font-size: 11px;
}

.episode-card {
    flex: 0 0 clamp(280px, 33vw, 420px);
    scroll-snap-align: start;
    cursor: pointer;
}

.episode-art {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 18px;
    background-position: center;
    background-size: cover;
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.episode-art-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.75));
}

.episode-number {
    position: absolute;
    left: 15px;
    bottom: 13px;
    color: #fff;
    font-size: 13px;
    font-weight: 650;
}

.episode-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
    transition: 0.2s ease;
    backdrop-filter: blur(12px);
}

.episode-card:hover .episode-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.episode-card h3 {
    margin: 11px 0 4px;
    color: #fff;
    font-size: 17px;
    font-weight: 660;
}

.episode-card p {
    margin: 0;
    color: #74747a;
    font-size: 12px;
}

/* 实际播放器：播放时装饰控件自动淡出 */
.player-stage {
    position: relative;
    width: 100%;
    height: 100dvh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #000;
}

#dplayer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    z-index: 9998;
    background: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#dplayer.is-prewarming,
#dplayer.is-playing {
    opacity: 1;
    visibility: visible;
}

#dplayer.is-playing {
    pointer-events: auto;
}

body.kand-player-smoke #app {
    display: none !important;
}

.detail-overlay.is-playing {
    overflow: hidden;
    background: transparent;
    pointer-events: none;
}

.detail-overlay.is-playing .detail-page,
.detail-overlay.is-playing .player-stage {
    background: transparent;
}

.detail-overlay.is-playing .player-top-controls,
.detail-overlay.is-playing .admin-source-panel,
.detail-overlay.is-playing .fit-mode-toast,
.detail-overlay.is-playing .failover-toast,
.detail-overlay.is-playing .now-playing-strip {
    pointer-events: auto;
}

.player-stage.is-prewarming {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100dvh;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

.detail-page > .detail-hero,
.detail-page > .episode-section {
    position: relative;
    z-index: 2;
}

#dplayer .kand-race-slot {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0.001;
    pointer-events: none;
}

#dplayer .kand-race-slot.is-winner {
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
}

#dplayer .kand-race-cover {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: #000;
    pointer-events: none;
}

#dplayer .kand-race-cover i {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.86);
    border-radius: 50%;
    animation: kand-race-spin 0.72s linear infinite;
}

@keyframes kand-race-spin {
    to { transform: rotate(360deg); }
}

#dplayer .dplayer-video-wrap,
#dplayer .dplayer-video {
    width: 100% !important;
    height: 100% !important;
}

#dplayer .dplayer-video-wrap {
    position: relative;
}

#dplayer .kand-ai-canvas {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: none;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    background: transparent;
}

#dplayer .kand-ai-active .kand-ai-canvas {
    display: block;
}

#dplayer .kand-ai-active .dplayer-video {
    opacity: 0;
}

#dplayer .kand-ai-css-active .dplayer-video {
    filter: contrast(1.14) brightness(0.96) saturate(1.10);
}

#dplayer.fit-contain .dplayer-video {
    object-fit: contain !important;
}

#dplayer.fit-contain .kand-ai-canvas {
    object-fit: contain;
}

#dplayer.fit-cover .dplayer-video {
    object-fit: cover !important;
}

#dplayer.fit-cover .kand-ai-canvas {
    object-fit: cover;
}

.player-top-controls {
    position: absolute;
    z-index: 100;
    top: max(20px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    right: max(20px, env(safe-area-inset-right));
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 1;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.player-top-controls.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
}

.player-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-marker-btn span { font-size: 12px; font-weight: 780; }
.admin-marker-btn.active { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.2); }
.admin-source-panel { position: absolute; z-index: 45; top: calc(env(safe-area-inset-top, 0px) + 82px); right: max(18px, env(safe-area-inset-right, 0px)); display: grid; gap: 10px; width: min(310px, calc(100vw - 36px)); padding: 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: rgba(28,28,30,.88); box-shadow: 0 16px 45px rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(24px) saturate(150%); }
.admin-source-panel > strong { font-size: 15px; }
.admin-source-panel > span { color: #a1a1a6; font-size: 11px; line-height: 1.4; }
.admin-source-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.admin-source-actions button { display: grid; place-items: center; gap: 6px; min-height: 66px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; color: #fff; font-size: 12px; font-weight: 700; }
.admin-source-actions button i { font-size: 19px; }
.admin-source-actions .approve { background: rgba(48,209,88,.16); color: #63e683; }
.admin-source-actions .reject { background: rgba(255,69,58,.16); color: #ff6961; }
.admin-source-panel input { width: 100%; height: 43px; padding: 0 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; outline: 0; background: rgba(255,255,255,.08); color: #fff; }
.admin-source-panel input:focus { border-color: var(--blue); }
.admin-source-error { color: #ff6961; font-size: 11px; }
.admin-source-confirm { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.admin-source-confirm button { min-height: 40px; border: 0; border-radius: 20px; background: rgba(255,255,255,.1); color: #fff; font-weight: 700; }
.admin-source-confirm button.primary { background: var(--blue); }
.admin-source-confirm button:disabled { opacity: .55; }

.player-control-btn,
.source-error-btn {
    width: 44px;
    height: 44px;
}

.fit-control-btn {
    background: rgba(42, 42, 45, 0.78);
}

.ai-control-btn span {
    font-size: 12px;
    font-weight: 750;
    letter-spacing: -0.2px;
}

.ai-control-btn.enabled:not(.active):not(.failed) {
    background: rgba(255, 255, 255, 0.20);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.ai-control-btn.active,
.audio-control-btn.active {
    background: rgba(10, 132, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 20px rgba(10, 132, 255, 0.28);
}

.ai-control-btn.failed {
    background: rgba(255, 159, 10, 0.88);
    color: #111;
}

@media (max-width: 430px) {
    .player-control-group {
        gap: 7px;
    }

    .player-control-group .player-control-btn,
    .player-control-group .source-error-btn {
        width: 40px;
        height: 40px;
    }
}

.fit-mode-toast {
    position: absolute;
    z-index: 112;
    top: 50%;
    left: 50%;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(28, 28, 30, 0.78);
    color: #fff;
    font-size: 13px;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.player-control-btn {
    background: rgba(42, 42, 45, 0.64);
    color: #fff;
}

.source-error-btn {
    background: rgba(255, 255, 255, 0.96);
    color: #111;
    font-size: 17px;
    box-shadow: 0 7px 24px rgba(0, 0, 0, 0.28);
}

.failover-toast {
    position: absolute;
    z-index: 110;
    left: 50%;
    bottom: 42px;
    max-width: calc(100% - 40px);
    padding: 10px 16px;
    border-radius: 18px;
    background: rgba(44, 44, 46, 0.78);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.now-playing-strip {
    padding: 26px var(--page-pad) 90px;
    background: #0b0b0c;
}

.now-playing-strip p {
    margin: 4px 0 18px;
    color: #8e8e93;
    font-size: 13px;
}

.player-episode-heading {
    width: min(760px, 100%);
    margin: 4px 0 12px;
    justify-content: space-between;
}

.player-episode-heading > strong {
    color: #fff;
    font-size: 19px;
}

.episode-list-vertical.compact {
    width: min(760px, 100%);
}

.episode-chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.episode-chip-row button {
    flex: 0 0 auto;
    min-width: 72px;
    height: 38px;
    padding: 0 13px;
    border: 0;
    border-radius: 19px;
    background: #2c2c2e;
    color: #d1d1d6;
    font-size: 12px;
}

.episode-chip-row button.active {
    background: #fff;
    color: #000;
    font-weight: 650;
}

/* 用户中心、收藏与观看进度 */
.continue-section {
    padding-top: 8px;
}

.continue-card {
    flex-basis: clamp(270px, 29vw, 390px);
}

.watch-progress {
    position: absolute;
    z-index: 4;
    left: 14px;
    right: 14px;
    bottom: 5px;
    height: 3px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.28);
}

.watch-progress i,
.library-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
}

.user-overlay {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.user-overlay.active {
    opacity: 1;
    visibility: visible;
}

.user-sheet {
    width: min(920px, 100%);
    max-height: min(820px, calc(100svh - 50px));
    overflow-y: auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 34px;
    background: rgba(24, 24, 27, 0.94);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
    transform: translateY(30px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
}

.user-overlay.active .user-sheet {
    transform: translateY(0) scale(1);
}

.user-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-sheet-header h2 {
    margin: 0;
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 760;
    letter-spacing: -1.6px;
}

.auth-card {
    width: min(420px, 100%);
    margin: 26px auto 8px;
    text-align: center;
}

.auth-mark,
.account-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0a850, #7653d6 48%, #2bb0b5);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
}

.auth-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    font-size: 30px;
}

.auth-card h3 {
    margin: 0;
    font-size: 26px;
}

.auth-card > p {
    margin: 8px 0 22px;
    color: var(--muted);
    font-size: 14px;
}

.auth-method-tabs {
    margin: 0 0 16px;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    border-radius: 14px;
    background: #2c2c2e;
}

.auth-method-tabs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.auth-method-tabs button {
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #a1a1a6;
    font-size: 12px;
    font-weight: 680;
}

.auth-method-tabs button.active {
    background: #fff;
    color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
}

.auth-card form,
.auth-card label {
    display: flex;
    flex-direction: column;
}

.auth-card form {
    gap: 13px;
}

.auth-card label {
    gap: 6px;
    color: #d1d1d6;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
}

.auth-card input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    outline: 0;
    background: #2c2c2e;
    color: #fff;
    font-size: 16px;
}

.auth-card input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}

.auth-field-hint {
    color: #8e8e93;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.auth-submit {
    height: 52px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 26px;
    background: #fff;
    color: #000;
    font-weight: 720;
}

.auth-submit:disabled { opacity: 0.65; }
.apple-spinner.mini { width: 20px; height: 20px; border-width: 2px; border-top-color: #000; }
.auth-error { color: #ff6961; font-size: 13px; text-align: left; }
.auth-notice { color: #30d158; font-size: 13px; text-align: left; }

.auth-switch {
    margin-top: 17px;
    border: 0;
    background: transparent;
    color: var(--blue);
    font-size: 14px;
}
.auth-method-switch { margin-top: 14px; }
.auth-resend { margin-top: 8px; color: #d1d1d6; font-size: 12px; }
.auth-resend:disabled { opacity: 0.55; }

.auth-auto-create-note {
    margin-top: 11px;
    color: #8e8e93;
    font-size: 11px;
    line-height: 1.4;
}

.auth-entry-links {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.auth-entry-links button {
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #a1a1a6;
    font-size: 12px;
    font-weight: 650;
}

.auth-entry-links button.active { color: var(--blue); }
.auth-quick-return { margin-top: 9px; color: #a1a1a6; font-size: 12px; }

.account-summary {
    margin-top: 25px;
    padding: 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.07);
}

.account-avatar { width: 52px; height: 52px; font-size: 21px; }
.account-avatar img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.account-avatar-edit { position: relative; width: 52px; height: 52px; cursor: pointer; }
.account-avatar-edit input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.account-avatar-edit.uploading { pointer-events: none; opacity: 0.72; }
.avatar-edit-badge {
    position: absolute;
    right: -3px;
    bottom: -2px;
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border: 2px solid #252528;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 9px;
}
.avatar-error { margin: 8px 4px 0; color: #ff6961; font-size: 12px; }
.account-summary div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.account-summary strong, .account-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary span { color: var(--muted); font-size: 12px; }
.account-summary button { border: 0; background: transparent; color: #ff6961; font-size: 13px; }
.account-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.account-summary .account-edit { color: var(--blue); white-space: nowrap; }
.account-edit i { margin-right: 4px; font-size: 10px; }

.account-settings {
    margin-top: 12px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.055);
}

.account-settings-head {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.account-settings-head > div { display: flex; flex-direction: column; gap: 3px; }
.account-settings-head strong { font-size: 17px; }
.account-settings-head span { color: var(--muted); font-size: 11px; }
.account-settings-head button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; }

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.settings-grid label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #d1d1d6;
    font-size: 11px;
    font-weight: 650;
}

.settings-grid .settings-wide { grid-column: 1 / -1; }
.settings-grid input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 13px;
    outline: 0;
    background: #2c2c2e;
    color: #fff;
    font-size: 15px;
}

.settings-grid input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,132,255,.14); }
.settings-grid input[readonly] { color: #a1a1a6; background: #242426; }
.contact-binding-panel { margin-top: 14px; }
.contact-binding-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-binding-actions button { min-height: 44px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(255,255,255,.07); color: #fff; font-weight: 680; }
.contact-binding-actions i { margin-right: 7px; color: var(--blue); }
.contact-change-box { padding: 14px; border: 1px solid rgba(10,132,255,.3); border-radius: 17px; background: rgba(10,132,255,.08); }
.contact-change-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.contact-change-head strong { font-size: 15px; }
.contact-change-head button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; }
.contact-change-box label { display: flex; flex-direction: column; gap: 6px; color: #d1d1d6; font-size: 11px; font-weight: 650; }
.contact-change-box input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; outline: 0; background: #2c2c2e; color: #fff; font-size: 15px; }
.contact-change-box select { width: 100%; height: 44px; padding: 0 34px 0 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; outline: 0; background: #2c2c2e; color: #fff; font-size: 14px; }
.password-setup-box { margin-top: 10px; }
.contact-change-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,132,255,.14); }
.contact-change-notice { margin-top: 10px; color: #64d2ff; font-size: 12px; line-height: 1.45; }
.merge-choice { display: grid; gap: 9px; }
.merge-choice > p { margin: 2px 2px 3px; color: #c7c7cc; font-size: 12px; line-height: 1.45; }
.merge-account-summary { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 14px; background: rgba(255,255,255,.07); }
.merge-account-summary > i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(10,132,255,.2); color: #64d2ff; }
.merge-account-summary div { display: grid; min-width: 0; }
.merge-account-summary strong { font-size: 13px; }
.merge-account-summary span, .merge-account-summary small { overflow: hidden; color: #a1a1a6; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.merge-choice > button { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(255,255,255,.06); color: #fff; text-align: left; }
.merge-choice > button > i { width: 25px; color: #64d2ff; text-align: center; }
.merge-choice > button span { display: grid; gap: 3px; min-width: 0; }
.merge-choice > button strong { font-size: 13px; }
.merge-choice > button small { color: #a1a1a6; font-size: 11px; line-height: 1.35; }
.merge-choice > button.recommended { border-color: rgba(10,132,255,.55); background: rgba(10,132,255,.15); }
.merge-choice > button em { position: absolute; top: 8px; right: 9px; padding: 2px 6px; border-radius: 7px; background: var(--blue); color: #fff; font-size: 9px; font-style: normal; }
.contact-change-next { width: 100%; min-height: 44px; margin-top: 12px; border: 0; border-radius: 22px; background: var(--blue); color: #fff; font-weight: 720; }
.contact-change-next:disabled { opacity: .6; }
.settings-error, .settings-success { margin-top: 11px; font-size: 12px; }
.settings-error { color: #ff6961; }
.settings-success { color: var(--green); }
.settings-save { width: 100%; height: 46px; margin-top: 14px; border: 0; border-radius: 23px; background: #fff; color: #000; font-weight: 720; }
.settings-save:disabled { opacity: .62; }

.access-card {
    position: relative;
    margin-top: 12px;
    padding: 17px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    border: 1px solid rgba(255, 159, 10, 0.32);
    border-radius: 22px;
    background: rgba(255, 159, 10, 0.08);
}

.access-card.active {
    border-color: rgba(48, 209, 88, 0.3);
    background: rgba(48, 209, 88, 0.08);
}

.access-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
}

.access-card.active .access-icon { background: rgba(48, 209, 88, 0.2); color: var(--green); }
.access-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.access-copy strong { font-size: 15px; }
.access-copy span { color: var(--muted); font-size: 12px; line-height: 1.4; }

.invite-redeem {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

.invite-redeem input {
    min-width: 0;
    flex: 1;
    height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    outline: 0;
    background: #2c2c2e;
    color: #fff;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.invite-redeem input:focus { border-color: #ff9f0a; }
.invite-redeem button { min-width: 76px; border: 0; border-radius: 14px; background: #fff; color: #000; font-weight: 700; }
.invite-redeem button:disabled { opacity: 0.6; }
.invite-error { grid-column: 1 / -1; color: #ff6961; font-size: 12px; }

.access-warning {
    margin-top: 10px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 14px;
    background: rgba(255, 69, 58, 0.12);
    color: #ff6961;
    font-size: 12px;
}

.library-tabs {
    margin: 22px 0 16px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 16px;
    background: rgba(118, 118, 128, 0.24);
}

.library-tabs button {
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
}

.library-tabs button.active { background: #3a3a3c; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.library-tabs span { margin-left: 4px; color: #8e8e93; }

.library-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.library-card {
    position: relative;
    min-width: 0;
    padding: 9px;
    display: grid;
    grid-template-columns: 82px 1fr 34px;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.library-card > img,
.library-card > .poster-fallback {
    position: relative;
    width: 82px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
}

.library-card > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.library-card strong, .library-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-card strong { font-size: 14px; }
.library-card span { color: var(--muted); font-size: 11px; }
.library-card > button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #ff6961; }
.library-progress { height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.15); }

.library-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 13px;
    color: #555;
}

.library-empty i { font-size: 35px; }
.library-empty p { margin: 0; color: var(--muted); }

.detail-add-btn.active {
    background: #fff;
    color: #000;
}

/* 底部导航 */
.tab-bar {
    position: fixed;
    z-index: 1300;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: min(560px, calc(100% - 32px));
    height: 76px;
    padding: 7px 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    background: rgba(42, 42, 45, 0.7);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: saturate(180%) blur(32px);
    -webkit-backdrop-filter: saturate(180%) blur(32px);
    transform: translateX(-50%);
}

.tab-bar button,
.tab-bar a {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    text-decoration: none;
    cursor: pointer;
}

.tab-bar i {
    font-size: 19px;
}

.tab-bar .active {
    background: rgba(255, 255, 255, 0.13);
    color: var(--blue);
}

.footer {
    padding: 28px var(--page-pad) 130px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #48484a;
    font-size: 11px;
    text-align: center;
}

.footer strong {
    color: #6e6e73;
    font-size: 13px;
}

@media (max-width: 767px) {
    :root {
        --page-pad: 20px;
    }

    .navbar-custom {
        height: 88px;
        grid-template-columns: 1fr auto;
    }

    .brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 17px;
        opacity: 0.84;
    }

    .page-title {
        font-size: 32px;
    }

    .icon-button {
        display: none;
    }

    .profile-avatar {
        width: 40px;
        height: 40px;
    }

    .hero-shell,
    .carousel,
    .carousel-inner,
    .carousel-item {
        height: 74svh;
        min-height: 600px;
        max-height: 760px;
    }

    .hero-bg {
        object-position: center top;
    }

    .hero-overlay {
        padding: 96px 22px 58px;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 28%, rgba(0, 0, 0, 0.24) 54%, #000 100%);
    }

    .hero-title {
        font-size: clamp(39px, 12vw, 56px);
        letter-spacing: -2.5px;
    }

    .hero-desc {
        display: none;
    }

    .hero-meta {
        margin-top: 11px;
        font-size: 14px;
    }

    .hero-btns {
        margin-top: 20px;
    }

    .btn-play {
        min-width: min(220px, 62vw);
        height: 56px;
        font-size: 18px;
    }

    .btn-add {
        width: 56px;
        height: 56px;
    }

    .hero-indicators {
        bottom: 22px;
    }

    .content-shell {
        padding-top: 18px;
    }

    .content-shell-no-hero {
        padding-top: 108px;
    }

    .section-container {
        margin-bottom: 32px;
    }

    .section-title {
        font-size: 24px;
    }

    .collection-page {
        padding-top: 116px;
    }

    .collection-hero {
        margin-bottom: 22px;
        gap: 12px;
    }

    .collection-back {
        width: 40px;
        height: 40px;
    }

    .collection-hero h1 {
        font-size: clamp(36px, 11vw, 52px);
        letter-spacing: -1.8px;
    }

    .collection-hero p {
        max-width: 270px;
        font-size: 13px;
    }

    .collection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 12px;
    }

    .collection-card .poster-wrap {
        border-radius: 16px;
    }

    .hot-row-nav {
        display: none;
    }

    .hot-row {
        gap: 12px;
    }

    .hot-card {
        flex-basis: 68vw;
        max-width: 360px;
    }

    .feature-card {
        flex-basis: 76vw;
        max-width: 400px;
    }

    .short-card {
        flex-basis: 42vw;
        max-width: 210px;
    }

    .poster-wrap {
        border-radius: 16px;
    }

    .movie-name {
        font-size: 16px;
    }

    .search-results {
        padding-top: max(168px, calc(env(safe-area-inset-top) + 146px));
    }

    .result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .result-card .poster-wrap {
        aspect-ratio: 4 / 5;
    }

    .result-card .poster-wrap img {
        object-position: center top;
    }

    .result-card .card-copy {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .detail-hero {
        height: 72svh;
        min-height: 650px;
        max-height: 790px;
        background-position: center top;
    }

    .detail-hero-shade {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 22%, transparent 38%, rgba(0, 0, 0, 0.46) 62%, #000 100%);
    }

    .detail-topbar {
        left: 20px;
        right: 20px;
    }

    .detail-copy {
        left: 22px;
        right: 22px;
        bottom: 26px;
        width: auto;
        text-align: center;
    }

    .detail-title {
        font-size: clamp(40px, 12vw, 58px);
        letter-spacing: -2.4px;
    }

    .detail-meta-line,
    .detail-actions,
    .detail-tech-line {
        justify-content: center;
    }

    .detail-overview {
        margin-top: 15px;
        text-align: left;
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .detail-play-btn {
        min-width: min(210px, 52vw);
        height: 56px;
        padding: 0 18px;
        font-size: 17px;
    }

    .detail-actions { gap: 10px; }

    .detail-add-btn,
    .detail-download-btn {
        width: 54px;
        height: 54px;
    }

    .download-overlay { padding: 0; align-items: flex-end; }
    .download-sheet {
        width: 100%;
        max-height: calc(100svh - max(18px, env(safe-area-inset-top)));
        padding: 21px 17px max(20px, env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
    }
    .download-sheet-header h2 { font-size: 21px; }
    .download-result { grid-template-columns: minmax(0, 1fr) auto; }
    .download-result > button { display: none; }
    .download-result > a { padding: 9px 10px; }

    .episode-section {
        padding-top: 22px;
    }

    .episode-heading {
        align-items: center;
    }

    .episode-heading-meta > span {
        display: none;
    }

    .episode-range-trigger {
        min-width: 104px;
        height: 38px;
        padding: 0 12px;
    }

    .episode-list-item {
        min-height: 64px;
        grid-template-columns: 44px minmax(0, 1fr) 32px;
        gap: 10px;
        border-radius: 14px;
    }

    .episode-list-number {
        width: 44px;
        height: 44px;
    }

    .episode-card {
        flex-basis: 74vw;
        max-width: 390px;
    }

    .episode-play-icon {
        opacity: 0.92;
        transform: translate(-50%, -50%) scale(1);
    }

    .player-stage {
        min-height: 100svh;
    }

    #dplayer {
        width: 100%;
        height: 100%;
    }

    .player-top-controls {
        top: max(14px, env(safe-area-inset-top));
        left: 14px;
        right: 14px;
    }

    .player-control-btn,
    .source-error-btn {
        width: 42px;
        height: 42px;
    }

    .now-playing-strip {
        padding-top: 22px;
    }

    .continue-card { flex-basis: 72vw; }

    .user-overlay {
        padding: 0;
    }

    .user-sheet {
        max-height: 92svh;
        padding: 24px 18px calc(28px + env(safe-area-inset-bottom));
        border-radius: 30px 30px 0 0;
    }

    .library-grid { grid-template-columns: 1fr; }

    .account-summary { grid-template-columns: auto 1fr; }
    .account-actions { grid-column: 1 / -1; width: 100%; flex-direction: row; justify-content: flex-end; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid .settings-wide { grid-column: auto; }
    .contact-binding-actions { grid-template-columns: 1fr; }

    .library-card { grid-template-columns: 72px 1fr 34px; }

    .library-card > img,
    .library-card > .poster-fallback { width: 72px; height: 49px; }

    .tab-bar {
        height: 72px;
        bottom: max(10px, env(safe-area-inset-bottom));
        border-radius: 25px;
    }
}

@media (min-width: 1100px) {
    .hero-overlay {
        justify-content: flex-start;
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.15) 50%, #000 100%),
            linear-gradient(90deg, rgba(0, 0, 0, 0.7), transparent 58%);
    }

    .hero-content {
        text-align: left;
    }

    .hero-meta,
    .hero-btns {
        justify-content: flex-start;
    }

    .hero-desc {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
