/* ============================================================
   学霸养成之路 - 主样式
   美学方向：阳光花园（PvZ 草坪 + 童趣 + 暖色调）
   目标用户：6-7 岁一年级孩子（大字体、大按钮、强对比）
   ============================================================ */

/* ===== CSS 变量 ===== */
:root {
    /* 主色：草坪绿系 */
    --grass-primary: #6BBF59;
    --grass-deep: #4A8B3D;
    --grass-dark: #2D5016;
    --grass-light: #A8D88A;

    /* 强调色：阳光黄系 */
    --sun-yellow: #FFD93D;
    --sun-orange: #FF8C42;
    --sun-deep: #E67E22;

    /* 辅助色 */
    --sky-blue: #87CEEB;
    --earth-brown: #8B5E3C;
    --zombie-purple: #6B5B95;
    --leaf-green: #52B788;

    /* 中性色 */
    --text-primary: #2C3E2D;
    --text-secondary: #5A6B5C;
    --text-light: #FFFFFF;
    --bg-cream: #FFF8E7;
    --bg-card: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* 阴影 */
    --shadow-soft: 0 4px 12px rgba(45, 80, 22, 0.15);
    --shadow-medium: 0 6px 20px rgba(45, 80, 22, 0.25);
    --shadow-strong: 0 10px 30px rgba(45, 80, 22, 0.35);
    --shadow-glow: 0 0 20px rgba(255, 217, 61, 0.5);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* 尺寸 */
    --sidebar-width: 130px;
    --tabbar-height: 72px;
    --font-body: 20px;
    --font-title: 28px;
    --font-large: 36px;

    /* 学科主题色 */
    --chinese-color: #E74C3C;
    --math-color: #3498DB;
    --english-color: #9B59B6;
}

/* ===== 全局重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px; /* 基准字号 */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
    font-size: var(--font-body);
    color: var(--text-primary);
    line-height: 1.5;
    background: linear-gradient(180deg, #87CEEB 0%, #B5E6A1 35%, #6BBF59 100%);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

h1, h2, h3, h4 {
    font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
    font-weight: 400;
    line-height: 1.2;
}

button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

/* ===== 草坪背景层 ===== */
.grass-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.grass-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 200px 80px at 20% 90%, rgba(74, 139, 61, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 200px 80px at 60% 95%, rgba(74, 139, 61, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 200px 80px at 85% 88%, rgba(74, 139, 61, 0.25) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 30px,
            rgba(82, 183, 136, 0.08) 30px,
            rgba(82, 183, 136, 0.08) 60px
        );
}

.clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
}

.cloud {
    position: absolute;
    font-size: 64px;
    opacity: 0.85;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: cloudFloat 60s linear infinite;
}

.cloud-1 { top: 8%; left: -10%; animation-duration: 80s; }
.cloud-2 { top: 18%; left: -15%; font-size: 48px; animation-duration: 100s; animation-delay: -20s; opacity: 0.6; }
.cloud-3 { top: 5%; left: -20%; font-size: 80px; animation-duration: 120s; animation-delay: -50s; opacity: 0.7; }

@keyframes cloudFloat {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 200px)); }
}

/* ===== 应用主体 ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ===== 左侧导航栏 ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2D5016 0%, #4A8B3D 100%);
    color: var(--text-light);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    border-right: 3px solid rgba(255, 217, 61, 0.3);
    overflow: hidden;
    transition: width 0.3s ease, padding 0.3s ease;
}

.logo {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px 0;
}

.logo-sun {
    font-size: 42px;
    display: inline-block;
    animation: sunRotate 8s linear infinite;
    filter: drop-shadow(0 0 12px rgba(255, 217, 61, 0.7));
}

@keyframes sunRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 8px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 180px);
}

.nav-list::-webkit-scrollbar { width: 3px; }
.nav-list::-webkit-scrollbar-thumb { background: rgba(255, 217, 61, 0.4); border-radius: 2px; }
.nav-list::-webkit-scrollbar-track { background: transparent; }

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
    position: relative;
    border: 2px solid transparent;
    min-height: 50px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--sun-yellow) 0%, var(--sun-orange) 100%);
    color: var(--grass-dark);
    border-color: var(--sun-yellow);
    box-shadow: var(--shadow-medium);
    transform: scale(1.05);
}

.nav-item.locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.nav-item.locked:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: none;
}

.nav-icon {
    font-size: 26px;
    line-height: 1;
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.lock-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-full);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: auto;
}

.settings-btn {
    color: rgba(255, 255, 255, 0.7);
    font-size: 26px;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--sun-yellow);
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 28px 80px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ===== 页面切换 ===== */
.page {
    display: none;
    animation: pageFadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 欢迎区 ===== */
.welcome-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(255, 248, 231, 0.95) 0%, rgba(255, 217, 61, 0.3) 100%);
    padding: 24px 28px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    border: 3px solid var(--sun-yellow);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.welcome-bar::before {
    content: '🌻';
    position: absolute;
    font-size: 80px;
    right: 30px;
    top: -10px;
    opacity: 0.15;
    transform: rotate(-15deg);
}

.mascot {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.mascot-svg {
    font-size: 64px;
    text-align: center;
    line-height: 80px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: mascotBounce 2s ease-in-out infinite;
}

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.mascot-aura {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 217, 61, 0.4) 0%, transparent 70%);
    animation: auraPulse 3s ease-in-out infinite;
}

@keyframes auraPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

.welcome-text {
    flex: 1;
}

.welcome-title {
    font-size: var(--font-large);
    color: var(--grass-dark);
    margin-bottom: 4px;
}

.welcome-title #studentName {
    color: var(--sun-deep);
    text-shadow: 0 2px 0 var(--sun-yellow);
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    border: 2px solid #FFD93D;
}

.flame {
    font-size: 36px;
    animation: flameFlicker 0.6s ease-in-out infinite alternate;
}

@keyframes flameFlicker {
    from { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 4px #FF6B35); }
    to { transform: scale(1.1) rotate(3deg); filter: drop-shadow(0 0 8px #FFD93D); }
}

.streak-info {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.streak-num {
    font-family: 'Fredoka', sans-serif;
    font-size: 28px;
    font-weight: 700;
}

.streak-label {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

/* ===== 今日目标进度条 ===== */
.daily-goal {
    background: var(--bg-card);
    padding: 18px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    border: 2px solid var(--grass-light);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.goal-title {
    font-size: 22px;
    color: var(--grass-dark);
}

.goal-progress-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--sun-deep);
}

.goal-bar {
    height: 28px;
    background: rgba(74, 139, 61, 0.15);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.goal-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--grass-primary) 0%, var(--sun-yellow) 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.goal-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%);
    background-size: 20px 20px;
    animation: progressStripe 1s linear infinite;
}

@keyframes progressStripe {
    from { background-position: 0 0; }
    to { background-position: 20px 0; }
}

.goal-sun {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    animation: sunRotate 8s linear infinite;
}

.goal-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 16px;
    color: var(--text-secondary);
}

.goal-meta strong {
    font-family: 'Fredoka', sans-serif;
    color: var(--sun-deep);
    font-size: 20px;
}

/* ===== PvZ 战况面板 ===== */
.pvz-panel {
    background: linear-gradient(135deg, #5D9C3A 0%, #4A8B3D 100%);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-strong);
    border: 4px solid #8B5E3C;
    position: relative;
    overflow: hidden;
}

.pvz-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent 0, transparent 50px, rgba(255,255,255,0.03) 50px, rgba(255,255,255,0.03) 100px),
        repeating-linear-gradient(0deg, transparent 0, transparent 30px, rgba(0,0,0,0.05) 30px, rgba(0,0,0,0.05) 60px);
    pointer-events: none;
}

.pvz-header {
    position: relative;
    z-index: 1;
}

.pvz-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pvz-title {
    font-size: var(--font-title);
    color: var(--sun-yellow);
    text-shadow: 2px 2px 0 var(--grass-dark), 0 0 12px rgba(255, 217, 61, 0.6);
}

.pvz-detail-btn {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.pvz-detail-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(10deg);
}

.pvz-stats {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    border: 2px solid rgba(255, 217, 61, 0.4);
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-num {
    font-family: 'Fredoka', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--sun-yellow);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.stat-divider {
    width: 2px;
    height: 36px;
    background: rgba(255, 217, 61, 0.4);
    margin: 0 12px;
}

.garden-wrapper {
    position: relative;
    background: linear-gradient(180deg, #87CEEB 0%, #B5E6A1 30%, #6BBF59 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 3px solid #8B5E3C;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.2);
}

#gardenCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 380px;
}

.garden-fallback {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 18px;
}

/* PvZ 操作按钮 */
.pvz-controls {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.pvz-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: linear-gradient(180deg, #FFE066 0%, #FFD93D 100%);
    border: 3px solid var(--sun-deep);
    border-radius: var(--radius-lg);
    color: var(--grass-dark);
    font-weight: 700;
    box-shadow: var(--shadow-medium);
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.pvz-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pvz-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
}

.pvz-btn:disabled {
    background: linear-gradient(180deg, #B0B0B0 0%, #888888 100%);
    border-color: #555555;
    color: #DDD;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-icon {
    font-size: 32px;
    line-height: 1;
}

.btn-text {
    font-size: 18px;
}

.btn-cost {
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    background: rgba(255, 140, 66, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* 植物选择菜单 */
.plant-menu {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    border: 3px solid var(--sun-yellow);
    z-index: 50;
    min-width: 320px;
    animation: menuPop 0.25s ease;
}

@keyframes menuPop {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.plant-menu-title {
    font-size: 20px;
    color: var(--grass-dark);
    text-align: center;
    margin-bottom: 12px;
    font-family: 'ZCOOL KuaiLe', sans-serif;
}

.plant-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.plant-option {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFE9B0 100%);
    border: 2px solid var(--sun-yellow);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s;
}

.plant-option:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--sun-orange);
}

.plant-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.plant-option-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 4px;
}

.plant-option-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.plant-option-cost {
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    color: var(--sun-deep);
    margin-top: 2px;
}

.plant-menu-close {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-secondary);
}

/* ===== 学科进度卡 ===== */
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title {
    font-size: var(--font-title);
    color: var(--grass-dark);
    text-shadow: 0 2px 0 rgba(255, 217, 61, 0.3);
}

.subject-cards {
    margin-bottom: 24px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.subject-card {
    background: var(--bg-card);
    padding: 18px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    text-align: left;
    transition: all 0.2s ease;
    border-top: 6px solid;
    position: relative;
    overflow: hidden;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.subject-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.08;
    background: currentColor;
}

.chinese-card { border-color: var(--chinese-color); color: var(--chinese-color); }
.math-card { border-color: var(--math-color); color: var(--math-color); }
.english-card { border-color: var(--english-color); color: var(--english-color); }

.card-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 8px;
}

.card-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.card-name {
    font-size: 24px;
    color: var(--text-primary);
    font-family: 'ZCOOL KuaiLe', sans-serif;
}

.card-progress-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    color: var(--text-secondary);
}

.card-progress-text .done {
    font-size: 24px;
    font-weight: 700;
    color: var(--sun-deep);
}

.card-progress-bar {
    height: 16px;
    background: rgba(74, 139, 61, 0.15);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

/* 向日葵花瓣填充进度条 */
.sunflower-fill {
    height: 100%;
    width: var(--fill, 0%);
    background: linear-gradient(90deg, #FFE066 0%, #FF8C42 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.sunflower-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0, transparent 8px, rgba(255,255,255,0.3) 8px, rgba(255,255,255,0.3) 16px);
    animation: progressStripe 1.5s linear infinite;
}

.sunflower-fill .petal {
    display: none; /* 预留：可扩展为向日葵花瓣装饰 */
}

.card-next {
    font-size: 15px;
    color: var(--text-secondary);
    padding: 6px 10px;
    background: rgba(74, 139, 61, 0.08);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* ===== 底部网格：任务清单 + 打卡日历 ===== */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 20px;
}

.task-panel,
.calendar-panel {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* 任务清单 */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(90deg, #FFF8E7 0%, #FFFFFF 100%);
    border-radius: var(--radius-md);
    border: 2px solid var(--grass-light);
    cursor: pointer;
    transition: all 0.2s;
}

.task-item:hover {
    border-color: var(--sun-yellow);
    transform: translateX(4px);
}

.task-item input[type="checkbox"] {
    display: none;
}

.task-check {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 3px solid var(--grass-primary);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.task-item input:checked ~ .task-check {
    background: var(--grass-primary);
    border-color: var(--grass-deep);
}

.task-item input:checked ~ .task-check::after {
    content: '✓';
    color: white;
    font-size: 22px;
    font-weight: 700;
}

.task-item input:checked ~ .task-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-icon {
    font-size: 24px;
}

.task-text {
    flex: 1;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 500;
}

.task-reward {
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    color: var(--sun-deep);
    background: rgba(255, 217, 61, 0.2);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.task-all-reward {
    margin-top: 4px;
    padding: 14px;
    background: linear-gradient(135deg, #FFD93D 0%, #FF8C42 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 18px;
    box-shadow: var(--shadow-soft);
    border: 2px solid var(--sun-yellow);
    transition: all 0.3s;
    opacity: 0.5;
    filter: grayscale(0.5);
}

.task-all-reward.unlocked {
    opacity: 1;
    filter: grayscale(0);
    animation: rewardGlow 1.5s ease-in-out infinite;
}

@keyframes rewardGlow {
    0%, 100% { box-shadow: var(--shadow-soft), 0 0 0 rgba(255, 217, 61, 0); }
    50% { box-shadow: var(--shadow-soft), 0 0 30px rgba(255, 217, 61, 0.7); }
}

.all-reward-icon {
    font-size: 28px;
}

/* 打卡日历 */
.month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--grass-light);
    color: white;
    font-size: 18px;
    font-weight: 700;
    transition: all 0.2s;
}

.month-btn:hover {
    background: var(--grass-deep);
    transform: scale(1.1);
}

.month-label {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
    min-width: 130px;
    text-align: center;
}

.calendar-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.cal-stat {
    flex: 1;
    background: linear-gradient(135deg, #6BBF59 0%, #4A8B3D 100%);
    color: white;
    padding: 10px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid var(--grass-light);
}

.cal-stat.missed {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    border-color: #F1948A;
}

.cal-stat-num {
    display: block;
    font-family: 'Fredoka', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.cal-stat-label {
    font-size: 13px;
    opacity: 0.9;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    font-weight: 600;
    background: rgba(74, 139, 61, 0.08);
    color: var(--text-secondary);
}

.cal-cell.header {
    background: transparent;
    color: var(--grass-dark);
    font-weight: 700;
    font-size: 13px;
}

.cal-cell.empty {
    background: transparent;
}

.cal-cell.checked {
    background: linear-gradient(135deg, #6BBF59 0%, #4A8B3D 100%);
    color: white;
    box-shadow: var(--shadow-soft);
}

.cal-cell.checked::after {
    content: '●';
    margin-left: 2px;
}

.cal-cell.missed {
    background: rgba(231, 76, 60, 0.15);
    color: #C0392B;
    border: 1px dashed #E74C3C;
}

.cal-cell.today {
    border: 3px solid var(--sun-orange);
    background: rgba(255, 217, 61, 0.3);
    font-weight: 700;
    color: var(--sun-deep);
}

.month-summary-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--sky-blue) 0%, #5DADE2 100%);
    color: white;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s;
}

.month-summary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* ===== 移动端底部 Tab 栏 ===== */
.mobile-tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #4A8B3D 0%, #2D5016 100%);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
    border-top: 2px solid var(--sun-yellow);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.tab-item.active {
    color: var(--sun-yellow);
    transform: translateY(-2px);
}

.tab-icon {
    font-size: 26px;
}

.tab-label {
    font-size: 12px;
}

/* ===== 休息提醒遮罩 ===== */
.rest-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 80, 22, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.4s ease;
}

/* hidden 属性必须覆盖 display: flex */
.rest-overlay[hidden] {
    display: none !important;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rest-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.rest-emoji {
    font-size: 120px;
    animation: restBreathe 4s ease-in-out infinite;
}

@keyframes restBreathe {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

.rest-title {
    font-size: 36px;
    margin: 20px 0 10px;
    color: var(--sun-yellow);
}

.rest-tip {
    font-size: 20px;
    opacity: 0.85;
    margin-bottom: 30px;
}

.rest-countdown {
    font-family: 'Fredoka', sans-serif;
    font-size: 80px;
    font-weight: 700;
    color: var(--sun-yellow);
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.6);
    margin-bottom: 20px;
}

.rest-progress {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
}

.rest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sun-yellow) 0%, var(--sun-orange) 100%);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 1s linear;
}

/* ===== 占位页 ===== */
.page-placeholder {
    display: none;
    min-height: 70vh;
    align-items: center;
    justify-content: center;
}

.page-placeholder.active {
    display: flex;
}

.placeholder-content {
    text-align: center;
    background: var(--bg-card);
    padding: 60px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-medium);
    max-width: 500px;
}

.placeholder-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: mascotBounce 2s ease-in-out infinite;
}

.placeholder-content h2 {
    font-size: 40px;
    color: var(--grass-dark);
    margin-bottom: 12px;
}

.placeholder-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.placeholder-note {
    color: var(--sun-deep) !important;
    font-weight: 600;
    margin-top: 20px !important;
}

.locked-page .placeholder-content {
    background: linear-gradient(135deg, #2C3E2D 0%, #4A8B3D 100%);
    color: white;
}

.locked-page .placeholder-content h2 {
    color: var(--sun-yellow);
}

.locked-page .placeholder-content p {
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--grass-dark);
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius-full);
    font-size: 20px;
    font-weight: 600;
    box-shadow: var(--shadow-strong);
    z-index: 500;
    border: 2px solid var(--sun-yellow);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== 撒花动画容器 ===== */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    top: -20px;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== 响应式：手机端 ===== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --tabbar-height: 64px;
        --font-body: 18px;
        --font-title: 24px;
        --font-large: 30px;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 16px 14px calc(var(--tabbar-height) + 24px);
    }

    .mobile-tabbar {
        display: flex;
    }

    .welcome-bar {
        flex-wrap: wrap;
        padding: 16px 20px;
        gap: 14px;
    }

    .mascot-svg { font-size: 52px; line-height: 70px; }
    .welcome-title { font-size: 26px; }
    .welcome-subtitle { font-size: 16px; }

    .streak-badge {
        padding: 8px 14px;
        gap: 6px;
    }
    .flame { font-size: 28px; }
    .streak-num { font-size: 22px; }

    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .pvz-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    .stat-divider { display: none; }

    .pvz-controls {
        flex-wrap: wrap;
    }

    .pvz-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }
}

/* ===== 响应式：大手机/小平板（576px - 768px） ===== */
@media (min-width: 576px) and (max-width: 768px) {
    .mobile-tabbar {
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    }

    .tab-icon {
        font-size: 24px;
    }

    .tab-label {
        font-size: 13px;
    }
}

/* ===== 响应式：平板竖屏（769px - 992px） ===== */
@media (min-width: 769px) and (max-width: 992px) {
    :root {
        --sidebar-width: 100px;
    }

    .sidebar {
        width: 100px;
        padding: 12px 0;
    }

    .logo {
        margin-bottom: 12px;
        padding: 8px 0;
    }

    .logo-sun {
        font-size: 36px;
    }

    .nav-list {
        gap: 2px;
        padding: 0 4px;
        max-height: calc(100vh - 150px);
    }

    .nav-item {
        padding: 6px 2px;
        min-height: 44px;
    }

    .nav-icon {
        font-size: 22px;
    }

    .nav-label {
        font-size: 11px;
        line-height: 1.2;
        text-align: center;
        word-break: keep-all;
        white-space: nowrap;
    }

    .sidebar-footer {
        padding: 10px 8px;
    }

    .settings-btn {
        font-size: 22px;
    }

    .main-content {
        padding: 20px 20px 60px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 响应式：平板横屏/小桌面（993px - 1280px） ===== */
@media (min-width: 993px) and (max-width: 1280px) {
    :root {
        --sidebar-width: 120px;
    }

    .sidebar {
        width: 120px;
    }

    .logo-sun {
        font-size: 38px;
    }

    .nav-list {
        gap: 3px;
        padding: 0 6px;
        max-height: calc(100vh - 160px);
    }

    .nav-item {
        padding: 7px 3px;
        min-height: 46px;
    }

    .nav-icon {
        font-size: 24px;
    }

    .nav-label {
        font-size: 12px;
    }

    .sidebar-footer {
        padding: 10px 12px;
    }

    .settings-btn {
        font-size: 24px;
    }

    .main-content {
        padding: 22px 24px 70px;
    }
}

/* ===== 响应式：标准桌面（1281px - 1440px） ===== */
@media (min-width: 1281px) and (max-width: 1440px) {
    .main-content {
        max-width: 1200px;
        margin-left: var(--sidebar-width);
        margin-right: auto;
    }
}

/* ===== 响应式：大屏优化（> 1440px） ===== */
@media (min-width: 1441px) {
    :root {
        --sidebar-width: 150px;
    }

    .sidebar {
        width: 150px;
        padding: 20px 0;
    }

    .logo {
        margin-bottom: 18px;
    }

    .logo-sun {
        font-size: 46px;
    }

    .nav-list {
        gap: 4px;
        padding: 0 10px;
        max-height: calc(100vh - 170px);
    }

    .nav-item {
        padding: 10px 6px;
        gap: 3px;
        min-height: 52px;
    }

    .nav-icon {
        font-size: 28px;
    }

    .nav-label {
        font-size: 14px;
    }

    .sidebar-footer {
        padding: 14px 16px;
    }

    .settings-btn {
        font-size: 26px;
    }

    .main-content {
        max-width: 1400px;
        margin-left: var(--sidebar-width);
        margin-right: auto;
    }
}

/* ===== 导航项优化：文字溢出处理 ===== */
.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

/* ===== 导航项优化：触摸目标大小 ===== */
@media (pointer: coarse) {
    .nav-item {
        min-height: 44px;
        padding: 8px 4px;
    }

    .nav-icon {
        font-size: 26px;
    }
}

/* ===== 导航项优化：横屏模式下调整 ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .nav-list {
        gap: 1px;
        max-height: calc(100vh - 120px);
    }

    .nav-item {
        padding: 5px 2px;
        min-height: 38px;
    }

    .nav-icon {
        font-size: 20px;
    }

    .nav-label {
        font-size: 10px;
    }

    .logo {
        margin-bottom: 8px;
        padding: 6px 0;
    }

    .logo-sun {
        font-size: 28px;
    }

    .sidebar-footer {
        padding: 8px 10px;
    }

    .settings-btn {
        font-size: 20px;
    }
}

/* ===== 深色模式适配（预留） ===== */
@media (prefers-color-scheme: dark) {
    /* 如果需要支持系统深色模式，可在此添加样式 */
}

/* ===== 高对比度模式适配 ===== */
@media (prefers-contrast: high) {
    .nav-item {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }

    .nav-item.active {
        border-color: #FFD93D;
    }
}

/* ===== 打印优化 ===== */
@media print {
    .sidebar,
    .mobile-tabbar,
    .grass-bg {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}

/* ===== 月度总结弹窗 ===== */
.summary-modal {
    position: fixed;
    inset: 0;
    background: rgba(45, 80, 22, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-modal.show {
    opacity: 1;
}

.summary-content {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFFFFF 100%);
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 4px solid var(--sun-yellow);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.summary-modal.show .summary-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #C0392B;
    transform: rotate(90deg);
}

.summary-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--grass-light);
}

.summary-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    animation: mascotBounce 2s ease-in-out infinite;
}

.summary-header h2 {
    font-size: 24px;
    color: var(--grass-dark);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 3px solid;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-sunshine {
    background: linear-gradient(135deg, #FFE066 0%, #FFD93D 100%);
    border-color: var(--sun-orange);
}

.stat-streak {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    border-color: #E67E22;
}

.stat-lessons {
    background: linear-gradient(135deg, #6BBF59 0%, #4A8B3D 100%);
    border-color: var(--grass-deep);
}

.stat-time {
    background: linear-gradient(135deg, #87CEEB 0%, #5DADE2 100%);
    border-color: #3498DB;
}

.stat-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.summary-calendar-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(74, 139, 61, 0.1);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.cal-stat-item {
    text-align: center;
}

.cal-stat-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}

.cal-stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--grass-dark);
    display: block;
    line-height: 1.2;
}

.cal-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-subjects {
    background: white;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 2px solid var(--grass-light);
}

.summary-subjects h3 {
    font-size: 18px;
    color: var(--grass-dark);
    margin-bottom: 12px;
}

.subject-progress-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subject-progress-item {
    display: grid;
    grid-template-columns: 30px 60px 1fr 50px;
    align-items: center;
    gap: 10px;
}

.subject-icon {
    font-size: 24px;
    text-align: center;
}

.subject-name {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.progress-bar {
    height: 14px;
    background: rgba(74, 139, 61, 0.15);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--grass-primary) 0%, var(--sun-yellow) 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.subject-count {
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--sun-deep);
    text-align: right;
}

.summary-encourage {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #FFD93D 0%, #FF8C42 100%);
    border-radius: var(--radius-md);
}

.encourage-text {
    font-size: 20px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* 响应式：月度总结弹窗 */
@media (max-width: 600px) {
    .summary-content {
        padding: 20px;
    }

    .summary-header h2 {
        font-size: 20px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .subject-progress-item {
        grid-template-columns: 25px 50px 1fr 40px;
        gap: 8px;
    }

    .stat-value {
        font-size: 20px;
    }

    .encourage-text {
        font-size: 18px;
    }
}

/* ===== 设置面板 ===== */
.settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(45, 80, 22, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* hidden 属性必须覆盖 display: flex */
.settings-modal[hidden] {
    display: none !important;
}

.settings-modal.show {
    opacity: 1;
}

.settings-content {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFFFFF 100%);
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 4px solid var(--sky-blue);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.settings-modal.show .settings-content {
    transform: scale(1);
}

.settings-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--sky-blue);
}

.settings-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.settings-header h2 {
    font-size: 24px;
    color: var(--grass-dark);
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    font-size: 18px;
    color: var(--grass-dark);
    margin-bottom: 12px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.setting-input,
.setting-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 18px;
    border: 2px solid var(--grass-light);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s;
    font-family: inherit;
}

.setting-input:focus,
.setting-select:focus {
    outline: none;
    border-color: var(--sky-blue);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.2);
}

.setting-toggle {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

/* 开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #CCC;
    transition: 0.3s;
    border-radius: 32px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--grass-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(28px);
}

.danger-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid #F1948A;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.settings-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.settings-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid rgba(74, 139, 61, 0.2);
    text-align: center;
}

.version-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* PIN码模态框 */
.pin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pin-modal[hidden] {
    display: none !important;
}

.pin-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 320px;
    width: 100%;
}

.pin-content h3 {
    font-size: 22px;
    color: var(--grass-dark);
    margin-bottom: 8px;
}

.pin-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.pin-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 12px;
    border: 2px solid var(--grass-light);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-family: 'Fredoka', sans-serif;
    transition: border-color 0.2s;
}

.pin-input:focus {
    outline: none;
    border-color: var(--sky-blue);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.2);
}

.pin-input.error {
    border-color: #E74C3C;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

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

.pin-cancel,
.pin-submit {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.pin-cancel {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

.pin-cancel:hover {
    background: rgba(0, 0, 0, 0.15);
}

.pin-submit {
    background: linear-gradient(135deg, var(--grass-primary) 0%, var(--grass-deep) 100%);
    color: white;
}

.pin-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* 锁定提示 */
.lock-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.95);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    z-index: 1200;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4);
    animation: toastIn 0.3s ease;
}

.lock-toast[hidden] {
    display: none !important;
}

/* 响应式：设置面板 */
@media (max-width: 600px) {
    .settings-content {
        padding: 20px;
    }

    .settings-header h2 {
        font-size: 20px;
    }

    .setting-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
