:root {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

.top-right-tools {
    position: absolute;
    right: 20px;
    top: 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 50;
}

.top-right-tools .user-panel {
    position: static;
    right: auto;
    top: auto;
    padding: 0;
    margin: 0;
}

.theme-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid #3d4b5d;
    background: rgba(14, 22, 33, 0.86);
    backdrop-filter: blur(8px);
}

.theme-option {
    border: 0;
    background: transparent;
    color: #a8c9ed;
    padding: 6px 10px;
    border-radius: 999px;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-option:hover {
    background: rgba(112, 170, 230, 0.16);
    color: #e8f2ff;
}

.theme-option.is-active {
    background: linear-gradient(135deg, #4f90d8 0%, #3672bb 100%);
    color: #fff;
}

.footer {
    margin: 24px 0 18px;
    padding: 0;
    border-top: 1px solid rgba(130, 156, 188, 0.18);
    text-align: center;
    color: #9aa8ba;
    background: transparent;
}

.footer a {
    color: inherit;
}

.footer a:hover {
    color: #d7e7fb;
}

.footer-license {
    max-width: 1080px;
    margin: 0 auto;
    padding-top: 14px;
    font-size: 0.72rem;
    line-height: 1.65;
    color: #7f8c9f;
}

.footer-license p {
    margin: 0;
}

.footer-license-links a,
.footer-admin-link a {
    margin: 0 5px;
}

@media (max-width: 768px) {
    .top-right-tools {
        position: static;
        margin-top: 8px;
        justify-content: center;
        align-items: center;
        padding: 0 12px 10px;
        gap: 8px;
    }

    .top-right-tools .user-panel {
        justify-content: center;
        margin-top: 0;
    }

    .theme-switcher {
        justify-content: center;
    }

    .footer-license {
        font-size: 0.68rem;
        line-height: 1.6;
        padding-top: 12px;
    }
}

@media (max-width: 480px) {
    .theme-option {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
}

html[data-theme="light"] body {
    background-color: #edf3fa;
    color: #1e2b3d;
}

html[data-theme="light"] .header {
    background-color: #ffffff;
    border-bottom-color: #d7e0eb;
    box-shadow: 0 3px 16px rgba(26, 40, 58, 0.08);
}

html[data-theme="light"] .game-title {
    color: #13243c;
    text-shadow: none;
}

html[data-theme="light"] .subtitle {
    color: #5f7086;
}

html[data-theme="light"] .top-nav a,
html[data-theme="light"] .user-panel a,
html[data-theme="light"] .user-panel-logout {
    color: #255d96;
}

html[data-theme="light"] .top-nav a:hover,
html[data-theme="light"] .user-panel a:hover,
html[data-theme="light"] .user-panel-logout:hover {
    color: #114173;
}

html[data-theme="light"] .user-panel {
    color: #44586f;
}

html[data-theme="light"] .theme-switcher {
    border-color: #c9d7e8;
    background: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .theme-option {
    color: #3e5470;
}

html[data-theme="light"] .theme-option:hover {
    background: rgba(55, 111, 174, 0.12);
    color: #1b4674;
}

html[data-theme="light"] .section {
    background: linear-gradient(180deg, #ffffff 0%, #f7fafd 100%);
    border-color: #d2dce9;
    box-shadow: 0 12px 26px rgba(44, 71, 102, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .section::before {
    background:
        radial-gradient(circle at 12% 0%, rgba(74, 144, 226, 0.11) 0, rgba(74, 144, 226, 0) 34%),
        radial-gradient(circle at 92% 100%, rgba(54, 179, 113, 0.08) 0, rgba(54, 179, 113, 0) 28%);
}

html[data-theme="light"] .section-title,
html[data-theme="light"] .detail-header,
html[data-theme="light"] .verification-section {
    border-bottom-color: #d4deea;
}

html[data-theme="light"] .section-title,
html[data-theme="light"] .detail-title,
html[data-theme="light"] .profile-header h2,
html[data-theme="light"] .auth-header h2 {
    color: #132843;
}

html[data-theme="light"] .announcement-item,
html[data-theme="light"] .update-item,
html[data-theme="light"] .detail-content,
html[data-theme="light"] .bbs-card,
html[data-theme="light"] .bbs-thread-item,
html[data-theme="light"] .bbs-post-item,
html[data-theme="light"] .bbs-reply-target,
html[data-theme="light"] .bbs-admin-table-wrap,
html[data-theme="light"] .event-signup-entry,
html[data-theme="light"] .event-signup-comment,
html[data-theme="light"] .external-account-item {
    background-color: #ffffff;
    border-color: #d3dce8;
    color: #223146;
}

html[data-theme="light"] .announcement-date,
html[data-theme="light"] .detail-date,
html[data-theme="light"] .update-date,
html[data-theme="light"] .bbs-thread-meta,
html[data-theme="light"] .bbs-post-header,
html[data-theme="light"] .external-account-info,
html[data-theme="light"] .event-signup-comment-meta,
html[data-theme="light"] .auth-header p,
html[data-theme="light"] .account-muted,
html[data-theme="light"] .account-empty,
html[data-theme="light"] .verification-status,
html[data-theme="light"] .form-text {
    color: #617388;
}

html[data-theme="light"] .announcement-title,
html[data-theme="light"] .update-version,
html[data-theme="light"] .detail-content strong,
html[data-theme="light"] .bbs-card-title,
html[data-theme="light"] .bbs-thread-title,
html[data-theme="light"] .bbs-thread-title-link,
html[data-theme="light"] .event-signup-list-main h3,
html[data-theme="light"] .auth-side-card h3,
html[data-theme="light"] .external-account-header strong {
    color: #163357;
}

html[data-theme="light"] .announcement-content,
html[data-theme="light"] .update-changes,
html[data-theme="light"] .detail-content p,
html[data-theme="light"] .detail-content li,
html[data-theme="light"] .bbs-content,
html[data-theme="light"] .message-item p,
html[data-theme="light"] .social-signature,
html[data-theme="light"] .account-tip-list,
html[data-theme="light"] .event-signup-comment p,
html[data-theme="light"] .event-signup-list-main p,
html[data-theme="light"] .auth-register-tip,
html[data-theme="light"] .auth-side-card > p,
html[data-theme="light"] .profile-form .form-group > label {
    color: #233247;
}

html[data-theme="light"] .message-title-row strong {
    color: #0f172a;
}

html[data-theme="light"] .message-item {
    border-bottom-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .message-item:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.22);
}

html[data-theme="light"] .detail-content em {
    color: #4f627b;
}

html[data-theme="light"] .back-link,
html[data-theme="light"] .profile-secondary-button,
html[data-theme="light"] .profile-nav-link,
html[data-theme="light"] .bbs-board-tab,
html[data-theme="light"] .bbs-sort-link,
html[data-theme="light"] .bbs-pagination a {
    background: #f4f8fd;
    border-color: #c7d3e4;
    color: #244f7e;
}

html[data-theme="light"] .back-link:hover,
html[data-theme="light"] .profile-secondary-button:hover,
html[data-theme="light"] .profile-nav-link:hover,
html[data-theme="light"] .bbs-sort-link:hover,
html[data-theme="light"] .bbs-pagination a:hover {
    background: #e5eef9;
    border-color: #adc0d8;
    color: #193f67;
}

html[data-theme="light"] .service-button {
    background-color: #336da9;
    border-color: #4a84c1;
}

html[data-theme="light"] .service-button:hover {
    background-color: #2b5f96;
    box-shadow: 0 6px 16px rgba(42, 94, 150, 0.22);
}

html[data-theme="light"] .service-button-muted {
    background-color: #cad7e8;
    border-color: #b5c5da;
    color: #1f3651;
}

html[data-theme="light"] .service-button-accent {
    background-color: #5f68ba;
    border-color: #6f79cc;
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .auth-field input,
html[data-theme="light"] .bbs-search-field input,
html[data-theme="light"] .bbs-form input,
html[data-theme="light"] .bbs-form textarea,
html[data-theme="light"] .bbs-form select,
html[data-theme="light"] .bbs-admin-filter input,
html[data-theme="light"] .bbs-admin-filter select,
html[data-theme="light"] .bbs-admin-table input,
html[data-theme="light"] .bbs-admin-table select,
html[data-theme="light"] .bbs-admin-table textarea,
html[data-theme="light"] .event-signup-comment-form textarea {
    background: #ffffff;
    border-color: #bcc9da;
    color: #1f2d41;
}

html[data-theme="light"] .bbs-form-label {
    color: #35506d;
}

html[data-theme="light"] .bbs-editor-toolbar {
    background: #edf3fa;
    border-color: #c5d3e3;
}

html[data-theme="light"] .bbs-editor-label,
html[data-theme="light"] .bbs-editor-hint {
    color: #5c6f85;
}

html[data-theme="light"] .bbs-editor-button,
html[data-theme="light"] .bbs-editor-select {
    background: #ffffff;
    border-color: #b8c7d8;
    color: #1f2d41;
}

html[data-theme="light"] .bbs-editor-button:hover,
html[data-theme="light"] .bbs-editor-select:hover {
    background: #f7fbff;
    border-color: #4784c7;
}

html[data-theme="light"] .bbs-admin-remark-marker {
    color: #b47600;
}

html[data-theme="light"] .bbs-emote-picker {
    background: #ffffff;
    border-color: #b8c7d8;
    box-shadow: 0 16px 36px rgba(20, 35, 55, 0.18);
}

html[data-theme="light"] .bbs-emote-choice {
    background: #f4f7fb;
    border-color: #cbd8e6;
}

html[data-theme="light"] .bbs-emote-picker-title {
    color: #1d3550;
}

html[data-theme="light"] .bbs-emote-close {
    background: #f4f7fb;
    border-color: #cbd8e6;
    color: #1d3550;
}

html[data-theme="light"] .bbs-emote-close:hover,
html[data-theme="light"] .bbs-emote-close:focus {
    background: #e8f1fb;
    border-color: #6f9ed0;
}

html[data-theme="light"] .bbs-emote-pack-tabs {
    border-top-color: #d8e2ee;
}

html[data-theme="light"] .bbs-emote-pack-tab {
    background: #f4f7fb;
    border-color: #cbd8e6;
    color: #35506d;
}

html[data-theme="light"] .bbs-emote-pack-tab:hover,
html[data-theme="light"] .bbs-emote-pack-tab:focus,
html[data-theme="light"] .bbs-emote-pack-tab.active {
    background: #e8f1fb;
    border-color: #6f9ed0;
    color: #1d3550;
}

html[data-theme="light"] .bbs-emote-choice:hover,
html[data-theme="light"] .bbs-emote-choice:focus {
    background: #e8f1fb;
    border-color: #6f9ed0;
}

html[data-theme="light"] .bbs-emote-command-preview {
    background: #eef3f8;
    color: #1d3550;
}

html[data-theme="light"] .bbs-draft-backdrop {
    background: rgba(14, 24, 38, 0.42);
}

html[data-theme="light"] .bbs-draft-dialog {
    background: #ffffff;
    border-color: #bdcbdc;
    box-shadow: 0 24px 60px rgba(26, 42, 64, 0.22);
}

html[data-theme="light"] .bbs-draft-header {
    background: #f2f6fb;
    border-color: #d4dfeb;
}

html[data-theme="light"] .bbs-draft-header h3,
html[data-theme="light"] .bbs-draft-empty strong,
html[data-theme="light"] .bbs-draft-title {
    color: #1f2d41;
}

html[data-theme="light"] .bbs-draft-header p,
html[data-theme="light"] .bbs-draft-empty,
html[data-theme="light"] .bbs-draft-meta {
    color: #5f7186;
}

html[data-theme="light"] .bbs-draft-close {
    background: #ffffff;
    border-color: #b8c7d8;
    color: #1f2d41;
}

html[data-theme="light"] .bbs-draft-close:hover,
html[data-theme="light"] .bbs-draft-close:focus {
    background: #f7fbff;
    border-color: #4784c7;
}

html[data-theme="light"] .bbs-draft-item {
    background: #f8fbff;
    border-color: #d4dfeb;
}

html[data-theme="light"] .bbs-draft-preview {
    color: #2d3d50;
}

html[data-theme="light"] .bbs-draft-status {
    color: #5f7186;
}

html[data-theme="light"] .bbs-draft-status.is-success {
    color: #27733a;
}

html[data-theme="light"] .bbs-draft-status.is-error {
    color: #b03434;
}

html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .auth-field input:focus,
html[data-theme="light"] .bbs-search-field input:focus,
html[data-theme="light"] .bbs-form input:focus,
html[data-theme="light"] .bbs-form textarea:focus,
html[data-theme="light"] .bbs-form select:focus,
html[data-theme="light"] .bbs-admin-filter input:focus,
html[data-theme="light"] .bbs-admin-filter select:focus,
html[data-theme="light"] .bbs-admin-table input:focus,
html[data-theme="light"] .bbs-admin-table select:focus,
html[data-theme="light"] .bbs-admin-table textarea:focus,
html[data-theme="light"] .event-signup-comment-form textarea:focus {
    border-color: #4784c7;
    box-shadow: 0 0 0 3px rgba(71, 132, 199, 0.16);
    background: #ffffff;
}

html[data-theme="light"] input.form-control[readonly],
html[data-theme="light"] input.form-control:disabled,
html[data-theme="light"] textarea.form-control:disabled,
html[data-theme="light"] select.form-control:disabled,
html[data-theme="light"] .profile-form .form-control[readonly],
html[data-theme="light"] .profile-form .form-control:disabled {
    background: #edf2f9;
    color: #6f7f93;
    border-color: #cad5e4;
}

html[data-theme="light"] .registration-captcha-button {
    background: #ffffff;
    border-color: #bcc9da;
}

html[data-theme="light"] .text-danger,
html[data-theme="light"] .auth-validation {
    color: #bf2f42;
}

html[data-theme="light"] .markdown-content,
html[data-theme="light"] .markdown-content h1,
html[data-theme="light"] .markdown-content h2,
html[data-theme="light"] .markdown-content h3 {
    color: #143052;
}

html[data-theme="light"] .markdown-content h1 {
    border-bottom-color: #d3ddea;
}

html[data-theme="light"] .markdown-content blockquote {
    color: #3e5570;
}

html[data-theme="light"] .markdown-content code {
    background-color: #edf2f9;
    color: #c14a17;
}

html[data-theme="light"] .markdown-content pre {
    background-color: #f6f9fd;
    border-color: #d2dcea;
}

html[data-theme="light"] .markdown-content pre code {
    color: #20354e;
}

html[data-theme="light"] .bbs-board-tab.active,
html[data-theme="light"] .bbs-sort-link.active,
html[data-theme="light"] .bbs-admin-nav .back-link:hover {
    color: #fff;
    background: #4a90e2;
    border-color: #4a90e2;
}

html[data-theme="light"] .bbs-avatar {
    border-color: #b9c8db;
    background: #e8f0fa;
}

html[data-theme="light"] .bbs-avatar-default {
    color: #244f7e;
}

html[data-theme="light"] .bbs-reply-node {
    background: transparent;
}

html[data-theme="light"] .bbs-admin-nav .back-link {
    background: #f4f8fd;
    border-color: #c7d3e4;
    color: #244f7e;
}

html[data-theme="light"] .bbs-reply-target {
    background: #eef5fd;
    color: #1f4d7c;
}

html[data-theme="light"] .bbs-reply-parent-context {
    color: #1f5f9f;
}

html[data-theme="light"] .bbs-reply-actions,
html[data-theme="light"] .bbs-post-time {
    color: #5f7189;
}

html[data-theme="light"] .bbs-reply-actions .bbs-reply-action {
    color: #244f7e;
}

html[data-theme="light"] .bbs-reply-actions .bbs-reply-action:hover {
    background: #eef5fd;
    border-color: #c7d3e4;
}

html[data-theme="light"] .bbs-admin-table th {
    background: #eef4fb;
    color: #1b3f66;
    border-color: #cad6e6;
}

html[data-theme="light"] .bbs-admin-table td {
    background: #ffffff;
    border-color: #d2dbe8;
    color: #233247;
}

html[data-theme="light"] .bbs-admin-table-wrap::after {
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95) 0%, transparent 100%);
}

html[data-theme="light"] .profile-grid .bbs-card {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    border-color: #ced8e6;
}

html[data-theme="light"] .xh-realname-account,
html[data-theme="light"] .xh-realname-table-card,
html[data-theme="light"] .xh-realname-sync-card,
html[data-theme="light"] .xh-realname-empty {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    border-color: #ced8e6;
}

html[data-theme="light"] .xh-openid {
    background: #f2f6fb;
    border-color: #cbd8e8;
    color: #17324f;
}

html[data-theme="light"] .xh-facts div {
    background: #f5f8fc;
    border-color: #d5dfec;
}

html[data-theme="light"] .xh-facts span,
html[data-theme="light"] .xh-realname-section-head span,
html[data-theme="light"] .xh-inline-note,
html[data-theme="light"] .xh-realname-table small {
    color: #60748b;
}

html[data-theme="light"] .xh-facts strong,
html[data-theme="light"] .xh-realname-table code {
    color: #17324f;
}

html[data-theme="light"] .xh-table-wrap,
html[data-theme="light"] .xh-realname-table th,
html[data-theme="light"] .xh-realname-table td {
    border-color: #d2dbe8;
}

html[data-theme="light"] .xh-realname-table th {
    background: #ebf3fd;
    color: #1b3f66;
}

html[data-theme="light"] .xh-status-good {
    color: #11623a;
    background: rgba(34, 139, 84, 0.12);
    border-color: rgba(34, 139, 84, 0.3);
}

html[data-theme="light"] .xh-status-warn {
    color: #81570b;
    background: rgba(255, 193, 7, 0.16);
    border-color: rgba(176, 129, 16, 0.28);
}

html[data-theme="light"] .xh-mini-tag {
    color: #245887;
    background: rgba(74, 144, 226, 0.12);
    border-color: rgba(74, 144, 226, 0.25);
}

html[data-theme="light"] .auth-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fafd 100%);
    border-color: #cfd9e8;
    box-shadow: 0 14px 30px rgba(41, 66, 95, 0.12);
}

html[data-theme="light"] .auth-submit,
html[data-theme="light"] .profile-primary-button {
    background: linear-gradient(135deg, #4f90d7 0%, #356fb7 100%);
    border-color: #4a84c8;
}

html[data-theme="light"] .auth-social-qq,
html[data-theme="light"] .service-button.qq,
html[data-theme="light"] .service-button.tieba,
html[data-theme="light"] .service-button.report,
html[data-theme="light"] .service-button.ban {
    color: #fff;
}

html[data-theme="light"] .event-signup-list-item {
    background: linear-gradient(135deg, #ffffff 0%, #f2f6fc 100%);
    border-color: #cad6e6;
}

html[data-theme="light"] .event-signup-promo {
    border-color: #c7d4e5;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7fd 100%);
}

html[data-theme="light"] .event-signup-comments {
    border-top-color: #d7e0ea;
}

html[data-theme="light"] .account-table-wrap .bbs-admin-table th {
    background: #ebf3fd;
}

html[data-theme="light"] .account-table-wrap .bbs-admin-table td {
    background: #ffffff;
}

html[data-theme="light"] .account-table-wrap .bbs-admin-table tbody tr:hover td {
    background: #f3f8ff;
}

html[data-theme="light"] .account-subtitle,
html[data-theme="light"] .profile-form .form-text,
html[data-theme="light"] .profile-form-text {
    color: #586b82;
}

html[data-theme="light"] .account-subtitle strong {
    color: #1b3350;
}

html[data-theme="light"] .account-tip-list li::before {
    background: #3f7fc6;
    box-shadow: 0 0 8px rgba(63, 127, 198, 0.45);
}

html[data-theme="light"] .u-text-muted,
html[data-theme="light"] .u-text-muted-2,
html[data-theme="light"] .u-text-muted-3,
html[data-theme="light"] .u-text-soft,
html[data-theme="light"] .u-text-soft-2,
html[data-theme="light"] .u-text-gray {
    color: #617386 !important;
}

html[data-theme="light"] .u-panel-border {
    border-color: #c9d6e7;
}

html[data-theme="light"] .u-stat-card {
    border-color: #cfdae9;
    background: #f6f9fd;
}

html[data-theme="light"] .u-note-panel {
    background-color: #f2f6fb;
    border-color: #d0dbea;
}

html[data-theme="light"] .u-info-callout {
    background-color: #e9f3ff;
    border-color: #b6d2f3;
    color: #1f3f63;
}

html[data-theme="light"] .u-danger-bg {
    background: #c64343 !important;
    border-color: #ce5555 !important;
}

html[data-theme="light"] .u-accent-bg {
    background: #5a63c1 !important;
    border-color: #6d74cc !important;
}

html[data-theme="light"] .footer {
    color: #66758a;
    background: transparent;
    border-top-color: rgba(115, 135, 160, 0.22);
}

html[data-theme="light"] .footer-license {
    color: #6f7b8d;
}

/* 系统提示消息 — 亮色主题下使用深色文字确保可读 */
html[data-theme="light"] .auth-alert-success {
    background: rgba(24, 130, 76, 0.1);
    border-color: rgba(46, 160, 100, 0.45);
    color: #1a5c2a;
}

html[data-theme="light"] .auth-alert-error {
    background: rgba(180, 36, 36, 0.1);
    border-color: rgba(200, 56, 56, 0.42);
    color: #8b1a1a;
}
