/* 定义现代化微光配色和玻璃质感变量 */
:root {
    --bg-dark: #0f0a1c;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    
    /* 专注模式颜色 */
    --focus-glow: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, rgba(79, 70, 229, 0.05) 50%, transparent 100%);
    --focus-accent-1: #c084fc;
    --focus-accent-2: #6366f1;
    
    /* 休息模式颜色 */
    --break-glow: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11 0.05) 50%, transparent 100%);
    --break-accent-1: #f87171;
    --break-accent-2: #fb923c;
    
    --transition-speed: 0.8s;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* 背景流动发光效果 */
.background-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    transition: background var(--transition-speed) ease;
    animation: pulseGlow 10s infinite alternate ease-in-out;
}

.bg-glow-focus {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.1) 50%, transparent 80%);
}

.bg-glow-break {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, rgba(251, 146, 60, 0.1) 50%, transparent 80%);
}

@keyframes pulseGlow {
    0% {
        transform: translate(-10%, -10%) scale(1);
    }
    100% {
        transform: translate(10%, 10%) scale(1.1);
    }
}

/* 核心毛玻璃容器 */
.glass-container {
    width: 90%;
    max-width: 400px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 32px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border-color var(--transition-speed) ease;
}

/* 顶部 Header */
.app-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--focus-accent-1);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--focus-accent-1);
    transition: background 0.5s, box-shadow 0.5s;
}

.sound-toggle {
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.sound-toggle svg {
    width: 18px;
    height: 18px;
}

.sound-muted .icon-volume {
    opacity: 0.5;
}

/* 计时器圆环区域 */
.timer-section {
    position: relative;
    margin-bottom: 30px;
}

.timer-circle-wrap {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bar {
    transition: stroke-dashoffset 0.3s linear, stroke 0.5s ease;
}

.timer-display-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.timer-mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--focus-accent-1);
    margin-bottom: 5px;
    transition: color 0.5s ease;
}

.timer-countdown {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.timer-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* 按钮区 */
.controls-section {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-bottom: 35px;
}

.btn {
    border: none;
    outline: none;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    flex-grow: 1;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--focus-accent-2) 0%, var(--focus-accent-1) 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    gap: 10px;
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(99, 102, 241, 0.6);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-secondary:disabled, .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn svg {
    width: 20px;
    height: 20px;
}

/* 历史卡片 */
.history-section {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.section-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: background 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 休息模式下的配色切换 */
body.mode-break {
    background-color: #170a0a;
}

body.mode-break .logo-dot {
    background: var(--break-accent-1);
    box-shadow: 0 0 10px var(--break-accent-1);
}

body.mode-break .timer-mode-label {
    color: var(--break-accent-1);
}

body.mode-break .btn-primary {
    background: linear-gradient(135deg, var(--break-accent-2) 0%, var(--break-accent-1) 100%);
    box-shadow: 0 10px 20px -10px rgba(239, 68, 68, 0.4);
}

body.mode-break .btn-primary:hover:not(:disabled) {
    box-shadow: 0 15px 25px -10px rgba(239, 68, 68, 0.6);
}
