:root {
    color-scheme: dark;
    --accent: #3b82f6;
    --accent-strong: #2563eb;
    --surface: rgba(24, 28, 35, 0.78);
    --surface-strong: rgba(18, 24, 34, 0.9);
    --border: rgba(255, 255, 255, 0.12);
    --text: #f5f7fb;
    --muted: #9aa7bb;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

select,
select option,
#theme-select,
#theme-select option {
    color-scheme: dark;
    background-color: #111827;
    color: #f5f7fb;
}

select option,
#theme-select option {
    padding: 8px 10px;
}

#return-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 16px;
    font-size: 1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
    transition: all 0.2s ease;
    z-index: 1001;
    backdrop-filter: blur(16px);
}

#return-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.16);
}

body {
    font-family: 'Segoe UI', 'Google Sans', 'Roboto', sans-serif;
    margin: 0;
    padding: 20px 24px 40px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), transparent 38%), linear-gradient(320deg, rgba(15, 23, 42, 0.95), rgba(9, 14, 24, 1));
    color: var(--text);
    overflow: auto;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 32%);
    pointer-events: none;
}

body::-webkit-scrollbar {
    display: none;
}

.top-btn-group {
    position: fixed;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1200;
}

.top-btn-group button,
#fullscreen-btn,
#settings-btn {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(16px);
    transition: all 0.2s ease;
}

.top-btn-group button:hover,
#fullscreen-btn:hover,
#settings-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

#TimeAPI-status {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 999px;
    backdrop-filter: blur(12px);
}

.container {
    padding: 28px 32px 32px;
    max-width: 92%;
    width: min(1400px, 92vw);
    margin: 0 auto;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

h1 {
    font-size: 2.9rem;
    font-weight: 600;
    text-align: left;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.2px;
}

#room {
    font-size: 2.3rem;
    font-weight: 500;
    color: #8ec5ff;
    margin-left: 16px;
}

#message {
    font-size: 1.2rem;
    color: var(--muted);
    margin-bottom: 22px;
}

.content {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.left-column {
    width: 47%;
}

.right-column {
    width: 53%;
    font-size: 1.5rem;
}

.clock-section, .info-section, .right-column {
    background: var(--surface);
    padding: 22px 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.right-column th,
.right-column td,
.right-column label,
.right-column input {
    font-size: 1.65rem;
}
.right-column span {
    font-size: 1.20rem;
}

#current-time {
    font-size: 7.2rem;
    text-align: center;
    color: #ffffff;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.02em;
}

#current-subject, #exam-timing, #remaining-time, #status {
    font-size: 1.7rem;
    margin: 12px 0;
    text-align: left;
    color: #ffffff;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
    background: var(--surface-strong);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
}

th, td {
    padding: 10px 8px;
    font-size: 1.05rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

th {
    background: rgba(59, 130, 246, 0.14);
    color: #f8fbff;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.exam-status-tag {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
}

.exam-status-进行中 {
    background-color: rgba(34, 197, 94, 0.16);
    color: #79f2aa;
}

.exam-status-即将开始 {
    background-color: rgba(255, 179, 0, 0.18);
    color: #ffcf69;
}

.exam-status-已结束 {
    background-color: rgba(248, 113, 113, 0.16);
    color: #ff9d9d;
}

.exam-status-未开始 {
    background-color: rgba(251, 191, 36, 0.16);
    color: #ffd36a;
}

#settings-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 8, 18, 0.62);
    backdrop-filter: blur(10px);
}

#settings-modal-content {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.06));
    padding: 24px 28px;
    margin: 32px auto;
    border-radius: 24px;
    width: min(640px, 92vw);
    max-height: 76vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

#settings-modal-content::-webkit-scrollbar {
    width: 8px;
}

#settings-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.16);
    border-radius: 999px;
}

#settings-modal-content h3 {
    margin: 0 0 18px;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 600;
}

#settings-modal-content label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    font-size: 0.95rem;
    color: var(--text);
}

#settings-modal-content input[type="number"],
#settings-modal-content input[type="text"] {
    font-size: 1rem;
    padding: 11px 14px;
    margin: 4px 0 12px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    background-color: rgba(255,255,255,0.06);
    color: var(--text);
    transition: all 0.2s ease;
}

#settings-modal-content input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    position: relative;
    padding: 12px 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}

#save-settings-btn, #close-settings-btn {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

#save-settings-btn::before {
    content: "✓";
    font-size: 0.95rem;
}

#close-settings-btn::before {
    content: "✕";
    font-size: 0.95rem;
}

#save-settings-btn:hover, #close-settings-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.16);
}

.error-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(155, 28, 28, 0.88);
    color: #ffe5e5;
    padding: 14px 18px;
    border-radius: 16px;
    display: none;
    z-index: 10001;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.16);
    transition: .3s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(59, 130, 246, 0.75);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #f8fbff;
}

.config-file-container {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
}

.config-file-container input[type="file"] {
    max-width: 100%;
    width: auto;
    box-sizing: border-box;
    padding: 10px;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 12px;
    background-color: rgba(255,255,255,0.04);
    color: var(--text);
    cursor: pointer;
}

.config-file-container input[type="file"]::-webkit-file-upload-button {
    padding: 8px 14px;
    margin-right: 10px;
    background-color: rgba(255,255,255,0.08);
    color: var(--text);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.file-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.config-control-btn {
    margin-top: 14px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.config-control-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.theme-toggle-container {
    margin: 18px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#theme-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    background-color: #111827;
    color: #f5f7fb;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

#theme-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

#theme-select option {
    background-color: #111827;
    color: #f5f7fb;
    padding: 8px;
}

#theme-select option:hover,
#theme-select option:focus {
    background-color: #1f2937;
}

.reminder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 8, 18, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
    z-index: 9999;
}

.reminder-overlay.show {
    opacity: 1;
    visibility: visible;
}

.reminder-content {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.reminder-title {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1rem;
}

.reminder-subtitle {
    font-size: 1.8rem;
    color: #ffd36a;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-section {
    position: relative;
}

.info-toggle-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.info-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.paper-count-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 18px;
    min-width: 320px;
    max-width: 95vw;
    backdrop-filter: blur(18px);
}

.paper-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 1.1rem;
}

.count-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.count-btn-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 6px;
}

.count-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.count-btn:hover {
    background: rgba(59, 130, 246, 0.24);
    transform: translateY(-1px);
}

.count-control input {
    width: 60px;
    padding: 5px;
    font-size: 1rem;
    text-align: center;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
}

.settings-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(4,8,18,0.62);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#reminder-modal-content {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.06));
    padding: 24px 28px;
    border-radius: 24px;
    width: min(760px, 92vw);
    max-height: 76vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    z-index: 2100;
}

.reminder-button-group {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

#save-reminder-btn, #close-reminder-btn, #stop-audio-btn {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

#stop-audio-btn {
    background: rgba(248, 113, 113, 0.16);
    color: #ffd5d5;
}

#save-reminder-btn:hover, #close-reminder-btn:hover, #stop-audio-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.16);
}

@media (max-width: 900px) {
    .content {
        flex-direction: column;
    }

    .left-column, .right-column {
        width: 100%;
    }
}

@media (max-width: 700px) {
    body {
        padding: 16px 12px 24px;
    }

    .container {
        max-width: 100%;
        padding: 20px 16px;
    }

    .paper-count-container {
        right: 8px;
        bottom: 8px;
        padding: 12px;
        min-width: 220px;
    }

    #current-time {
        font-size: 4.2rem;
    }

    h1 {
        font-size: 1.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 700px) {
    #reminder-modal-content {
        width: 95vw;
        padding: 16px;
    }
}

.top-btn-group {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    z-index: 1002;
}

.top-btn-group button {
    padding: 10px 16px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #404040;
    color: #E6E1E5;
    border: none;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.top-btn-group button::before {
    font-family: 'Material Icons';
    font-size: 20px;
    margin-right: 8px;
}

.top-btn-group button:hover {
    background-color: #4A4A4A;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

#fullscreen-btn::before {
    content: "fullscreen";
}

#reminder-settings-btn::before {
    content: "notifications";
}

#settings-btn::before {
    content: "settings";
}

/* 修改提醒弹窗样式 */
.reminder-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}

#reminder-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #404040;
    padding: 32px 48px 32px 32px;
    border-radius: 28px;
    width: 800px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* 提醒表格样式 */
.reminder-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.reminder-table th,
.reminder-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #555555;
    font-size: 14px;
    line-height: 36px;
    vertical-align: middle;
}

.reminder-table th {
    font-weight: 500;
    color: #E6E1E5;
    font-size: 14px;
}

.reminder-table select,
.reminder-table input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    background-color: #332D41;
    color: #E6E1E5;
    border: 2px solid #4A4458;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* 提醒时间输入框独立样式 */
.reminder-table .reminder-time-input {
    width: 80px;
    height: 36px;
    padding: 0 12px;
    font-size: 1.1rem; /* 修复字体过大 */
    background-color: #332D41;
    color: #E6E1E5;
    border: 2px solid #4A4458;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-align: center;
}

.reminder-table .reminder-time-input:focus {
    outline: none;
    border-color: #D0BCFF;
    background-color: #4A4458;
}

.reminder-table button {
    height: 36px;
    min-width: 80px;
    padding: 0 16px;
    font-size: 14px;
    background-color: #404040;
    color: #E6E1E5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reminder-table select:focus,
.reminder-table input:focus {
    outline: none;
    border-color: #D0BCFF;
    background-color: #4A4458;
}

.reminder-table button {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #404040;
    color: #E6E1E5;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reminder-table button:hover {
    background-color: #4A4A4A;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.action-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    background-color: #404040;
    color: #E6E1E5;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.action-btn:hover {
    background-color: #4A4A4A;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.action-btn {
    height: 36px;
    font-size: 14px;
    line-height: 36px;
    padding: 0 16px;
}

/* 提醒表格的时间输入框样式 */
.reminder-table td input[type="number"] {
    width: 80px !important;
    text-align: center !important;
    padding: 0 8px !important;
    margin: 0 auto !important;
    display: block !important;
    -moz-appearance: textfield !important;
}

.reminder-table td input[type="number"]::-webkit-outer-spin-button,
.reminder-table td input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 确保修改其他输入框和选择框不受影响 */
.reminder-table td select {
    min-width: 200px;
}

.reminder-table td:nth-child(1) {
    width: 50%;
}

.reminder-table td:nth-child(2) {
    width: 15%;
}

.reminder-table td:nth-child(3) {
    width: 25%;
}

.reminder-table td:nth-child(4) {
    width: 10%;
}

.reminder-table .action-btn,
.action-btn {
    height: 36px;
    min-width: 80px;
    padding: 0 16px;
    font-size: 1rem;
    background-color: #404040;
    color: #E6E1E5;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reminder-table .action-btn:hover,
.action-btn:hover {
    background-color: #4A4A4A;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* 导出按钮样式 */
#export-config-btn {
    margin-top: 12px;
    padding: 12px 28px;
    background-color: #404040;
    color: #E6E1E5;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#export-config-btn:hover {
    background-color: #4A4A4A;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

