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

:root {
    --bg: #000000;
    --surface: #0a0a0a;
    --surface-hover: #141414;
    --border: #262626;
    --border-focus: #525252;
    --text-primary: #FFFFFF;
    --text-secondary: #a3a3a3;
    --text-caption: #525252;
    --danger: #f87171;
    --input-bg: #0a0a0a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 设置界面 ========== */
.setup-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.setup-view.hidden {
    display: none;
}

.input-section {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group label {
    font-size: 0.6875rem;
    color: var(--text-caption);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

.input-group input {
    width: 80px;
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 300;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.input-group input.error {
    border-color: var(--danger);
}

.presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.preset-btn {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-family: inherit;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
}

.preset-btn:hover {
    border-color: var(--border-focus);
    color: var(--text-primary);
    background: var(--surface-hover);
}

.error-message {
    color: var(--danger);
    font-size: 0.8125rem;
    text-align: center;
    min-height: 20px;
}

.controls {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 40px;
    border: 1px solid var(--text-primary);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--text-primary);
    color: var(--bg);
}

.btn:hover {
    background: #e5e5e5;
    border-color: #e5e5e5;
}

/* ========== 倒计时界面：纯黑背景 + 居中白色时间 ========== */
.countdown-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    align-items: center;
    justify-content: center;
}

.countdown-view.active {
    display: flex;
}

.countdown-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(6rem, 22vw, 18rem);
    font-weight: 200;
    color: #FFFFFF;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    user-select: none;
}

/* ========== 页脚 ========== */
.footer {
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-caption);
    letter-spacing: 0.02em;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer a:hover {
    color: var(--text-primary);
}

/* ========== 确认退出模态窗口 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.modal-overlay.visible {
    display: flex;
    opacity: 1;
}

.modal-overlay.fade-in {
    opacity: 1;
}

.modal {
    background: #FFFFFF;
    color: #000000;
    border-radius: 8px;
    padding: 32px;
    min-width: 280px;
    max-width: 360px;
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

.modal-overlay.visible .modal {
    transform: scale(1);
}

.modal-text {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
    color: #000000;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #000000;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.1s ease;
}

.modal-btn-confirm {
    background: #000000;
    color: #FFFFFF;
}

.modal-btn-confirm:hover {
    opacity: 0.8;
}

.modal-btn-cancel {
    background: #FFFFFF;
    color: #000000;
}

.modal-btn-cancel:hover {
    opacity: 0.8;
}

/* 响应式 - 手机 */
@media (max-width: 480px) {
    .setup-view {
        gap: 28px;
        padding: 16px;
    }

    .input-section {
        gap: 10px;
    }

    .input-group input {
        width: 68px;
        font-size: 1.25rem;
        padding: 10px 6px;
    }

    .presets {
        gap: 6px;
    }

    .preset-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
    }

    .controls {
        width: 100%;
    }

    .btn {
        flex: 1;
    }
}
