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

body {
    min-height: 100vh;
    background: linear-gradient(145deg, #0b1120 0%, #19223c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    padding: 20px;
}

.timer-card {
    max-width: 700px;
    width: 100%;
    background: rgba(18, 25, 45, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 64px;
    padding: 32px 28px 42px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
}

.countdown-display {
    background: #0a0f1c;
    border-radius: 56px;
    padding: 28px 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 6px 14px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.timer-digits {
    font-family: 'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
    font-size: clamp(1.8rem, 7vw, 3.8rem);
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #eef2ff, #cbd5ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 8px;
    scrollbar-width: thin;
}
.timer-digits::-webkit-scrollbar {
    height: 4px;
}
@supports not (background-clip: text) {
    .timer-digits {
        color: #bbd9ff;
        text-shadow: 0 2px 5px #00000030;
    }
}

.timer-label {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: #8da2cf;
    margin-top: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.progress-section {
    margin: 10px 0 20px 0;
}
.progress-bar-bg {
    background-color: #1e293b;
    border-radius: 40px;
    height: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px #00000040;
}
.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #a855f7);
    border-radius: 40px;
    transition: width 0.05s linear;
    box-shadow: 0 0 6px #3b82f6;
}

.time-input-group {
    background: rgba(10, 15, 28, 0.6);
    border-radius: 48px;
    padding: 20px 18px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.input-fields {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.input-item {
    flex: 1;
    text-align: center;
    background: #0f172ad9;
    border-radius: 48px;
    padding: 8px 6px;
    backdrop-filter: blur(4px);
}
.input-item label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3d8;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.input-item input {
    width: 100%;
    background: #020617;
    border: none;
    padding: 12px 0;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    font-family: monospace;
    color: #e2e8ff;
    border-radius: 60px;
    outline: none;
    transition: all 0.2s;
    border: 1px solid #334155;
}
.input-item input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 8px #3b82f6;
    background: #0b1122;
}
.input-item input:disabled {
    opacity: 0.6;
    background: #1e2933;
    cursor: not-allowed;
}

.presets {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.preset-btn {
    background: #1e2a3e;
    border: none;
    padding: 8px 20px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #cbd5ff;
    cursor: pointer;
    transition: 0.2s;
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 2px black;
}
.preset-btn:hover:not(:disabled) {
    background: #2d3b55;
    color: white;
    transform: scale(0.97);
}
.preset-btn:active {
    transform: scale(0.95);
}

.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.home-btn-container {
    text-align: center;
    margin-top: 20px;
}
.btn-home {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3d8;
    padding: 10px 24px;
    border-radius: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    backdrop-filter: blur(4px);
}
.btn-home:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8ff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.btn {
    border: none;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    flex: 0 1 auto;
    min-width: 100px;
}
.btn-primary {
    background: linear-gradient(95deg, #2563eb, #4f46e5);
    color: white;
    box-shadow: 0 4px 12px #2563eb40;
}
.btn-primary:active {
    transform: scale(0.96);
}
.btn-secondary {
    background: #334155;
}
.btn-warning {
    background: #475569;
}
.btn:active {
    transform: scale(0.96);
}
.btn:disabled {
    opacity: 0.5;
    transform: none;
    cursor: not-allowed;
    filter: grayscale(0.1);
}

.toast-notify {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: #1e1f2c;
    backdrop-filter: blur(20px);
    color: #facc15;
    padding: 12px 28px;
    border-radius: 80px;
    font-weight: 600;
    font-size: 1rem;
    border-left: 5px solid #facc15;
    box-shadow: 0 12px 25px rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    font-family: monospace;
    letter-spacing: 1px;
}
.toast-notify.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* 倒计时结束弹窗样式 */
.time-up-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.time-up-modal.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(239, 68, 68, 0.3);
}
.time-up-modal.show .modal-content {
    transform: scale(1) translateY(0);
}
.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #facc15;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(250, 204, 21, 0.3);
}
.modal-message {
    font-size: 1rem;
    color: #94a3d8;
    margin-bottom: 30px;
    line-height: 1.6;
}
.modal-close-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}
.modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}
.modal-close-btn:active {
    transform: translateY(0);
}

.info-text {
    text-align: center;
    font-size: 0.7rem;
    color: #6a7a9e;
    margin-top: 24px;
    border-top: 1px dashed #2a3958;
    padding-top: 18px;
}
.key-hint {
    background: #1e293b60;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 30px;
    font-family: monospace;
    font-weight: bold;
}

@media (max-width: 550px) {
    .timer-card {
        padding: 20px 16px;
    }
    .timer-digits {
        font-size: clamp(1.3rem, 6vw, 2.5rem);
        letter-spacing: 1px;
    }
    .input-item input {
        font-size: 1.2rem;
        padding: 8px 0;
    }
    .btn {
        padding: 10px 20px;
        min-width: 75px;
    }
    .preset-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
}
