
        :root {
            /* 系统字体栈，理由同前台（见 index.html 里的注释） */
            --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                         'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
            --bg-primary: #ffffff;
            --bg-secondary: #f8f9fa;
            --bg-tertiary: #f1f3f4;
            --bg-card: #ffffff;
            --text-primary: #202124;
            --text-secondary: #5f6368;
            --text-tertiary: #80868b;
            --accent-blue: #4285f4;
            --accent-purple: #a142f4;
            --accent-pink: #f451ab;
            --accent-orange: #f6982a;
            --accent-green: #34a853;
            --border-color: #e0e0e0;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
            --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 24px;
            --radius-xl: 32px;
        }

        @media (prefers-color-scheme: dark) {
            :root:not([data-theme="light"]) {
                --bg-primary: #1a1a1a;
                --bg-secondary: #121212;
                --bg-tertiary: #2a2a2a;
                --bg-card: #1e1e1e;
                --text-primary: #e8eaed;
                --text-secondary: #9aa0a6;
                --text-tertiary: #5f6368;
                --border-color: #3c4043;
                --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
                --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
                --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
            }
        }

        :root[data-theme="dark"] {
            --bg-primary: #1a1a1a;
            --bg-secondary: #121212;
            --bg-tertiary: #2a2a2a;
            --bg-card: #1e1e1e;
            --text-primary: #e8eaed;
            --text-secondary: #9aa0a6;
            --text-tertiary: #5f6368;
            --border-color: #3c4043;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
            --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: var(--font-sans);
            background: var(--bg-secondary);
            color: var(--text-primary);
            min-height: 100vh;
            display: flex;
            position: relative;
            overflow-x: hidden;
        }

        /* 登录遮罩不在这里 —— 它是 position:fixed 的整屏覆盖层，见文件末尾的 .auth-screen */
        .sidebar, .main-content, .modal-overlay {
            position: relative;
            z-index: 1;
        }

        .sidebar {
            width: 260px;
            background: var(--bg-primary);
            border-right: 1px solid var(--border-color);
            padding: 1.5rem 0;
            position: fixed;
            height: 100vh;
            overflow-y: auto;
        }

        .sidebar-header {
            padding: 0 1.5rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 1rem;
        }

        .sidebar-logo {
            font-family: var(--font-sans);
            font-size: 1.2rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .sidebar-subtitle {
            font-size: 0.85rem;
            color: var(--text-tertiary);
            margin-top: 0.25rem;
        }

        .view-site-link {
            display: block;
            margin: 0.5rem 1.5rem;
            padding: 0.5rem 1rem;
            background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(161, 66, 244, 0.1));
            border-radius: var(--radius-md);
            color: var(--accent-blue);
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 500;
            text-align: center;
            transition: all 0.2s ease;
        }

        .view-site-link:hover {
            background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(161, 66, 244, 0.2));
            transform: translateY(-1px);
        }

        .logout-btn {
            display: block;
            margin: 1rem 1.5rem;
            padding: 0.5rem 1rem;
            background: rgba(234, 67, 53, 0.1);
            border-radius: var(--radius-md);
            color: #ea4335;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            width: calc(100% - 3rem);
        }

        .logout-btn:hover {
            background: rgba(234, 67, 53, 0.2);
        }

        .theme-toggle-admin {
            display: block;
            margin: 0.5rem 1.5rem;
            padding: 0.5rem 1rem;
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 500;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            width: calc(100% - 3rem);
        }

        .theme-toggle-admin:hover {
            background: var(--border-color);
        }

        .sidebar-toggle {
            display: none;
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 1001;
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 0.5rem;
            cursor: pointer;
            box-shadow: var(--shadow-md);
        }

        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }

        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s ease;
                z-index: 1000;
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .sidebar-overlay.active {
                display: block;
            }
            .sidebar-toggle {
                display: block;
            }
            .main-content {
                margin-left: 0;
                padding: 1rem;
            }
        }

        .nav-section { margin-bottom: 1rem; }

        .nav-section-title {
            padding: 0.5rem 1.5rem;
            font-size: 0.75rem;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1.5rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
            border-left: 3px solid transparent;
        }

        .nav-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .nav-item.active {
            background: linear-gradient(90deg, rgba(66, 133, 244, 0.1), transparent);
            color: var(--accent-blue);
            border-left-color: var(--accent-blue);
        }

        .nav-icon { font-size: 1.2rem; }

        .main-content {
            flex: 1;
            margin-left: 260px;
            padding: 2rem 3rem;
        }

        /* 读不到 data.json 时的横幅（admin.js 的 showLoadError）。
           默认藏起来，由 showLoadError() 切换内联 display。 */
        .load-error {
            display: none;
            background: rgba(234, 67, 53, 0.08);
            border: 1px solid rgba(234, 67, 53, 0.35);
            border-radius: var(--radius-md);
            color: var(--text-secondary);
            font-size: 0.9rem;
            line-height: 1.7;
            padding: 1rem 1.25rem;
            margin-bottom: 1.5rem;
        }

        .load-error strong {
            display: block;
            color: #ea4335;
            margin-bottom: 0.25rem;
        }

        .load-error code {
            background: rgba(234, 67, 53, 0.12);
            border-radius: 4px;
            padding: 0.1rem 0.35rem;
        }

        /* 读不到内容时把「保存」类按钮一并置灰：save() 本来就会拦下来，
           但让人先看见按钮是灰的，比点下去才弹提示清楚。 */
        body.load-failed .btn-success {
            opacity: 0.45;
            pointer-events: none;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
        }

        .page-title {
            font-family: var(--font-sans);
            font-size: 1.8rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .header-actions { display: flex; gap: 0.75rem; }

        .btn {
            font-family: var(--font-sans);
            padding: 0.65rem 1.25rem;
            border: none;
            font-weight: 600;
            font-size: 0.9rem;
            border-radius: var(--radius-lg);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-primary { background: var(--accent-blue); color: white; }
        .btn-primary:hover { background: #3367d6; transform: translateY(-1px); box-shadow: var(--shadow-md); }

        .btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }
        .btn-secondary:hover { background: var(--border-color); }

        .btn-success { background: var(--accent-green); color: white; }
        .btn-success:hover { background: #2d8e47; transform: translateY(-1px); }

        .btn-danger { background: #ea4335; color: white; }
        .btn-danger:hover { background: #d33426; }

        .btn-small { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

        /* 下载按钮是个 <a>，补上按钮本身没有的默认样式 */
        a.btn { display: inline-block; text-decoration: none; text-align: center; }
        .btn.disabled { opacity: 0.45; pointer-events: none; }

        /* 简历 PDF 面板 */
        .pdf-current { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem 1.25rem; margin-bottom: 1rem; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
        .pdf-current-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
        .pdf-current-name.empty { font-weight: 500; color: var(--text-tertiary); }
        .pdf-current-name.warn { color: #ea4335; }
        .pdf-current-path { font-size: 0.8rem; color: var(--text-tertiary); word-break: break-all; }
        .pdf-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
        .pdf-notes { margin: 0; padding-left: 1.25rem; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.9; }

        .panel { display: none; }
        .panel.active { display: block; }

        .form-section {
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
        }

        .form-section-title {
            font-family: var(--font-sans);
            font-size: 1rem;
            font-weight: 600;
            color: var(--accent-purple);
            margin-bottom: 1.25rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid var(--bg-tertiary);
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1rem;
        }

        .form-group { margin-bottom: 1rem; }
        .form-group.full-width { grid-column: 1 / -1; }

        .form-label {
            display: block;
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 0.4rem;
        }

        /* 头像字段：左边一个圆形预览，右边是输入框和按钮。
           Emoji 和图片共用 profile.avatar 一个字段，填什么这里就预览什么。 */
        .avatar-field { display: flex; gap: 0.9rem; align-items: flex-start; }
        .avatar-preview {
            flex: 0 0 56px; width: 56px; height: 56px;
            display: flex; align-items: center; justify-content: center;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 50%;
            font-size: 1.6rem; line-height: 1;
            overflow: hidden;
        }
        .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
        .avatar-field-body { flex: 1; min-width: 0; }
        .avatar-field-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
        .field-note { font-size: 0.78rem; color: var(--text-tertiary); }

        /* 表单区块标题下面的一行小字说明，比 .form-hint 轻，不抢眼 */
        .section-hint {
            margin: -0.4rem 0 0.8rem;
            font-size: 0.8rem;
            line-height: 1.6;
            color: var(--text-tertiary);
        }

        /* 面板顶部的说明条，例如「现在显示的是示例内容」 */
        .form-hint {
            margin-bottom: 1rem;
            font-size: 0.82rem;
            line-height: 1.6;
            color: var(--text-secondary);
            background: rgba(66, 133, 244, 0.08);
            border-left: 3px solid var(--accent-blue);
            border-radius: var(--radius-sm);
            padding: 0.7rem 0.9rem;
        }

        .form-input, .form-textarea, .form-select {
            width: 100%;
            padding: 0.65rem 0.9rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-family: var(--font-sans);
            font-size: 0.95rem;
            transition: all 0.2s ease;
        }

        .form-input:focus, .form-textarea:focus, .form-select:focus {
            outline: none;
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
        }

        .form-textarea { min-height: 80px; resize: vertical; }

        .tag-input-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            padding: 0.5rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            min-height: 42px;
        }

        .tag-input-container:focus-within {
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
        }

        .tag {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.25rem 0.6rem;
            background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(161, 66, 244, 0.1));
            border-radius: var(--radius-lg);
            font-size: 0.85rem;
            color: var(--accent-blue);
        }

        .tag-remove { cursor: pointer; opacity: 0.6; }
        .tag-remove:hover { opacity: 1; }

        .tag-input {
            flex: 1;
            min-width: 100px;
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 0.95rem;
        }
        .tag-input:focus { outline: none; }

        .data-list { display: flex; flex-direction: column; gap: 1rem; }

        .data-item {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 1.25rem;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            transition: all 0.2s ease;
        }

        .data-item:hover {
            border-color: var(--accent-blue);
            box-shadow: var(--shadow-md);
        }

        .data-item-content { flex: 1; }
        .data-item-title {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.3rem;
        }

        .data-item-desc {
            color: var(--text-tertiary);
            font-size: 0.9rem;
        }

        .data-item-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }

        .meta-tag {
            padding: 0.15rem 0.5rem;
            background: var(--bg-tertiary);
            border-radius: var(--radius-lg);
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .meta-date { color: var(--accent-pink); font-size: 0.85rem; }
        .data-item-actions { display: flex; gap: 0.5rem; margin-left: 1rem; }

        .game-images-list {
            display: flex; flex-wrap: wrap; gap: 0.75rem;
        }
        .game-image-item {
            position: relative; width: 120px; height: 90px;
            border-radius: var(--radius-md); overflow: hidden;
            border: 1px solid var(--border-color);
            background: var(--bg-secondary);
        }
        .game-image-item img {
            width: 100%; height: 100%; object-fit: cover;
        }
        .game-image-item .remove-btn {
            position: absolute; top: 3px; right: 3px;
            width: 22px; height: 22px; border-radius: 50%;
            background: rgba(234,67,53,0.85); color: #fff;
            border: none; font-size: 14px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.2s;
        }
        .game-image-item:hover .remove-btn { opacity: 1; }
        .game-image-item .order-btn {
            position: absolute; bottom: 3px; width: 22px; height: 22px;
            border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff;
            border: none; font-size: 12px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.2s;
        }
        .game-image-item:hover .order-btn { opacity: 1; }
        .game-image-item .order-left { left: 3px; }
        .game-image-item .order-right { right: 3px; }

        .video-drag-item.dragging, .game-drag-item.dragging { opacity: 0.4; }
        .video-drag-item:hover, .game-drag-item:hover { border-color: var(--accent-blue) !important; box-shadow: var(--shadow-sm); }

        .modal-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 1000;
            justify-content: center;
            align-items: flex-start;
            padding-top: 3rem;
            overflow-y: auto;
            backdrop-filter: blur(4px);
        }

        .modal-overlay.active { display: flex; }

        .modal {
            background: var(--bg-card);
            border-radius: var(--radius-xl);
            width: 90%;
            max-width: 650px;
            box-shadow: var(--shadow-lg);
        }

        .modal-header {
            padding: 1.5rem 2rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-title {
            font-family: var(--font-sans);
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .modal-close {
            width: 32px; height: 32px;
            border-radius: 50%;
            background: var(--bg-tertiary);
            border: none;
            font-size: 1.3rem;
            cursor: pointer;
            color: var(--text-secondary);
            transition: all 0.2s ease;
        }

        .modal-close:hover { background: var(--text-primary); color: white; }

        .modal-body { padding: 1.5rem 2rem; max-height: 60vh; overflow-y: auto; }
        .modal-footer { padding: 1rem 2rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 0.75rem; }

        .toast {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            padding: 0.9rem 1.5rem;
            background: var(--text-primary);
            color: white;
            border-radius: var(--radius-lg);
            font-weight: 500;
            z-index: 2000;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.3s ease;
        }

        .toast.show { opacity: 1; transform: translateY(0); }

        .empty-state {
            text-align: center;
            padding: 3rem;
            color: var(--text-tertiary);
        }

        .empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

        .timeline-list { display: flex; flex-direction: column; gap: 1rem; }

        .timeline-item-form {
            background: var(--bg-secondary);
            border-radius: var(--radius-md);
            padding: 1.25rem;
        }

        .timeline-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .timeline-item-number { color: var(--accent-blue); font-size: 0.9rem; font-weight: 600; }

        @media (max-width: 900px) {
            .sidebar { width: 200px; }
            .main-content { margin-left: 200px; padding: 1.5rem; }
        }

        body.unauthenticated .sidebar,
        body.unauthenticated .main-content {
            display: none;
        }

        /* ---------- 登录遮罩 ---------- */

        /* 默认就是「显示」，只在本地存着 token 时才藏起来（下面那条规则）。
           为什么不用 HTML 里的 style="display:none"：内联样式优先级最高，
           会把 showAuthScreen() / hideAuthScreen() 的切换也一起锁死。 */
        .auth-screen {
            position: fixed;
            inset: 0;
            background: var(--bg-secondary);
            z-index: 3000;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* 本地存着 token：先别弹登录框，等 admin.js 拿它去服务器校验。
           已登录的人每次刷新都闪一下密码框，就是这段判断存在的理由
           （<head> 里的内联脚本负责加这个类，必须在首次绘制之前跑完）。
           token 其实过期了的话，showAuthScreen() 会用内联样式把它重新顶出来。 */
        html.has-token .auth-screen { display: none; }

        .auth-card {
            background: var(--bg-card);
            padding: 3rem;
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg);
            text-align: center;
            max-width: 400px;
            width: 90%;
        }

        .auth-emoji { font-size: 3rem; margin-bottom: 1.5rem; }
        .auth-title { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-primary); }
        .auth-hint { color: var(--text-tertiary); margin-bottom: 2rem; font-size: 0.9rem; }
        .auth-input { margin-bottom: 1rem; text-align: center; }
        .auth-submit { width: 100%; }
        .auth-error { color: #ea4335; margin-top: 1rem; font-size: 0.9rem; display: none; }
    