/**
 * 情绪气泡 - 样式表
 * 
 * 文件结构:
 * 1. CSS 变量定义
 * 2. 基础重置
 * 3. 背景效果 (星空/光晕)
 * 4. 布局容器
 * 5. 标题与文字
 * 6. 按钮组件
 * 7. 时间/主题选择器
 * 8. 气泡样式与动画
 * 9. 粒子效果
 * 10. 面板 (结果/统计)
 * 11. 响应式适配
 */

/* ===========================================
   1. CSS 变量定义
   =========================================== */
:root {
    /* 主题色 */
    --primary: #667eea;
    --primary-rgb: 102, 126, 234;
    --secondary: #764ba2;

    /* 背景色 */
    --bg-dark: #0a0a1a;
    --bg-mid: #1a1a3a;
    --bg-light: #0d1b2a;

    /* 文字色 */
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-hint: rgba(255, 255, 255, 0.35);

    /* 边框/分隔 */
    --border-light: rgba(255, 255, 255, 0.2);
    --border-lighter: rgba(255, 255, 255, 0.1);

    /* 尺寸 */
    --bubble-min-size: 55px;
    --bubble-size-range: 50px;
    --header-safe-zone: 80px;
    --footer-height: 120px;

    /* 动画时长 */
    --transition-fast: 0.15s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;

    /* 圆角 */
    --radius-sm: 2px;
    --radius-md: 15px;
    --radius-lg: 25px;
    --radius-xl: 50px;
    --radius-full: 50%;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-top: env(safe-area-inset-top, 0px);
}

/* ===========================================
   2. 基础重置
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-light) 100%);
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
}

/* ===========================================
   3. 背景效果 (星空/光晕)
   =========================================== */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: var(--radius-full);
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.glow {
    position: fixed;
    border-radius: var(--radius-full);
    filter: blur(80px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: float 15s ease-in-out infinite;
}

.glow-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 30px);
    }
}

/* ===========================================
   4. 布局容器
   =========================================== */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===========================================
   5. 标题与文字
   =========================================== */
/* 品牌组合 */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.brand-icon {
    width: 88px;
    height: 88px;
    margin-bottom: 0.8rem;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0;
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.5);
    font-weight: 200;
    letter-spacing: 0.5em;
    padding-left: 0.5em;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    text-align: center;
    max-width: 22rem;
    font-size: 1rem;
    line-height: 1.85;
    letter-spacing: 0.08em;
}

.subtitle-hint {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

/* ===========================================
   6. 按钮组件
   =========================================== */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
    outline: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* ===========================================
   7. 时间/主题选择器
   =========================================== */
.time-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.time-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 80px;
    font-family: inherit;
}

.time-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.theme-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.theme-btn.healing {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.theme-btn.forest {
    background: linear-gradient(135deg, #134E5E, #71B280);
}

.theme-btn.sunset {
    background: linear-gradient(135deg, #FF5122, #DD2476);
}

.theme-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

/* ===========================================
   8. 进度条与计时器
   =========================================== */
.progress-container {
    width: 200px;
    height: 4px;
    background: var(--border-lighter);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--primary);
    width: 0;
}

.timer-display {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ===========================================
   9. 气泡样式与动画
   =========================================== */
.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--footer-height));
    z-index: 10;
}

.bubble {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    cursor: pointer;
    pointer-events: auto;
    transition: transform var(--transition-fast) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(2px);
    opacity: 0;
    transform: scale(0.3);
}

/* 气泡入场动画（通过 JS 添加） */
.bubble.entering {
    animation: bubbleEnter 1.5s ease-out forwards;
    will-change: opacity, transform;
}

/* 气泡入场完成后的漂浮状态 */
.bubble.floating {
    opacity: 1;
    transform: scale(1);
    will-change: transform, opacity;
    animation:
        floatInPlace 6s ease-in-out infinite,
        bubblePulse 3s ease-in-out infinite;
}

/* 气泡入场动画 - 缓缓浮现 */
@keyframes bubbleEnter {
    0% {
        opacity: 0;
        transform: scale(0.4) translateY(25px);
    }

    15% {
        opacity: 0.2;
        transform: scale(0.5) translateY(20px);
    }

    30% {
        opacity: 0.4;
        transform: scale(0.65) translateY(14px);
    }

    50% {
        opacity: 0.65;
        transform: scale(0.8) translateY(8px);
    }

    70% {
        opacity: 0.85;
        transform: scale(0.92) translateY(3px);
    }

    85% {
        opacity: 0.95;
        transform: scale(0.98) translateY(0);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 气泡原地漂浮动画 */
@keyframes floatInPlace {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(15px, -10px) scale(1.03);
    }

    50% {
        transform: translate(-10px, -20px) scale(0.98);
    }

    75% {
        transform: translate(20px, -5px) scale(1.02);
    }
}

/* 气泡淡入（保留兼容） */
@keyframes bubbleFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 气泡脉冲 */
@keyframes bubblePulse {

    0%,
    100% {
        opacity: 0.85;
        box-shadow: 0 0 20px var(--bubble-color, rgba(102, 126, 234, 0.4)),
            inset 0 0 15px rgba(255, 255, 255, 0.3);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 35px var(--bubble-color, rgba(102, 126, 234, 0.6)),
            inset 0 0 20px rgba(255, 255, 255, 0.4);
    }
}

/* 气泡自然消失 */
.bubble.fading {
    animation: bubbleFadeOut 3s ease-out forwards !important;
    pointer-events: none;
}

@keyframes bubbleFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.6);
    }
}

/* 气泡可见状态 */
.bubble.visible {
    opacity: 1 !important;
}

/* 气泡悬停 */
.bubble:hover {
    transform: scale(1.12) !important;
    animation-play-state: paused;
}

/* 气泡按压 */
.bubble:active {
    transform: scale(0.85);
}

/* 气泡戳破动画 */
.bubble.popping {
    animation: pop 0.4s ease-out forwards !important;
}

@keyframes pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    30% {
        transform: scale(1.35);
        opacity: 0.8;
    }

    60% {
        transform: scale(1.1);
        opacity: 0.5;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* 气泡文字 */
.bubble-text {
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem;
    max-width: 80%;
    word-wrap: break-word;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    animation: textFloat 2s ease-in-out infinite;
}

@keyframes textFloat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ===========================================
   10. 粒子效果
   =========================================== */
.particle {
    position: absolute;
    border-radius: var(--radius-full);
    pointer-events: none;
    animation: particleFade 0.8s ease-out forwards;
    box-shadow: 0 0 6px currentColor;
}

@keyframes particleFade {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: translate(var(--tx), var(--ty)) scale(0.6) rotate(180deg);
        opacity: 0.7;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* ===========================================
   11. 面板样式
   =========================================== */
.panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.panel.hidden {
    display: none;
}

/* 开始面板：上（身份/配置）— 中（主行动/呼吸区）— 下（次要入口/拇指区） */
.start-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: center;
    width: 100%;
    max-width: 420px;
    min-height: 100dvh;
    min-height: 100svh;
    box-sizing: border-box;
    padding-top: max(1.25rem, calc(var(--safe-area-top) + 0.5rem));
    padding-bottom: max(1rem, calc(var(--safe-area-bottom) + 0.75rem));
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.start-panel-upper {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 占据竖向剩余空间，主按钮在视觉「稳定带」内垂直居中（非整页几何中心） */
.start-panel-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: clamp(7rem, 18vh, 11rem);
    padding: clamp(0.75rem, 3vh, 2rem) 0;
}

.start-panel-footer {
    flex: 0 0 auto;
    width: 100%;
    padding-top: 0.25rem;
}

/* 游戏面板 */
.play-panel {
    display: none;
}

/* 提前结束按钮 */
.btn-end-early {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-end-early:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-end-early:active {
    transform: scale(0.95);
}

/* 底部控制区 */
.play-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    background: linear-gradient(to top, rgba(10, 10, 26, 0.8), transparent);
}

/* 提示文字 */
.hint-top {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-hint);
    font-size: 0.8rem;
    z-index: 10;
}

/* 倒计时面板 */
.countdown-panel {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.countdown {
    display: none;
}

.countdown-halo {
    --halo-duration: 900ms;
    --halo-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    position: absolute;
    top: 50%;
    left: 50%;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.24) 0%, rgba(var(--primary-rgb), 0.1) 45%, rgba(var(--primary-rgb), 0.02) 62%, rgba(var(--primary-rgb), 0) 76%);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 0 44px rgba(var(--primary-rgb), 0.22), inset 0 0 26px rgba(255, 255, 255, 0.08);
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
    z-index: 1;
    filter: blur(0.2px);
    transition: transform var(--halo-duration) var(--halo-ease),
        opacity var(--halo-duration) var(--halo-ease),
        box-shadow var(--halo-duration) var(--halo-ease),
        border-color var(--halo-duration) ease;
}

.countdown-halo::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    pointer-events: none;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    opacity: 0.16;
    transform: scale(0.98);
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.14);
    background: conic-gradient(from 120deg,
            rgba(var(--primary-rgb), 0) 0deg,
            rgba(var(--primary-rgb), 0.18) 56deg,
            rgba(var(--primary-rgb), 0.03) 120deg,
            rgba(var(--primary-rgb), 0) 220deg,
            rgba(var(--primary-rgb), 0.16) 300deg,
            rgba(var(--primary-rgb), 0) 360deg);
    transition: transform var(--halo-duration) var(--halo-ease),
        opacity var(--halo-duration) var(--halo-ease),
        box-shadow var(--halo-duration) var(--halo-ease);
}

.countdown-halo.halo-neutral {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.2), inset 0 0 24px rgba(255, 255, 255, 0.07);
}

.countdown-halo.halo-inhale {
    transform: translate(-50%, -50%) scale(1.18);
    opacity: 0.92;
    border-color: rgba(var(--primary-rgb), 0.38);
    box-shadow: 0 0 56px rgba(var(--primary-rgb), 0.3), inset 0 0 34px rgba(255, 255, 255, 0.1);
}

.countdown-halo.halo-exhale {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.58;
    border-color: rgba(var(--primary-rgb), 0.22);
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.16), inset 0 0 18px rgba(255, 255, 255, 0.05);
}

.countdown-halo.halo-settle {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.42;
    border-color: rgba(var(--primary-rgb), 0.18);
    box-shadow: 0 0 18px rgba(var(--primary-rgb), 0.12), inset 0 0 12px rgba(255, 255, 255, 0.03);
}

.countdown-halo.halo-inhale::before {
    opacity: 0.25;
    transform: scale(1.03);
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.2);
}

.countdown-halo.halo-exhale::before {
    opacity: 0.12;
    transform: scale(0.95);
    box-shadow: 0 0 9px rgba(var(--primary-rgb), 0.12);
}

.countdown-halo.halo-settle::before {
    opacity: 0.08;
    transform: scale(0.93);
    box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.08);
}

.countdown-breathing {
    --breath-duration: 1200ms;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    z-index: 2;
    text-align: center;
    min-height: 1.6em;
    opacity: 0;
    position: absolute;
    top: calc(50% + 170px);
    left: 50%;
    transform: translateX(-50%);
    width: min(86vw, 360px);
}

.countdown-breathing.breathing-fade {
    animation: breathingTextFade var(--breath-duration) ease-out forwards;
}

@keyframes breathingTextFade {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    20% {
        opacity: 0.92;
        transform: translateX(-50%) translateY(0);
    }

    75% {
        opacity: 0.88;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-2px);
    }
}

.countdown-skip-btn {
    margin-top: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.58);
    z-index: 2;
    position: absolute;
    top: calc(50% + 218px);
    left: 50%;
    transform: translateX(-50%);
}

.countdown-skip-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* 结果面板 */
.result-panel {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.95);
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    padding-bottom: calc(2rem + var(--safe-area-bottom));
    overflow-y: auto;
}

.result-panel.show {
    display: flex;
    animation: fadeIn var(--transition-slow) ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.result-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.result-subtitle {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.emotion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    max-width: 500px;
    margin-bottom: 1.5rem;
}

.emotion-tag {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(236, 72, 153, 0.3));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.ai-suggestion {
    max-width: 450px;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-lighter);
}

.ai-suggestion-title {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.ai-suggestion-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.result-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* 统计面板 */
.stats-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    background: rgba(10, 10, 26, 0.98);
    z-index: 100;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stats-panel.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

/* 统计头部（避开刘海 / 灵动岛；与设置页 header 一致） */
.stats-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    padding: 1.2rem 1rem;
    padding-top: calc(1.2rem + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 0.1em;
}

.stats-close-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.stats-close-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.stats-settings-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.stats-settings-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.stats-settings-icon {
    display: block;
    flex-shrink: 0;
}

/* 可滚动内容区 */
.stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-overflow-scrolling: touch;
}

/* 时间筛选器 */
.stats-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn.active {
    background: rgba(var(--primary-rgb), 0.3);
    border-color: rgba(var(--primary-rgb), 0.5);
    color: var(--text-primary);
}

.filter-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.12);
}

/* 概览统计卡片 */
.stats-overview {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.stat-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1rem 0.5rem;
    text-align: center;
    min-width: 0;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.3rem;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

/* 统计区块通用样式 */
.stats-section-title {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 0.8rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
}

/* 趋势图表 */
.stats-trend {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    padding: 1rem;
}

.trend-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 80px;
    gap: 2px;
}

.trend-bar {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.trend-bar-fill {
    width: 80%;
    max-width: 16px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px 2px 0 0;
    min-height: 3px;
    transition: height 0.5s ease;
}

.trend-label {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 成就系统 */
.stats-achievements {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    padding: 1rem;
}

.achievements-summary {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.achievements-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.achievements-count strong {
    color: var(--primary);
    font-weight: 600;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.achievement-badge {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.8rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.achievement-badge.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.achievement-badge.unlocked {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: rgba(var(--primary-rgb), 0.3);
    animation: badgeGlow 2s ease-in-out infinite;
}

.achievement-badge:hover:not(.locked) {
    transform: scale(1.1);
    border-color: rgba(var(--primary-rgb), 0.5);
}

.achievement-badge .lock-icon {
    position: absolute;
    font-size: 0.6rem;
    bottom: 0.2rem;
    right: 0.2rem;
    opacity: 0.5;
}

@keyframes badgeGlow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(var(--primary-rgb), 0.2);
    }

    50% {
        box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.4);
    }
}

/* 下一个成就进度 */
.achievement-next {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.8rem;
    padding: 0.8rem;
    display: none;
}

.achievement-next.show {
    display: block;
}

.achievement-next-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.achievement-next-icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

.achievement-next-info {
    flex: 1;
}

.achievement-next-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.achievement-next-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
}

.achievement-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.achievement-progress-text {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
}

/* 成就详情弹窗 */
.achievement-detail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.achievement-detail.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.achievement-detail-card {
    background: rgba(20, 20, 40, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    max-width: 300px;
    width: 100%;
    text-align: center;
}

.achievement-detail-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.achievement-detail-name {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.achievement-detail-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.achievement-detail-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1.5rem;
}

.achievement-detail-status.unlocked {
    color: var(--primary);
}

.achievement-detail-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.achievement-detail-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

/* 成就解锁通知 */
.achievement-toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.achievement-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.achievement-toast-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.9), rgba(var(--primary-rgb), 0.7));
    padding: 0.8rem 1.2rem;
    border-radius: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(var(--primary-rgb), 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.achievement-toast-icon {
    font-size: 1.5rem;
    animation: toastBounce 0.6s ease;
}

@keyframes toastBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.achievement-toast-text {
    text-align: left;
}

.achievement-toast-title {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.achievement-toast-name {
    font-size: 0.95rem;
    color: white;
    font-weight: 600;
}

/* Top 情绪 */
.stats-top {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.top-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-emotion {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

.top-count {
    color: var(--primary);
    font-size: 0.75rem;
    opacity: 0.8;
}

.top-percent {
    display: none;
}

/* 分类统计 */
.stats-category {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.category-name {
    width: 50px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    text-align: right;
}

.category-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.category-count {
    width: 50px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* 设置页 */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    background: rgba(10, 10, 26, 0.98);
    z-index: 100;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 1rem;
    padding-top: calc(1.2rem + env(safe-area-inset-top, 0px));
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.settings-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 0.1em;
}

.settings-close-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.settings-close-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.settings-section {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-section-title {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.settings-section-desc {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.65;
    margin: 0 0 0.85rem 0;
}

.settings-section-desc strong {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
}

.settings-section-desc.muted {
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 0;
}

.settings-range-filter {
    margin-bottom: 0;
    justify-content: center;
}

.settings-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.settings-section-danger {
    border-color: rgba(255, 100, 100, 0.15);
}

.settings-clear-btn {
    width: 100%;
    text-align: center;
    padding: 0.65rem;
}

.settings-section-placeholder {
    opacity: 0.85;
}

.btn-text-danger {
    background: none;
    border: none;
    color: rgba(255, 100, 100, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
    font-family: inherit;
}

.btn-text-danger:hover {
    color: rgba(255, 100, 100, 0.9);
}

/* 空状态提示 */
.empty-tip {
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    font-size: 0.85rem;
    padding: 2rem 1rem;
}

/* ===========================================
   12. 主题变体
   =========================================== */
body.theme-minimal {
    background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
}

body.theme-minimal .title,
body.theme-minimal .timer-display,
body.theme-minimal .result-title {
    color: #e0e1dd;
    text-shadow: none;
}

body.theme-minimal .btn-secondary,
body.theme-minimal .time-btn {
    border-color: rgba(224, 225, 221, 0.3);
    color: #e0e1dd;
}

body.theme-minimal .bubble-text,
body.theme-minimal .emotion-tag,
body.theme-minimal .ai-suggestion-text {
    color: #e0e1dd;
    text-shadow: none;
}

body.theme-minimal .hint-top {
    color: #778da9;
}

/* ===========================================
   13. 响应式适配
   =========================================== */
@media (max-width: 600px) {
    .countdown-halo {
        width: 236px;
        height: 236px;
    }

    .countdown-breathing {
        top: calc(50% + 154px);
        font-size: 0.88rem;
    }

    .countdown-skip-btn {
        top: calc(50% + 198px);
    }

    .brand-icon {
        width: 70px;
        height: 70px;
    }

    .title {
        font-size: 2rem;
        letter-spacing: 0.38em;
        padding-left: 0.38em;
    }

    /* 首页略放宽可用宽度，减少挤压感 */
    .start-panel {
        max-width: 100%;
    }

    .timer-display {
        font-size: 2rem;
    }

    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .time-btn {
        padding: 0.5rem 1rem;
        min-width: 70px;
        font-size: 0.85rem;
    }

    .time-options {
        gap: 0.5rem;
    }

    .bubble-text {
        font-size: 0.75rem;
    }

    .result-panel {
        padding: 1rem;
        padding-bottom: calc(1rem + var(--safe-area-bottom));
    }

    .ai-suggestion {
        padding: 1rem;
    }

    /* 统计面板响应式 */
    .stats-content {
        padding: 1rem;
    }

    .stats-overview {
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.8rem 0.3rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stats-trend,
    .stats-top,
    .stats-category {
        max-width: 100%;
    }

    .trend-chart {
        height: 60px;
        gap: 1px;
    }

    .trend-bar-fill {
        max-width: 12px;
    }

    .trend-label {
        font-size: 0.45rem;
    }

    .category-name {
        width: 45px;
        font-size: 0.7rem;
    }

    .category-count {
        width: 35px;
        font-size: 0.65rem;
    }

    /* 首页：小屏隐藏主题圆点面板，仅用左右滑切换 */
    .start-settings .home-theme-picker {
        display: none;
    }

    /* 小屏显示「整页左右滑切换主题」提示 */
    .theme-swipe-hint {
        display: block;
        text-align: center;
    }
}

@media (max-width: 360px) {
    .brand-icon {
        width: 60px;
        height: 60px;
    }

    .title {
        font-size: 1.8rem;
        letter-spacing: 0.3em;
    }

    .subtitle {
        font-size: 0.8rem;
    }
}

/* ===========================================
   每日提醒
   =========================================== */
.reminder-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.reminder-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.3rem;
}

/* 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: rgba(255, 215, 0, 0.6);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* 时间选择 */
.reminder-time-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reminder-time-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: #ffd700;
    font-size: 1rem;
    color-scheme: dark;
}

.reminder-time-input:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.5);
}

/* ===========================================
   首页布局优化
   =========================================== */

/* 开始面板头部：略收紧与下方的距离，整体作为「引入」区块 */
.start-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

/*
 * 标题 vs 主旨：二者首字重复（念起 / 念起即觉…），若间距过小易产生「念错了」的错觉。
 * 略增留白 + 顶部分隔线，区分「名」与「句」，减轻重复字带来的别扭感。
 */
.start-header .title {
    margin-bottom: 0;
}

.start-header .subtitle {
    margin-top: 1.35rem;
    margin-bottom: 1rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    font-size: 0.92rem;
    line-height: 2;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
}

/* 设置区域：与主按钮分离，形成清晰两段式任务流 */
.start-settings {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    width: 100%;
    max-width: 320px;
    margin-bottom: 0;
}

.setting-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.setting-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* 整页滑动换主题提示（仅小屏显示，见 @media max-width:600px） */
.theme-swipe-hint {
    display: none;
    margin: 0.45rem 0 0;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.06em;
}

/* 主题选项 */
.theme-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.theme-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    opacity: 0.6;
}

.theme-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.theme-btn.active {
    opacity: 1;
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* 时间选项 */
.time-options {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.time-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9rem;
}

/* 大按钮：主行动略加重对比，减少与次要链的视觉竞争 */
.btn-large {
    padding: 1.05rem 3.25rem;
    font-size: 1.2rem;
    margin-bottom: 0;
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.35);
    letter-spacing: 0.12em;
}

/* 辅助按钮组：底部链接，间距分隔（无竖线，避免窄屏折行时错位） */
.start-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    padding-top: 0.35rem;
}

.start-actions .btn-text {
    padding: 0.55rem 0.35rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.42);
}

.btn-text {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.btn-text:hover {
    color: rgba(255, 215, 0, 0.8);
}

.btn-text:focus-visible {
    outline: 1px solid rgba(255, 215, 0, 0.6);
    border-radius: 0.4rem;
}

/* 提醒模态框 */
.reminder-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.95);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.reminder-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.reminder-modal-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 300px;
    text-align: center;
    position: relative;
}

.reminder-close-btn {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem;
    transition: color 0.3s ease;
    line-height: 1;
}

.reminder-close-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.reminder-modal-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.reminder-modal-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.reminder-unsupported-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.48);
    line-height: 1.55;
    margin: 0 0 1.25rem;
    text-align: center;
}

.reminder-settings {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    padding: 0.5rem;
    overflow: hidden;
}

.reminder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: transparent;
    border-radius: 0.6rem;
    transition: background 0.2s ease;
}

.reminder-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.reminder-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.reminder-toggle {
    flex-shrink: 0;
}

.reminder-modal .reminder-time-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: transparent;
    border-radius: 0.6rem;
    transition: background 0.2s ease;
}

.reminder-modal .reminder-time-wrapper:hover {
    background: rgba(255, 255, 255, 0.03);
}

.reminder-time-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
    color: var(--primary);
    font-size: 0.95rem;
    color-scheme: dark;
    font-family: inherit;
}

.reminder-time-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===========================================
   Toast 提示
   =========================================== */
.toast-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
    padding: 2rem;
}

.toast {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 35, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    max-width: 320px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    animation: toastEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.leaving {
    animation: toastLeave 0.3s ease-out forwards;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes toastLeave {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
}

.toast-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: iconPop 0.5s ease-out 0.1s both;
}

@keyframes iconPop {
    from {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    to {
        transform: scale(1);
    }
}

.toast-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.toast-message {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.toast-message .highlight {
    color: var(--primary);
    font-weight: 500;
}

.toast-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.toast-backdrop.leaving {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}