/* LeLeTV v2 · 内页
   结果页、分类、观看记录、设置、关于、项目说明，以及主题取色器。
   海报卡片沿用 home.css 的 .v2-pcard，这里只补结果页与分类页的差异。 */

/* ============ 海报卡片：<img> 版本（结果页、分类页） ============ */
.v2-poster > img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.v2-poster > img.loaded {
    opacity: 1;
}

/* 非 2:3 的封面（横版、方图）：原图完整居中，背后垫一层同图模糊 */
.v2-poster.is-wide::before {
    content: "";
    position: absolute;
    inset: -20px;
    background: var(--poster) center / cover no-repeat;
    filter: blur(18px) brightness(0.55) saturate(1.2);
}

.v2-poster.is-wide > img {
    object-fit: contain;
}

.v2-poster .v2-badge,
.v2-poster .v2-rcard-src,
.v2-poster .v2-lang {
    z-index: 2;
}

.v2-poster-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(160deg, #22151D 0%, #141116 100%);
    color: rgba(255, 228, 241, 0.45);
    text-align: center;
}

.v2-poster-empty b {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
}

.v2-poster-empty span {
    display: -webkit-box;
    overflow: hidden;
    color: var(--v2-t3);
    font-size: 12px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 右上角的语言 / 备注小标签 */
.v2-lang {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(10, 10, 12, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--v2-t2);
    font-size: 11px;
    line-height: 1.5;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.v2-badge--note {
    max-width: calc(100% - 16px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--v2-t1);
    font-weight: 500;
}

/* ============ 结果页 ============ */
.movies-page-layout {
    min-height: 100dvh;
    padding-bottom: 80px;
}

.movies-topbar {
    position: sticky;
    top: 0;
    z-index: var(--v2-z-nav);
    isolation: isolate;
    border-bottom: 1px solid var(--v2-line);
}

.movies-topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(10, 10, 11, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
}

.movies-topbar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    padding-top: env(safe-area-inset-top, 0px);
}

.movies-back-btn {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--v2-line-2);
    color: var(--v2-t1);
    transition: background-color var(--v2-dur) var(--v2-ease);
}

.movies-back-btn svg {
    width: 18px;
    height: 18px;
}

.movies-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 只给读屏器的标题 */
.movies-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* 顶栏搜索框：关键词常驻，改词直接回车 */
.movies-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 560px;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 10px 0 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--v2-line-2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color var(--v2-dur) var(--v2-ease), box-shadow var(--v2-dur) var(--v2-ease);
}

.movies-search:focus-within {
    border-color: rgba(var(--v2-accent-rgb), 0.55);
    box-shadow: 0 0 0 4px rgba(var(--v2-accent-rgb), 0.12);
}

.movies-search > svg {
    flex: none;
    width: 17px;
    height: 17px;
    color: var(--v2-t3);
}

.movies-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: var(--v2-t1);
    font-size: 15px;
    font-weight: 500;
    outline: none;
}

.movies-search input::placeholder {
    color: #6B6B74;
    font-weight: 400;
}

.movies-search input::-webkit-search-cancel-button,
.movies-search input::-webkit-search-decoration {
    -webkit-appearance: none;
}

.movies-search-clear {
    display: grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--v2-t2);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease);
}

.movies-search-clear svg {
    width: 10px;
    height: 10px;
}

.movies-search.has-text .movies-search-clear {
    opacity: 1;
    pointer-events: auto;
}

.movies-search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--v2-t1);
}

.movies-bar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 auto;
    color: var(--v2-t3);
    font-size: 13px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.movies-status-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--v2-t3);
}

.movies-status-dot[data-mode="search"] {
    background: var(--v2-ok);
    box-shadow: 0 0 8px rgba(98, 194, 142, 0.7);
}

.movies-status-dot[data-mode="loading"] {
    background: var(--v2-accent);
    animation: v2DotPulse 1.2s ease-in-out infinite;
}

.movies-status-dot[data-mode="fallback"] {
    background: var(--v2-warn);
    animation: v2DotPulse 1.2s ease-in-out infinite;
}

.movies-status-dot[data-mode="empty"] {
    background: var(--v2-bad);
}

@keyframes v2DotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

/* 正文：筛选一行 → 最佳匹配 → 货架 */
.movies-body {
    display: grid;
    gap: 28px;
    padding-top: 20px;
}

/* 筛选一行：左边按类型分段，右边来源与本次延迟（各只出现一次） */
.movies-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
}

.movies-filters[hidden] {
    display: none;
}

.movies-seg {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v2-line);
}

.movies-seg:empty {
    display: none;
}

.movies-seg-btn {
    height: 32px;
    padding: 0 14px;
    border-radius: 9px;
    color: var(--v2-t2);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease);
}

.movies-seg-btn span {
    margin-left: 5px;
    color: var(--v2-t3);
    font-variant-numeric: tabular-nums;
}

.movies-seg-btn:hover {
    color: var(--v2-t1);
}

.movies-seg-btn.is-active {
    color: var(--v2-t1);
    background: rgba(255, 255, 255, 0.11);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.movies-seg-btn.is-active span {
    color: var(--v2-t2);
}

.movies-sources {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 4px;
    color: var(--v2-t2);
    font-size: 12.5px;
}

.movies-sources-label {
    margin-right: 6px;
    color: var(--v2-t3);
    white-space: nowrap;
}

.movies-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--v2-t2);
    font-size: 12.5px;
    white-space: nowrap;
    transition: color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease), border-color var(--v2-dur) var(--v2-ease);
}

.movies-chip em {
    color: var(--v2-t3);
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.movies-chip-dot {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--v2-t3);
}

.movies-chip-dot.is-fast { background: var(--v2-ok); box-shadow: 0 0 0 3px rgba(98, 194, 142, 0.15); }
.movies-chip-dot.is-mid { background: var(--v2-warn); box-shadow: 0 0 0 3px rgba(216, 166, 87, 0.15); }
.movies-chip-dot.is-slow { background: var(--v2-bad); box-shadow: 0 0 0 3px rgba(217, 113, 107, 0.15); }
.movies-chip-dot.is-bad { background: var(--v2-t3); box-shadow: none; }

@media (hover: hover) {
    .movies-chip:hover {
        color: var(--v2-t1);
        background: rgba(255, 255, 255, 0.05);
    }
}

.movies-chip.is-active {
    color: var(--v2-t1);
    background: rgba(var(--v2-accent-rgb), 0.14);
    border-color: rgba(var(--v2-accent-rgb), 0.45);
}

.movies-chip.is-active em {
    color: var(--v2-accent-hi);
}

/* 最佳匹配：这部片自己的海报模糊成背景，每部片的氛围色都不一样 */
.movies-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    overflow: hidden;
    padding: 28px;
    border-radius: 20px;
    border: 1px solid var(--v2-line);
    background: rgba(255, 255, 255, 0.02);
}

.movies-hero[hidden] {
    display: none;
}

.movies-hero-bg {
    position: absolute;
    inset: -60px;
    z-index: -2;
    background: var(--poster) center / cover;
    filter: blur(60px) saturate(1.35);
    opacity: 0.6;
}

.movies-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(12, 12, 16, 0.92) 0%, rgba(12, 12, 16, 0.72) 42%, rgba(12, 12, 16, 0.5) 100%);
}

.movies-hero-poster {
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    background: var(--v2-surface) var(--poster) center / cover;
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.movies-hero-poster.is-empty {
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #22151D 0%, #141116 100%);
    color: rgba(255, 228, 241, 0.45);
    font-size: 56px;
    font-weight: 700;
}

.movies-hero-info {
    display: grid;
    gap: 14px;
    align-content: center;
    min-width: 0;
}

.movies-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--v2-t2);
    font-size: 12px;
    letter-spacing: 0.14em;
}

.movies-eyebrow i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--v2-accent);
}

.movies-hero h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-wrap: balance;
}

.movies-hero-meta {
    margin: 0;
    color: var(--v2-t2);
    font-size: 14px;
}

.movies-seasons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.movies-season {
    display: grid;
    gap: 2px;
    min-width: 200px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--v2-line);
    color: var(--v2-t1);
    text-align: left;
    transition: background-color var(--v2-dur) var(--v2-ease), border-color var(--v2-dur) var(--v2-ease);
}

.movies-season b {
    font-size: 14px;
    font-weight: 600;
}

.movies-season span {
    color: var(--v2-t3);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.movies-season:hover {
    background: rgba(255, 255, 255, 0.08);
}

.movies-season.is-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.movies-season.is-active span {
    color: var(--v2-t2);
}

.movies-hero-desc {
    display: -webkit-box;
    overflow: hidden;
    max-width: 46em;
    margin: 0;
    color: var(--v2-t2);
    font-size: 14px;
    line-height: 1.7;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movies-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.movies-hero-actions .v2-btn {
    height: 44px;
    padding: 0 20px;
    font-size: 14.5px;
}

.movies-hero-actions .v2-btn svg {
    width: 15px;
    height: 15px;
}

.movies-hero-remarks {
    color: var(--v2-t3);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.movies-hero .card-ripple {
    display: none;
}

.movies-hero .card-loading {
    opacity: 0.7;
}

/* 线路列表：每条都能直接播 */
.movies-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.movies-lines[hidden] {
    display: none;
}

/* 预检判死的线路：压暗，排到最后 */
.movies-line.is-dead {
    opacity: 0.5;
}

.movies-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--v2-line);
    color: var(--v2-t1);
    font-size: 13px;
    white-space: nowrap;
    transition: background-color var(--v2-dur) var(--v2-ease);
}

.movies-line em {
    color: var(--v2-t3);
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.movies-line span {
    color: var(--v2-t3);
    font-size: 12px;
}

.movies-line:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 分组货架 */
.movies-shelves {
    display: grid;
    gap: 32px;
}

.movies-shelf {
    display: grid;
    gap: 16px;
}

.movies-shelf-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.movies-shelf-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.movies-shelf-head span {
    color: var(--v2-t3);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.movies-shelf-head p {
    margin: 0 0 0 auto;
    color: var(--v2-t3);
    font-size: 12.5px;
}

.movies-fallback-tip {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(216, 166, 87, 0.08);
    border: 1px solid rgba(216, 166, 87, 0.22);
    color: #E3C48E;
    font-size: 13.5px;
}

/* 栅格：桌面 6 列、列距 20、行距 28；分类页同一套 */
.movies-results-grid,
.tmdb-results-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 28px 20px;
}

@media (max-width: 1100px) {
    .movies-results-grid,
    .tmdb-results-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .movies-results-grid,
    .tmdb-results-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* 卡片上最多两处信息：右上角源数，左下角集数 */
.v2-poster .v2-badge--srcs {
    left: auto;
    right: 8px;
    color: rgba(255, 255, 255, 0.92);
}

.v2-scrim-note {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    height: 46%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.35) 60%, transparent);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.v2-scrim-note > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.v2-pcard.v2-rcard {
    cursor: pointer;
}

.v2-pcard.v2-rcard:focus-visible {
    outline: 2px solid rgba(var(--v2-accent-rgb), 0.85);
    outline-offset: 4px;
    border-radius: var(--v2-r-s);
}

/* 点卡片后跳转前的反馈：海报压暗 + 转圈 */
.search-result-card.card-loading .v2-poster > img {
    filter: brightness(0.45);
}

.search-result-card.card-loading .v2-poster::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: v2Spin 0.8s linear infinite;
}

.search-result-card .card-ripple {
    display: none;
}

.v2-rcard .v2-poster {
    transition: transform 0.3s var(--v2-ease);
}

.search-result-card.card-loading .v2-poster {
    transform: scale(0.97);
}

/* ============ 分类页 ============ */
.tmdb-filter-section {
    display: grid;
    gap: 12px;
    margin-bottom: 28px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--v2-line);
}

.tmdb-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tmdb-type-row {
    justify-content: space-between;
}

/* 类型切换：分段控件 */
.tmdb-type-switch {
    display: inline-flex;
    padding: 4px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--v2-line);
}

.tmdb-type-btn {
    height: 34px;
    padding: 0 16px;
    border-radius: 9px;
    color: var(--v2-t2);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease);
}

.tmdb-type-btn:hover {
    color: var(--v2-t1);
}

.tmdb-type-btn.active {
    color: var(--v2-on-accent);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tmdb-filter-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--v2-line);
    color: var(--v2-t2);
    font-size: 13px;
    transition: color var(--v2-dur) var(--v2-ease), border-color var(--v2-dur) var(--v2-ease);
}

.tmdb-filter-collapse-btn:hover {
    color: var(--v2-t1);
    border-color: var(--v2-line-3);
}

.tmdb-filter-collapse-btn.collapsed {
    color: var(--v2-accent-hi);
    border-color: rgba(var(--v2-accent-rgb), 0.35);
}

.tmdb-filter-btn-icon {
    width: 14px;
    height: 14px;
}

/* 筛选整体收起：只留类型行 */
.tmdb-filter-collapsed .tmdb-genre-row {
    display: none;
}

.tmdb-genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

/* 筛选标签：未选中是纯文字，选中才有底色，避免满屏粉色 */
.tmdb-genre-btn {
    height: 30px;
    padding: 0 11px;
    border-radius: 8px;
    color: var(--v2-t2);
    font-size: 13.5px;
    white-space: nowrap;
    transition: color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease);
}

.tmdb-genre-btn:hover {
    color: var(--v2-t1);
    background: rgba(255, 255, 255, 0.05);
}

.tmdb-genre-btn.active {
    color: var(--v2-t1);
    background: rgba(var(--v2-accent-rgb), 0.16);
    box-shadow: inset 0 0 0 1px rgba(var(--v2-accent-rgb), 0.4);
}

.genre-filter-collapsed .genre-btn-extra,
.year-filter-collapsed .year-btn-extra {
    display: none;
}

.genre-toggle-btn,
.year-toggle-btn {
    color: var(--v2-t3);
}

/* 分页 */
.tmdb-pagination-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
}

.tmdb-page-btn {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--v2-line);
    color: var(--v2-t2);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    transition: color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease), border-color var(--v2-dur) var(--v2-ease);
}

.tmdb-page-btn svg {
    width: 16px;
    height: 16px;
}

.tmdb-page-btn:hover:not(.disabled):not(.active) {
    color: var(--v2-t1);
    border-color: var(--v2-line-3);
}

.tmdb-page-btn.active {
    color: var(--v2-on-accent);
    background: var(--v2-accent);
    border-color: var(--v2-accent);
}

.tmdb-page-btn.disabled {
    opacity: 0.35;
    cursor: default;
}

.tmdb-page-ellipsis {
    padding: 0 4px;
    color: var(--v2-t3);
}

/* ============ 观看记录 ============ */
.history-group + .history-group {
    margin-top: 36px;
}

.history-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--v2-t2);
    font-size: 14px;
    font-weight: 600;
}

.history-group-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--v2-line);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.history-item {
    position: relative;
    display: flex;
    gap: 14px;
    min-width: 0;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--v2-line);
    cursor: pointer;
    transition: background-color var(--v2-dur) var(--v2-ease), border-color var(--v2-dur) var(--v2-ease);
}

@media (hover: hover) {
    .history-item:hover {
        background: rgba(255, 255, 255, 0.055);
        border-color: var(--v2-line-2);
    }
}

.history-cover {
    position: relative;
    flex: none;
    width: 72px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: var(--v2-surface);
}

.history-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-cover-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #22151D, #141116);
    color: rgba(255, 228, 241, 0.4);
}

.history-cover-placeholder svg {
    width: 22px;
    height: 22px;
}

.history-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    padding-right: 28px;
}

.history-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--v2-t1);
    font-size: 15px;
    font-weight: 600;
}

.history-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    color: var(--v2-t3);
    font-size: 12.5px;
}

.history-meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.history-episode {
    color: var(--v2-t2);
}

.history-source {
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time {
    flex: none;
    font-variant-numeric: tabular-nums;
}

.history-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.history-progress .progress-bar {
    flex: 1;
    height: 3px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
}

.history-progress .progress-filled {
    height: 100%;
    background: var(--v2-accent);
    transform-origin: left center;
}

.history-progress .progress-text {
    flex: none;
    color: var(--v2-t3);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.history-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--v2-t3);
    transition: color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease), opacity var(--v2-dur) var(--v2-ease);
}

.history-item .delete-btn svg {
    width: 14px;
    height: 14px;
}

.history-item .delete-btn:hover {
    color: var(--v2-t1);
    background: rgba(255, 255, 255, 0.08);
}

@media (hover: hover) {
    .history-item .delete-btn {
        opacity: 0;
    }

    .history-item:hover .delete-btn,
    .history-item .delete-btn:focus-visible {
        opacity: 1;
    }
}

/* ============ 设置 ============ */
/* 两列等高：同一行的两张卡片上下沿对齐，内容少的那张由卡片主体撑满 */
.settings-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.theme-full-width,
.invite-full-width {
    grid-column: 1 / -1;
}

.dash-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--v2-line);
}

.dash-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 0;
}

.dash-card-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(var(--v2-accent-rgb), 0.1);
    border: 1px solid rgba(var(--v2-accent-rgb), 0.22);
    color: var(--v2-accent-hi);
}

.dash-card-icon svg {
    width: 17px;
    height: 17px;
}

.dash-card-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--v2-t1);
    font-size: 16px;
    font-weight: 600;
}

.dash-card-desc {
    margin: 4px 0 0;
    color: var(--v2-t3);
    font-size: 12.5px;
    font-weight: 400;
}

.dash-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 20px 20px;
}

.dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

/* 数据源勾选 */
.dash-api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 2px 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.dash-api-grid > .contents {
    display: contents;
}

.api-group-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 6px;
    color: var(--v2-t3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.api-group-title .hidden-warning svg {
    width: 14px;
    height: 14px;
    color: var(--v2-warn);
}

.v2-src-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 7px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.v2-src-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.v2-src-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--v2-t2);
    font-size: 13.5px;
    transition: color 0.15s ease;
}

.v2-switch-input:checked ~ .v2-src-name {
    color: var(--v2-t1);
}

/* 小开关：30×18，与「播放与内容」里的开关同一套做法，只是小一号。input 只管状态，开关本体是后面的 span */
.v2-switch-wrap {
    position: relative;
    display: inline-flex;
    flex: none;
    cursor: pointer;
}

.v2-switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.v2-switch {
    position: relative;
    flex: none;
    width: 30px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: background-color 0.2s ease;
}

.v2-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.22s var(--v2-ease);
}

.v2-switch-input:checked ~ .v2-switch {
    background: var(--v2-accent);
}

.v2-switch-input:checked ~ .v2-switch::after {
    transform: translateX(12px);
}

.v2-switch-input:focus-visible ~ .v2-switch {
    outline: 2px solid rgba(var(--v2-accent-rgb), 0.85);
    outline-offset: 2px;
}

.v2-switch-input:disabled ~ .v2-switch {
    opacity: 0.5;
}

.dash-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--v2-line);
    color: var(--v2-t3);
    font-size: 13px;
}

.dash-stats b {
    color: var(--v2-t1);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 自定义资源站 */
.custom-apis-list {
    display: grid;
    align-content: start;
    gap: 6px;
    flex: 1;
}

/* 一个都没有时，提示文字在卡片剩余空间里居中 */
.custom-apis-list:has(> .v2-empty-line) {
    place-items: center;
    align-content: center;
}

.v2-custom-api {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--v2-line);
}

.v2-custom-api-info {
    flex: 1;
    min-width: 0;
}

.v2-custom-api-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--v2-t1);
    font-size: 14px;
    font-weight: 500;
}

.v2-custom-api-name em {
    margin-right: 6px;
    color: var(--v2-accent-hi);
    font-size: 12px;
    font-style: normal;
}

.v2-custom-api-url {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--v2-t3);
    font-size: 12px;
}

.v2-custom-api-actions {
    display: flex;
    gap: 2px;
}

.v2-custom-api-actions .v2-icon-btn {
    width: 32px;
    height: 32px;
}

.v2-custom-api-actions .v2-icon-btn svg {
    width: 15px;
    height: 15px;
}

.v2-custom-api-actions .is-danger:hover {
    color: #F0A29D;
}

.v2-empty-line {
    margin: 0;
    padding: 12px 0;
    color: var(--v2-t3);
    font-size: 13px;
    text-align: center;
}

#addCustomApiForm {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--v2-line);
}

#addCustomApiForm.hidden {
    display: none;
}

#addCustomApiForm .v2-input {
    height: 42px;
    font-size: 14px;
}

.v2-check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--v2-t2);
    font-size: 13px;
}

#addCustomApiForm > div:last-child {
    display: flex;
    gap: 8px;
}

#addCustomApiForm > div:last-child > .v2-btn {
    flex: 1;
}

.dash-add-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--v2-line-2);
    color: var(--v2-t1);
    transition: background-color var(--v2-dur) var(--v2-ease);
}

.dash-add-btn svg {
    width: 16px;
    height: 16px;
}

.dash-add-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* 开关 */
.dash-switch-body {
    display: grid;
    gap: 0;
    padding-top: 8px;
}

.dash-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.dash-switch-row + .dash-switch-row {
    border-top: 1px solid var(--v2-line);
}

.dash-switch-info {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.dash-switch-label {
    color: var(--v2-t1);
    font-size: 14.5px;
    font-weight: 500;
}

.dash-switch-desc {
    color: var(--v2-t3);
    font-size: 12.5px;
    line-height: 1.55;
}

.dash-switch-desc a {
    color: var(--v2-accent-hi);
}

.dash-switch-desc a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dash-switch-toggle {
    position: relative;
    flex: none;
    width: 46px;
    height: 28px;
    cursor: pointer;
}

.dash-switch-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.dash-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: background-color 0.2s ease;
}

.dash-switch-dot {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.22s var(--v2-ease);
}

.dash-switch-input:checked ~ .dash-switch-track {
    background: var(--v2-accent);
}

.dash-switch-input:checked ~ .dash-switch-dot {
    transform: translateX(18px);
}

.dash-switch-input:focus-visible ~ .dash-switch-track {
    outline: 2px solid rgba(var(--v2-accent-rgb), 0.85);
    outline-offset: 2px;
}

.dash-switch-input:disabled ~ .dash-switch-track {
    opacity: 0.5;
}

/* 数据管理 */
.dash-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dash-action-grid .v2-btn {
    height: 42px;
    padding: 0 10px;
    font-size: 14px;
}

.dash-action-grid .is-danger {
    color: #F0A29D;
}

.dash-action-grid .is-danger:hover {
    background: rgba(217, 113, 107, 0.12);
    border-color: rgba(217, 113, 107, 0.35);
}

/* 旧面板（设备管理、邀请码管理、取色器）里仍在用的按钮类名 */
.dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--v2-line-2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--v2-t1);
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color var(--v2-dur) var(--v2-ease), filter var(--v2-dur) var(--v2-ease);
}

.dash-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 主色按钮：与首页搜索按钮同一种带主色的清玻璃，不带阴影 */
.dash-btn-green,
.dash-btn-primary {
    color: #FFFFFF;
    border: 0.5px solid rgba(var(--v2-accent-rgb), 0.55);
    background: linear-gradient(180deg, rgba(var(--v2-accent-rgb), 0.36), rgba(var(--v2-accent-rgb), 0.22));
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    backdrop-filter: blur(12px) saturate(1.4);
    box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.28);
}

.dash-btn-green:hover,
.dash-btn-primary:hover {
    border-color: rgba(var(--v2-accent-rgb), 0.68);
    background: linear-gradient(180deg, rgba(var(--v2-accent-rgb), 0.46), rgba(var(--v2-accent-rgb), 0.3));
}

.dash-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--v2-line-2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--v2-t1);
    font-size: 14px;
    outline: none;
}

.dash-input:focus {
    border-color: rgba(var(--v2-accent-rgb), 0.6);
}

/* ============ 主题色盘与取色器 ============ */
/* 方案卡片：铺满整行，每张 = 双色色块（大圆主色、小圆辅助色）+ 方案名 + 主色 / 辅助色名 */
.theme-scheme-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.theme-scheme {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--v2-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s var(--v2-ease);
}

@media (hover: hover) {
    .theme-scheme:hover {
        border-color: var(--v2-line-3);
        background: rgba(255, 255, 255, 0.06);
    }
}

.theme-scheme:active {
    transform: scale(0.98);
}

.theme-scheme:focus-visible {
    outline: 2px solid rgba(var(--v2-accent-rgb), 0.85);
    outline-offset: 2px;
}

.theme-scheme.is-active {
    border-color: var(--disc-color, var(--v2-accent));
    background: rgba(255, 255, 255, 0.05);
}

/* 右上角一个小点标记当前生效的方案 */
.theme-scheme.is-active::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--disc-color, var(--v2-accent));
}

.theme-swatch {
    position: relative;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: var(--disc-color, #2A2A2A);
}

.theme-swatch::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--disc-aux, transparent);
    box-shadow: 0 0 0 2px #141417;
}

.theme-scheme.is-mono .theme-swatch::after {
    display: none;
}

.theme-scheme-text {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-right: 8px;
}

.theme-scheme-text b {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--v2-t2);
    font-size: 13.5px;
    font-weight: 600;
    transition: color 0.18s ease;
}

.theme-scheme.is-active .theme-scheme-text b {
    color: var(--v2-t1);
}

.theme-scheme-sub {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--v2-t3);
    font-size: 11.5px;
}

@media (max-width: 1100px) {
    .theme-scheme-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .theme-scheme-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .theme-scheme {
        gap: 9px;
        padding: 9px 10px;
    }

    .theme-swatch {
        width: 30px;
        height: 30px;
    }

    .theme-swatch::after {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 460px) {
    .theme-scheme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.theme-burst-canvas {
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
}

.theme-picker-popover {
    position: fixed;
    z-index: var(--v2-z-dialog);
    width: 256px;
    padding: 14px;
    border-radius: 16px;
    background: var(--v2-panel);
    border: 1px solid var(--v2-line-2);
    box-shadow: var(--v2-panel-shadow);
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s var(--v2-ease);
}

.theme-picker-popover.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.theme-picker-popover [hidden] {
    display: none;
}

.theme-picker-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.theme-picker-swatch {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.theme-picker-name {
    color: var(--v2-t1);
    font-size: 13px;
    font-weight: 600;
}

.theme-picker-hex {
    margin-left: auto;
    color: var(--v2-t3);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

.theme-picker-close {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--v2-t3);
    font-size: 16px;
    line-height: 1;
}

.theme-picker-close:hover {
    color: var(--v2-t1);
    background: rgba(255, 255, 255, 0.06);
}

.theme-picker-ramp {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    margin-bottom: 12px;
}

.theme-picker-ramp button {
    height: 14px;
    padding: 0;
    border-radius: 3px;
    transition: transform 0.12s ease;
}

.theme-picker-ramp button:hover {
    transform: scaleY(1.35);
}

.theme-picker-plane {
    position: relative;
    height: 132px;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: crosshair;
    touch-action: none;
}

.theme-picker-plane-dot,
.theme-picker-hue-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.theme-picker-hue {
    position: relative;
    height: 12px;
    margin-top: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(to right, #F00 0%, #FF0 17%, #0F0 33%, #0FF 50%, #00F 67%, #F0F 83%, #F00 100%);
    cursor: pointer;
    touch-action: none;
}

.theme-picker-hue-dot {
    top: 50%;
}

.theme-picker-rgb {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.theme-picker-code {
    margin-top: 6px;
}

.theme-picker-rgb label,
.theme-picker-code label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--v2-t3);
    font-size: 11px;
}

.theme-picker-rgb input,
.theme-picker-code input {
    width: 100%;
    min-width: 0;
    padding: 5px 7px;
    border: 1px solid var(--v2-line-2);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--v2-t1);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    outline: none;
}

.theme-picker-rgb input:focus,
.theme-picker-code input:focus {
    border-color: var(--v2-accent);
}

.theme-picker-code input {
    flex: 1;
    text-transform: uppercase;
}

.theme-picker-rgb input::-webkit-outer-spin-button,
.theme-picker-rgb input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.theme-picker-rgb input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.theme-picker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

/* ============ 关于 ============ */
/* 两列等高：隐私、版权两张卡片上下沿对齐 */
.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.about-hero {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    padding: 28px;
    border-radius: 24px;
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(var(--v2-accent-rgb), 0.12), transparent 60%),
        rgba(255, 255, 255, 0.03);
    border: 1px solid var(--v2-line);
}

.about-hero-mark {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)) var(--v2-tile);
    border: 1px solid rgba(var(--v2-accent-rgb), 0.28);
    box-shadow: 0 16px 40px -16px rgba(var(--v2-accent-rgb), 0.6);
}

.about-hero-mark .v2-mark {
    width: 60px;
    height: 45.3px;
}

.about-hero h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.about-hero p {
    max-width: 44em;
    margin: 0;
    color: var(--v2-t2);
    font-size: 14.5px;
    line-height: 1.75;
}

/* 四个入口：宽屏一行四个，窄屏两行两列。用 grid 而不是 flex-wrap——
   每列等宽，两行的左右边缘都对齐。
   断点跟 .about-grid 的单列断点一致：900px 以下卡片已经单列，
   这里再放四个就会挤在 hero 的文字栏里（901px 起 hero 才是「图标 + 文字」两栏） */
.about-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.about-actions .v2-btn {
    padding: 0 12px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .about-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.about-text {
    display: grid;
    gap: 10px;
}

.about-text p {
    margin: 0;
    color: var(--v2-t2);
    font-size: 14px;
    line-height: 1.75;
}

.about-text a {
    color: var(--v2-accent-hi);
}

.about-text a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 项目贡献者：声明文字与贡献者之间用一条细分隔线断开，
   每位贡献者一个轻包裹（头像方块 + 名字 + 身份），换配色时整块跟随主题色 */
.about-credits {
    display: grid;
    gap: 12px;
    margin-top: 6px;
    padding-top: 18px;
    border-top: 1px solid var(--v2-line);
}

.about-credits-label {
    color: var(--v2-t3);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
}

.about-credits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.credit {
    display: flex;
    flex: 1 1 140px;
    max-width: 200px;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-r-m);
    background: rgba(255, 255, 255, 0.03);
}

/* 头像用圆角方块（不是圆形）：主色的一层薄雾 + 内描边，与设置页图标同一套 accent 用法 */
.credit-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: var(--v2-r-s);
    background: rgba(var(--v2-accent-rgb), 0.12);
    box-shadow: inset 0 0 0 1px rgba(var(--v2-accent-rgb), 0.24);
    color: var(--v2-accent-hi);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.credit-meta {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.credit-name {
    color: var(--v2-t1);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.credit-role {
    color: var(--v2-t3);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

/* 作者用主题色标出身份，贡献者保持中性：有主次，但不靠加粗或堆叠 */
.credit--author .credit-role {
    color: var(--v2-accent-hi);
}

.about-changelog-card {
    grid-column: 1 / -1;
}

/* 更新日志时间线（app-routing.js 渲染） */
.changelog-timeline {
    display: grid;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 6px;
}

.changelog-entry {
    display: flex;
    gap: 14px;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: none;
    width: 12px;
    padding-top: 6px;
}

.timeline-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--v2-surface-3);
    border: 2px solid var(--v2-line-3);
}

.timeline-dot.latest {
    background: var(--v2-accent);
    border-color: rgba(var(--v2-accent-rgb), 0.35);
    box-shadow: 0 0 10px rgba(var(--v2-accent-rgb), 0.6);
}

.timeline-line {
    flex: 1;
    width: 1px;
    margin-top: 6px;
    background: var(--v2-line-2);
}

.changelog-entry:last-child .timeline-line {
    display: none;
}

.timeline-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 24px;
}

.entry-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.version-number {
    color: var(--v2-t1);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.latest-badge {
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(var(--v2-accent-rgb), 0.15);
    color: var(--v2-accent-hi);
    font-size: 11px;
    font-weight: 600;
}

.version-date {
    color: var(--v2-t3);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.entry-body {
    color: var(--v2-t2);
    font-size: 13.5px;
    line-height: 1.7;
}

.entry-body ul,
.entry-body ol {
    margin: 0;
    padding-left: 1.15em;
    list-style: disc;
}

.entry-body li + li {
    margin-top: 4px;
}

.entry-body li::marker {
    color: var(--v2-t3);
}

.entry-body p {
    margin: 0 0 6px;
}

.entry-body strong {
    color: var(--v2-t1);
    font-weight: 600;
}

.entry-body code {
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.92em;
}

/* ============ 项目说明（README） ============ */
.readme-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.readme-topbar .v2-page-title {
    font-size: clamp(22px, 2.6vw, 28px);
}

.readme-body {
    max-width: 820px;
}

.readme-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 72px 16px;
    color: var(--v2-t3);
    font-size: 14px;
}

.readme-state.hidden {
    display: none;
}

.markdown-body {
    color: var(--v2-t2);
    font-size: 15px;
    line-height: 1.8;
    overflow-wrap: break-word;
}

.markdown-body > * + * {
    margin-top: 0.9em;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: var(--v2-t1);
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.markdown-body h1 {
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--v2-line);
    font-size: 1.7em;
}

.markdown-body h2 {
    margin-top: 1.8em;
    font-size: 1.3em;
}

.markdown-body h3 {
    margin-top: 1.5em;
    font-size: 1.1em;
}

.markdown-body a {
    color: var(--v2-accent-hi);
}

.markdown-body a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.4em;
}

.markdown-body ul {
    list-style: disc;
}

.markdown-body ol {
    list-style: decimal;
}

.markdown-body li + li {
    margin-top: 0.3em;
}

.markdown-body li::marker {
    color: var(--v2-t3);
}

.markdown-body strong {
    color: var(--v2-t1);
    font-weight: 600;
}

.markdown-body code {
    padding: 0.15em 0.4em;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--v2-t1);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
}

.markdown-body pre {
    overflow-x: auto;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--v2-line);
}

.markdown-body pre code {
    padding: 0;
    background: transparent;
    font-size: 0.85em;
}

.markdown-body blockquote {
    padding: 4px 16px;
    border-left: 3px solid var(--v2-accent);
    border-radius: 0 10px 10px 0;
    background: rgba(255, 255, 255, 0.03);
    color: var(--v2-t2);
}

.markdown-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
    padding: 8px 12px;
    border: 1px solid var(--v2-line-2);
    text-align: left;
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--v2-t1);
    font-weight: 600;
}

.markdown-body hr {
    height: 1px;
    margin: 2em 0;
    background: var(--v2-line);
}

.markdown-body img {
    max-width: 100%;
    border-radius: 10px;
}

/* ============ 窄屏 ============ */
@media (max-width: 900px) {
    .settings-dashboard-grid,
    .about-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* 单列时把常用的排前面：数据源 > 主题 > 开关 > 其余 */
    .settings-dashboard-grid > * {
        order: 4;
    }

    .settings-dashboard-grid > :has(#apiCheckboxes) {
        order: 1;
    }

    .settings-dashboard-grid > .theme-full-width {
        order: 2;
    }

    .settings-dashboard-grid > :has(#hiddenContentModeToggle) {
        order: 3;
    }
}

@media (max-width: 720px) {
    /* 数据源勾选：窄屏强制 3 列，缩小 gap 和 item 内边距给名称留空间 */
    .dash-api-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px 6px;
    }

    .dash-api-grid .v2-src-item {
        gap: 6px;
        padding: 6px 4px;
    }

    .movies-topbar-inner {
        gap: 10px;
        min-height: 60px;
    }

    .movies-search {
        height: 42px;
        max-width: none;
    }

    .movies-bar-meta {
        display: none;
    }

    .movies-body {
        gap: 20px;
        padding-top: 14px;
    }

    /* 筛选和来源各占一行，横向滑动，右端渐隐提示还能滑 */
    .movies-filters {
        display: grid;
        gap: 12px;
    }

    .movies-seg {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin-inline: calc(var(--v2-gutter) * -1);
        padding: 0 var(--v2-gutter);
        border: 0;
        border-radius: 0;
        background: none;
        scrollbar-width: none;
    }

    .movies-seg::-webkit-scrollbar {
        display: none;
    }

    /* 右端渐隐提示还能滑 */
    .movies-seg,
    .movies-sources {
        padding-right: 32px;
        -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
        mask-image: linear-gradient(90deg, #000 88%, transparent);
    }

    .movies-seg-btn {
        flex: none;
        padding: 0 12px;
        border: 1px solid var(--v2-line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.05);
        font-size: 13px;
    }

    .movies-seg-btn.is-active {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: none;
    }

    .movies-hero {
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 12px 14px;
        align-items: start;
        padding: 14px;
        border-radius: 16px;
    }

    .movies-hero-poster {
        grid-row: 1 / span 3;
        border-radius: 10px;
    }

    .movies-hero-info {
        display: contents;
    }

    .movies-eyebrow {
        grid-column: 2;
        align-self: end;
        font-size: 11px;
    }

    .movies-hero h2 {
        grid-column: 2;
        font-size: 24px;
    }

    .movies-hero-meta {
        grid-column: 2;
        align-self: start;
        font-size: 12.5px;
    }

    .movies-seasons {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .movies-season {
        min-width: 0;
        padding: 9px 11px;
    }

    .movies-season b {
        font-size: 13px;
    }

    .movies-season span {
        font-size: 11.5px;
    }

    .movies-hero-desc {
        display: none;
    }

    .movies-hero-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .movies-hero-actions .v2-btn {
        height: 42px;
        padding: 0 16px;
        font-size: 14px;
    }

    .movies-hero-remarks {
        display: none;
    }

    .movies-lines {
        grid-column: 1 / -1;
    }

    .movies-shelves {
        gap: 24px;
    }

    .movies-shelf {
        gap: 12px;
    }

    .movies-shelf-head h3 {
        font-size: 16px;
    }

    .movies-shelf-head p {
        display: none;
    }

    /* 片源筛选条：单行横滑 */
    .movies-sources {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-inline: calc(var(--v2-gutter) * -1);
        padding-inline: var(--v2-gutter);
        scrollbar-width: none;
    }

    .movies-sources::-webkit-scrollbar {
        display: none;
    }

    .movies-chip {
        flex: none;
    }

    .history-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 22px;
    }

    .about-hero-mark {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }

    .about-hero-mark .v2-mark {
        width: 44px;
        height: 33.2px;
    }

    .tmdb-filter-section {
        padding: 14px;
    }

    /* 筛选标签单行横滑，省纵向空间 */
    .tmdb-genre-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tmdb-genre-list::-webkit-scrollbar {
        display: none;
    }

    .tmdb-genre-btn {
        flex: none;
    }

    .genre-filter-collapsed .genre-btn-extra,
    .year-filter-collapsed .year-btn-extra {
        display: inline-block;
    }

    .genre-toggle-btn,
    .year-toggle-btn {
        display: none;
    }

    .tmdb-type-btn {
        padding: 0 12px;
    }
}

@media (max-width: 640px) {
    .movies-results-grid,
    .tmdb-results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px 10px;
    }

    .dash-card-header {
        padding: 16px 16px 0;
    }

    .dash-card-body {
        padding: 14px 16px 16px;
    }

    .dash-action-grid .v2-btn {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .movies-results-grid,
    .tmdb-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============ 导入配置 ============ */
.v2-dropzone {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 32px 20px;
    border-radius: 16px;
    border: 1.5px dashed var(--v2-line-3);
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
    transition: border-color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease);
}

.v2-dropzone.is-over {
    border-color: rgba(var(--v2-accent-rgb), 0.7);
    background: rgba(var(--v2-accent-rgb), 0.06);
}

.v2-dropzone-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    border-radius: 14px;
    background: rgba(var(--v2-accent-rgb), 0.1);
    color: var(--v2-accent-hi);
}

.v2-dropzone-icon svg {
    width: 22px;
    height: 22px;
}

.v2-dropzone-title {
    color: var(--v2-t1);
    font-size: 15px;
    font-weight: 600;
}

.v2-dropzone-sub {
    color: var(--v2-t3);
    font-size: 13px;
}

.v2-dropzone-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.v2-dropzone-actions label {
    cursor: pointer;
}

/* 更新日志条目里的分类标记（新增 / 修复 / 优化……）与补充说明 */
.entry-body .entry-tag {
    display: inline-block;
    margin-right: 8px;
    padding: 0 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--v2-t1);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.7;
}

.entry-body .entry-note {
    margin-top: 6px;
    color: var(--v2-t3);
    font-size: 12.5px;
}

/* 封面到达前：占位层带一道缓慢扫过的微光，表示仍在加载 */
.v2-poster:has(> img:not(.loaded)) .v2-poster-empty::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%) 0 0 / 300% 100%;
    animation: v2Shimmer 1.8s linear infinite;
}

.v2-poster:has(> img.loaded) .v2-poster-empty {
    visibility: hidden;
}

/* 分类页：卡片按钮撑满网格列，否则会按标题长短各自收缩，海报大小不一 */
.tmdb-card {
    min-width: 0;
}

.tmdb-card > .v2-pcard {
    width: 100%;
}

/* 更新日志滚动区：底部渐隐，提示下面还有内容 */
.changelog-timeline {
    -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent);
    mask-image: linear-gradient(to bottom, #000 88%, transparent);
    padding-bottom: 24px;
}

/* 小号分段开关（设置页「动态效果」） */
.v2-seg-mini {
    display: inline-flex;
    flex: none;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--v2-line);
}

.v2-seg-mini button {
    height: 28px;
    padding: 0 11px;
    border-radius: 7px;
    color: var(--v2-t2);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--v2-dur) var(--v2-ease), background-color var(--v2-dur) var(--v2-ease);
}

.v2-seg-mini button:hover {
    color: var(--v2-t1);
}

.v2-seg-mini button.is-active {
    color: var(--v2-t1);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dash-switch-note {
    display: block;
    margin-top: 4px;
    color: var(--v2-warn);
}

.dash-switch-note:empty {
    display: none;
}

@media (max-width: 520px) {
    .dash-switch-row[data-role="motion-pref"] {
        flex-wrap: wrap;
    }
}

/* 开关两列排（设置页「首页与导航」） */
.dash-switch-body.is-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
}

.dash-switch-body.is-two-col .dash-switch-row + .dash-switch-row {
    border-top: 0;
}

.dash-switch-body.is-two-col .dash-switch-row:nth-child(n+3) {
    border-top: 1px solid var(--v2-line);
}

@media (max-width: 900px) {
    .dash-switch-body.is-two-col {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-switch-body.is-two-col .dash-switch-row + .dash-switch-row {
        border-top: 1px solid var(--v2-line);
    }
}
