/* 深色模式基础样式 */
@media (prefers-color-scheme: dark) {
    /* 前置弹窗 - 深色模式 */
    body .pre-popup {
        background-color: rgba(26, 26, 26, 0.9);
        border-color: #5a5a5a;
    }

    body .pre-popup-content {
        background-color: #2a2a2a;
    }

    body .pre-popup-content h3 {
        color: #c8a78b;
    }

    body .pre-popup-content p {
        color: #e0e0e0;
    }

    body .pre-popup-content .btn {
        background-color: #7d4d32;
        color: #fff;
    }

    body .pre-popup-content .btn:hover {
        background-color: #633a25;
    }

    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
        background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 50 C60 40, 70 40, 80 50 C90 60, 90 70, 80 80 C70 90, 60 90, 50 80 C40 90, 30 90, 20 80 C10 70, 10 60, 20 50 C30 40, 40 40, 50 50' fill='none' stroke='%235a5a5a' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
    }

    /* 图案背景 - 深色模式 */
    body .pattern {
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L10 0 L10 10 L0 10 Z' fill='none' stroke='%235a5a5a' stroke-width='0.5' opacity='0.2'/%3E%3Cpath d='M10 10 L20 10 L20 20 L10 20 Z' fill='none' stroke='%235a5a5a' stroke-width='0.5' opacity='0.2'/%3E%3C/svg%3E");
    }

    /* 回到顶部按钮 - 深色模式 */
    body .scroll-top {
        background-color: #7d4d32;
    }

    body .scroll-top:hover {
        background-color: #633a25;
    }

    /* 标题区域 - 深色模式 */
    body .decoration-left,
    body .decoration-right {
        background-color: #7d4d32;
    }

    body .decoration-left::before,
    body .decoration-right::before,
    body .decoration-left::after,
    body .decoration-right::after {
        border-color: #7d4d32;
        background-color: #1a1a1a;
    }

    body .header h1 {
        color: #c8a78b;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    }

    /* 注意事项区域 - 深色模式 */
    body .notice-section {
        background-color: rgba(40, 40, 40, 0.8);
        border-color: #5a5a5a;
    }

    body .notice-section h2 {
        color: #c8a78b;
        border-bottom-color: #5a5a5a;
    }

    body .notice-box {
        background-color: rgba(30, 30, 30, 0.8);
    }

    body .notice-list li::before {
        color: #7d4d32;
    }

    /* 过滤和搜索区域 - 深色模式 */
    body .filter-section {
        background-color: rgba(40, 40, 40, 0.8);
        border-color: #5a5a5a;
    }

    body .filter-group label {
        color: #c8a78b;
    }

    body .filter-group select,
    body .filter-group input {
        border-color: #5a5a5a;
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    /* 登录状态显示 - 深色模式 */
    body .auth-status-text {
        color: #c8a78b;
    }

    /* 登录/注册弹窗 - 深色模式 */
    body .auth-modal-content {
        background-color: #2a2a2a;
    }

    body .auth-modal .close {
        color: #c8a78b;
    }

    body .auth-modal .close:hover {
        color: #e9d9c5;
    }

    body .auth-tabs {
        border-bottom-color: #5a5a5a;
    }

    body .auth-tab {
        color: #c8a78b;
    }

    body .auth-tab:hover {
        background-color: rgba(90, 90, 90, 0.3);
    }

    body .auth-tab.active {
        background-color: #3a3a3a;
        border-bottom-color: #7d4d32;
    }

    body .auth-form h3 {
        color: #c8a78b;
    }

    body .auth-input {
        background-color: #3a3a3a;
        color: #e0e0e0;
        border-color: #5a5a5a;
    }

    body .auth-input:focus {
        border-color: #7d4d32;
        box-shadow: 0 0 0 3px rgba(125, 77, 50, 0.2);
    }

    body .auth-submit-btn {
        background-color: #7d4d32;
    }

    body .auth-submit-btn:hover {
        background-color: #633a25;
    }

    body .auth-note {
        color: #b0b0b0;
    }

    body .auth-message {
        color: #c8a78b;
    }

    /* 复选框样式 - 深色模式 */
    body input[type="checkbox"] {
        accent-color: #7d4d32;
        background-color: #2a2a2a;
        border-color: #5a5a5a;
    }

    body input[type="checkbox"]:checked {
        background-color: #7d4d32;
    }

    /* 特定复选框样式 */
    body #show-completed,
    body .task-checkbox {
        accent-color: #7d4d32;
        background-color: #2a2a2a;
        border-color: #5a5a5a;
    }

    body .btn {
        background-color: #7d4d32;
        display: inline-block;
        line-height: 1.5;
        text-align: center;
        user-select: none;
    }

    body .btn:hover {
        background-color: #633a25;
    }

    /* 表格区域 - 深色模式 */
    body .table-section {
        background-color: rgba(40, 40, 40, 0.8);
        border-color: #5a5a5a;
    }

    body .table-section h2 {
        color: #c8a78b;
        border-bottom-color: #5a5a5a;
    }

    body .character-table {
        background-color: rgba(30, 30, 30, 0.7);
    }

    body .character-table th,
    body .character-table td {
        border-color: #5a5a5a;
    }

    body .character-table th {
        background-color: #3a3a3a;
        color: #c8a78b;
    }

    body .character-table tr:nth-child(even) {
        background-color: rgba(35, 35, 35, 0.7);
    }

    body .character-table tr:hover {
        background-color: rgba(50, 50, 50, 0.4);
    }

    body .character-table small {
        color: #999;
    }

    /* 隐藏的游逸旅闻斜体样式 - 深色模式 */
    body .hidden-travel {
        color: #c8a78b;
    }

    /* 区域高亮 - 深色模式 */
    body .region-mondstadt td:nth-child(5) {
        background-color: rgba(144, 238, 144, 0.1);
    }

    body .region-liyue td:nth-child(5) {
        background-color: rgba(251, 191, 36, 0.1);
    }

    body .region-inazuma td:nth-child(5) {
        background-color: rgba(167, 139, 250, 0.1);
    }

    body .region-sumeru td:nth-child(5) {
        background-color: rgba(34, 197, 94, 0.1);
    }

    body .region-fontaine td:nth-child(5) {
        background-color: rgba(147, 197, 253, 0.1);
    }

    body .region-natlan td:nth-child(5) {
        background-color: rgba(239, 68, 68, 0.1);
    }

    body .region-nordkala td:nth-child(5) {
        background-color: rgba(156, 163, 175, 0.1);
    }

    /* 完成任务样式 - 深色模式 */
    body .completed-task {
        background-color: rgba(167, 243, 208, 0.1);
    }

    body .completed-task td {
        color: #777;
    }

    /* 页脚 - 深色模式 */
    body .footer {
        color: #c8a78b;
        border-top-color: #5a5a5a;
    }

    input#auth-email {
        padding: 8px 12px;
        border: 1px solid #5a5a5a;
        border-radius: 4px;
        background-color: #2a2a2a;
        color: #e0e0e0;
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }

    input#auth-password {
        padding: 8px 12px;
        border: 1px solid #5a5a5a;
        border-radius: 4px;
        background-color: #2a2a2a;
        color: #e0e0e0;
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }

    /* 移动端样式 - 深色模式 */
    @media (max-width: 768px) {
        body .character-card {
            background-color: rgba(40, 40, 40, 0.8);
            border-color: #5a5a5a;
        }

        body .card-character {
            color: #c8a78b;
        }

        body .card-version {
            background-color: #3a3a3a;
            color: #c8a78b;
        }

        body .card-value {
            color: #e0e0e0;
        }

        body .card-value.hidden-travel {
            color: #c8a78b;
        }

        body .condition-item,
        body .extra-item {
            background-color: rgba(50, 50, 50, 0.2);
        }

        body .condition-item strong,
        body .extra-item strong {
            color: #c8a78b;
        }

        body .show-more-btn {
            background-color: #3a3a3a;
            color: #c8a78b;
        }

        body .show-more-btn:hover {
            background-color: #5a5a5a;
        }
    }

    /* 模态框样式 - 深色模式 */
    body .modal-content {
        background-color: #2a2a2a;
        border-color: #5a5a5a;
        color: #e0e0e0;
    }

    body .close {
        color: #888;
    }

    body .close:hover,
    body .close:focus {
        color: #ccc;
    }
}