:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --success: #10b981;
    --warning: #f59e0b;
    --accent: #f43f5e;
    --gold: #fbbf24;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --bg-gradient: radial-gradient(circle at 0% 0%, #0f172a 0%, #1e293b 100%);
    --modal-bg: #1e293b;
    --font-main: 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-main);
    margin: 0;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- 核心布局 (Grid System) --- */
.layout {
    display: grid;
    grid-template-columns: 340px 1fr 320px;
    grid-template-rows: auto auto;
    gap: 24px;
    max-width: 1400px;
    width: 100%;
}

@media (max-width: 1200px) {
    .layout {
        grid-template-columns: 1fr 1fr;
    }

    .card-side {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

/* --- 玻璃拟态卡片 --- */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    border-color: rgba(0, 0, 0, 0.0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

h2 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 20px 0;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- 组件样式 --- */
.btn-action {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: #0f172a;
    font-weight: 700;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-action:hover {
    box-shadow: 0 0 20px var(--primary);
    transform: scale(1.02);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: 0.3s;
    width: 100%;
    text-align: center;
    /* 统一居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(244, 63, 94, 0.05);
}

/* 返回按钮悬停变红 */

.list-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: 0.3s;
}

.list-item:hover {
    border-color: var(--border);
    background: var(--glass-hover);
}

/* --- 番茄钟 --- */
.pomo-container {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    border: 1px solid var(--border);
}

#pomo-timer {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 30px currentColor;
    opacity: 0.9;
    margin: 10px 0;
    line-height: 1;
}

/* --- 数据看板 --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1px 1fr 1px 1fr;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    text-align: center;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

/* --- 弹窗体系 --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-card {
    width: 400px;
    background: var(--modal-bg);
    border: 1px solid var(--primary);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
    animation: modalIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    color: var(--text-main);
    margin-bottom: 16px;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
    font-family: var(--font-main);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 242, 254, 0.1);
}

/* --- Toast --- */
#toast-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s, fadeOut 0.3s 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* --- 排行榜 & 成就 --- */
.rank-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.rank-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
}

.top-1 {
    background: var(--gold);
    color: #000;
    box-shadow: 0 0 15px var(--gold);
}

.ach-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.ach-item {
    text-align: center;
    padding: 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    opacity: 0.3;
    filter: grayscale(1);
    transition: all 0.4s ease;
    position: relative;
    cursor: help;
}

.ach-item.active {
    opacity: 1;
    filter: grayscale(0);
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

/* Tooltip 样式 */
.ach-item::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: var(--primary);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    font-size: 0.65rem;
    white-space: nowrap;
    width: max-content;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.ach-item:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.floating-pet-sprite {
    width: 128px;
    height: 128px;
    background-image: url('/pet/img/cat_OrangeTabby.png');
    background-size: 400% 400%; /* 4 columns, 4 rows */
    background-position: 0 0;
    z-index: 2;
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
    transition: filter 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-pet:active .floating-pet-sprite {
    transform: scale(0.9) translateY(10px);
}

/* 点击互动的跳跃动画 */
@keyframes petJump {
    0%, 100% { transform: translateY(0) scale(1.15); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* --- V3.0 终极系统视觉 --- */
.header-v3 {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.hp-bar-container {
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.hp-bar-fill {
    height: 100%;
    width: 100%;
    /* 默认全满 */
    background: linear-gradient(90deg, #f43f5e, #00f2fe);
    box-shadow: 0 0 15px var(--primary);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-monitor-msg {
    background: rgba(0, 242, 254, 0.05);
    border-left: 3px solid var(--primary);
    padding: 12px 18px;
    margin-bottom: 25px;
    border-radius: 4px 12px 12px 4px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    line-height: 1.5;
    animation: pulseGlow 4s infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 242, 254, 0.05);
        background: rgba(0, 242, 254, 0.05);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
        background: rgba(0, 242, 254, 0.08);
    }
}

/* 生命值过低警告 */
.hp-low {
    animation: hpDanger 0.5s infinite;
}

@keyframes hpDanger {

    0%,
    100% {
        border-color: var(--accent);
    }

    50% {
        border-color: #fff;
        box-shadow: 0 0 20px var(--accent);
    }
}

.hp-bar-fill.danger {
    background: linear-gradient(90deg, #b91c1c, #f43f5e);
    box-shadow: 0 0 15px var(--accent);
}

/* --- Workout Modal --- */
.workout-step-badge {
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.2);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--primary);
}

.workout-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    transition: all 0.35s ease;
}

.workout-dot.active {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    transform: scale(1.35);
}

.workout-dot.done {
    background: var(--success);
}

.workout-info-box {
    background: rgba(0, 242, 254, 0.04);
    border: 1px solid rgba(0, 242, 254, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

#workout-ring-progress {
    transition: stroke-dashoffset 1s linear;
}

/* --- 🔥 Streak 连续打卡 --- */
.streak-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 20px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 16px;
    animation: streakGlow 3s infinite;
}

@keyframes streakGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.1); }
    50% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.25); }
}

.streak-fire {
    font-size: 2rem;
    display: inline-block;
}

.streak-fire.active {
    animation: fireBounce 1s infinite;
}

.streak-fire.dim {
    filter: grayscale(0.6);
    opacity: 0.5;
}

@keyframes fireBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-5deg); }
    50% { transform: scale(1.05) rotate(3deg); }
    75% { transform: scale(1.2) rotate(-3deg); }
}

.streak-count {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--gold);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.streak-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 600;
}

/* --- ⚙️ 主题/文风选择按钮 --- */
.theme-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.theme-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 242, 254, 0.06);
}

.theme-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 242, 254, 0.1);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
    font-weight: 700;
}

/* --- 主题过渡动画 --- */
:root {
    transition: --primary 0.4s, --secondary 0.4s, --bg-gradient 0.6s;
}

body, .glass-card, .modal-card, .btn-action, .btn-outline, h2, .status-monitor-msg {
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* --- 🌬️ 呼吸训练动画 --- */
.breath-circle-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.breath-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.15), rgba(0, 242, 254, 0.03));
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: transform 4s ease-in-out, background 4s ease-in-out, box-shadow 4s ease-in-out, border-color 0.5s;
}

.breath-circle.inhale {
    transform: scale(1.6);
    background: radial-gradient(circle, rgba(0, 242, 254, 0.35), rgba(0, 242, 254, 0.08));
    box-shadow: 0 0 50px rgba(0, 242, 254, 0.3);
}

.breath-circle.hold {
    transform: scale(1.6);
    background: radial-gradient(circle, rgba(251, 191, 36, 0.25), rgba(251, 191, 36, 0.05));
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.2);
    transition: background 0.5s, border-color 0.5s, color 0.5s, box-shadow 0.5s;
}

.breath-circle.exhale {
    transform: scale(1);
    background: radial-gradient(circle, rgba(79, 172, 254, 0.12), rgba(79, 172, 254, 0.02));
    border-color: var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.15);
    transition: transform 8s ease-in-out, background 8s ease-in-out, box-shadow 8s ease-in-out, border-color 0.5s, color 0.5s;
}

/* --- 📋 每日任务侧边栏 --- */
.task-sidebar {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.task-item {
    margin-bottom: 15px;
}

.task-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 6px;
    color: var(--text-dim);
}

.task-progress-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--secondary), var(--primary));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.task-progress-fill.done {
    background: linear-gradient(to right, var(--success), #10b981);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* --- 📅 GitHub 热力日历 --- */
.heatmap-wrapper {
    overflow-x: auto;
    padding: 10px 0;
}

.heatmap-grid {
    display: grid;
    grid-template-rows: repeat(7, 13px);
    grid-auto-flow: column;
    grid-auto-columns: 13px;
    gap: 3px;
    width: fit-content;
}

.heatmap-cell {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
    cursor: crosshair;
    position: relative;
}

.heatmap-cell:hover { outline: 1px solid var(--primary); z-index: 1; }
.heatmap-cell.level-1 { background: rgba(0, 242, 254, 0.15); }
.heatmap-cell.level-2 { background: rgba(0, 242, 254, 0.35); }
.heatmap-cell.level-3 { background: rgba(0, 242, 254, 0.55); }
.heatmap-cell.level-4 { background: rgba(0, 242, 254, 0.85); }
.heatmap-cell.empty { background: transparent; }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.6rem;
    color: var(--text-dim);
    justify-content: flex-end;
}

.heatmap-legend .heatmap-cell { width: 11px; height: 11px; cursor: default; }

/* --- 🎵 环境音效按钮 --- */
.ambient-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.ambient-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.ambient-btn.active {
    border-color: var(--secondary);
    color: var(--secondary);
    background: rgba(79, 172, 254, 0.12);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.2);
    animation: soundPulse 2s infinite;
}

@keyframes soundPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(79, 172, 254, 0.15); }
    50% { box-shadow: 0 0 18px rgba(79, 172, 254, 0.35); }
}

/* --- 🤖 AI 每日日报 --- */
.brief-stat-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}

.brief-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    padding: 12px 18px;
    min-width: 70px;
}

.brief-val {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1;
}

.brief-lbl {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.brief-insight {
    background: rgba(0, 242, 254, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 4px 12px 12px 4px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 10px;
    text-align: left;
    line-height: 1.5;
}

/* --- 👫 健康搭子 --- */
.partner-code-box {
    display: inline-block;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 8px;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-left: 6px;
    transition: 0.2s;
}

.partner-code-box:hover {
    background: rgba(0, 242, 254, 0.15);
}

.partner-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.partner-card:hover {
    border-color: rgba(0, 242, 254, 0.25);
}

/* --- ⚡ 智能自适应 --- */
.adaptive-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 0.82rem;
}

/* ─── ⬜ 亮色主题专项覆盖 ────────────────────────────────────────────── */
body[data-theme="light"] {
    color: var(--text-main);
}

body[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .glass-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 0 40px rgba(37, 99, 235, 0.1);
}

body[data-theme="light"] .modal-overlay {
    background: rgba(241, 245, 249, 0.85);
}

body[data-theme="light"] .modal-card {
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.12);
}

body[data-theme="light"] input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

body[data-theme="light"] input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

body[data-theme="light"] input::placeholder {
    color: #94a3b8;
}

body[data-theme="light"] .pomo-container {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
}

body[data-theme="light"] .cv-container {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(37, 99, 235, 0.15) !important;
}

body[data-theme="light"] .list-item {
    background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .list-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .rank-row {
    border-color: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .ach-item {
    background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .ach-item.active {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.2);
}

body[data-theme="light"] .ach-item::after {
    background: rgba(255, 255, 255, 0.97);
    color: var(--primary);
    border-color: var(--primary);
}

body[data-theme="light"] .status-monitor-msg {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--primary);
}

body[data-theme="light"] .stats-grid {
    background: rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .workout-info-box {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
}

body[data-theme="light"] .workout-step-badge {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.2);
}

body[data-theme="light"] .streak-container {
    background: rgba(251, 191, 36, 0.08);
}

body[data-theme="light"] .brief-stat {
    background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .brief-insight {
    background: rgba(37, 99, 235, 0.06);
}

body[data-theme="light"] .partner-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .adaptive-row {
    background: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .heatmap-cell {
    background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.96);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .theme-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
}

body[data-theme="light"] .theme-btn:hover,
body[data-theme="light"] .theme-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
}

body[data-theme="light"] .ambient-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
}

body[data-theme="light"] #pomo-timer {
    color: var(--primary);
    text-shadow: none;
}

/* ─── 🌿 森林主题专项覆盖 ────────────────────────────────────────────── */
body[data-theme="forest"] .glass-card {
    background: rgba(5, 46, 22, 0.5);
    border-color: rgba(16, 185, 129, 0.15);
}
body[data-theme="forest"] .glass-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.1);
}
body[data-theme="forest"] .modal-overlay {
    background: rgba(2, 20, 10, 0.85);
}
body[data-theme="forest"] .modal-card {
    background: var(--modal-bg);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.15);
}
body[data-theme="forest"] input {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--text-main);
}
body[data-theme="forest"] input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}
body[data-theme="forest"] .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
}
body[data-theme="forest"] .toast {
    background: rgba(5, 46, 22, 0.95);
    border-color: rgba(16, 185, 129, 0.3);
}
body[data-theme="forest"] .theme-btn:hover,
body[data-theme="forest"] .theme-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.12);
}
body[data-theme="forest"] .ambient-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.12);
}
body[data-theme="forest"] .streak-container {
    background: rgba(16, 185, 129, 0.08);
}
body[data-theme="forest"] .brief-insight {
    background: rgba(16, 185, 129, 0.06);
    border-left-color: var(--primary);
    color: var(--primary);
}
body[data-theme="forest"] .ach-item.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

/* ─── 🌊 深海主题专项覆盖 ────────────────────────────────────────────── */
body[data-theme="ocean"] .glass-card {
    background: rgba(12, 10, 26, 0.5);
    border-color: rgba(167, 139, 250, 0.15);
}
body[data-theme="ocean"] .glass-card:hover {
    border-color: rgba(244, 114, 182, 0.4);
    box-shadow: 0 0 40px rgba(167, 139, 250, 0.1);
}
body[data-theme="ocean"] .modal-overlay {
    background: rgba(5, 4, 14, 0.85);
}
body[data-theme="ocean"] .modal-card {
    background: var(--modal-bg);
    border-color: rgba(244, 114, 182, 0.5);
    box-shadow: 0 20px 60px rgba(167, 139, 250, 0.15);
}
body[data-theme="ocean"] input {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(167, 139, 250, 0.2);
    color: var(--text-main);
}
body[data-theme="ocean"] input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.12);
}
body[data-theme="ocean"] .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(244, 114, 182, 0.08);
}
body[data-theme="ocean"] .toast {
    background: rgba(12, 10, 26, 0.95);
    border-color: rgba(167, 139, 250, 0.3);
}
body[data-theme="ocean"] .theme-btn:hover,
body[data-theme="ocean"] .theme-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(244, 114, 182, 0.1);
}
body[data-theme="ocean"] .ambient-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(244, 114, 182, 0.1);
}
body[data-theme="ocean"] .streak-container {
    background: rgba(244, 114, 182, 0.08);
}
body[data-theme="ocean"] .brief-insight {
    background: rgba(244, 114, 182, 0.06);
    border-left-color: var(--primary);
    color: var(--primary);
}
body[data-theme="ocean"] .ach-item.active {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.35);
}

/* ─── 🐾 健康小怪兽 ─────────────────────────────────────────────────── */
#health-pet-widget {
    transition: all 0.3s ease;
}
#health-pet-widget:hover {
    border-color: var(--primary) !important;
    background: rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-2px);
}
@keyframes petBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.05); }
}
@keyframes petShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}
@keyframes petSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ─── 🏅 隐藏成就解锁动画 ───────────────────────────────────────────── */
@keyframes achieveUnlock {
    0% { transform: scale(0.5) rotate(-15deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.ach-item.just-unlocked {
    animation: achieveUnlock 0.7s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    box-shadow: 0 0 20px var(--gold);
}
.ach-item[data-hidden="true"]:not(.active) {
    opacity: 0.4;
    filter: grayscale(1);
}
.ach-item[data-hidden="true"]:not(.active) .ach-emoji {
    filter: blur(3px);
}

/* ─── 🌙 夜间免打扰时间选择器 ───────────────────────────────────────────── */
.quiet-time-input {
    width: auto;
    padding: 6px 10px;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    outline: none;
    transition: 0.25s;
    margin-bottom: 0;
    cursor: pointer;
}

.quiet-time-input:focus,
.quiet-time-input:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.1);
}

/* WebKit 时间选择器图标着色 */
.quiet-time-input::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.5);
    cursor: pointer;
}

body[data-theme="light"] .quiet-time-input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--primary);
}

body[data-theme="light"] .quiet-time-input::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.5;
}

/* ─── 🧭 顶部导航栏 ─────────────────────────────────────────────────────── */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 18, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}

.top-nav-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 38px;
    max-width: 1400px;
    margin: 0 auto;
}

.top-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.top-nav-link:hover {
    background: rgba(0, 242, 254, 0.08);
    color: var(--primary);
}

body[data-theme="light"] .top-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .top-nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

/* ─── 🌐 页脚 ───────────────────────────────────────────────────────────── */
.site-footer {
    max-width: 1400px;
    width: 100%;
    margin: 10px auto 0;
    padding: 18px 25px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.footer-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.25s;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-sep {
    color: var(--border);
    font-size: 0.75rem;
}

.footer-text {
    color: var(--text-dim);
    font-size: 0.75rem;
    opacity: 0.7;
}

.footer-sub {
    font-size: 0.62rem;
    color: var(--text-dim);
    opacity: 0.4;
}

.footer-donate-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.25s;
    font-family: var(--font-main);
}

.footer-donate-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(251, 191, 36, 0.06);
}

/* 亮色主题下的页脚 */
body[data-theme="light"] .site-footer {
    border-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .footer-donate-btn {
    background: none;
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
}

body[data-theme="light"] .footer-donate-btn:hover {
    border-color: #d97706;
    color: #d97706;
}

/* ─── 🌦️ P5 环境感知天气栏 ──────────────────────────────────────────────── */
.weather-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.weather-bar:hover {
    border-color: rgba(0, 242, 254, 0.3);
}

.weather-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.weather-tip {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-align: right;
    line-height: 1.4;
}

/* 各主题天气栏适配 */
body[data-theme="light"] .weather-bar {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}
body[data-theme="forest"] .weather-bar {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.15);
}
body[data-theme="ocean"] .weather-bar {
    background: rgba(167, 139, 250, 0.06);
    border-color: rgba(167, 139, 250, 0.15);
}

/* ─── 📐 布局修正：右侧排行榜对齐顶部 ──────────────────────────────────── */
.card-right {
    align-self: start;
}

/* ─── 🖥️ 桌面版下载横幅 ──────────────────────────────────────────────────── */
.download-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 25px 16px;
    flex-wrap: wrap;
}

.download-btn-exe {
    display: inline-flex;
    align-items: center;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #0f172a;
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: 10px;
    text-decoration: none;
    transition: box-shadow 0.25s, transform 0.25s;
    box-shadow: 0 4px 18px rgba(0, 242, 254, 0.25);
    letter-spacing: 0.3px;
}

.download-btn-exe:hover {
    box-shadow: 0 6px 28px rgba(0, 242, 254, 0.45);
    transform: translateY(-2px);
}

.download-btn-release {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.78rem;
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.25s, color 0.25s;
}

.download-btn-release:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 亮色主题适配 */
body[data-theme="light"] .download-btn-exe {
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.25);
}
body[data-theme="light"] .download-btn-exe:hover {
    box-shadow: 0 6px 28px rgba(37, 99, 235, 0.4);
}
body[data-theme="light"] .download-btn-release {
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
}
body[data-theme="light"] .download-btn-release:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 森林主题 */
body[data-theme="forest"] .download-btn-exe {
    color: #052e16;
}
/* 深海主题 */
body[data-theme="ocean"] .download-btn-exe {
    color: #0c0a1a;
}

/* ─── 🐾 悬浮互动宠物 (Standalone Floating Pet) ──────────────────────── */
.floating-pet {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    z-index: 1000;
    cursor: grab;
}
.floating-pet:active { cursor: grabbing; }

.pet-shadow {
    position: absolute;
    bottom: -10px;
    width: 50px;
    height: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    filter: blur(4px);
    z-index: 1;
    animation: shadowScale 4s ease-in-out infinite;
}

.pet-speech-bubble {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--primary);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 12px 12px 12px 2px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.2);
}

.pet-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: -1px;
    border-width: 6px 6px 0 0;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
}

.floating-pet.show-speech .pet-speech-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pet-hp-container {
    width: 60px;
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    margin-top: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.pet-hp-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--success));
    width: 20%;
    transition: width 0.8s ease;
    border-radius: 6px;
}

@keyframes petFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes shadowScale {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(0.7); opacity: 0.3; }
}

/* ─── 🛒 猫咪商店 ──────────────────────────────────────────────────────── */
.shop-cat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}
.shop-cat-card:hover {
    border-color: var(--primary);
    background: rgba(0,242,254,0.06);
    transform: translateY(-2px);
}
.shop-cat-card.selected {
    border-color: var(--success);
    background: rgba(16,185,129,0.08);
    box-shadow: 0 0 12px rgba(16,185,129,0.2);
}

/* ─── 🐟 小鱼干币收支明细 ──────────────────────────────────────────────────── */
.coin-log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.8rem;
}
.coin-log-item:last-child { border-bottom: none; }
.coin-log-type { flex: 1; color: var(--text-dim); }
.coin-log-date { flex: 1; text-align: center; color: var(--text-dim); font-size: 0.7rem; }
.coin-log-amount { flex: 0 0 80px; text-align: right; font-weight: 700; font-family: var(--font-mono); }
.coin-income  { color: #10b981; }
.coin-expense { color: #f43f5e; }
