/* Theme layer — wuxia (default) / cyber / ink / aurora */

:root {
    --bg: #0c0908;
    --bg-deep: #080605;
    --surface: rgba(20, 14, 12, 0.74);
    --surface-strong: #1a1210;
    --text: #f5f0e8;
    --muted: #c4b09a;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #c75450;
    --accent-soft: rgba(199, 84, 80, 0.16);
    --accent-dark: #8b3230;
    --success: #72d6a3;
    --warning: #d4a85c;
    --danger: #ff7d7d;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    --radius: 24px;
    --radius-sm: 16px;
    --content-width: 1320px;
    --font-ui: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-display: "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
    --theme-body-bg:
        radial-gradient(circle at 14% 4%, rgba(199, 84, 80, 0.14), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(212, 168, 92, 0.12), transparent 24%),
        radial-gradient(circle at 50% 110%, rgba(80, 40, 30, 0.18), transparent 28%),
        linear-gradient(180deg, #0c0908 0%, #140e0b 48%, #080504 100%);
    --theme-body-after:
        radial-gradient(circle at 50% 0%, rgba(199, 84, 80, 0.08), transparent 28%),
        radial-gradient(circle at 100% 0%, rgba(212, 168, 92, 0.1), transparent 25%),
        radial-gradient(circle at 0% 100%, rgba(80, 40, 30, 0.12), transparent 28%);
    --theme-panel-bg:
        linear-gradient(180deg, rgba(24, 16, 14, 0.86), rgba(14, 10, 8, 0.8)),
        radial-gradient(circle at top right, rgba(199, 84, 80, 0.08), transparent 32%);
    --theme-topbar-bg:
        linear-gradient(180deg, rgba(18, 12, 10, 0.92), rgba(10, 7, 6, 0.84)),
        radial-gradient(circle at top right, rgba(212, 168, 92, 0.1), transparent 28%);
    --theme-topbar-border: rgba(255, 255, 255, 0.1);
    --theme-topbar-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 24px 60px rgba(0, 0, 0, 0.5);
    --theme-nav-hover-bg: rgba(199, 84, 80, 0.1);
    --theme-button-primary-bg: linear-gradient(145deg, #d46a60, #8b3230);
    --theme-button-primary-fg: #fff5f0;
    --theme-button-primary-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 18px 32px rgba(140, 50, 48, 0.28);
    --theme-button-ghost-bg: rgba(255, 255, 255, 0.07);
    --theme-danger-bg: rgba(255, 125, 125, 0.12);
    --theme-danger-fg: #ffd0d0;
    --theme-danger-border: rgba(255, 125, 125, 0.22);
    --theme-profile-action-bg:
        radial-gradient(circle at top right, rgba(212, 168, 92, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(20, 14, 12, 0.98), rgba(10, 8, 6, 0.96));
    --theme-profile-feature-bg:
        radial-gradient(circle at top right, rgba(199, 84, 80, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(26, 14, 14, 0.99), rgba(12, 8, 8, 0.97));
    --theme-profile-battle-bg:
        radial-gradient(circle at top right, rgba(212, 168, 92, 0.2), transparent 30%),
        linear-gradient(180deg, rgba(24, 18, 10, 0.99), rgba(12, 10, 6, 0.97));
    --theme-profile-utility-bg:
        radial-gradient(circle at top right, rgba(199, 84, 80, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(22, 14, 12, 0.98), rgba(10, 8, 6, 0.96));
    --theme-profile-admin-bg:
        radial-gradient(circle at top right, rgba(212, 168, 92, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(22, 16, 12, 0.98), rgba(10, 8, 6, 0.96));
    --theme-home-card-bg:
        linear-gradient(180deg, rgba(20, 14, 12, 0.96), rgba(10, 8, 6, 0.98)),
        radial-gradient(circle at top, rgba(255, 240, 220, 0.06), transparent 52%);
    --theme-shelfwall-card-bg:
        linear-gradient(180deg, rgba(22, 16, 12, 0.94), rgba(10, 8, 6, 0.98)),
        radial-gradient(circle at top right, rgba(199, 84, 80, 0.1), transparent 38%);
    --theme-action-blue: linear-gradient(145deg, #d46a60, #8b3230);
    --theme-action-indigo: linear-gradient(145deg, #c77a4a, #7a4428);
    --theme-action-emerald: linear-gradient(145deg, #72d6a3, #3a7a56);
    --theme-action-violet: linear-gradient(145deg, #d4a85c, #8a6a2e);
    --theme-action-gold: linear-gradient(145deg, #d4a85c, #8a6a2e);
    --theme-action-rose: linear-gradient(145deg, #d46a60, #8b3230);
    --theme-action-slate: linear-gradient(145deg, #8a7668, #504038);
}

body.theme-midnight.theme-variant-cyber {
    --accent: #00e5c8;
    --accent-soft: rgba(0, 229, 200, 0.16);
    --accent-dark: #009e8a;
    --success: #00e5c8;
    --warning: #b06aff;
    --danger: #ff6b8a;
    --theme-body-bg:
        radial-gradient(circle at 14% 4%, rgba(0, 229, 200, 0.14), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(176, 106, 255, 0.12), transparent 24%),
        radial-gradient(circle at 50% 110%, rgba(0, 100, 180, 0.16), transparent 28%),
        linear-gradient(180deg, #050508 0%, #0a0a14 48%, #030306 100%);
    --theme-body-after:
        radial-gradient(circle at 50% 0%, rgba(0, 229, 200, 0.08), transparent 28%),
        radial-gradient(circle at 100% 0%, rgba(176, 106, 255, 0.1), transparent 25%),
        radial-gradient(circle at 0% 100%, rgba(0, 100, 180, 0.1), transparent 28%);
    --theme-panel-bg:
        linear-gradient(180deg, rgba(10, 12, 22, 0.88), rgba(6, 6, 14, 0.82)),
        radial-gradient(circle at top right, rgba(0, 229, 200, 0.06), transparent 32%);
    --theme-topbar-bg:
        linear-gradient(180deg, rgba(8, 10, 20, 0.92), rgba(5, 5, 12, 0.86)),
        radial-gradient(circle at top right, rgba(0, 229, 200, 0.1), transparent 28%);
    --theme-nav-hover-bg: rgba(0, 229, 200, 0.08);
    --theme-button-primary-bg: linear-gradient(145deg, #20f0d0, #009e8a);
    --theme-button-primary-fg: #041a16;
    --theme-button-primary-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 18px 32px rgba(0, 158, 138, 0.28);
    --theme-profile-action-bg:
        radial-gradient(circle at top right, rgba(0, 229, 200, 0.1), transparent 32%),
        linear-gradient(180deg, rgba(8, 10, 20, 0.98), rgba(5, 5, 12, 0.96));
    --theme-profile-feature-bg:
        radial-gradient(circle at top right, rgba(176, 106, 255, 0.2), transparent 28%),
        linear-gradient(180deg, rgba(14, 10, 26, 0.99), rgba(6, 5, 14, 0.97));
    --theme-profile-battle-bg:
        radial-gradient(circle at top right, rgba(0, 229, 200, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(6, 16, 18, 0.99), rgba(4, 8, 10, 0.97));
    --theme-profile-utility-bg:
        radial-gradient(circle at top right, rgba(176, 106, 255, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(10, 8, 20, 0.98), rgba(5, 5, 12, 0.96));
    --theme-profile-admin-bg:
        radial-gradient(circle at top right, rgba(255, 107, 138, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(14, 8, 14, 0.98), rgba(6, 4, 8, 0.96));
    --theme-home-card-bg:
        linear-gradient(180deg, rgba(10, 12, 22, 0.96), rgba(5, 5, 12, 0.98)),
        radial-gradient(circle at top, rgba(0, 229, 200, 0.06), transparent 52%);
    --theme-shelfwall-card-bg:
        linear-gradient(180deg, rgba(10, 12, 22, 0.94), rgba(5, 5, 12, 0.98)),
        radial-gradient(circle at top right, rgba(176, 106, 255, 0.08), transparent 38%);
    --theme-action-blue: linear-gradient(145deg, #20f0d0, #009e8a);
    --theme-action-indigo: linear-gradient(145deg, #b06aff, #6838b0);
    --theme-action-emerald: linear-gradient(145deg, #00e5c8, #008878);
    --theme-action-violet: linear-gradient(145deg, #b06aff, #6838b0);
    --theme-action-gold: linear-gradient(145deg, #20f0d0, #009e8a);
    --theme-action-rose: linear-gradient(145deg, #ff6b8a, #a8304a);
    --theme-action-slate: linear-gradient(145deg, #6a7a90, #38465a);
}

body.theme-midnight.theme-variant-ink {
    --accent: #d8c9a3;
    --accent-soft: rgba(216, 201, 163, 0.14);
    --accent-dark: #a0947d;
    --success: #a8c8a0;
    --warning: #d8c9a3;
    --danger: #d4877a;
    --theme-body-bg:
        radial-gradient(circle at 14% 4%, rgba(216, 201, 163, 0.1), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(160, 148, 125, 0.08), transparent 24%),
        radial-gradient(circle at 50% 110%, rgba(80, 72, 58, 0.12), transparent 28%),
        linear-gradient(180deg, #08090a 0%, #0e0f10 48%, #050606 100%);
    --theme-body-after:
        radial-gradient(circle at 50% 0%, rgba(216, 201, 163, 0.06), transparent 28%),
        radial-gradient(circle at 100% 0%, rgba(160, 148, 125, 0.06), transparent 25%),
        radial-gradient(circle at 0% 100%, rgba(80, 72, 58, 0.08), transparent 28%);
    --theme-panel-bg:
        linear-gradient(180deg, rgba(18, 18, 16, 0.88), rgba(10, 10, 9, 0.82)),
        radial-gradient(circle at top right, rgba(216, 201, 163, 0.06), transparent 32%);
    --theme-topbar-bg:
        linear-gradient(180deg, rgba(14, 14, 12, 0.92), rgba(8, 8, 7, 0.86)),
        radial-gradient(circle at top right, rgba(216, 201, 163, 0.08), transparent 28%);
    --theme-nav-hover-bg: rgba(216, 201, 163, 0.08);
    --theme-button-primary-bg: linear-gradient(145deg, #e0d4b4, #a0947d);
    --theme-button-primary-fg: #1a1810;
    --theme-button-primary-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 18px 32px rgba(80, 72, 58, 0.24);
    --theme-profile-action-bg:
        radial-gradient(circle at top right, rgba(216, 201, 163, 0.1), transparent 32%),
        linear-gradient(180deg, rgba(16, 16, 14, 0.98), rgba(8, 8, 7, 0.96));
    --theme-profile-feature-bg:
        radial-gradient(circle at top right, rgba(160, 148, 125, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(18, 16, 14, 0.99), rgba(10, 9, 8, 0.97));
    --theme-profile-battle-bg:
        radial-gradient(circle at top right, rgba(216, 201, 163, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(18, 17, 14, 0.99), rgba(10, 9, 7, 0.97));
    --theme-profile-utility-bg:
        radial-gradient(circle at top right, rgba(160, 148, 125, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(16, 15, 13, 0.98), rgba(8, 8, 7, 0.96));
    --theme-profile-admin-bg:
        radial-gradient(circle at top right, rgba(212, 135, 122, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(16, 14, 14, 0.98), rgba(8, 7, 7, 0.96));
    --theme-home-card-bg:
        linear-gradient(180deg, rgba(16, 16, 14, 0.96), rgba(8, 8, 7, 0.98)),
        radial-gradient(circle at top, rgba(216, 201, 163, 0.05), transparent 52%);
    --theme-shelfwall-card-bg:
        linear-gradient(180deg, rgba(18, 17, 15, 0.94), rgba(8, 8, 7, 0.98)),
        radial-gradient(circle at top right, rgba(216, 201, 163, 0.06), transparent 38%);
    --theme-action-blue: linear-gradient(145deg, #d8c9a3, #a0947d);
    --theme-action-indigo: linear-gradient(145deg, #b0a48a, #7a7062);
    --theme-action-emerald: linear-gradient(145deg, #a8c8a0, #5e7a56);
    --theme-action-violet: linear-gradient(145deg, #c4b090, #8a7a64);
    --theme-action-gold: linear-gradient(145deg, #d8c9a3, #a0947d);
    --theme-action-rose: linear-gradient(145deg, #d4877a, #8a524a);
    --theme-action-slate: linear-gradient(145deg, #8a8478, #585248);
}

body.theme-midnight.theme-variant-aurora {
    --accent: #b388ff;
    --accent-soft: rgba(179, 136, 255, 0.16);
    --accent-dark: #7c4dff;
    --success: #64ffda;
    --warning: #ffd54f;
    --danger: #ff8a80;
    --theme-body-bg:
        radial-gradient(circle at 14% 4%, rgba(179, 136, 255, 0.14), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(100, 181, 246, 0.12), transparent 24%),
        radial-gradient(circle at 50% 110%, rgba(100, 255, 218, 0.1), transparent 28%),
        linear-gradient(180deg, #06050e 0%, #0c0a18 48%, #040308 100%);
    --theme-body-after:
        radial-gradient(circle at 50% 0%, rgba(179, 136, 255, 0.08), transparent 28%),
        radial-gradient(circle at 100% 0%, rgba(100, 181, 246, 0.08), transparent 25%),
        radial-gradient(circle at 0% 100%, rgba(100, 255, 218, 0.06), transparent 28%);
    --theme-panel-bg:
        linear-gradient(180deg, rgba(14, 12, 24, 0.88), rgba(8, 6, 16, 0.82)),
        radial-gradient(circle at top right, rgba(179, 136, 255, 0.08), transparent 32%);
    --theme-topbar-bg:
        linear-gradient(180deg, rgba(10, 8, 20, 0.92), rgba(6, 5, 14, 0.86)),
        radial-gradient(circle at top right, rgba(179, 136, 255, 0.1), transparent 28%);
    --theme-nav-hover-bg: rgba(179, 136, 255, 0.08);
    --theme-button-primary-bg: linear-gradient(145deg, #c9a0ff, #7c4dff);
    --theme-button-primary-fg: #0e0820;
    --theme-button-primary-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 18px 32px rgba(124, 77, 255, 0.28);
    --theme-profile-action-bg:
        radial-gradient(circle at top right, rgba(179, 136, 255, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(12, 10, 22, 0.98), rgba(6, 5, 14, 0.96));
    --theme-profile-feature-bg:
        radial-gradient(circle at top right, rgba(100, 181, 246, 0.2), transparent 28%),
        linear-gradient(180deg, rgba(10, 14, 28, 0.99), rgba(5, 7, 16, 0.97));
    --theme-profile-battle-bg:
        radial-gradient(circle at top right, rgba(100, 255, 218, 0.16), transparent 30%),
        linear-gradient(180deg, rgba(8, 16, 18, 0.99), rgba(4, 8, 10, 0.97));
    --theme-profile-utility-bg:
        radial-gradient(circle at top right, rgba(100, 181, 246, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(10, 12, 24, 0.98), rgba(5, 6, 14, 0.96));
    --theme-profile-admin-bg:
        radial-gradient(circle at top right, rgba(255, 138, 128, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(16, 10, 16, 0.98), rgba(8, 5, 10, 0.96));
    --theme-home-card-bg:
        linear-gradient(180deg, rgba(12, 10, 22, 0.96), rgba(6, 5, 14, 0.98)),
        radial-gradient(circle at top, rgba(179, 136, 255, 0.06), transparent 52%);
    --theme-shelfwall-card-bg:
        linear-gradient(180deg, rgba(14, 12, 24, 0.94), rgba(6, 5, 14, 0.98)),
        radial-gradient(circle at top right, rgba(100, 181, 246, 0.08), transparent 38%);
    --theme-action-blue: linear-gradient(145deg, #64b5f6, #2e6eaa);
    --theme-action-indigo: linear-gradient(145deg, #b388ff, #7c4dff);
    --theme-action-emerald: linear-gradient(145deg, #64ffda, #2e9a7e);
    --theme-action-violet: linear-gradient(145deg, #b388ff, #7c4dff);
    --theme-action-gold: linear-gradient(145deg, #ffd54f, #b8962e);
    --theme-action-rose: linear-gradient(145deg, #ff8a80, #c44040);
    --theme-action-slate: linear-gradient(145deg, #8090a8, #404e60);
}

@keyframes theme-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.theme-midnight {
    position: relative;
    isolation: isolate;
    color-scheme: dark;
    color: var(--text);
    font-family: var(--font-ui);
    background: var(--theme-body-bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.theme-midnight::before,
body.theme-midnight::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body.theme-midnight::before {
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 128px 128px;
    opacity: 0.18;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.94), transparent 88%);
}

body.theme-midnight::after {
    background: var(--theme-body-after);
    opacity: 0.72;
}

body.theme-midnight a {
    color: inherit;
}

body.theme-midnight ::selection {
    background: rgba(216, 176, 106, 0.28);
    color: #fff;
}

body.theme-midnight::-webkit-scrollbar,
body.theme-midnight *::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body.theme-midnight::-webkit-scrollbar-thumb,
body.theme-midnight *::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    background-clip: content-box;
}

body.theme-midnight::-webkit-scrollbar-track,
body.theme-midnight *::-webkit-scrollbar-track {
    background: transparent;
}

body.theme-midnight .page-frame {
    width: min(calc(100% - 24px), 1320px);
    padding: 16px 0 40px;
}

body.theme-midnight.route-home .page-frame {
    width: min(calc(100% - 20px), 1380px);
}

body.theme-midnight.route-dashboard .page-frame {
    width: min(calc(100% - 24px), 1280px);
}

body.theme-midnight.route-growth .page-frame {
    width: min(calc(100% - 20px), 1080px);
}

body.theme-midnight.admin-mode .page-frame {
    width: min(calc(100% - 24px), 1360px);
}

body.theme-midnight .main-shell {
    display: grid;
    gap: 20px;
}

body.theme-midnight .content-section {
    display: grid;
    gap: 16px;
    animation: theme-rise 0.45s ease both;
}

body.theme-midnight .content-section + .content-section {
    margin-top: 2px;
}

body.theme-midnight p {
    line-height: 1.7;
}

body.theme-midnight :is(h1, h2, h3, .brand-copy strong, .section-heading h1, .section-heading h2, .section-heading h3, .home-shelf-title h2, .profile-summary-title-row h1, .growth-level-name h1, .battle-sheet-header h2) {
    font-family: var(--font-display);
    letter-spacing: 0.01em;
}

body.theme-midnight :is(.topbar, .card, .paper-card, .list-card, .stat-card, .feature-card, .auth-panel, .home-notice-card, .home-video-stage, .home-shelf-bar, .profile-summary-card, .profile-action-section, .dashboard-sheet, .admin-nav-card, .admin-toolbar, .admin-panel, .admin-kpi-card, .growth-level-card, .growth-checkin-card, .growth-badges-card--full, .growth-tasks-card, .growth-log-card, .growth-task-item, .growth-badge-item, .battle-member-sheet, .battle-tactics-sheet, .battle-signup-notice, .battle-signup-control, .battle-signup-command, .battle-tactics-entry, .battle-summary-card, .battle-summary-pill, .battle-signup-day-card, .battle-signup-school-card, .battle-board-overview, .battle-config-row, .battle-group-section, .battle-sticky-bar, .battle-signup-member-row, .battle-assignment-card, .battle-active-config-card, .battle-candidate-panel, .battle-structure-panel, .battle-squad-table-wrap, .table-wrap, .member-inline, .empty-state) {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--theme-panel-bg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 42px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px) saturate(120%);
}

body.theme-midnight .topbar {
    position: sticky;
    top: 14px;
    z-index: 50;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--theme-topbar-border);
    border-radius: 28px;
    background: var(--theme-topbar-bg);
    box-shadow: var(--theme-topbar-shadow);
}

body.theme-midnight .brandmark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

body.theme-midnight .brand-badge,
body.theme-midnight .brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    flex-shrink: 0;
}

body.theme-midnight .brand-badge {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #e2c07f, #8d6730);
    color: #20170a;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.12em;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 12px 24px rgba(0, 0, 0, 0.28);
}

body.theme-midnight .brand-logo {
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-midnight .brand-copy {
    min-width: 0;
    gap: 3px;
}

body.theme-midnight .brand-copy strong {
    font-size: 1rem;
    line-height: 1.1;
}

body.theme-midnight .site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

body.theme-midnight .nav-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease;
}

body.theme-midnight .nav-link:hover,
body.theme-midnight .nav-link.is-active {
    color: var(--text);
    border-color: rgba(216, 176, 106, 0.18);
    background: var(--theme-nav-hover-bg);
    transform: translateY(-1px);
}

body.theme-midnight .topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.theme-midnight .topbar-growth-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(18, 25, 37, 0.84), rgba(11, 16, 24, 0.7)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 42%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: rgba(233, 236, 242, 0.92);
}

body.theme-midnight .topbar-growth-btn:hover {
    border-color: var(--accent-soft);
    background: rgba(255, 255, 255, 0.06);
}

body.theme-midnight .topbar-growth-copy small {
    color: rgba(233, 236, 242, 0.6);
}

body.theme-midnight .user-status-pill {
    min-width: 240px;
    padding: 10px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(18, 25, 37, 0.84), rgba(11, 16, 24, 0.7)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 42%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 12px 26px rgba(0, 0, 0, 0.22);
}

body.theme-midnight .user-status-pill .avatar-sm {
    width: 36px;
    height: 36px;
}

body.theme-midnight .user-status-level {
    background: rgba(216, 176, 106, 0.12);
    border-color: rgba(216, 176, 106, 0.28);
    color: #f3d7a0;
}

body.theme-midnight .user-status-bar {
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
}

body.theme-midnight .user-status-bar-fill {
    background: linear-gradient(90deg, #99703a, #d8b06a 55%, #f0d79a);
    box-shadow: 0 0 16px rgba(216, 176, 106, 0.22);
}

body.theme-midnight .user-status-flag {
    background: rgba(114, 214, 163, 0.12);
    color: #8fe0b9;
}

body.theme-midnight .button,
body.theme-midnight .icon-action-button,
body.theme-midnight .modal-close,
body.theme-midnight .portrait-close,
body.theme-midnight .book-nav-button,
body.theme-midnight .home-video-dot,
body.theme-midnight .mobile-tab,
body.theme-midnight .chip,
body.theme-midnight .battle-action-btn,
body.theme-midnight .battle-tactics-entry-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease;
}

body.theme-midnight .button,
body.theme-midnight .icon-action-button,
body.theme-midnight .modal-close,
body.theme-midnight .portrait-close,
body.theme-midnight .book-nav-button {
    min-height: 42px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.theme-midnight .button:hover,
body.theme-midnight .icon-action-button:hover,
body.theme-midnight .modal-close:hover,
body.theme-midnight .portrait-close:hover,
body.theme-midnight .book-nav-button:hover,
body.theme-midnight .home-video-dot:hover,
body.theme-midnight .chip:hover,
body.theme-midnight .battle-action-btn:hover,
body.theme-midnight .battle-tactics-entry-btn:hover {
    transform: translateY(-1px);
}

body.theme-midnight .button.primary {
    background: var(--theme-button-primary-bg);
    color: var(--theme-button-primary-fg);
    border-color: rgba(255, 231, 182, 0.12);
    box-shadow: var(--theme-button-primary-shadow);
}

body.theme-midnight .button.ghost,
body.theme-midnight .icon-action-button,
body.theme-midnight .modal-close,
body.theme-midnight .portrait-close,
body.theme-midnight .book-nav-button {
    background: var(--theme-button-ghost-bg);
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-midnight .button.danger {
    background: var(--theme-danger-bg);
    color: var(--theme-danger-fg);
    border-color: var(--theme-danger-border);
}

body.theme-midnight .button:disabled,
body.theme-midnight .battle-action-btn:disabled,
body.theme-midnight .battle-tactics-entry-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

body.theme-midnight input:not([type="checkbox"]):not([type="radio"]),
body.theme-midnight textarea,
body.theme-midnight select,
body.theme-midnight .growth-submit-input,
body.theme-midnight .home-shelf-search-inline input {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(7, 11, 17, 0.72);
    color: var(--text);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

body.theme-midnight textarea {
    min-height: 110px;
    resize: vertical;
}

body.theme-midnight select option {
    background: #0e1420 !important;
    color: #f0ece4 !important;
}

body.theme-midnight input::placeholder,
body.theme-midnight textarea::placeholder {
    color: rgba(154, 167, 184, 0.72);
}

body.theme-midnight input:focus,
body.theme-midnight textarea:focus,
body.theme-midnight select:focus,
body.theme-midnight .growth-submit-input:focus,
body.theme-midnight .home-shelf-search-inline input:focus {
    border-color: rgba(216, 176, 106, 0.34);
    box-shadow:
        0 0 0 3px rgba(216, 176, 106, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-midnight label {
    display: grid;
    gap: 8px;
}

body.theme-midnight label > span {
    color: #cdd7e4;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

body.theme-midnight .checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

body.theme-midnight .checkbox-field input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: var(--accent);
}

body.theme-midnight .form-grid,
body.theme-midnight .stats-grid,
body.theme-midnight .card-grid,
body.theme-midnight .profile-card-grid,
body.theme-midnight .growth-badge-grid,
body.theme-midnight .growth-task-groups,
body.theme-midnight .growth-task-list,
body.theme-midnight .growth-log-list,
body.theme-midnight .battle-summary-grid,
body.theme-midnight .battle-signup-groups,
body.theme-midnight .battle-signup-member-list,
body.theme-midnight .battle-config-list,
body.theme-midnight .battle-admin-groups,
body.theme-midnight .battle-group-structure-list,
body.theme-midnight .battle-signup-action-grid,
body.theme-midnight .admin-kpi-strip {
    display: grid;
    gap: 14px;
}

body.theme-midnight .form-grid,
body.theme-midnight .stats-grid,
body.theme-midnight .card-grid,
body.theme-midnight .profile-card-grid,
body.theme-midnight .admin-kpi-strip,
body.theme-midnight .battle-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body.theme-midnight .card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.theme-midnight .full-span {
    grid-column: 1 / -1;
}

body.theme-midnight .stack-gap {
    display: grid;
    gap: 14px;
}

body.theme-midnight .inline-form {
    display: inline-flex;
}

body.theme-midnight .section-heading {
    display: grid;
    gap: 6px;
}

body.theme-midnight .section-heading h1,
body.theme-midnight .section-heading h2,
body.theme-midnight .section-heading h3 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.18rem, 1.04rem + 0.8vw, 1.7rem);
}

body.theme-midnight .section-heading p {
    margin: 0;
    color: rgba(227, 234, 242, 0.84);
    line-height: 1.72;
}

body.theme-midnight .section-heading.compact h1,
body.theme-midnight .section-heading.compact h2,
body.theme-midnight .section-heading.compact h3 {
    font-size: clamp(1.02rem, 0.96rem + 0.36vw, 1.22rem);
}

body.theme-midnight .badge,
body.theme-midnight .growth-badge-rarity,
body.theme-midnight .growth-task-type,
body.theme-midnight .growth-task-group-count,
body.theme-midnight .growth-badges-count,
body.theme-midnight .growth-level-badge,
body.theme-midnight .battle-summary-card span,
body.theme-midnight .battle-summary-pill span,
body.theme-midnight .battle-action-icon,
body.theme-midnight .battle-sheet-eyebrow,
body.theme-midnight .chip,
body.theme-midnight .admin-kpi-card span,
body.theme-midnight .profile-summary-stat small,
body.theme-midnight .member-inline .badge,
body.theme-midnight .home-book-card-pages,
body.theme-midnight .home-notice-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #e8eef7;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

body.theme-midnight .soft-blue {
    border-color: rgba(126, 166, 255, 0.18);
    background: rgba(126, 166, 255, 0.12);
    color: #c4d7ff;
}

body.theme-midnight .soft-success {
    border-color: rgba(114, 214, 163, 0.18);
    background: rgba(114, 214, 163, 0.12);
    color: #b5f0d2;
}

body.theme-midnight .soft-rose {
    border-color: rgba(255, 125, 125, 0.18);
    background: rgba(255, 125, 125, 0.12);
    color: #ffd0d0;
}

body.theme-midnight .soft-gold {
    border-color: rgba(216, 176, 106, 0.18);
    background: rgba(216, 176, 106, 0.12);
    color: #f3d7a0;
}

body.theme-midnight .flash {
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(14, 20, 30, 0.84);
    color: var(--text);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

body.theme-midnight .flash.success {
    border-color: rgba(114, 214, 163, 0.18);
    background: rgba(114, 214, 163, 0.12);
}

body.theme-midnight .flash.warning {
    border-color: rgba(225, 180, 93, 0.18);
    background: rgba(225, 180, 93, 0.12);
}

body.theme-midnight .flash.error,
body.theme-midnight .flash.danger {
    border-color: rgba(255, 125, 125, 0.2);
    background: rgba(255, 125, 125, 0.12);
}

body.theme-midnight .table-wrap {
    padding: 0;
}

body.theme-midnight table {
    width: 100%;
    border-collapse: collapse;
}

body.theme-midnight thead th {
    padding: 14px 16px;
    color: #dbe4ef;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
}

body.theme-midnight tbody td {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
}

body.theme-midnight .empty-state {
    padding: 18px;
    color: rgba(223, 231, 240, 0.82);
}

body.theme-midnight .footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 18px 20px;
    margin-top: 4px;
    color: var(--muted);
}

body.theme-midnight .mobile-tabbar {
    display: none;
}

body.theme-midnight .mobile-tabbar .mobile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.86rem;
    font-weight: 600;
    background: transparent;
    color: var(--muted);
}

body.theme-midnight .mobile-tabbar .mobile-tab.is-active {
    color: var(--text);
    background: rgba(216, 176, 106, 0.12);
    border-color: rgba(216, 176, 106, 0.2);
}

body.theme-midnight .home-notice-section {
    display: none;
}

body.theme-midnight .home-stage-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
    gap: 18px;
    align-items: stretch;
}

body.theme-midnight .home-stage-grid--solo {
    grid-template-columns: 1fr;
}

body.theme-midnight .home-notice-card {
    padding: 0;
    border-radius: 30px;
    border-color: rgba(216, 176, 106, 0.16);
    background:
        linear-gradient(135deg, rgba(18, 25, 37, 0.96), rgba(9, 13, 20, 0.92)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.12), transparent 40%);
}

body.theme-midnight .home-notice-card--rail {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: visible;
}

body.theme-midnight .home-notice-card::before,
body.theme-midnight .home-notice-card::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(216, 176, 106, 0.26), transparent);
    pointer-events: none;
}

body.theme-midnight .home-notice-card::before {
    top: 10px;
}

body.theme-midnight .home-notice-card::after {
    bottom: 10px;
}

body.theme-midnight .home-notice-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 92px;
}

body.theme-midnight .home-notice-card--rail .home-notice-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
}

body.theme-midnight .home-notice-marker {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(22, 30, 43, 0.98), rgba(16, 22, 32, 0.96)),
        radial-gradient(circle at top left, rgba(216, 176, 106, 0.1), transparent 40%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-midnight .home-notice-card--rail .home-notice-marker {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 16px 14px;
}

body.theme-midnight .home-notice-seal {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(145deg, #e2c07f, #8d6730);
    color: #21170a;
    font-family: var(--font-display);
    font-size: 1.18rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 14px 24px rgba(0, 0, 0, 0.28);
}

body.theme-midnight .home-notice-marker-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

body.theme-midnight .home-notice-marker-copy strong {
    color: var(--text);
    display: block;
    font-size: 1.02rem;
    line-height: 1.14;
}

body.theme-midnight .home-notice-marker-copy small {
    display: block;
    color: rgba(217, 227, 239, 0.72);
    line-height: 1.25;
}

body.theme-midnight .home-notice-feed {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
}

body.theme-midnight .home-notice-card--rail .home-notice-feed {
    align-content: start;
    overflow: auto;
    padding: 12px 14px 14px;
}

body.theme-midnight .home-notice-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-midnight .home-notice-card--rail .home-notice-item {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 12px 12px 11px;
}

body.theme-midnight .home-notice-card--rail .home-notice-time {
    justify-self: start;
}

body.theme-midnight .home-bonus-ranking {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 16px;
}

body.theme-midnight .home-bonus-ranking-head small {
    color: var(--muted);
}

body.theme-midnight .home-bonus-ranking-row:nth-child(-n+3) {
    background: rgba(216, 176, 106, 0.06);
}

body.theme-midnight .home-bonus-rank {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

body.theme-midnight .home-bonus-ranking-row:nth-child(1) .home-bonus-rank { background: rgba(228, 200, 74, 0.22); color: #f0d856; }
body.theme-midnight .home-bonus-ranking-row:nth-child(2) .home-bonus-rank { background: rgba(180, 180, 190, 0.18); color: #c0c0c8; }
body.theme-midnight .home-bonus-ranking-row:nth-child(3) .home-bonus-rank { background: rgba(200, 140, 80, 0.18); color: #d4a060; }

body.theme-midnight .home-notice-title {
    min-height: 28px;
    background: rgba(216, 176, 106, 0.12);
    color: #f0d79a;
    border-color: rgba(216, 176, 106, 0.18);
}

body.theme-midnight .home-notice-body {
    color: rgba(245, 241, 234, 0.84);
    font-size: 0.9rem;
    line-height: 1.6;
}

body.theme-midnight .home-video-stage {
    display: grid;
    gap: 16px;
    padding: 20px;
    border-radius: 30px;
    min-height: 100%;
}

body.theme-midnight .home-video-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(216, 176, 106, 0.12), transparent 26%),
        linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 68%);
    pointer-events: none;
}

body.theme-midnight .home-video-slides,
body.theme-midnight .home-video-slide {
    display: grid;
    gap: 12px;
}

body.theme-midnight .home-video-slide[hidden] {
    display: none;
}

body.theme-midnight .home-video-frame {
    min-height: 360px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(5, 8, 13, 0.96), rgba(10, 14, 21, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.1), transparent 36%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

body.theme-midnight .home-video-frame video {
    width: 100%;
    min-height: 360px;
    object-fit: cover;
    border-radius: 0;
}

body.theme-midnight .home-video-fallback {
    min-height: 360px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 10px;
    padding: 32px;
    color: #f5f1ea;
}

body.theme-midnight .home-video-title-badge {
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(8, 12, 18, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

body.theme-midnight .home-video-pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

body.theme-midnight .home-video-dots {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-midnight .home-video-dot {
    width: 38px;
    height: 38px;
    padding: 0;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

body.theme-midnight .home-video-dot.is-active {
    background: rgba(216, 176, 106, 0.16);
    color: var(--text);
    border-color: rgba(216, 176, 106, 0.28);
}

body.theme-midnight .home-shelf-bar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 28px;
}

body.theme-midnight .home-shelf-title {
    display: grid;
    gap: 3px;
}

body.theme-midnight .home-shelf-title h2 {
    margin: 0;
    font-size: clamp(1.2rem, 1rem + 1vw, 2rem);
}

body.theme-midnight .home-shelf-title span {
    color: var(--muted);
    letter-spacing: 0.22em;
    font-size: 0.72rem;
}

body.theme-midnight .home-shelf-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

body.theme-midnight .home-shelf-search-cluster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

body.theme-midnight .home-shelf-reroll {
    flex-shrink: 0;
    align-self: center;
    white-space: nowrap;
}

body.theme-midnight .home-shelf-search-inline {
    display: inline-flex;
    align-items: center;
    flex: 0 1 340px;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-midnight .home-shelf-search-inline input {
    width: 100%;
    min-width: 220px;
    min-height: 38px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 8px 6px;
}

body.theme-midnight .home-shelf-search-inline button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-midnight .home-shelf-reroll.is-busy {
    opacity: 0.72;
    pointer-events: none;
}

body.theme-midnight .book-corridor {
    overflow: hidden;
}

body.theme-midnight .book-corridor-track {
    display: flex;
    gap: 14px;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 4px;
}

body.theme-midnight .corridor-book {
    flex: 0 0 140px;
    display: grid;
    gap: 10px;
    text-align: left;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--text);
}

body.theme-midnight .corridor-book-shell {
    position: relative;
    display: grid;
    align-content: end;
    gap: 8px;
    min-height: 180px;
    padding: 16px 12px;
    border-radius: 22px 22px 16px 16px;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 16px 24px rgba(0, 0, 0, 0.24);
    transform: translateY(0);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body.theme-midnight .corridor-book:hover .corridor-book-shell {
    transform: translateY(-4px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 22px 36px rgba(0, 0, 0, 0.3);
}

body.theme-midnight .palette-umber {
    background:
        linear-gradient(180deg, #7e4c2b, #2d1c16),
        radial-gradient(circle at top right, rgba(255, 200, 132, 0.16), transparent 28%);
}

body.theme-midnight .palette-slate {
    background:
        linear-gradient(180deg, #273547, #141b27),
        radial-gradient(circle at top right, rgba(126, 166, 255, 0.14), transparent 28%);
}

body.theme-midnight .palette-graphite {
    background:
        linear-gradient(180deg, #2d3137, #13161c),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 28%);
}

body.theme-midnight .corridor-book-spine,
body.theme-midnight .corridor-book-edge {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

body.theme-midnight .corridor-book-spine {
    left: 10px;
    right: 10px;
    top: 12px;
    bottom: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-midnight .corridor-book-label {
    display: block;
    color: #f7edd9;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin: 0 auto;
}

body.theme-midnight .corridor-book-stamp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #f4ead8;
    font-size: 0.7rem;
}

body.theme-midnight .corridor-book-meta {
    display: grid;
    gap: 4px;
    padding: 0 6px;
}

body.theme-midnight .corridor-book-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
}

body.theme-midnight .corridor-book-note {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

























body.theme-midnight .home-books-masonry {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 74px;
    grid-auto-flow: dense;
    gap: 16px;
    align-items: stretch;
}

body.theme-midnight .home-books-masonry .home-book-card {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry {
    grid-column: span 4;
    grid-row: span 4;
    grid-template-rows: minmax(172px, 1.15fr) auto;
    border-radius: 28px;
    overflow: hidden;
    background: var(--theme-shelfwall-card-bg);
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"] {
    grid-column: span 6;
    grid-row: span 8;
    grid-template-rows: minmax(308px, 1.28fr) auto;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="2"] {
    grid-column: span 6;
    grid-row: span 4;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="3"] {
    grid-column: span 3;
    grid-row: span 4;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="4"] {
    grid-column: span 3;
    grid-row: span 4;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="5"] {
    grid-column: span 4;
    grid-row: span 4;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] {
    grid-column: span 8;
    grid-row: span 4;
    grid-template-rows: minmax(220px, 1.02fr) auto;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-media {
    aspect-ratio: 6 / 7;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"] .home-book-card-media {
    aspect-ratio: auto;
    min-height: 308px;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] .home-book-card-media {
    aspect-ratio: auto;
    min-height: 220px;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-body {
    gap: 10px;
    padding: 15px 15px 17px;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"] .home-book-card-body,
body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] .home-book-card-body {
    align-content: start;
    padding: 16px 16px 18px;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-title {
    font-size: 0.94rem;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"] .home-book-card-title {
    font-size: 1.2rem;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] .home-book-card-title {
    font-size: 1.06rem;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-pages {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 0.72rem;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-tags {
    gap: 6px;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-tags .badge {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 0.72rem;
}

body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: 0.84rem;
    line-height: 1.55;
}

body.theme-midnight .home-books-masonry .home-book-card--text-only {
    grid-row: span 3;
    grid-template-rows: auto;
}

body.theme-midnight .home-books-masonry .home-book-card--text-only .home-book-card-body {
    gap: 12px;
    padding: 18px 18px 20px;
}

body.theme-midnight .home-books-masonry .home-book-card--text-only .home-book-card-excerpt {
    -webkit-line-clamp: 5;
}

body.theme-midnight .home-books-masonry .home-book-card--text-only[data-book-batch-slot="1"] {
    grid-row: span 5;
}

@media (max-width: 980px) {

    body.theme-midnight .home-books-masonry {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-auto-rows: 72px;
    }

    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"] {
        grid-column: 1 / -1;
        grid-row: span 6;
        grid-template-rows: minmax(240px, 1.08fr) auto;
    }

    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="2"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="3"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="4"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="5"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] {
        grid-column: span 3;
        grid-row: span 4;
        grid-template-columns: none;
        grid-template-rows: minmax(168px, 1fr) auto;
    }

    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"] .home-book-card-media,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="2"] .home-book-card-media,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="3"] .home-book-card-media,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="4"] .home-book-card-media,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="5"] .home-book-card-media,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] .home-book-card-media {
        aspect-ratio: 6 / 7;
        height: auto;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    body.theme-midnight .home-books-masonry .home-book-card--text-only[data-book-batch-slot="1"] {
        grid-row: span 4;
    }
}

@media (max-width: 720px) {
    body.theme-midnight .dashboard-sheet-header {
        padding: 14px 54px 14px 14px;
        gap: 6px;
        border-radius: 18px;
    }

    body.theme-midnight .dashboard-sheet-header p {
        max-width: none;
    }

    body.theme-midnight .home-books-masonry {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    body.theme-midnight .home-books-masonry .home-book-card--masonry,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="2"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="3"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="4"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="5"],
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] {
        grid-column: auto;
        grid-row: auto;
        grid-template-columns: none;
        grid-template-rows: minmax(180px, 1fr) auto;
    }

    body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-media {
        aspect-ratio: 7 / 8;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-body,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="1"] .home-book-card-body,
    body.theme-midnight .home-books-masonry .home-book-card--masonry[data-book-batch-slot="6"] .home-book-card-body {
        padding: 14px 14px 16px;
        align-content: start;
    }

    body.theme-midnight .home-books-masonry .home-book-card--masonry .home-book-card-excerpt {
        -webkit-line-clamp: 2;
    }
}

body.theme-midnight .home-book-card {
    display: grid;
    gap: 0;
    padding: 0;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--theme-home-card-bg);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    text-align: left;
}

body.theme-midnight .home-book-card[hidden] {
    display: none !important;
}

body.theme-midnight .home-book-card:hover {
    transform: translateY(-4px);
    border-color: rgba(216, 176, 106, 0.24);
    box-shadow:
        0 26px 44px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(216, 176, 106, 0.12);
}

body.theme-midnight .home-book-card-media {
    position: relative;
    display: grid;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(216, 176, 106, 0.08), rgba(8, 11, 17, 0.94)),
        radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 44%);
}

body.theme-midnight .home-book-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.24s ease;
}

body.theme-midnight .home-book-card:hover .home-book-card-media img {
    transform: scale(1.03);
}

body.theme-midnight .home-book-card-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.86rem;
}

body.theme-midnight .home-book-card-body {
    display: grid;
    gap: 10px;
    padding: 14px 14px 16px;
}

body.theme-midnight .home-book-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
}

body.theme-midnight .home-book-card-title {
    display: -webkit-box;
    font-family: var(--font-display);
    font-size: 1rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-height: 1.35;
    word-break: break-word;
}

body.theme-midnight .home-book-card-pages {
    background: rgba(216, 176, 106, 0.12);
    color: #f3d7a0;
    flex-shrink: 0;
}

body.theme-midnight .home-book-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-midnight .home-book-card-excerpt {
    display: -webkit-box;
    line-height: 1.6;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    word-break: break-word;
}

body.theme-midnight .portrait-overlay {
    align-items: center;
    padding: 18px;
}

body.theme-midnight .portrait-panel {
    width: min(430px, calc(100vw - 24px));
    padding: 18px;
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(246, 238, 225, 0.98), rgba(232, 220, 202, 0.98)),
        radial-gradient(circle at top, rgba(216, 176, 106, 0.24), transparent 46%);
    border: 1px solid rgba(156, 114, 67, 0.34);
    box-shadow:
        0 36px 90px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body.theme-midnight .portrait-panel::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 26px;
    border: 1px solid rgba(163, 121, 76, 0.22);
    pointer-events: none;
}

body.theme-midnight .portrait-frame {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
    padding: 24px 20px 20px;
    border-radius: 26px;
    border: 3px solid rgba(171, 128, 74, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(241, 230, 213, 0.96)),
        radial-gradient(circle at top, rgba(217, 184, 123, 0.18), transparent 42%);
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 16px 34px rgba(75, 50, 31, 0.14);
}

body.theme-midnight .portrait-avatar-ring {
    width: 132px;
    height: 132px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 230, 210, 0.98));
    border: 4px solid rgba(190, 148, 92, 0.92);
    box-shadow:
        0 16px 30px rgba(93, 62, 31, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.theme-midnight .portrait-avatar-ring .avatar-lg {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

body.theme-midnight .portrait-copy {
    display: grid;
    gap: 12px;
    justify-items: center;
    color: #3a271c;
}

body.theme-midnight .portrait-copy h3 {
    margin: 0;
    font-size: clamp(1.8rem, 1.48rem + 1vw, 2.35rem);
    color: #40271a;
}

body.theme-midnight .portrait-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

body.theme-midnight .portrait-tags .badge {
    border: 1px solid rgba(160, 113, 63, 0.14);
    background: rgba(159, 119, 67, 0.1);
    color: #6c4b31;
}

body.theme-midnight .portrait-quote {
    width: 100%;
    min-height: 104px;
    padding: 15px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 251, 245, 0.7);
    border: 1px solid rgba(156, 114, 67, 0.18);
    color: #5a4334;
    line-height: 1.85;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.theme-midnight .portrait-open-book {
    width: 100%;
    min-height: 52px;
    align-self: stretch;
    border-radius: 16px;
    background: linear-gradient(140deg, #a7412d, #74271c);
    color: #fff8ef;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 14px 28px rgba(107, 39, 26, 0.26);
}

body.theme-midnight .portrait-open-book:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

body.theme-midnight .opened-book-panel {
    width: min(1120px, calc(100vw - 30px));
    padding: 22px;
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(11, 16, 25, 0.98), rgba(7, 10, 17, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.12), transparent 34%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.46);
}

body.theme-midnight .opened-book-reader {
    gap: 18px;
    color: #342419;
}

body.theme-midnight .opened-book-header {
    padding: 0 90px 0 0;
}

body.theme-midnight .opened-book-header-copy {
    max-width: none;
    gap: 10px;
    padding: 20px 22px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(248, 242, 233, 0.98), rgba(236, 226, 209, 0.97)),
        radial-gradient(circle at top left, rgba(216, 176, 106, 0.16), transparent 48%);
    border: 1px solid rgba(150, 108, 66, 0.18);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
}

body.theme-midnight .opened-book-header-copy .badge {
    border: 1px solid rgba(165, 76, 54, 0.18);
    background: rgba(165, 76, 54, 0.1);
    color: #8a452f;
}

body.theme-midnight .opened-book-header-copy h3 {
    color: #302118;
    font-size: clamp(1.38rem, 1.08rem + 0.6vw, 1.7rem);
}

body.theme-midnight .opened-book-header-copy p {
    color: #745b49;
}

body.theme-midnight .opened-book-toolbar {
    top: 0;
    right: 0;
    gap: 10px;
}

body.theme-midnight .book-tool-button {
    border: 1px solid rgba(155, 113, 69, 0.16);
    background: rgba(248, 242, 233, 0.96);
    color: #764e34;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

body.theme-midnight .book-tool-button:hover {
    border-color: rgba(165, 76, 54, 0.22);
    background: rgba(252, 247, 239, 0.98);
}

body.theme-midnight .opened-book-spread {
    position: relative;
    grid-template-columns: minmax(300px, 0.96fr) minmax(340px, 1.04fr);
    min-height: 620px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(132, 94, 58, 0.18);
    background: linear-gradient(180deg, rgba(247, 241, 231, 0.99), rgba(234, 224, 207, 0.99));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.46),
        0 18px 40px rgba(0, 0, 0, 0.18);
}

body.theme-midnight .opened-book-spread::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 34px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(111, 80, 50, 0.02), rgba(111, 80, 50, 0.1), rgba(255, 255, 255, 0.3), rgba(111, 80, 50, 0.1), rgba(111, 80, 50, 0.02));
    pointer-events: none;
}

body.theme-midnight .opened-book-page {
    gap: 18px;
    padding: 32px 28px 24px;
}

body.theme-midnight .opened-book-page + .opened-book-page {
    border-left: 1px solid rgba(132, 94, 58, 0.12);
}

body.theme-midnight .opened-book-photo-frame {
    padding: 12px;
    border: 1px solid rgba(132, 94, 58, 0.14);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(245, 238, 226, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.theme-midnight .opened-book-photo-frame img {
    border-radius: 12px;
    aspect-ratio: 4 / 5;
}

body.theme-midnight .opened-book-page-no {
    color: #886c55;
    font-weight: 600;
}

body.theme-midnight .opened-book-title {
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(132, 94, 58, 0.15);
}

body.theme-midnight .opened-book-title h3 {
    padding-left: 14px;
    border-left: 5px solid #a24331;
    color: #302118;
    font-size: clamp(1.42rem, 1.1rem + 0.84vw, 2rem);
}

body.theme-midnight .opened-book-title span {
    color: #7c6553;
    font-weight: 600;
}

body.theme-midnight .opened-book-text {
    min-height: 320px;
    color: #3f2d22;
    font-size: 1.08rem;
    line-height: 1.95;
}

body.theme-midnight .opened-book-text p {
    margin: 0;
}

body.theme-midnight .opened-book-text p + p {
    margin-top: 1em;
}

body.theme-midnight .opened-book-pagination {
    padding: 0 4px;
    border-top: 0;
    color: #c9b08b;
}

body.theme-midnight .opened-book-pagination strong {
    color: #f0dcc0;
    letter-spacing: 0.04em;
}

body.theme-midnight .book-nav-button {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(34, 42, 58, 0.94), rgba(18, 24, 36, 0.94));
    color: #f3dfb2;
    box-shadow: none;
}

body.theme-midnight .book-nav-button:not(:disabled):hover {
    border-color: rgba(216, 176, 106, 0.28);
}

body.theme-midnight .opened-book-dots {
    gap: 8px;
    padding: 0 0 6px;
    justify-content: center;
}

body.theme-midnight .opened-book-dot {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(239, 227, 210, 0.76);
}

body.theme-midnight .opened-book-dot.is-active {
    border-color: rgba(216, 176, 106, 0.26);
    background: rgba(216, 176, 106, 0.12);
    color: #f2d9a4;
}

body.theme-midnight .opened-book-reader .empty-state {
    background:
        linear-gradient(180deg, rgba(248, 242, 233, 0.98), rgba(236, 226, 209, 0.97)),
        radial-gradient(circle at top left, rgba(216, 176, 106, 0.16), transparent 48%);
    color: #302118;
}

body.theme-midnight .profile-center-shell {
    display: grid;
    gap: 20px;
}

body.theme-midnight .profile-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, auto);
    gap: 22px;
    align-items: stretch;
    padding: 18px 22px;
}

body.theme-midnight .profile-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}

body.theme-midnight .profile-summary-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-width: 0;
}

body.theme-midnight .profile-summary-main .avatar-md {
    width: 72px;
    height: 72px;
}

body.theme-midnight .profile-summary-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

body.theme-midnight .profile-summary-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

body.theme-midnight .profile-summary-title-row h1 {
    margin: 0;
    font-size: clamp(1.18rem, 0.98rem + 0.68vw, 1.5rem);
    line-height: 1;
    white-space: nowrap;
}

body.theme-midnight .profile-summary-edit {
    margin-left: 0;
    flex-shrink: 0;
}

body.theme-midnight .profile-summary-tags {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

body.theme-midnight .profile-summary-copy p {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.theme-midnight .profile-summary-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-self: center;
    min-width: min(100%, 468px);
}

body.theme-midnight .profile-summary-stat {
    display: grid;
    gap: 8px;
    align-content: center;
    min-height: 100px;
    padding: 14px 16px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(28, 35, 48, 0.72), rgba(13, 18, 27, 0.82)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 46%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-midnight .profile-summary-stat small {
    color: rgba(233, 236, 242, 0.74);
}

body.theme-midnight .profile-summary-stat strong {
    font-size: clamp(1.2rem, 1rem + 0.6vw, 1.75rem);
    line-height: 1.08;
}

body.theme-midnight .profile-summary-stat[data-modal-open] {
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

body.theme-midnight .profile-summary-stat[data-modal-open]:hover {
    border-color: var(--accent-soft);
    background: rgba(255, 255, 255, 0.06);
}

body.theme-midnight .profile-stat-action {
    background: var(--accent);
    color: #fff;
}

body.theme-midnight .profile-action-sections {
    display: grid;
    gap: 18px;
}

body.theme-midnight .profile-action-section {
    display: grid;
    gap: 18px;
    padding: 22px;
}

body.theme-midnight .profile-action-stage {
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.28fr);
    gap: 18px;
    align-items: stretch;
}

body.theme-midnight .profile-action-rail {
    display: grid;
    gap: 16px;
    align-content: start;
}

body.theme-midnight .profile-action-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body.theme-midnight .profile-action-section-head h2 {
    margin: 0;
    font-size: 1.16rem;
}

body.theme-midnight .profile-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.theme-midnight .profile-card-grid-primary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: dense;
    grid-auto-rows: minmax(112px, auto);
}

body.theme-midnight .profile-card-grid-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: minmax(112px, auto);
}

body.theme-midnight .profile-card-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.theme-midnight .profile-action-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    grid-template-areas: "icon copy arrow";
    align-items: center;
    align-content: center;
    gap: 14px;
    padding: 17px 18px;
    min-height: 112px;
    border-radius: 22px;
    text-align: left;
    cursor: pointer;
    isolation: isolate;
    min-width: 0;
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--theme-profile-action-bg);
    backdrop-filter: none;
}

body.theme-midnight .profile-action-card::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26%),
        linear-gradient(180deg, rgba(8, 11, 18, 0.12), rgba(8, 11, 18, 0));
    pointer-events: none;
    z-index: 0;
}

body.theme-midnight .profile-action-card > * {
    position: relative;
    z-index: 1;
}

body.theme-midnight .profile-action-card:hover {
    transform: translateY(-3px);
    border-color: rgba(216, 176, 106, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 24px 38px rgba(0, 0, 0, 0.28);
}

body.theme-midnight .profile-action-card:hover .profile-action-arrow {
    transform: translate3d(4px, -1px, 0);
}

body.theme-midnight .profile-action-icon {
    grid-area: icon;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    color: #fff;
    border: 1px solid rgba(255, 240, 212, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -10px 16px rgba(0, 0, 0, 0.18),
        0 10px 18px rgba(0, 0, 0, 0.18);
    justify-self: start;
    align-self: center;
}

body.theme-midnight .profile-action-icon::before {
    content: "";
    width: 24px;
    height: 24px;
    display: block;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

body.theme-midnight .profile-action-icon::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 231, 194, 0.14);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 36%),
        radial-gradient(circle at 22% 18%, rgba(255, 229, 181, 0.1), transparent 42%);
    pointer-events: none;
}

body.theme-midnight .action-blue {
    background: var(--theme-action-blue);
}

body.theme-midnight .action-indigo {
    background: var(--theme-action-indigo);
}

body.theme-midnight .action-emerald {
    background: var(--theme-action-emerald);
}

body.theme-midnight .action-violet {
    background: var(--theme-action-violet);
}

body.theme-midnight .action-gold {
    background: var(--theme-action-gold);
    color: #20170a;
}

body.theme-midnight .action-rose {
    background: var(--theme-action-rose);
}

body.theme-midnight .action-slate {
    background: var(--theme-action-slate);
}

body.theme-midnight .profile-action-copy {
    grid-area: copy;
    display: grid;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    align-self: center;
    align-content: center;
}

body.theme-midnight .profile-action-copy strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    font-size: 1rem;
    line-height: 1.22;
    color: #fbf7ef;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    overflow-wrap: anywhere;
    letter-spacing: 0.01em;
}

body.theme-midnight .profile-action-copy small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-width: none;
    color: rgba(222, 231, 241, 0.84);
    line-height: 1.42;
    overflow-wrap: anywhere;
}

body.theme-midnight .profile-action-arrow {
    grid-area: arrow;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    justify-self: end;
    align-self: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #f0d79a;
    font-size: 0.98rem;
    transition: transform 0.18s ease;
}

body.theme-midnight .profile-action-card-wide {
    grid-column: 1 / -1;
}

body.theme-midnight .profile-action-card-feature {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
    padding: 22px 24px;
    background: var(--theme-profile-feature-bg);
    border-color: rgba(144, 83, 215, 0.2);
    gap: 18px;
}

body.theme-midnight .profile-action-rail .profile-action-card-feature {
    grid-column: auto;
    grid-row: auto;
    min-height: 182px;
}

body.theme-midnight button[data-modal-open="dashboard-battle-signup"].profile-action-card-feature {
    background: var(--theme-profile-battle-bg);
    border-color: rgba(217, 101, 119, 0.22);
}

body.theme-midnight .profile-action-card-feature .profile-action-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    font-size: 0;
}

body.theme-midnight .profile-action-card-feature .profile-action-icon::before {
    width: 28px;
    height: 28px;
}

body.theme-midnight .profile-action-card-feature .profile-action-icon::after {
    inset: 5px;
    border-radius: 10px;
}

body.theme-midnight .profile-action-card[data-modal-open="dashboard-battle-signup"] .profile-action-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'1.85'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M6%2020V4.5'%2F%3E%3Cpath%20d%3D'M7.8%205.5h9l-2.2%203%202.2%203h-9z'%2F%3E%3Cpath%20d%3D'M10.2%2013.7h6.4'%2F%3E%3Cpath%20d%3D'M12.1%2016.8h4.5'%2F%3E%3C%2Fsvg%3E");
}

body.theme-midnight .profile-action-card[data-modal-open="dashboard-team-center"] .profile-action-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'1.85'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'8.2'%20cy%3D'9.4'%20r%3D'2.5'%2F%3E%3Ccircle%20cx%3D'15.8'%20cy%3D'9.4'%20r%3D'2.5'%2F%3E%3Cpath%20d%3D'M5.8%2017.8c.8-2%202-3.1%203.7-3.1%201.1%200%201.9.4%202.5%201.2.6-.8%201.5-1.2%202.5-1.2%201.7%200%202.9%201.1%203.7%203.1'%2F%3E%3Cpath%20d%3D'm10.5%2012.8%201.5%201.7%201.5-1.7'%2F%3E%3C%2Fsvg%3E");
}

body.theme-midnight .profile-action-card[data-modal-open="dashboard-shop"] .profile-action-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'1.85'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'12'%20cy%3D'9.5'%20r%3D'4.7'%2F%3E%3Cpath%20d%3D'M10.1%207.6h3.8v3.8h-3.8z'%2F%3E%3Cpath%20d%3D'M8.2%2016.4h7.6'%2F%3E%3Cpath%20d%3D'M9.4%2019h5.2'%2F%3E%3C%2Fsvg%3E");
}

body.theme-midnight .profile-action-card[data-modal-open="dashboard-winners"] .profile-action-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'1.85'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M7%205.8h10a1.8%201.8%200%200%201%201.8%201.8v6.7A3.7%203.7%200%200%201%2015.1%2018H8.9A3.7%203.7%200%200%201%205.2%2014.3V7.6A1.8%201.8%200%200%201%207%205.8Z'%2F%3E%3Cpath%20d%3D'M9.2%209.2h5.6'%2F%3E%3Cpath%20d%3D'M9.2%2012h5.6'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'16.1'%20r%3D'1.4'%2F%3E%3C%2Fsvg%3E");
}

body.theme-midnight .profile-action-card[href*="page=growth"] .profile-action-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'1.85'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M7%2019V7'%2F%3E%3Cpath%20d%3D'M12%2019V5'%2F%3E%3Cpath%20d%3D'M17%2019V9'%2F%3E%3Cpath%20d%3D'M6%2010h2'%2F%3E%3Cpath%20d%3D'M11%208h2'%2F%3E%3Cpath%20d%3D'M16%2012h2'%2F%3E%3Cpath%20d%3D'm13.3%206.4%203-2.2'%2F%3E%3C%2Fsvg%3E");
}

body.theme-midnight .profile-action-card[data-modal-open="dashboard-book"] .profile-action-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'1.85'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M6.5%206.5c1.4-.9%202.9-.9%204.4%200l1.1.6%201.1-.6c1.5-.9%203-.9%204.4%200V18c-1.4-.9-2.9-.9-4.4%200l-1.1.6-1.1-.6c-1.5-.9-3-.9-4.4%200Z'%2F%3E%3Cpath%20d%3D'M12%207.1v12'%2F%3E%3Cpath%20d%3D'M8.8%2010.3h1.4'%2F%3E%3Cpath%20d%3D'M13.8%2010.3h1.4'%2F%3E%3C%2Fsvg%3E");
}

body.theme-midnight .profile-action-card-admin .profile-action-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'1.85'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M9%206.2V4.5h6v1.7'%2F%3E%3Cpath%20d%3D'M7.2%206.2h9.6v9.8H7.2z'%2F%3E%3Cpath%20d%3D'M10%209.4h4'%2F%3E%3Cpath%20d%3D'M10%2012.4h4'%2F%3E%3Cpath%20d%3D'M10%2015.4h2.3'%2F%3E%3C%2Fsvg%3E");
}

body.theme-midnight .profile-action-card-feature .profile-action-copy {
    gap: 7px;
    align-self: center;
}

body.theme-midnight .profile-action-card-feature .profile-action-copy strong {
    font-size: 1.14rem;
    -webkit-line-clamp: 1;
    line-height: 1.18;
}

body.theme-midnight .profile-action-card-feature .profile-action-copy small {
    max-width: 30ch;
    font-size: 0.9rem;
    line-height: 1.55;
    -webkit-line-clamp: 2;
}

body.theme-midnight .profile-action-card-quick {
    min-height: 112px;
}

body.theme-midnight .profile-action-card-utility {
    min-height: 110px;
}

body.theme-midnight .profile-action-card-admin {
    grid-column: 1 / -1;
    min-height: 118px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    grid-template-areas: "icon copy arrow";
    align-items: center;
    align-content: center;
    gap: 16px;
}

body.theme-midnight .profile-action-card-admin .profile-action-copy {
    align-self: center;
}

body.theme-midnight .profile-action-card-admin .profile-action-arrow {
    align-self: center;
}

body.theme-midnight .profile-action-card-utility {
    background: var(--theme-profile-utility-bg);
}

body.theme-midnight .profile-action-card-admin {
    background: var(--theme-profile-admin-bg);
}

body.theme-midnight .dashboard-sheet {
    padding: 20px;
}

body.theme-midnight .profile-select-field--primary {
    border-color: rgba(100, 160, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(14, 20, 34, 0.96), rgba(8, 12, 22, 0.94)),
        radial-gradient(circle at top right, rgba(100, 160, 255, 0.14), transparent 42%);
    box-shadow: inset 0 0 0 1px rgba(100, 160, 255, 0.06);
}

body.theme-midnight .profile-select-field--primary .profile-select-title,
body.theme-midnight .profile-select-field--primary > span:first-child {
    color: #b8d4ff;
}

body.theme-midnight .profile-select-field--primary .profile-select-note {
    display: block;
    color: rgba(184, 212, 255, 0.72);
}

body.theme-midnight .profile-select-field--primary select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

body.theme-midnight .profile-select-field--primary select:focus {
    border-color: rgba(100, 160, 255, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(100, 160, 255, 0.16);
}

body.theme-midnight .profile-select-field--battle {
    border-color: rgba(216, 176, 106, 0.18);
    background:
        linear-gradient(180deg, rgba(30, 21, 17, 0.96), rgba(14, 11, 10, 0.94)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.16), transparent 42%);
    box-shadow: inset 0 0 0 1px rgba(216, 176, 106, 0.06);
}

body.theme-midnight .profile-select-field--battle .profile-select-title,
body.theme-midnight .profile-select-field--battle > span:first-child {
    color: #f8e7c2;
}

body.theme-midnight .profile-select-field--battle .profile-select-note {
    display: block;
    color: rgba(241, 223, 186, 0.76);
}

body.theme-midnight .profile-select-field--battle select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

body.theme-midnight .profile-select-field--battle select:focus {
    border-color: rgba(216, 176, 106, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(216, 176, 106, 0.16);
}

body.theme-midnight .profile-select-field--battle option {
    color: #101620;
}

body.theme-midnight .profile-select-field--name {
    border-color: rgba(130, 150, 255, 0.22);
    background:
        linear-gradient(180deg, rgba(12, 14, 30, 0.97), rgba(8, 10, 22, 0.95)),
        radial-gradient(circle at top right, rgba(130, 150, 255, 0.16), transparent 42%);
    box-shadow: inset 0 0 0 1px rgba(130, 150, 255, 0.07);
}

body.theme-midnight .profile-select-field--name > span:first-child {
    color: #c4ccff;
}

body.theme-midnight .profile-select-field--name input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

body.theme-midnight .profile-select-field--name input:focus {
    border-color: rgba(130, 150, 255, 0.32);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(130, 150, 255, 0.18);
}

body.theme-midnight .profile-select-field--platform {
    border-color: rgba(140, 155, 185, 0.18);
    background:
        linear-gradient(180deg, rgba(14, 16, 24, 0.97), rgba(10, 12, 18, 0.95)),
        radial-gradient(circle at top right, rgba(140, 155, 185, 0.10), transparent 42%);
    box-shadow: inset 0 0 0 1px rgba(140, 155, 185, 0.06);
}

body.theme-midnight .profile-select-field--platform > span:first-child {
    color: #b8c2d8;
}

body.theme-midnight .profile-select-field--platform select,
body.theme-midnight .profile-select-field--platform input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

body.theme-midnight .profile-select-field--platform select:focus,
body.theme-midnight .profile-select-field--platform input:focus {
    border-color: rgba(140, 155, 185, 0.30);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(140, 155, 185, 0.15);
}

body.theme-midnight .profile-select-field--platform option {
    color: #101620;
}

body.theme-midnight .dashboard-sheet-header {
    position: relative;
    gap: 8px;
    padding: 16px 64px 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(13, 18, 28, 0.99), rgba(8, 12, 19, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 28px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

body.theme-midnight .dashboard-sheet-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 26%);
    pointer-events: none;
}

body.theme-midnight .dashboard-sheet-header > * {
    position: relative;
    z-index: 1;
}

body.theme-midnight .dashboard-sheet-header h2,
body.theme-midnight .dashboard-sheet-header h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-height: 1.28;
    color: #fbf7ef;
}

body.theme-midnight .dashboard-sheet-header p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-width: 52ch;
    color: rgba(229, 236, 245, 0.92);
    line-height: 1.62;
    overflow-wrap: anywhere;
}

body.theme-midnight .dashboard-winners-grid {
    grid-template-columns: minmax(0, 1fr);
}

body.theme-midnight .dashboard-winners-grid .winner-rank-card {
    width: 100%;
}

body.theme-midnight .winner-rank-actions {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

body.theme-midnight .winner-rank-more {
    min-width: 120px;
    justify-content: center;
}

body.theme-midnight .winner-rank-row[hidden],
body.theme-midnight [data-winner-rank-extra][hidden] {
    display: none !important;
}

body.theme-midnight .winner-rank-total {
    color: #f1d7a1;
}

body.theme-midnight .winner-rank-row.is-self {
    border-color: rgba(98, 216, 170, 0.24);
    background: rgba(79, 199, 139, 0.12);
}

body.theme-midnight .book-editor-surface {
    display: grid;
    gap: 16px;
}

body.theme-midnight .book-editor-modal .book-editor-pane-head,
body.theme-midnight .book-editor-modal .book-page-editor-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(12, 18, 28, 0.96), rgba(8, 12, 18, 0.94)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 32%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 16px 36px rgba(0, 0, 0, 0.22);
}

body.theme-midnight .book-editor-modal .book-editor-pane-head strong,
body.theme-midnight .book-editor-modal .book-page-editor-head strong {
    color: #fbf7ef;
}

body.theme-midnight .book-editor-modal .book-editor-pane-head small,
body.theme-midnight .book-editor-modal .book-page-editor-head .badge,
body.theme-midnight .book-editor-modal .book-editor-content-field > span,
body.theme-midnight .book-editor-modal .book-editor-meta-grid label > span {
    color: rgba(226, 234, 243, 0.86);
}

body.theme-midnight .book-editor-modal .book-editor-tab {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(226, 234, 243, 0.82);
}

body.theme-midnight .book-editor-modal .book-editor-tab.is-active {
    background: rgba(216, 176, 106, 0.18);
    border-color: rgba(216, 176, 106, 0.3);
    color: #f8edd4;
}

body.theme-midnight .book-editor-modal .book-editor-spread {
    background:
        linear-gradient(180deg, rgba(10, 14, 22, 0.98), rgba(7, 10, 16, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.06), transparent 34%);
}

body.theme-midnight .book-editor-modal .book-editor-side + .book-editor-side {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-midnight .book-editor-modal .book-editor-image-frame {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-midnight .book-editor-modal .book-editor-image-empty {
    background:
        radial-gradient(circle at top, rgba(216, 176, 106, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(20, 28, 40, 0.96), rgba(10, 14, 22, 0.98));
}

body.theme-midnight .book-editor-modal .book-editor-content-field textarea {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #edf3fa;
}

body.theme-midnight .book-editor-modal .book-editor-content-field textarea::placeholder {
    color: rgba(203, 213, 225, 0.56);
}

body.theme-midnight .book-editor-modal .book-page-editor-card.is-new {
    border-style: solid;
    border-color: rgba(216, 176, 106, 0.2);
}

body.theme-midnight .book-editor-modal .book-editor-surface {
    gap: 18px;
}

body.theme-midnight .book-editor-modal .book-editor-pane-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

body.theme-midnight .book-editor-modal .book-editor-pane-heading {
    display: grid;
    gap: 4px;
}

body.theme-midnight .book-editor-modal .book-editor-pane-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #f1d7a1;
}

body.theme-midnight .book-editor-modal .book-editor-pane-head strong {
    font-size: 1rem;
}

body.theme-midnight .book-editor-modal .book-editor-tabbar {
    justify-content: flex-end;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

body.theme-midnight .book-editor-modal .book-editor-tab {
    min-width: 40px;
    height: 40px;
    border-radius: 12px;
    border-color: transparent;
    background: transparent;
}

body.theme-midnight .book-editor-modal .book-editor-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-midnight .book-editor-modal .book-editor-tab.is-active {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 12px 24px rgba(0, 0, 0, 0.18);
}

body.theme-midnight .book-editor-modal .book-editor-form-stack {
    gap: 16px;
    padding-right: 2px;
}

body.theme-midnight .book-editor-modal .book-page-editor-card {
    padding: 18px;
    gap: 18px;
    border-radius: 28px;
    overflow: hidden;
}

body.theme-midnight .book-editor-modal .book-page-editor-head {
    padding: 0;
    align-items: center;
}

body.theme-midnight .book-editor-modal .book-page-editor-title {
    gap: 4px;
}

body.theme-midnight .book-editor-modal .book-page-editor-title strong {
    font-size: 1.2rem;
    line-height: 1.1;
}

body.theme-midnight .book-editor-modal .book-page-editor-title small {
    color: rgba(223, 231, 240, 0.7);
    font-size: 0.82rem;
    line-height: 1.45;
}

body.theme-midnight .book-editor-modal .book-page-editor-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(241, 215, 161, 0.9);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

body.theme-midnight .book-editor-modal .book-page-editor-badge.is-new {
    background: rgba(216, 176, 106, 0.16);
    border-color: rgba(216, 176, 106, 0.22);
    color: #f8edd4;
}

body.theme-midnight .book-editor-modal .book-editor-spread {
    grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
    min-height: 560px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(14, 20, 31, 0.98), rgba(8, 12, 18, 0.98)),
        radial-gradient(circle at top left, rgba(216, 176, 106, 0.06), transparent 34%);
}

body.theme-midnight .book-editor-modal .book-editor-media-side {
    align-content: start;
    background:
        linear-gradient(180deg, rgba(17, 24, 36, 0.96), rgba(10, 15, 24, 0.98)),
        radial-gradient(circle at top, rgba(216, 176, 106, 0.08), transparent 32%);
}

body.theme-midnight .book-editor-modal .book-editor-content-side {
    align-content: start;
    background: rgba(8, 12, 18, 0.72);
}

body.theme-midnight .book-editor-modal .book-editor-image-frame {
    padding: 12px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        rgba(4, 7, 13, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 20px 36px rgba(0, 0, 0, 0.18);
}

body.theme-midnight .book-editor-modal .book-page-thumb {
    border-radius: 16px;
}

body.theme-midnight .book-editor-modal .book-editor-image-empty {
    min-height: 420px;
    border-radius: 16px;
}

body.theme-midnight .book-editor-modal .book-editor-media-tools {
    display: grid;
    gap: 10px;
}

body.theme-midnight .book-editor-modal .book-editor-upload-field {
    display: grid;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

body.theme-midnight .book-editor-modal .book-editor-upload-field > span {
    color: rgba(223, 231, 240, 0.82);
}

body.theme-midnight .book-editor-modal .book-editor-remove-toggle {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

body.theme-midnight .book-editor-modal .book-editor-meta-grid {
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 12px;
}

body.theme-midnight .book-editor-modal .book-editor-content-field {
    gap: 8px;
}

body.theme-midnight .book-editor-modal .book-editor-content-field textarea {
    min-height: 420px;
    padding: 18px 20px;
    border-radius: 20px;
    line-height: 1.84;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.theme-midnight .book-editor-ai-panel {
    display: grid;
    gap: 10px;
    padding: 14px 16px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(14, 20, 31, 0.96), rgba(9, 13, 20, 0.94)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.1), transparent 34%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 14px 28px rgba(0, 0, 0, 0.14);
}

body.theme-midnight .book-editor-ai-field {
    display: grid;
    gap: 8px;
}

body.theme-midnight .book-editor-ai-field > span {
    color: rgba(226, 234, 243, 0.88);
    font-size: 0.86rem;
    font-weight: 600;
}

body.theme-midnight .book-editor-ai-field input {
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(17, 24, 36, 0.98), rgba(10, 15, 22, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 34%);
    color: #edf3fa;
}

body.theme-midnight .book-editor-ai-field input::placeholder {
    color: rgba(203, 213, 225, 0.56);
}

body.theme-midnight .book-editor-ai-field input:focus {
    border-color: rgba(216, 176, 106, 0.28);
    box-shadow:
        0 0 0 1px rgba(216, 176, 106, 0.12),
        0 0 0 5px rgba(216, 176, 106, 0.08);
}

body.theme-midnight .book-page-editor-actions .book-editor-ai-type-select,
body.theme-midnight .button-row .book-editor-ai-type-select {
    min-height: 48px;
    min-width: 132px;
    padding: 0 38px 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(17, 24, 36, 0.98), rgba(10, 15, 22, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 34%);
    color: #edf3fa;
    font-weight: 600;
    color-scheme: dark;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

body.theme-midnight .book-page-editor-actions .book-editor-ai-type-select:focus,
body.theme-midnight .button-row .book-editor-ai-type-select:focus {
    border-color: rgba(216, 176, 106, 0.28);
    box-shadow:
        0 0 0 1px rgba(216, 176, 106, 0.12),
        0 0 0 5px rgba(216, 176, 106, 0.08);
}

body.theme-midnight .book-page-editor-actions .book-editor-ai-type-select option,
body.theme-midnight .button-row .book-editor-ai-type-select option {
    background: #111722;
    color: #edf3fa;
}

body.theme-midnight .book-page-editor-actions {
    padding-top: 0;
    justify-content: flex-end;
}

body.theme-midnight .book-page-editor-actions .button[data-book-ai-generate],
body.theme-midnight .button-row .button[data-book-ai-generate] {
    min-width: 116px;
}

body.theme-midnight .book-editor-ai-status {
    min-height: 18px;
    color: rgba(203, 213, 225, 0.72);
    font-size: 0.82rem;
    line-height: 1.45;
}

body.theme-midnight .book-editor-ai-status[data-state="loading"] {
    color: rgba(241, 215, 161, 0.94);
}

body.theme-midnight .book-editor-ai-status[data-state="success"] {
    color: rgba(147, 225, 188, 0.96);
}

body.theme-midnight .book-editor-ai-status[data-state="error"] {
    color: rgba(255, 170, 170, 0.96);
}

body.theme-midnight .book-page-editor-card textarea[name="page_content"].is-ai-filled {
    border-color: rgba(216, 176, 106, 0.34);
    background:
        linear-gradient(180deg, rgba(27, 35, 52, 0.94), rgba(21, 28, 40, 0.92)),
        rgba(255, 255, 255, 0.04);
    box-shadow:
        0 0 0 1px rgba(216, 176, 106, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 6px rgba(216, 176, 106, 0.08);
}

body.theme-midnight .book-editor-modal .book-page-editor-actions {
    padding-top: 0;
}

body.theme-midnight .book-editor-modal .book-page-editor-actions .button {
    min-width: 132px;
}

body.theme-midnight .book-editor-modal .book-page-editor-footer {
    display: flex;
    justify-content: flex-end;
}

body.theme-midnight .book-editor-modal .book-page-editor-delete .button {
    min-width: 112px;
}

@media (max-width: 960px) {
    body.theme-midnight .book-editor-modal .book-editor-pane-head {
        grid-template-columns: 1fr;
        align-items: start;
    }

    body.theme-midnight .book-editor-modal .book-editor-tabbar {
        justify-content: flex-start;
    }

    body.theme-midnight .book-editor-modal .book-editor-spread {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    body.theme-midnight .book-editor-modal .book-editor-side + .book-editor-side {
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 720px) {
    body.theme-midnight .book-editor-modal .book-page-editor-card {
        padding: 14px;
    }

    body.theme-midnight .book-editor-modal .book-editor-tabbar {
        width: 100%;
        justify-content: flex-start;
    }

    body.theme-midnight .book-editor-modal .book-page-editor-head {
        align-items: flex-start;
    }

    body.theme-midnight .book-editor-modal .book-editor-image-empty {
        min-height: 260px;
    }

    body.theme-midnight .book-editor-modal .book-editor-content-field textarea {
        min-height: 280px;
    }

    body.theme-midnight .book-editor-ai-panel {
        padding: 12px 14px;
    }

    body.theme-midnight .book-page-editor-actions {
        width: 100%;
    }

    body.theme-midnight .book-page-editor-actions .button,
    body.theme-midnight .button-row .button {
        flex: 1 1 140px;
    }

    body.theme-midnight .book-page-editor-actions .book-editor-ai-type-select,
    body.theme-midnight .button-row .book-editor-ai-type-select {
        flex: 1 1 140px;
        min-width: 140px;
    }
}

body.theme-midnight .dashboard-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

body.theme-midnight [data-overlay-modal="dashboard-shop"] .dashboard-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

body.theme-midnight .member-kpi {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line);
}

body.theme-midnight [data-overlay-modal="dashboard-shop"] .member-kpi {
    min-height: 88px;
    padding: 16px 18px;
}

body.theme-midnight .dashboard-redeem-builder {
    width: 100%;
    padding: 18px 20px 20px;
    gap: 14px;
}

body.theme-midnight .dashboard-redeem-builder-head p {
    color: rgba(226, 234, 243, 0.86);
}

body.theme-midnight .dashboard-redeem-select-field {
    display: grid;
    gap: 8px;
    position: relative;
}

body.theme-midnight .dashboard-redeem-select-field > span {
    color: rgba(226, 234, 243, 0.86);
}

body.theme-midnight .dashboard-redeem-select-field select {
    min-height: 48px;
    padding: 0 44px 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(17, 24, 36, 0.98), rgba(10, 15, 22, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.1), transparent 36%);
    color: #f8f2e7;
    font-weight: 600;
    color-scheme: dark;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

body.theme-midnight .dashboard-redeem-select-field select:focus {
    border-color: rgba(216, 176, 106, 0.26);
    box-shadow:
        0 0 0 1px rgba(216, 176, 106, 0.12),
        0 0 0 5px rgba(216, 176, 106, 0.08);
}

body.theme-midnight .dashboard-redeem-select-field::after {
    content: "⌄";
    position: absolute;
    right: 16px;
    bottom: 11px;
    font-size: 1rem;
    line-height: 1;
    color: rgba(241, 215, 161, 0.9);
    pointer-events: none;
}

body.theme-midnight .dashboard-redeem-select-field select option {
    background: #0f1723;
    color: #f8f2e7;
}

body.theme-midnight .dashboard-redeem-select-field select:disabled {
    color: rgba(248, 242, 231, 0.56);
    -webkit-text-fill-color: rgba(248, 242, 231, 0.56);
}

body.theme-midnight .dashboard-redeem-preset {
    display: grid;
    gap: 10px;
    padding: 16px 16px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(14, 20, 30, 0.96), rgba(9, 13, 19, 0.94)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 34%);
}

body.theme-midnight .dashboard-redeem-preset-copy {
    display: grid;
    gap: 6px;
}

body.theme-midnight .dashboard-redeem-preset-copy strong {
    color: #fbf7ef;
    font-size: 1.04rem;
}

body.theme-midnight .dashboard-redeem-preset-copy p {
    margin: 0;
    color: rgba(223, 231, 240, 0.84);
    line-height: 1.6;
}

body.theme-midnight .dashboard-redeem-custom-fields {
    gap: 12px;
}

body.theme-midnight .dashboard-redeem-custom-fields[hidden] {
    display: none;
}

body.theme-midnight .dashboard-redeem-custom-fields label {
    display: grid;
    gap: 8px;
}

body.theme-midnight .dashboard-redeem-custom-fields label > span {
    color: rgba(226, 234, 243, 0.86);
}

body.theme-midnight .dashboard-redeem-submit {
    width: 100%;
    justify-content: center;
}

body.theme-midnight [data-overlay-modal="dashboard-shop"] .dashboard-history-card {
    width: 100%;
}

@media (max-width: 720px) {
    body.theme-midnight [data-overlay-modal="dashboard-shop"] .dashboard-stat-row,
    body.theme-midnight [data-overlay-modal="dashboard-shop"] .dashboard-redeem-builder .form-grid {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    body.theme-midnight .dashboard-winners-grid .winner-rank-card,
    body.theme-midnight .dashboard-redeem-builder,
    body.theme-midnight [data-overlay-modal="dashboard-shop"] .dashboard-history-card {
        max-width: none;
    }
}

body.theme-midnight .dashboard-subform {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-midnight .profile-edit-head {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

body.theme-midnight .file-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

body.theme-midnight .file-field input[type="file"] {
    width: 100%;
    min-height: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.theme-midnight .admin-shell {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    gap: 18px;
}

body.theme-midnight .admin-sidebar {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100svh - 120px);
    overflow: auto;
}

body.theme-midnight .admin-nav-card {
    padding: 18px;
}

body.theme-midnight .admin-nav-head {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-midnight .admin-menu {
    display: grid;
    gap: 10px;
}

body.theme-midnight .admin-menu-link {
    display: block;
    padding: 12px 14px;
    border-radius: 16px;
    color: #cbd6e2;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

body.theme-midnight .admin-menu-link:hover,
body.theme-midnight .admin-menu-link.is-active {
    color: var(--text);
    border-color: rgba(216, 176, 106, 0.2);
    background: rgba(216, 176, 106, 0.1);
}

body.theme-midnight .admin-main {
    display: grid;
    gap: 18px;
}

body.theme-midnight .admin-theme-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(12, 17, 26, 0.88), rgba(8, 11, 18, 0.82)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.1), transparent 30%);
}

body.theme-midnight .admin-theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

body.theme-midnight .admin-theme-card {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(17, 22, 33, 0.92), rgba(9, 12, 18, 0.9)),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 28%);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

body.theme-midnight .admin-theme-card:hover,
body.theme-midnight .admin-theme-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(216, 176, 106, 0.24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 32px rgba(0, 0, 0, 0.22);
}

body.theme-midnight .admin-theme-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

body.theme-midnight .admin-theme-swatch-row {
    display: flex;
    gap: 10px;
}

body.theme-midnight .admin-theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--theme-swatch);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 8px 16px rgba(0, 0, 0, 0.18);
}

body.theme-midnight .admin-theme-copy {
    display: grid;
    gap: 6px;
}

body.theme-midnight .admin-theme-copy strong {
    font-size: 1rem;
    color: #fbf7ef;
}

body.theme-midnight .admin-theme-copy small {
    color: rgba(224, 231, 239, 0.88);
    line-height: 1.6;
}

body.theme-midnight .admin-page {
    gap: 16px;
}

body.theme-midnight .admin-page-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

body.theme-midnight .admin-page-actions,
body.theme-midnight .admin-toolbar-actions,
body.theme-midnight .admin-toolbar-filters,
body.theme-midnight .button-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.theme-midnight .admin-kpi-strip {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

body.theme-midnight .admin-kpi-card {
    padding: 16px 18px;
    border-radius: 22px;
}

body.theme-midnight .admin-kpi-card strong {
    font-size: 1.4rem;
}

body.theme-midnight .admin-toolbar {
    padding: 18px 20px;
}

body.theme-midnight .admin-toolbar-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

body.theme-midnight .admin-panel {
    padding: 20px;
}

body.theme-midnight .admin-panel-head {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-midnight .battle-signup-member-row,
body.theme-midnight .battle-config-row,
body.theme-midnight .battle-summary-card,
body.theme-midnight .battle-summary-pill,
body.theme-midnight .battle-group-section,
body.theme-midnight .battle-signup-school-card,
body.theme-midnight .battle-board-overview,
body.theme-midnight .battle-sticky-bar,
body.theme-midnight .battle-signup-day-card {
    padding: 16px 18px;
    border-radius: 22px;
}

/* ── Dark theme: admin user compact cards ── */
body.theme-midnight .ucard {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.07);
}

body.theme-midnight .ucard:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

body.theme-midnight .ucard.is-blocked {
    background: rgba(200, 60, 60, 0.08);
    border-color: rgba(200, 60, 60, 0.2);
}

body.theme-midnight .ucard.is-blocked:hover {
    background: rgba(200, 60, 60, 0.13);
}

body.theme-midnight .ucard-id {
    background: rgba(255, 255, 255, 0.08);
    color: #9ab0c8;
}

body.theme-midnight .ucard-name {
    color: #dde6f2;
}

body.theme-midnight .ucard-dot {
    color: rgba(180, 196, 218, 0.25);
}

body.theme-midnight .ucard-team {
    color: rgba(180, 200, 225, 0.65);
}

body.theme-midnight .ucard-platform {
    color: rgba(180, 200, 225, 0.6);
}

body.theme-midnight .ucard-pts {
    color: #f0a060;
}

body.theme-midnight .ucard-tag-pill {
    background: rgba(255, 255, 255, 0.1);
    color: #b8c8dc;
}

body.theme-midnight .ucard-tag-pill.is-danger {
    background: rgba(200, 60, 60, 0.25);
    color: #f08080;
}

body.theme-midnight .ucard-school {
    background: rgba(100, 140, 200, 0.15);
    color: #7aa8d0;
}

body.theme-midnight .admin-user-icon-btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    border-radius: 6px;
    border: 0;
    box-shadow: none;
}

body.theme-midnight .admin-user-icon-btn.is-edit {
    background: rgba(255, 255, 255, 0.12);
    color: #d0dae8;
}

body.theme-midnight .admin-user-icon-btn.is-edit:hover {
    background: rgba(255, 255, 255, 0.20);
}

body.theme-midnight .admin-user-icon-btn.is-block {
    background: rgba(220, 100, 60, 0.6);
    color: #fff;
}

body.theme-midnight .admin-user-icon-btn.is-block:hover {
    background: rgba(220, 100, 60, 0.8);
}

body.theme-midnight .admin-user-icon-btn.is-restore {
    background: rgba(40, 160, 120, 0.5);
    color: #fff;
}

body.theme-midnight .admin-user-icon-btn.is-restore:hover {
    background: rgba(40, 160, 120, 0.7);
}

body.theme-midnight .admin-user-icon-btn.is-delete {
    background: rgba(200, 50, 50, 0.6);
    color: #fff;
}

body.theme-midnight .admin-user-icon-btn.is-delete:hover {
    background: rgba(200, 50, 50, 0.8);
}

body.theme-midnight .admin-user-modal .overlay-panel,
body.theme-midnight .admin-user-edit-sheet {
    width: min(980px, calc(100vw - 24px));
}

body.theme-midnight .admin-team-manage-card {
    padding: 0;
}

body.theme-midnight .admin-team-card-head,
body.theme-midnight .admin-team-card-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 20px 22px;
}

body.theme-midnight .admin-team-card-head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-midnight .admin-team-card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    align-items: center;
}

body.theme-midnight .admin-team-card-title {
    display: grid;
    gap: 6px;
}

body.theme-midnight .admin-team-card-title h3 {
    margin: 0;
    font-size: 1.25rem;
}

body.theme-midnight .admin-team-edit-form {
    padding: 0 22px 22px;
}

body.theme-midnight .admin-team-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.theme-midnight .member-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
}

body.theme-midnight .member-inline p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

body.theme-midnight .growth-shell {
    display: grid;
    gap: 18px;
}

body.theme-midnight .growth-level-card {
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(216, 176, 106, 0.08), transparent 46%),
        linear-gradient(180deg, rgba(17, 24, 38, 0.86), rgba(9, 13, 20, 0.86));
}

body.theme-midnight .growth-level-head {
    display: flex;
    gap: 18px;
    align-items: center;
}

body.theme-midnight .growth-level-info {
    display: grid;
    gap: 10px;
    flex: 1;
}

body.theme-midnight .growth-level-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-level-name h1 {
    margin: 0;
    font-size: clamp(1.28rem, 1rem + 1vw, 2rem);
}

body.theme-midnight .growth-level-badge {
    background: rgba(216, 176, 106, 0.12);
    color: #f3d7a0;
    border-color: rgba(216, 176, 106, 0.18);
}

body.theme-midnight .growth-exp-bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.theme-midnight .growth-exp-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

body.theme-midnight .growth-exp-fill {
    background: linear-gradient(90deg, #8e6230, #d8b06a 55%, #f0d79a);
}

body.theme-midnight .growth-level-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-checkin-card {
    padding: 20px;
}

body.theme-midnight .growth-checkin-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-streak-display {
    display: grid;
    gap: 4px;
}

body.theme-midnight .growth-streak-num {
    font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem);
    color: #f0d79a;
}

body.theme-midnight .growth-checkin-actions {
    display: flex;
    justify-content: flex-end;
}

body.theme-midnight .growth-badges-card--full {
    padding: 20px;
}

body.theme-midnight .growth-badges-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-badges-count {
    background: rgba(216, 176, 106, 0.12);
    color: #f3d7a0;
}

body.theme-midnight .growth-badge-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border-radius: 20px;
}

body.theme-midnight .growth-badge-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(216, 176, 106, 0.24);
}

body.theme-midnight .growth-badge-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

body.theme-midnight .growth-badge-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
}

body.theme-midnight .growth-badge-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-badge-desc {
    margin: 0;
}

body.theme-midnight .growth-badge-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-badge-boost-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-badge-boost {
    background: rgba(114, 214, 163, 0.12);
    color: #b5f0d2;
}

body.theme-midnight .growth-badge-boost.boost-exp {
    background: rgba(100, 160, 255, 0.14);
    color: #8ac4ff;
}

body.theme-midnight .growth-badge-boost.boost-pts {
    background: rgba(228, 200, 74, 0.14);
    color: #f0d856;
}

body.theme-midnight .growth-badge-boost.boost-checkin {
    background: rgba(180, 120, 255, 0.14);
    color: #cda0ff;
}

body.theme-midnight .growth-badge-boost.boost-legend {
    background: rgba(255, 100, 100, 0.1);
    color: #ff9090;
    border: 1px dashed rgba(255, 100, 100, 0.3);
    font-size: 0.72rem;
}

body.theme-midnight .growth-task-groups {
    gap: 16px;
}

body.theme-midnight .growth-task-group {
    gap: 12px;
}

body.theme-midnight .growth-task-group-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

body.theme-midnight .growth-task-item {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 20px;
}

body.theme-midnight .growth-task-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

body.theme-midnight .growth-task-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-task-type--daily {
    background: rgba(114, 214, 163, 0.12);
    color: #b5f0d2;
}

body.theme-midnight .growth-task-type--single {
    background: rgba(216, 176, 106, 0.12);
    color: #f3d7a0;
}

body.theme-midnight .growth-task-rewards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

body.theme-midnight .growth-task-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

body.theme-midnight .growth-submit-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

body.theme-midnight .growth-submit-input {
    width: 160px;
    min-height: 38px;
}

body.theme-midnight .growth-log-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 18px;
}

body.theme-midnight .growth-log-main {
    display: flex;
    gap: 10px;
    align-items: center;
}

body.theme-midnight .growth-log-main strong {
    color: #f0d79a;
}

body.theme-midnight .growth-log-item small {
    color: var(--muted);
}

body.theme-midnight .rarity-common {
    color: #c0b2a7;
    background: rgba(192, 178, 167, 0.12);
    border-color: rgba(192, 178, 167, 0.2);
}

body.theme-midnight .rarity-rare {
    color: #9fc0ff;
    background: rgba(111, 156, 255, 0.12);
    border-color: rgba(111, 156, 255, 0.2);
}

body.theme-midnight .rarity-epic {
    color: #cf9dff;
    background: rgba(168, 98, 255, 0.12);
    border-color: rgba(168, 98, 255, 0.2);
}

body.theme-midnight .rarity-legendary {
    color: #f3d7a0;
    background: rgba(216, 176, 106, 0.14);
    border-color: rgba(216, 176, 106, 0.22);
}

body.theme-midnight .battle-member-sheet,
body.theme-midnight .battle-tactics-sheet {
    width: min(1120px, calc(100vw - 24px));
}

body.theme-midnight .battle-member-sheet {
    border-color: rgba(216, 176, 106, 0.14);
}

body.theme-midnight .battle-member-hero {
    position: relative;
    display: grid;
    gap: 16px;
    padding: 20px 22px 18px;
    border-radius: 24px;
    border: 1px solid rgba(216, 176, 106, 0.14);
    background:
        linear-gradient(180deg, rgba(13, 19, 29, 0.88), rgba(8, 12, 18, 0.94)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.12), transparent 28%);
    color: var(--text);
}

body.theme-midnight .battle-member-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(216, 176, 106, 0.12), transparent 18%),
        linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.05) 48%, transparent 64%);
    pointer-events: none;
}

body.theme-midnight .battle-sheet-header {
    position: relative;
    z-index: 1;
}

body.theme-midnight .battle-sheet-eyebrow {
    background: transparent;
    color: #f3d7a0;
    border-color: rgba(216, 176, 106, 0.16);
}

body.theme-midnight .battle-sheet-eyebrow::before {
    background: linear-gradient(90deg, rgba(216, 176, 106, 0.08), rgba(216, 176, 106, 0.9));
}

body.theme-midnight .battle-member-status-bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-midnight .battle-member-status-item span {
    color: var(--muted);
}

body.theme-midnight .battle-member-status-item strong {
    color: var(--text);
}

body.theme-midnight .battle-member-status-sep {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

body.theme-midnight .battle-signup-notice {
    border-color: rgba(216, 176, 106, 0.14);
}

body.theme-midnight .battle-signup-notice-inline {
    background: rgba(216, 176, 106, 0.06);
    border-color: rgba(216, 176, 106, 0.12);
    color: rgba(216, 225, 236, 0.7);
}

body.theme-midnight .battle-signup-form {
    gap: 12px;
}

body.theme-midnight .battle-tactics-inline-btn {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

body.theme-midnight .battle-tactics-inline-btn:hover:not(.is-muted) {
    border-color: rgba(216, 176, 106, 0.3);
}

body.theme-midnight .battle-tactics-inline-icon {
    background: rgba(216, 176, 106, 0.14);
    color: #f0c878;
}

body.theme-midnight .battle-school-inline-label {
    color: rgba(216, 225, 236, 0.6);
}

body.theme-midnight .battle-signup-ops {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 14px;
    align-items: stretch;
}

body.theme-midnight .battle-signup-control,
body.theme-midnight .battle-signup-command,
body.theme-midnight .battle-tactics-entry {
    display: grid;
    gap: 14px;
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-midnight .battle-signup-control-head,
body.theme-midnight .battle-signup-command-head,
body.theme-midnight .battle-active-config-head,
body.theme-midnight .battle-signup-day-head,
body.theme-midnight .battle-signup-school-head,
body.theme-midnight .battle-config-row-main,
body.theme-midnight .battle-config-row-meta,
body.theme-midnight .battle-config-row-actions,
body.theme-midnight .battle-board-overview-head,
body.theme-midnight .battle-group-head,
body.theme-midnight .battle-group-head-compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body.theme-midnight .battle-tactics-entry-btn,
body.theme-midnight .battle-tactics-entry-empty,
body.theme-midnight .battle-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 88px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

body.theme-midnight .battle-action-btn {
    justify-content: flex-start;
    text-align: left;
}

body.theme-midnight .battle-tactics-entry-btn:hover {
    border-color: rgba(216, 176, 106, 0.2);
    background: rgba(216, 176, 106, 0.08);
}

body.theme-midnight .battle-action-btn.is-active {
    border-color: var(--accent);
    background:
        linear-gradient(135deg, var(--accent-soft), transparent 70%),
        rgba(255, 255, 255, 0.04);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 20px var(--accent-soft);
}

body.theme-midnight .battle-action-btn.is-active .battle-action-icon {
    background: var(--accent);
    color: var(--bg);
    -webkit-text-fill-color: var(--bg);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.theme-midnight .battle-action-btn.is-active .battle-action-copy small {
    color: var(--accent);
    opacity: 0.9;
}

body.theme-midnight .battle-action-icon,
body.theme-midnight .battle-tactics-entry-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body.theme-midnight .battle-action-copy,
body.theme-midnight .battle-tactics-entry-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

body.theme-midnight .battle-signup-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.theme-midnight .battle-signup-reminder {
    margin: 0;
}

body.theme-midnight .battle-signup-feedback {
    margin: 0;
    color: #f3d7a0;
}

body.theme-midnight .battle-active-config-card {
    display: grid;
    gap: 14px;
}

body.theme-midnight .battle-active-config-note {
    margin: 0;
    color: var(--muted);
}

body.theme-midnight .battle-assignment-card {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-midnight .battle-assignment-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-midnight .battle-signup-day-card {
    display: grid;
    gap: 16px;
}

body.theme-midnight .battle-signup-groups {
    display: grid;
    gap: 14px;
}

body.theme-midnight .battle-signup-school-card {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
}

body.theme-midnight .battle-signup-member-list {
    display: grid;
    gap: 10px;
}

body.theme-midnight .battle-signup-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.theme-midnight .battle-signup-member-row small {
    color: var(--muted);
}

body.theme-midnight .battle-signup-inline-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.theme-midnight .battle-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

body.theme-midnight .battle-summary-card,
body.theme-midnight .battle-summary-pill {
    display: grid;
    gap: 8px;
}

body.theme-midnight .battle-summary-card strong,
body.theme-midnight .battle-summary-pill strong {
    font-size: 1.2rem;
}

body.theme-midnight .battle-board-top-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    align-items: start;
}

body.theme-midnight .battle-board-overview {
    display: grid;
    gap: 14px;
}

body.theme-midnight .battle-board-overview-tags,
body.theme-midnight .battle-summary-strip,
body.theme-midnight .battle-inline-warning {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-midnight .battle-board-overview-note {
    margin: 0;
}

body.theme-midnight .battle-config-list {
    display: grid;
    gap: 10px;
}

body.theme-midnight .battle-config-row {
    display: grid;
    gap: 10px;
}

body.theme-midnight .battle-config-row-main,
body.theme-midnight .battle-config-row-actions {
    align-items: center;
}

body.theme-midnight .battle-sticky-bar {
    position: sticky;
    top: 96px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

body.theme-midnight .battle-sticky-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

body.theme-midnight .battle-admin-actionbar {
    border-color: rgba(216, 176, 106, 0.14);
}

body.theme-midnight .battle-admin-groups {
    display: grid;
    gap: 16px;
}

body.theme-midnight .battle-group-section {
    display: grid;
    gap: 14px;
}

body.theme-midnight .battle-group-head-compact {
    align-items: center;
}

body.theme-midnight .battle-structure-panel {
    padding: 16px 18px;
}

body.theme-midnight .battle-structure-grid {
    display: grid;
    gap: 12px;
}

body.theme-midnight .battle-group-structure-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body.theme-midnight .battle-group-structure-item {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
}

body.theme-midnight .battle-squad-table-wrap {
    overflow: auto;
}

body.theme-midnight .battle-squad-table-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

body.theme-midnight .battle-candidate-panel {
    display: grid;
    gap: 14px;
}

body.theme-midnight .battle-summary-card span,
body.theme-midnight .battle-summary-pill span {
    color: var(--muted);
}

body.theme-midnight .battle-summary-card strong,
body.theme-midnight .battle-summary-pill strong {
    color: var(--text);
}

body.theme-midnight .battle-summary-card small,
body.theme-midnight .battle-summary-pill small,
body.theme-midnight .battle-config-row-meta,
body.theme-midnight .battle-active-config-head p,
body.theme-midnight .battle-signup-school-head span,
body.theme-midnight .battle-signup-member-row-rich small {
    color: rgba(200, 212, 226, 0.72);
}

body.theme-midnight .battle-summary-card .badge,
body.theme-midnight .battle-summary-pill .badge {
    width: fit-content;
}

body.theme-midnight .battle-member-sheet .modal-close,
body.theme-midnight .battle-tactics-sheet .modal-close,
body.theme-midnight .dashboard-sheet .modal-close,
body.theme-midnight .admin-user-edit-sheet .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

body.theme-midnight .overlay-modal {
    padding: 12px;
}

body.theme-midnight .overlay-backdrop {
    background: rgba(3, 6, 10, 0.76);
    backdrop-filter: blur(12px);
}

body.theme-midnight .overlay-panel,
body.theme-midnight .sheet-panel {
    width: min(1120px, calc(100vw - 24px));
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(16, 23, 35, 0.98), rgba(8, 12, 18, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.08), transparent 34%);
    color: var(--text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 72px rgba(0, 0, 0, 0.46);
    animation: theme-rise 0.24s ease both;
}

body.theme-midnight .overlay-panel {
    padding: 20px;
}

body.theme-midnight .overlay-panel.portrait-panel {
    width: min(430px, calc(100vw - 24px));
    padding: 18px;
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(246, 238, 225, 0.98), rgba(232, 220, 202, 0.98)),
        radial-gradient(circle at top, rgba(216, 176, 106, 0.24), transparent 46%);
    border: 1px solid rgba(156, 114, 67, 0.34);
    color: #3a271c;
    box-shadow:
        0 36px 90px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body.theme-midnight .overlay-panel.portrait-panel::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 26px;
    border: 1px solid rgba(163, 121, 76, 0.22);
    pointer-events: none;
}

body.theme-midnight .overlay-panel.opened-book-panel {
    width: min(1120px, calc(100vw - 30px));
    padding: 22px;
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(11, 16, 25, 0.98), rgba(7, 10, 17, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.12), transparent 34%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.46);
}

body.theme-midnight .button.portrait-open-book {
    width: 100%;
    min-height: 52px;
    align-self: stretch;
    border-radius: 16px;
    background: linear-gradient(140deg, #a7412d, #74271c);
    color: #fff8ef;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 14px 28px rgba(107, 39, 26, 0.26);
}

body.theme-midnight .button.portrait-open-book:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

body.theme-midnight .overlay-panel.dashboard-sheet,
body.theme-midnight .overlay-panel.sheet-panel,
body.theme-midnight .dashboard-sheet.overlay-panel {
    overflow: auto;
    overscroll-behavior: contain;
}

body.theme-midnight [data-overlay-modal="dashboard-shop"] .overlay-panel.dashboard-sheet.dashboard-sheet-compact {
    width: min(500px, calc(100vw - 24px));
    padding: 18px 18px 20px;
}

body.theme-midnight [data-overlay-modal="dashboard-winners"] .overlay-panel.dashboard-sheet {
    width: min(560px, calc(100vw - 24px));
    padding: 18px 18px 20px;
}

body.theme-midnight [data-overlay-modal="dashboard-growth"] .overlay-panel.dashboard-sheet {
    width: min(1040px, calc(100vw - 24px));
    padding: 18px 18px 20px;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] {
    position: fixed;
    inset: 0;
    z-index: 280;
    padding: 20px;
}

body.theme-midnight [data-overlay-modal="admin-award-create"][hidden] {
    display: none !important;
}

body.theme-midnight [data-overlay-modal="admin-award-create"]:not([hidden]) {
    display: grid;
    place-items: center;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 10, 0.8);
    backdrop-filter: blur(14px);
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .overlay-panel.admin-award-modal {
    position: relative;
    z-index: 2;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    display: grid;
    gap: 0;
    padding: 0;
    overflow: hidden auto;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(17, 24, 38, 0.98), rgba(9, 13, 21, 0.98)),
        radial-gradient(circle at top right, rgba(216, 176, 106, 0.12), transparent 34%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 32px 80px rgba(0, 0, 0, 0.46);
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-modal-head {
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at top left, rgba(216, 176, 106, 0.1), transparent 46%);
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-modal-head h2 {
    margin: 0;
    color: #f8efe2;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-form {
    gap: 18px;
    padding: 20px 22px 22px;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-step-copy strong,
body.theme-midnight [data-overlay-modal="admin-award-create"] label > span,
body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-member-copy strong,
body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-selected-card strong {
    color: #eef3fb;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-search input,
body.theme-midnight [data-overlay-modal="admin-award-create"] select,
body.theme-midnight [data-overlay-modal="admin-award-create"] textarea,
body.theme-midnight [data-overlay-modal="admin-award-create"] input[type="text"],
body.theme-midnight [data-overlay-modal="admin-award-create"] input[type="date"],
body.theme-midnight [data-overlay-modal="admin-award-create"] input[type="number"] {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #eef3fb;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-member-list {
    padding-right: 4px;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-member-item,
body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-selected-card {
    border-color: rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03)),
        rgba(11, 16, 24, 0.82);
    color: #eef3fb;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-member-item:hover {
    border-color: rgba(216, 176, 106, 0.28);
    background:
        linear-gradient(180deg, rgba(216, 176, 106, 0.12), rgba(255, 255, 255, 0.05)),
        rgba(11, 16, 24, 0.94);
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-member-copy small,
body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-selected-card small {
    color: rgba(223, 231, 240, 0.78);
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .admin-award-submit {
    width: 100%;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    min-width: 42px;
}

body.theme-midnight [data-overlay-modal="admin-award-create"] .modal-close::before {
    content: "×";
}

body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-icon {
    width: 100%;
    max-width: 300px;
    height: 276px;
    padding-top: 16px;
    margin: 0 auto;
}

body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-icon .growth-badge-icon {
    width: calc(100% - 20px);
    max-width: 268px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 36px;
}

body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-icon .growth-badge-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-body {
    justify-items: stretch;
}

body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-hero {
    justify-items: stretch;
}

body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-copy,
body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-copy p,
body.theme-midnight [data-overlay-modal="growth-badge-detail"] .growth-badge-sheet-bonuses {
    width: 100%;
    max-width: none;
}

body.theme-midnight .overlay-panel .modal-close,
body.theme-midnight .sheet-panel .modal-close,
body.theme-midnight .dashboard-sheet .modal-close,
body.theme-midnight .battle-member-sheet .modal-close,
body.theme-midnight .battle-tactics-sheet .modal-close,
body.theme-midnight .admin-user-edit-sheet .modal-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    color: transparent;
    white-space: nowrap;
    overflow: hidden;
    border-radius: 14px;
}

body.theme-midnight .overlay-panel .modal-close::before,
body.theme-midnight .sheet-panel .modal-close::before,
body.theme-midnight .dashboard-sheet .modal-close::before,
body.theme-midnight .battle-member-sheet .modal-close::before,
body.theme-midnight .battle-tactics-sheet .modal-close::before,
body.theme-midnight .admin-user-edit-sheet .modal-close::before {
    content: "×";
    color: rgba(244, 225, 188, 0.9);
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 500;
}

body.theme-midnight .overlay-panel .modal-close:hover::before,
body.theme-midnight .sheet-panel .modal-close:hover::before,
body.theme-midnight .dashboard-sheet .modal-close:hover::before,
body.theme-midnight .battle-member-sheet .modal-close:hover::before,
body.theme-midnight .battle-tactics-sheet .modal-close:hover::before,
body.theme-midnight .admin-user-edit-sheet .modal-close:hover::before {
    color: #fff2d6;
}

body.theme-midnight .sheet-panel {
    padding: 20px;
}

body.theme-midnight :is(.overlay-panel, .sheet-panel, .dashboard-sheet, .team-center-panel, .admin-panel, .admin-nav-card, .battle-member-sheet, .battle-tactics-sheet, .growth-level-card, .growth-checkin-card, .growth-badges-card--full, .growth-tasks-card, .growth-log-card, .profile-action-card, .profile-summary-card, .profile-summary-stat, .list-card, .card, .paper-card, .table-wrap, .member-inline, .empty-state) :is(p, small) {
    color: rgba(223, 231, 240, 0.84);
}

body.theme-midnight .opened-book-header-copy p,
body.theme-midnight .opened-book-reader .opened-book-page-no,
body.theme-midnight .opened-book-reader .empty-state p {
    color: #745b49;
}

body.theme-midnight :is(.team-center-count, .team-center-notice, .team-center-team-num, .team-center-team-desc, .team-center-member-info small, .team-center-member-empty, .team-center-team-arrow, .dungeon-signup-meta, .dashboard-history-time, .winner-rank-row small, .winner-recent-row small) {
    color: rgba(216, 225, 236, 0.82);
}

body.theme-midnight .team-center-open-badge {
    background: rgba(79, 199, 139, 0.14);
    color: #98efc2;
    border-color: rgba(79, 199, 139, 0.28);
}

body.theme-midnight :is(.team-center-hint-sub, .dungeon-signup-feedback, .team-center-signuplist-head, .dungeon-signup-num, .dungeon-empty) {
    color: rgba(216, 225, 236, 0.8);
}

body.theme-midnight .survey-option-label {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-midnight .survey-option-label:has(input:checked) {
    border-color: rgba(216, 176, 106, 0.4);
    background: rgba(216, 176, 106, 0.1);
}

body.theme-midnight .survey-fieldset legend {
    color: var(--text);
}

body.theme-midnight .team-rename-suffix {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f0c878;
}

body.theme-midnight .team-center-my-leader {
    color: rgba(216, 225, 236, 0.65);
}

body.theme-midnight .team-center-header {
    border-color: rgba(255, 255, 255, 0.06);
}

body.theme-midnight .auth-shell {
    min-height: calc(100svh - 160px);
    display: grid;
    place-items: center;
    padding: 24px 0;
}

body.theme-midnight .auth-panel {
    width: min(560px, 100%);
    display: grid;
    gap: 18px;
    padding: 28px;
}

body.theme-midnight .auth-panel .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f3d7a0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

body.theme-midnight .auth-panel h1 {
    margin: 0;
    font-size: clamp(1.7rem, 1.2rem + 2vw, 3rem);
}

body.theme-midnight .auth-panel p {
    margin: 0;
    color: var(--muted);
}

body.theme-midnight .auth-panel form {
    display: grid;
    gap: 14px;
}

body.theme-midnight .auth-panel .meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body.theme-midnight.admin-wide .page-frame {
    width: min(calc(100% - 24px), 100%);
    max-width: none;
}

body.theme-midnight.admin-wide .admin-shell {
    grid-template-columns: minmax(0, 1fr);
}

body.theme-midnight.admin-wide .admin-sidebar {
    display: none;
}

body.theme-midnight .battle-admin-top-panel {
    display: grid;
    gap: 14px;
}

body.theme-midnight .battle-board,
body.theme-midnight .battle-picker,
body.theme-midnight .battle-tower,
body.theme-midnight .battle-slot,
body.theme-midnight .battle-result,
body.theme-midnight .battle-group-structure-item,
body.theme-midnight .battle-settings-details {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-midnight .battle-settings-summary,
body.theme-midnight .battle-settings-body,
body.theme-midnight .battle-slot-item,
body.theme-midnight .battle-tower-item {
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-midnight .battle-board,
body.theme-midnight .battle-picker,
body.theme-midnight .battle-tower,
body.theme-midnight .battle-slot,
body.theme-midnight .battle-result {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

body.theme-midnight .battle-board-overview-head h2,
body.theme-midnight .battle-board-overview-head p,
body.theme-midnight .battle-group-head h3,
body.theme-midnight .battle-signup-control-head strong,
body.theme-midnight .battle-signup-command-head strong {
    margin: 0;
}

body.theme-midnight .battle-board-overview-head p,
body.theme-midnight .battle-group-head p,
body.theme-midnight .battle-signup-control-head span,
body.theme-midnight .battle-signup-command-head span {
    color: var(--muted);
}

body.theme-midnight .battle-settings-summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

body.theme-midnight .battle-settings-summary-copy {
    display: grid;
    gap: 4px;
}

body.theme-midnight .battle-settings-body {
    padding-top: 16px;
}

body.theme-midnight .battle-signup-day-head strong,
body.theme-midnight .battle-signup-school-head strong {
    font-size: 1.05rem;
}

body.theme-midnight .battle-summary-grid .battle-summary-card strong {
    font-size: 1.38rem;
}

body.theme-midnight .profile-action-card-growth {
    border-color: rgba(114, 214, 163, 0.14);
}

body.theme-midnight .profile-action-card-growth-clean {
    border-color: rgba(216, 176, 106, 0.14);
}

body.theme-midnight .profile-action-card .badge {
    width: fit-content;
}

body.theme-midnight .admin-system-grid,
body.theme-midnight .admin-section-grid,
body.theme-midnight .admin-content-grid {
    display: grid;
    gap: 14px;
}

body.theme-midnight .admin-system-block {
    padding: 16px 18px;
    border-radius: 20px;
}

body.theme-midnight .battle-signup-feedback[hidden] {
    display: none;
}

@media (max-width: 1180px) {
    body.theme-midnight .topbar {
        grid-template-columns: minmax(0, 1fr);
        justify-items: start;
    }

    body.theme-midnight .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    body.theme-midnight .user-status-pill {
        width: 100%;
    }

    body.theme-midnight .admin-shell,
    body.theme-midnight .battle-board-top-layout,
    body.theme-midnight .battle-signup-ops,
    body.theme-midnight .portrait-frame {
        grid-template-columns: 1fr;
    }

    body.theme-midnight .profile-summary-card {
        grid-template-columns: 1fr;
    }

    body.theme-midnight .profile-summary-stats {
        min-width: 0;
    }

    body.theme-midnight .profile-action-stage {
        grid-template-columns: 1fr;
    }

    body.theme-midnight .profile-card-grid-primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.theme-midnight .profile-card-grid-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.theme-midnight .profile-action-card-feature {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    body.theme-midnight .profile-action-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 920px) {
    body.theme-midnight .desktop-nav {
        display: none;
    }

    body.theme-midnight .mobile-tabbar {
        position: fixed;
        left: 50%;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        width: min(calc(100% - 24px), 400px);
        padding: 6px 8px;
        border-radius: 22px;
        transform: translateX(-50%);
        background:
            linear-gradient(180deg, rgba(12, 17, 27, 0.94), rgba(8, 12, 18, 0.92)),
            radial-gradient(circle at top right, rgba(216, 176, 106, 0.12), transparent 36%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
    }

    body.theme-midnight .page-frame {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    body.theme-midnight .footer {
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }

    /* 移动端顶部栏极致压缩 */
    body.theme-midnight .topbar {
        top: 6px;
        gap: 10px;
        padding: 8px 12px;
        margin-bottom: 10px;
        border-radius: 18px;
    }

    body.theme-midnight .brandmark {
        gap: 8px;
    }

    body.theme-midnight .brand-logo {
        max-height: 28px;
    }

    body.theme-midnight .brand-copy strong {
        font-size: 0.9rem;
    }

    body.theme-midnight .user-status-pill {
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }

    body.theme-midnight .user-status-pill .user-status-avatar .avatar {
        width: 28px;
        height: 28px;
    }

    body.theme-midnight .user-status-copy {
        gap: 1px;
    }

    body.theme-midnight .user-status-head strong {
        font-size: 0.78rem;
    }

    body.theme-midnight .user-status-level {
        font-size: 0.62rem;
        padding: 1px 5px;
    }

    body.theme-midnight .user-status-bar {
        height: 3px;
    }

    body.theme-midnight .user-status-meta {
        font-size: 0.62rem;
        gap: 4px;
    }

    body.theme-midnight .topbar-actions .button {
        min-height: 32px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    body.theme-midnight .topbar-growth-btn {
        padding: 4px 8px;
        border-radius: 14px;
        gap: 2px;
    }

    body.theme-midnight .topbar-growth-icon {
        width: 22px;
        height: 22px;
        font-size: 0.68rem;
        border-radius: 6px;
    }

    body.theme-midnight .topbar-growth-copy strong {
        font-size: 0.64rem;
    }

    body.theme-midnight .topbar-growth-copy small {
        font-size: 0.54rem;
    }

    body.theme-midnight .admin-sidebar {
        position: static;
        max-height: none;
    }

    body.theme-midnight .home-stage-grid,
    body.theme-midnight .home-notice-shell,
    body.theme-midnight .home-notice-item,
    body.theme-midnight .battle-signup-action-grid,
    body.theme-midnight .profile-action-stage,
    body.theme-midnight .profile-card-grid,
    body.theme-midnight .profile-card-grid-primary,
    body.theme-midnight .profile-card-grid-secondary,
    body.theme-midnight .admin-theme-grid,
    body.theme-midnight .card-grid-2,
    body.theme-midnight .form-grid {
        grid-template-columns: 1fr;
    }

    body.theme-midnight .home-notice-marker {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    body.theme-midnight .home-notice-card--rail .home-notice-feed {
        max-height: none;
        overflow: visible;
    }

    body.theme-midnight .home-shelf-bar {
        flex-direction: column;
        align-items: stretch;
    }

    body.theme-midnight .home-shelf-search-cluster {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: stretch;
    }

    body.theme-midnight .home-shelf-reroll {
        width: auto;
        min-width: fit-content;
        justify-content: center;
    }

    body.theme-midnight .home-shelf-search-inline {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.theme-midnight .home-shelf-search-inline input {
        min-width: 0;
    }

    body.theme-midnight .battle-sticky-bar,
    body.theme-midnight .admin-toolbar-main,
    body.theme-midnight .battle-member-status-bar {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    body.theme-midnight .profile-summary-card {
        gap: 14px;
        padding: 16px;
    }

    body.theme-midnight .profile-action-card {
        gap: 12px;
        padding: 15px;
    }

    body.theme-midnight .profile-action-copy {
        gap: 4px;
    }

    body.theme-midnight .profile-action-arrow {
        width: 28px;
        height: 28px;
        border-radius: 9px;
        font-size: 0.9rem;
    }

    body.theme-midnight .profile-action-card-admin {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: 1fr;
        grid-template-areas: "icon copy arrow";
        align-items: center;
        align-content: center;
        gap: 12px;
    }

    body.theme-midnight .profile-summary-main {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
    }

    body.theme-midnight .profile-summary-main .avatar-md {
        width: 60px;
        height: 60px;
    }

    body.theme-midnight .profile-summary-copy {
        gap: 8px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.theme-midnight .profile-summary-title-row {
        width: 100%;
        flex-wrap: nowrap;
    }

    body.theme-midnight .profile-summary-title-row h1 {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1.08rem;
    }

    body.theme-midnight .profile-summary-edit {
        width: auto;
        min-height: 34px;
        padding: 0 12px;
        margin-left: auto;
    }

    body.theme-midnight .profile-summary-tags {
        width: 100%;
        gap: 6px;
        flex-wrap: wrap;
    }

    body.theme-midnight .profile-summary-copy p {
        width: 100%;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        overflow: hidden;
        white-space: normal;
        font-size: 0.82rem;
        line-height: 1.5;
    }

    body.theme-midnight .profile-summary-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    body.theme-midnight .profile-summary-stat {
        min-height: auto;
        padding: 10px;
        border-radius: 16px;
    }

    body.theme-midnight .profile-summary-stat small {
        font-size: 0.68rem;
        line-height: 1.3;
    }

    body.theme-midnight .profile-summary-stat strong {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    body.theme-midnight .page-frame {
        width: min(calc(100% - 14px), 100%);
        padding-top: 10px;
    }

    body.theme-midnight .topbar {
        top: 10px;
        padding: 14px;
        border-radius: 24px;
    }

    body.theme-midnight .topbar-actions,
    body.theme-midnight .home-shelf-tools,
    body.theme-midnight .button-row,
    body.theme-midnight .admin-page-actions,
    body.theme-midnight .admin-toolbar-actions,
    body.theme-midnight .battle-signup-inline-meta {
        width: 100%;
    }

    body.theme-midnight .button,
    body.theme-midnight .book-nav-button,
    body.theme-midnight .icon-action-button,
    body.theme-midnight .modal-close,
    body.theme-midnight .portrait-close {
        width: 100%;
        justify-content: center;
    }

    body.theme-midnight .profile-summary-card {
        gap: 10px;
        padding: 14px;
    }

    body.theme-midnight .profile-summary-main {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 10px;
    }

    body.theme-midnight .profile-summary-main .avatar-md {
        width: 52px;
        height: 52px;
    }

    body.theme-midnight .profile-summary-copy {
        gap: 6px;
    }

    body.theme-midnight .profile-summary-title-row {
        gap: 8px;
    }

    body.theme-midnight .profile-summary-title-row h1 {
        font-size: 1rem;
    }

    body.theme-midnight .profile-summary-edit {
        width: auto;
        min-height: 32px;
        padding: 0 10px;
        font-size: 0.78rem;
        justify-content: center;
    }

    body.theme-midnight .profile-summary-tags .badge {
        min-height: 24px;
        padding: 4px 9px;
        font-size: 0.72rem;
    }

    body.theme-midnight .profile-summary-copy p {
        display: none;
    }

    body.theme-midnight .profile-summary-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    body.theme-midnight .profile-summary-stat {
        gap: 6px;
        padding: 8px;
        border-radius: 14px;
    }

    body.theme-midnight .profile-summary-stat small {
        font-size: 0.64rem;
    }

    body.theme-midnight .profile-summary-stat strong {
        font-size: 0.92rem;
    }

    body.theme-midnight .home-video-frame,
    body.theme-midnight .home-video-frame video,
    body.theme-midnight .home-video-fallback {
        min-height: 240px;
    }

    body.theme-midnight .home-stage-grid {
        gap: 14px;
    }

    body.theme-midnight .home-notice-card,
    body.theme-midnight .home-video-stage,
    body.theme-midnight .home-shelf-bar,
    body.theme-midnight .profile-summary-card,
    body.theme-midnight .profile-action-section,
    body.theme-midnight .growth-level-card,
    body.theme-midnight .growth-checkin-card,
    body.theme-midnight .growth-badges-card--full,
    body.theme-midnight .growth-tasks-card,
    body.theme-midnight .growth-log-card,
    body.theme-midnight .admin-panel,
    body.theme-midnight .admin-toolbar,
    body.theme-midnight .admin-nav-card,
    body.theme-midnight .auth-panel,
    body.theme-midnight .overlay-panel,
    body.theme-midnight .sheet-panel {
        border-radius: 22px;
    }

    body.theme-midnight .portrait-frame {
        gap: 14px;
        padding: 20px 16px 16px;
    }

    body.theme-midnight .overlay-panel.portrait-panel {
        width: min(390px, calc(100vw - 14px));
        padding: 14px;
    }

    body.theme-midnight .portrait-avatar-ring {
        width: 112px;
        height: 112px;
    }

    body.theme-midnight .portrait-avatar-ring .avatar-lg {
        width: 100%;
        height: 100%;
    }

    body.theme-midnight .overlay-panel.opened-book-panel {
        width: min(100vw - 10px, 1120px);
        padding: 14px;
        border-radius: 24px;
    }

    body.theme-midnight .opened-book-header {
        padding-right: 58px;
    }

    body.theme-midnight .opened-book-spread {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body.theme-midnight .opened-book-spread::before {
        display: none;
    }

    body.theme-midnight .opened-book-page {
        padding: 22px 18px 18px;
    }

    body.theme-midnight .opened-book-page + .opened-book-page {
        border-left: 0;
        border-top: 1px solid rgba(132, 94, 58, 0.12);
    }

    body.theme-midnight .opened-book-title {
        flex-direction: column;
        align-items: flex-start;
    }

    body.theme-midnight .home-book-card,
    body.theme-midnight .corridor-book {
        flex-basis: 100%;
    }

    body.theme-midnight .growth-level-head,
    body.theme-midnight .growth-checkin-body,
    body.theme-midnight .battle-member-status-bar,
    body.theme-midnight .battle-signup-member-row,
    body.theme-midnight .battle-config-row,
    body.theme-midnight .battle-summary-card,
    body.theme-midnight .battle-summary-pill {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.theme-midnight *,
    body.theme-midnight *::before,
    body.theme-midnight *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    /* 抽奖页动画豁免 */
    .lt-winner.is-in { animation-duration: 1.4s !important; animation-iteration-count: 1 !important; }
    .lt-prize { animation-duration: 0.5s !important; animation-iteration-count: 1 !important; }
    .lt-name { transition-duration: 0.15s !important; }
    .lt-pulse { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
    .lt-stage::after { animation-duration: 5s !important; animation-iteration-count: infinite !important; }
    .lt-drum .lt-name.is-hl { transition-duration: 0.1s !important; }
}
