/* ==========================================================================
   1. 基础变量与重置 (Design Tokens)
   ========================================================================== */
   :root {
    --primary-color: #C20C0C; /* 网易红 */
    --accent-color: #ff3a3a;
    --text-main: #1d1d1f;
    --text-soft: #6e6e73;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
    --header-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 清除移动端点击高亮 */
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: #fbfbfd;
    line-height: 1.6;
    overflow-x: hidden;
    word-break: break-word;
    /* 为底部固定播放器留出空间（随播放器高度收紧） */
    padding-bottom: min(320px, 48vh);
}

/* 外站嵌入模式：覆盖首页的超大预留，避免宿主页面底部出现大空隙 */
body.aplayer-embed-loaded {
    padding-bottom: 0 !important;
}

body.aplayer-embed-injected {
    padding-bottom: 120px !important;
}

/* ==========================================================================
   2. 装饰性元素 (流体背景)
   ========================================================================== */
.mesh-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(at 0% 0%, rgba(194, 12, 12, 0.05) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(66, 133, 244, 0.05) 0, transparent 50%);
    background-attachment: fixed;
}

/* ==========================================================================
   3. 通用布局组件
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    border: none;
    width: 100%; /* 移动端默认全宽 */
}

@media (min-width: 768px) {
    .btn { width: auto; } /* 桌面端恢复自适应宽度 */
}

.btn-primary {
    background: var(--text-main);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid rgba(0,0,0,0.1);
}

/* ==========================================================================
   4. 导航栏 (Header)
   ========================================================================== */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

/* ==========================================================================
   5. 英雄区 (Hero Section)
   ========================================================================== */
.hero-section {
    padding: calc(var(--header-height) + 60px) 0 60px;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(194, 12, 12, 0.08);
    color: var(--primary-color);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 2.5rem; /* 移动端较小字号 */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
}

.text-accent { color: var(--primary-color); }

.hero-lead {
    font-size: 1.1rem;
    color: var(--text-soft);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
}

.hero-visual {
    display: none; /* 移动端默认隐藏 */
    margin-top: 60px;
}

/* 桌面端适配 */
@media (min-width: 992px) {
    .hero-inner {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
    }
    .hero-title { font-size: 4rem; }
    .hero-actions { flex-direction: row; width: auto; }
    .hero-visual { display: block; flex: 1; max-width: 400px; }
}

/* ==========================================================================
   6. 代码实验室 (Embed Section)
   ========================================================================== */
.embed-section { padding: 40px 0; }

.code-container {
    overflow: hidden;
    padding: 0;
}

.code-header {
    background: rgba(0,0,0,0.03);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.window-dots { display: flex; gap: 8px; }
.window-dots span { width: 10px; height: 10px; border-radius: 50%; background: #ddd; }
.window-dots span:nth-child(1) { background: #ff5f56; }
.window-dots span:nth-child(2) { background: #ffbd2e; }
.window-dots span:nth-child(3) { background: #27c93f; }

.copy-trigger {
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.preview-trigger {
    background: rgba(29, 29, 31, 0.06);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
}

.preview-trigger:disabled,
.copy-trigger:disabled {
    opacity: 0.65;
    cursor: wait;
}

.code-content {
    padding: 20px;
    overflow-x: auto; /* 允许代码横向滚动 */
}

.code-content pre {
    margin: 0 !important;
    background: transparent !important;
    font-size: 0.9rem;
}

.status-tip {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #27c93f;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

/* ==========================================================================
   7. 特性卡片 (Features Grid)
   ========================================================================== */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 60px 0;
}

@media (min-width: 768px) {
    .features-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-item {
    padding: 32px;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.icon-box.red { background: rgba(194,12,12,0.1); }
.icon-box.blue { background: rgba(66,133,244,0.1); }
.icon-box.green { background: rgba(39,201,63,0.1); }

/* ==========================================================================
   8. 页脚与播放器停靠
   ========================================================================== */
.site-footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.85rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.player-dock {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    /* 桌面略收窄；手机端见下方 media，不再铺满屏宽 */
    width: min(340px, calc(100vw - 32px));
    max-width: 100%;
    max-height: 82vh;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
}

.player-dock.player-dock--right {
    left: auto;
    right: 20px;
}

/* 外站嵌入：data-mount 挂到自定义容器内时随文档流，不再 fixed 贴底 */
.player-dock.player-dock-embed.player-dock-embed-inline {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    z-index: auto;
}

.player-dock.player-dock--collapsible {
    --dock-handle-width: 24px;
    /* 收起后仍露出的宽度（仅用于 transform） */
    --dock-handle-peek: 8px;
    /*
     * 拉手向外「探出」的距离，与 --dock-handle-peek 分离，避免为收起动画牺牲横向位置
     * 取约 (宽度 - 2px) 使几乎整条在卡片外，只留 2px 叠边，不挡歌单/图标
     */
    --dock-handle-outset: calc(var(--dock-handle-width) - 2px);
    /* 与下方 .aplayer 圆角一致，拉手外沿与之呼应 */
    --dock-radius: 16px;
    /* 固定贴顶部控制区，歌单展开变高时不再随 50% 下移 */
    --dock-handle-top: 12px;
}

.player-dock.player-dock--collapsible.is-collapsed {
    transform: translateX(calc(-100% + var(--dock-handle-peek)));
}

.player-dock.player-dock--right.player-dock--collapsible.is-collapsed {
    transform: translateX(calc(100% - var(--dock-handle-peek)));
}

/* 收起 dock 后歌词浮层（挂 body，避免父级 transform 导致 fixed 失效） */
.player-dock-collapsed-lrc {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 10000;
    max-width: min(90vw, 30rem);
    margin: 0;
    padding: 0.32rem 0.95rem;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.98);
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.8),
        0 1px 4px rgba(0, 0, 0, 0.55),
        0 0 24px rgba(0, 0, 0, 0.35);
    background: rgba(15, 15, 20, 0.42);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.28s ease,
        visibility 0.28s step-end;
}

.player-dock-collapsed-lrc.is-visible {
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.28s ease,
        visibility 0s;
}

@media (max-width: 768px) {
    .player-dock-collapsed-lrc {
        font-size: 0.7rem;
        line-height: 1.25;
        padding: 0.26rem 0.7rem;
        max-width: min(88vw, 19rem);
        font-weight: 500;
        /* 单行省略，避免小屏堆成多行 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.player-dock-toggle {
    position: absolute;
    top: var(--dock-handle-top);
    right: calc(-1 * var(--dock-handle-outset));
    transform: none;
    width: var(--dock-handle-width);
    min-height: 64px;
    height: auto;
    padding: 12px 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* 贴播放器一侧不要描边，避免一条「割线」 */
    border-left: none;
    border-radius: 0 var(--dock-radius) var(--dock-radius) 0;
    /* 与 .aplayer 同底，避免灰条「贴上去」的割裂感 */
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    color: rgba(45, 45, 50, 0.75);
    /* 与播放器阴影同系，略收一点避免双边过重 */
    box-shadow: 2px 4px 18px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    z-index: 10001;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        transform 0.18s ease,
        color 0.2s ease;
}

.player-dock-toggle:hover {
    background: rgba(255, 255, 255, 0.99) !important;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 3px 6px 22px rgba(0, 0, 0, 0.09);
}

.player-dock-toggle:active {
    transform: scale(0.97);
}

.player-dock-toggle:focus-visible {
    outline: 2px solid rgba(194, 12, 12, 0.4);
    outline-offset: 2px;
}

.player-dock.player-dock--right .player-dock-toggle {
    left: calc(-1 * var(--dock-handle-outset));
    right: auto;
    margin-right: 0;
    margin-left: 0;
    border-radius: var(--dock-radius) 0 0 var(--dock-radius);
    border-right: none;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: -2px 4px 18px rgba(0, 0, 0, 0.07);
}

.player-dock.player-dock--right .player-dock-toggle:hover {
    box-shadow: -3px 6px 22px rgba(0, 0, 0, 0.09);
}

.player-dock-toggle-text {
    display: block;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.06em;
    color: rgba(55, 55, 62, 0.82);
    -webkit-font-smoothing: antialiased;
    transition: color 0.2s ease, transform 0.18s ease;
}

.player-dock-toggle:hover .player-dock-toggle-text {
    color: var(--primary-color, #c20c0c);
}

.player-dock-toggle:active .player-dock-toggle-text {
    transform: scale(0.9);
}

.player-dock #netease-player,
.player-dock .aplayer-embed-inner {
    width: 100%;
    min-height: 100px;
}

/* 加载中 / 错误提示（APlayer 初始化前） */
.player-dock .netease-player-message {
    margin: 0;
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    word-break: break-word;
}

.player-dock .netease-player-message.is-error {
    color: #922b21;
    background: #fdedec;
    border-color: #f5b7b1;
}

.player-dock .aplayer {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
}

/* 控制条区域：封面与列表高度平衡（列表仍紧凑） */
.player-dock .aplayer .aplayer-pic {
    width: 60px !important;
    height: 60px !important;
    margin-right: 8px !important;
}

.player-dock .aplayer .aplayer-body {
    min-height: 60px !important;
    padding: 6px 8px 6px 0 !important;
}

/* APlayer 默认 info 按 66px 封面留边，与自定义封面宽度对齐 */
.player-dock .aplayer .aplayer-info {
    margin-left: 68px !important;
    min-height: 60px !important;
    height: auto !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    box-sizing: border-box !important;
}

.player-dock .aplayer .aplayer-info .aplayer-music .aplayer-title {
    font-size: 0.82rem !important;
    line-height: 1.12 !important;
}

.player-dock .aplayer .aplayer-info .aplayer-music .aplayer-author {
    font-size: 0.68rem !important;
    line-height: 1.1 !important;
    margin-top: 0 !important;
}

.player-dock .aplayer.aplayer-narrow .aplayer-info,
.player-dock .aplayer-full-ui .aplayer-info {
    transform: none !important;
    -webkit-transform: none !important;
    opacity: 1 !important;
}

.player-dock .aplayer .aplayer-info .aplayer-icon svg path,
.player-dock .aplayer .aplayer-info .aplayer-icon svg circle {
    fill: #444 !important;
}

.player-dock .aplayer .aplayer-pic .aplayer-button svg path {
    fill: #fff !important;
}

.player-dock .aplayer.aplayer-withlist .aplayer-list {
    display: block !important;
}

.player-dock .aplayer .aplayer-list {
    margin-top: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(250, 250, 252, 0.96) !important;
}

/* APlayer 默认 .aplayer * { box-sizing: content-box }，与 flex + padding 叠加易把行撑高 */
.player-dock .aplayer .aplayer-list,
.player-dock .aplayer .aplayer-list ol,
.player-dock .aplayer .aplayer-list ol li,
.player-dock .aplayer .aplayer-list ol li span {
    box-sizing: border-box !important;
}

.player-dock .aplayer .aplayer-list ol {
    /* 覆盖 APlayer 内联 listMaxHeight，保证停靠条总高度可控 */
    max-height: 96px !important;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
    padding: 2px 0 !important;
}

.player-dock .aplayer .aplayer-list ol::-webkit-scrollbar {
    width: 5px;
}

.player-dock .aplayer .aplayer-list ol::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
}

/* 单行紧凑行：覆盖默认 height:32px、作者 float:right（与 flex 冲突会拉高行） */
.player-dock .aplayer .aplayer-list ol li {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 !important;
    padding: 0 8px 0 10px !important;
    font-size: 11px !important;
    line-height: 26px !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    cursor: pointer !important;
    overflow: hidden !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.player-dock .aplayer .aplayer-list ol li:last-child {
    border-bottom: none !important;
}

/* 当前播放左侧指示：默认 3×22 直角条 → 圆角短条 + 主题色 */
.player-dock .aplayer .aplayer-list ol li .aplayer-list-cur {
    width: 3px !important;
    height: 14px !important;
    top: 50% !important;
    left: 3px !important;
    margin-top: 0 !important;
    transform: translateY(-50%) !important;
    border-radius: 2px !important;
    background: var(--primary-color, #c20c0c) !important;
    opacity: 0.95;
}

.player-dock .aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(194, 12, 12, 0.07) !important;
}

.player-dock .aplayer .aplayer-list ol li:hover {
    background: rgba(0, 0, 0, 0.045) !important;
}

.player-dock .aplayer .aplayer-list ol li.aplayer-list-light:hover {
    background: rgba(194, 12, 12, 0.1) !important;
}

.player-dock .aplayer .aplayer-list ol li .aplayer-list-index {
    flex: 0 0 auto !important;
    width: 1.1rem !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
    font-size: 10px !important;
    font-variant-numeric: tabular-nums;
    line-height: 26px !important;
    text-align: right !important;
}

.player-dock .aplayer .aplayer-list ol li .aplayer-list-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 26px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    float: none !important;
}

.player-dock .aplayer .aplayer-list ol li .aplayer-list-author {
    flex: 0 1 auto !important;
    max-width: 38% !important;
    margin: 0 0 0 6px !important;
    padding: 0 !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    line-height: 26px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    float: none !important;
    text-align: right !important;
}

/* 仅默认皮肤：歌单字色（带主题的 dock 由 player-themes 继承/覆盖） */
.player-dock:not([class*="player-theme--"]) .aplayer .aplayer-list ol li .aplayer-list-index {
    color: rgba(0, 0, 0, 0.38) !important;
}

.player-dock:not([class*="player-theme--"]) .aplayer .aplayer-list ol li .aplayer-list-title {
    color: rgba(0, 0, 0, 0.88) !important;
}

.player-dock:not([class*="player-theme--"]) .aplayer .aplayer-list ol li .aplayer-list-author {
    color: rgba(0, 0, 0, 0.48) !important;
}

/* 移动端：限制最大宽度，避免横向拉满整屏 */
@media (max-width: 768px) {
    body {
        padding-bottom: min(300px, 46vh);
    }

    body.aplayer-embed-injected {
        padding-bottom: 96px !important;
    }

    .player-dock {
        left: 10px;
        bottom: 10px;
        width: min(280px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
    }

    .player-dock.player-dock--right {
        left: auto;
        right: 10px;
    }

    .player-dock.player-dock-embed.player-dock-embed-inline {
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: 100%;
    }

    .player-dock.player-dock--collapsible {
        --dock-handle-width: 22px;
        --dock-handle-peek: 6px;
        --dock-handle-outset: calc(var(--dock-handle-width) - 2px);
        --dock-radius: 16px;
        --dock-handle-top: 10px;
    }

    .player-dock-toggle {
        min-height: 52px;
        padding: 10px 0;
        border-radius: 0 var(--dock-radius) var(--dock-radius) 0;
    }

    .player-dock.player-dock--right .player-dock-toggle {
        border-radius: var(--dock-radius) 0 0 var(--dock-radius);
    }

    .player-dock-toggle-text {
        font-size: 1.1rem;
    }

    .player-dock .aplayer .aplayer-list ol {
        max-height: 80px !important;
    }
}

/* APlayer 视觉修正 */
.aplayer {
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    background: rgba(255,255,255,0.95) !important;
}

.copy-trigger.success {
    background: rgba(39, 201, 63, 0.15);
    border-color: rgba(39, 201, 63, 0.4);
    color: #1a7f37;
}

/* ==========================================================================
   10. 多主题嵌入（首页 + 后台共用）
   ========================================================================== */
.theme-section-title {
    margin: 0 0 0.75rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
    color: var(--text-main);
}

.theme-section-lead {
    margin: 0 auto 2rem;
    max-width: 640px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-soft);
    line-height: 1.65;
}

.theme-section-lead code {
    font-size: 0.85em;
    padding: 0.1em 0.35em;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
}

.theme-embed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 720px) {
    .theme-embed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .theme-embed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.theme-embed-card {
    padding: 1.25rem 1.35rem;
    text-align: left;
}

.theme-embed-card-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.theme-swatch {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.theme-embed-name {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.theme-embed-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-soft);
    line-height: 1.5;
}

.theme-embed-code {
    width: 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.45;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    color: #1d1d1f;
    resize: vertical;
    min-height: 9rem;
}

.theme-embed-card-actions {
    margin-top: 0.85rem;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.theme-preview-shell {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-preview-shell .aplayer {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
}

.theme-preview-shell .aplayer.aplayer-withlist .aplayer-list {
    display: block !important;
}

.theme-preview-shell .aplayer .aplayer-list,
.theme-preview-shell .aplayer .aplayer-list ol,
.theme-preview-shell .aplayer .aplayer-list ol li,
.theme-preview-shell .aplayer .aplayer-list ol li span {
    box-sizing: border-box !important;
}

.theme-preview-shell .aplayer .aplayer-list ol li {
    position: relative !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 !important;
    padding: 0 8px 0 10px !important;
    font-size: 11px !important;
    line-height: 26px !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    overflow: hidden !important;
}

.theme-preview-shell .aplayer .aplayer-list ol li:last-child {
    border-bottom: none !important;
}

.theme-preview-shell .aplayer .aplayer-list ol li .aplayer-list-cur {
    width: 3px !important;
    height: 14px !important;
    top: 50% !important;
    left: 3px !important;
    margin-top: 0 !important;
    transform: translateY(-50%) !important;
    border-radius: 2px !important;
    background: var(--primary-color, #c20c0c) !important;
}

.theme-preview-shell .aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(194, 12, 12, 0.07) !important;
}

.theme-preview-shell .aplayer .aplayer-list ol li .aplayer-list-index {
    flex: 0 0 auto !important;
    width: 1.1rem !important;
    margin: 0 6px 0 0 !important;
    font-size: 10px !important;
    line-height: 26px !important;
    text-align: right !important;
}

.theme-preview-shell .aplayer .aplayer-list ol li .aplayer-list-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 26px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    float: none !important;
}

.theme-preview-shell .aplayer .aplayer-list ol li .aplayer-list-author {
    flex: 0 1 auto !important;
    max-width: 38% !important;
    margin: 0 0 0 6px !important;
    font-size: 10px !important;
    line-height: 26px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    float: none !important;
    text-align: right !important;
}

.theme-preview-shell:not([class*="player-theme--"]) .aplayer .aplayer-list ol li .aplayer-list-index {
    color: rgba(0, 0, 0, 0.38) !important;
}

.theme-preview-shell:not([class*="player-theme--"]) .aplayer .aplayer-list ol li .aplayer-list-title {
    color: rgba(0, 0, 0, 0.88) !important;
}

.theme-preview-shell:not([class*="player-theme--"]) .aplayer .aplayer-list ol li .aplayer-list-author {
    color: rgba(0, 0, 0, 0.48) !important;
}

.theme-preview-shell .aplayer .aplayer-list ol {
    max-height: 96px !important;
    padding: 2px 0 !important;
}

.theme-preview-shell .aplayer.aplayer-narrow .aplayer-info,
.theme-preview-shell .aplayer-full-ui .aplayer-info {
    transform: none !important;
    -webkit-transform: none !important;
    opacity: 1 !important;
}

.theme-preview-shell .aplayer .aplayer-info .aplayer-icon svg path,
.theme-preview-shell .aplayer .aplayer-info .aplayer-icon svg circle {
    fill: #444 !important;
}

.theme-preview-shell .aplayer .aplayer-pic .aplayer-button svg path {
    fill: #fff !important;
}

.theme-preview-message {
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-preview-message.is-error {
    color: #922b21;
    background: #fdedec;
    border-color: #f5b7b1;
}

.theme-embed-empty {
    text-align: center;
    color: var(--text-soft);
    padding: 1.5rem;
}

.theme-copy-status {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.88rem;
    color: #27c93f;
    min-height: 1.5em;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.theme-reference-fold {
    margin-top: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.5);
}

.theme-reference-fold summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-soft);
}

.theme-reference-inner {
    margin-top: 1rem;
}

.admin-panel .theme-embed-grid {
    margin-top: 0.5rem;
}

.admin-panel .theme-embed-card {
    background: #fafbfc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin: 0;
}

.admin-panel .theme-embed-code {
    background: #fff;
}

/* ==========================================================================
   9. 管理后台 / 初始化页（site-page + admin-*）
   ========================================================================== */

/* 后台无首页播放器 dock，取消为播放器预留的大段底部空白 */
body:has(.admin-page) {
    padding-bottom: 2.5rem;
}

.site-page {
    max-width: 840px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.site-page h1 {
    margin: 0 0 1rem;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.site-page > p {
    margin: 0 0 1rem;
}

.site-page code {
    font-size: 0.88em;
    padding: 0.12em 0.35em;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.hint {
    font-size: 0.875rem;
    color: var(--text-soft);
    line-height: 1.55;
}

.admin-page {
    max-width: 880px;
}

.admin-nav {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
}

.admin-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.admin-nav a:hover {
    text-decoration: underline;
}

.admin-nav-sep {
    margin: 0 0.5rem;
    color: var(--text-soft);
}

.admin-login-form {
    max-width: 420px;
}

.admin-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
}

.admin-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(194, 12, 12, 0.12);
}

.admin-page h1 {
    margin-bottom: 0.75rem;
}

.admin-h2 {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.admin-panel {
    margin: 1.5rem 0;
    padding: 1.35rem 1.4rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

.admin-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-main);
}

.admin-label-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-weight: 500;
}

.admin-textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    resize: vertical;
    min-height: 120px;
    background: #fff;
}

.admin-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(194, 12, 12, 0.1);
}

.admin-preview {
    background: #f8f9fb;
    color: #1d1d1f;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.admin-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    cursor: pointer;
    color: var(--text-main);
    font-family: inherit;
    font-weight: 500;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-btn:hover {
    border-color: rgba(194, 12, 12, 0.35);
    background: rgba(194, 12, 12, 0.04);
}

.admin-btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.admin-btn-primary:hover {
    filter: brightness(1.05);
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.admin-btn-muted {
    color: var(--text-soft);
}

.admin-status {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    color: var(--text-soft);
    min-height: 1.25em;
}

.admin-status.is-ok {
    color: #1a7f37;
}

.admin-status.is-error {
    color: #c0392b;
}

.admin-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.admin-dl > div {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.5rem 1rem;
    align-items: baseline;
    font-size: 0.9rem;
}

@media (max-width: 560px) {
    .admin-dl > div {
        grid-template-columns: 1fr;
    }
}

.admin-dl dt {
    margin: 0;
    font-weight: 600;
    color: var(--text-soft);
}

.admin-dl dd {
    margin: 0;
    word-break: break-all;
    color: var(--text-main);
}

.admin-warn {
    color: #c0392b;
    font-weight: 600;
}

.admin-hint-tight {
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
}

.admin-input-mono {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.9rem;
}
