﻿:root {
    --primary-green: #4CAF50;
    --dark-green: #388E3C;
    --light-green: #C8E6C9;
    --brown: #795548;
    --light-brown: #D7CCC8;
    --orange: #FF9800;
    --light-orange: #FFE0B2;
    --cream: #FFF8E1;
    --white: #FFFFFF;
    --gray: #F5F5F5;
    --dark-gray: #333333;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

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


body {
    background-color: var(--cream);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(76, 175, 80, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(121, 85, 72, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 152, 0, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cream);
    color: var(--dark-gray);
    line-height: 1.6;
}

header {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 0.9rem 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    /* 标题永远不换行：被压缩时宁可让导航整体折行，也不要标题断成两行 */
    white-space: nowrap;
    flex: 0 0 auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    /* 整块可以折行，但每一个栏目名内部绝不拆字 */
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.nav-links li {
    flex: 0 0 auto;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
    white-space: nowrap;
    display: inline-block;
    font-size: 0.95rem;
    line-height: 1.4;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--dark-green);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* 导航项增加到 7 个后，中等宽度（<1200px）整体收紧，保证标题和栏目名都排在一行 */
@media (max-width: 1200px) {
    .logo {
        font-size: 1.25rem;
    }

    .nav-links {
        gap: 0.35rem;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.45rem 0.6rem;
    }

    .user-info {
        gap: 0.5rem;
    }

    .user-info .sync-pill {
        font-size: 0.72rem;
        padding: 2px 8px;
    }
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

h1 {
    color: var(--dark-green);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 0.5rem;
}

button {
    background-color: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    /* 按钮文字永远不折行：放不下就让按钮组整体换行，而不是拆字 */
    white-space: nowrap;
}

button:hover {
    background-color: var(--dark-green);
}

button.secondary {
    background-color: var(--brown);
}

button.secondary:hover {
    background-color: #5D4037;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--primary-green);
}

.stat-card h3 {
    color: var(--dark-green);
    margin-bottom: 1rem;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--orange);
}

.class-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 班级卡片里的按钮组：卡片窄，按钮要紧凑且能整组换行 */
.class-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.class-card-actions button {
    flex: 1 1 auto;
    min-width: 84px;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
}

.class-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.class-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary-green);
}

.class-card h3 {
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}

.class-card p {
    color: #666;
    margin-bottom: 1rem;
}

.student-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

select {
    padding: 0.8rem;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    font-size: 1rem;
    min-width: 200px;
}

.student-farm {
    background-color: var(--light-brown);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.farm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-avatar {
    width: 60px;
    height: 60px;
    background-color: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.stats-container {
    display: flex;
    gap: 2rem;
}

.stat-item {
    background-color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-item .label {
    font-size: 0.9rem;
    color: #666;
}

.stat-item .value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--orange);
}

.carrot-garden {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}


.carrot-slot {
    background-color: rgba(255,255,255,0.3);
    border-radius: var(--border-radius);
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--brown);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    background-color: rgba(255,255,255,0.3);
    border-radius: var(--border-radius);
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--brown);
    transition: all 0.3s;
}

.carrot-slot:hover {
    background-color: rgba(255,255,255,0.5);
    transform: scale(1.05);
}

.carrot-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.carrot-label {
    font-size: 0.8rem;
    color: var(--brown);
    font-weight: bold;
}

.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background-color: var(--light-green);
    color: var(--dark-green);
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background-color: var(--primary-green);
    color: var(--white);
}

.leaderboard-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank {
    width: 40px;
    height: 40px;
    background-color: var(--light-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
}

.rank.gold {
    background-color: #FFD700;
    color: #8B6914;
}

.rank.silver {
    background-color: #C0C0C0;
    color: #5A5A5A;
}

.rank.bronze {
    background-color: #CD7F32;
    color: #4A2800;
}

.leaderboard-info {
    flex-grow: 1;
}

.leaderboard-name {
    font-weight: bold;
    color: var(--dark-gray);
}

.leaderboard-class {
    font-size: 0.9rem;
    color: #666;
}

.leaderboard-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--orange);
}

/* 模态框样式 */
.modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-container.active {
    display: flex;
}

.modal {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    color: var(--dark-green);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--dark-gray);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* 动画容器 */
.animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
}

/* 胡萝卜动画 */
@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes floatUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-100px); opacity: 0; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.animate-bounce {
    animation: bounceIn 0.5s ease;
}

.animate-float {
    animation: floatUp 1s ease forwards;
}

.animate-pulse {
    animation: pulse 0.5s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .student-selector {
        flex-direction: column;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    
.class-list {
        grid-template-columns: 1fr;
    }
}

/* 胡萝卜生长动画 */
@keyframes grow {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.carrot-slot.growing {
    animation: grow 0.8s ease;
}

/* 成熟胡萝卜特殊效果 */
.carrot-slot.mature {
    background-color: rgba(255, 152, 0, 0.2);
    border-color: #FF9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}

.carrot-slot.mature .carrot-icon {
    animation: pulse 2s infinite;
}

/* 田园风格装饰 */
.farm-decoration {
    position: absolute;
    font-size: 2rem;
    opacity: 0.3;
    pointer-events: none;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 1rem;
}

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

/* 学生农场网格改进 */
.carrot-garden {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1rem;
    background-color: rgba(139, 119, 101, 0.1);
    border-radius: var(--border-radius);
    border: 2px dashed var(--brown);
}

/* 成就徽章样式 */
.achievement {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--light-orange);
    color: #E65100;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 1rem;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}




/* 学生卡片容器 */
.student-cards-container {
    margin-top: 1rem;
}

/* 学生卡片网格 */
.student-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* 学生卡片 */
.student-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.student-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #FFD700);
    border-radius: 12px 12px 0 0;
}

.student-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4CAF50;
}

/* 学生卡片头部 */
.student-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.student-avatar-small {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.student-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* 胡萝卜显示区域 */
.carrot-display {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(76, 175, 80, 0.05);
    border-radius: 8px;
    border: 1px dashed #4CAF50;
}

.carrot-icon-large {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.carrot-status {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* 学生统计信息 */
.student-stats {
    display: flex;
    justify-content: space-around;
    margin: 1rem 0;
    gap: 0.5rem;
}

.stat-item-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255,255,255,0.8);
    border-radius: 8px;
    min-width: 60px;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

/* 小型进度条 */
.progress-bar-small {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill-small {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 返回按钮样式 */
#back-to-class-list {
    margin-left: 1rem;
    vertical-align: middle;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .student-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .student-card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .student-stats {
        flex-wrap: wrap;
    }
}

/* 卡片快捷操作按钮 */
.card-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: center;
}
.quick-btn {
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}
.quick-coin {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: #5D4037;
}
.quick-coin:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(255,160,0,0.4);
}
.quick-carrot {
    background: linear-gradient(135deg, #FF8C00, #E65100);
    color: white;
}
.quick-carrot:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(230,81,0,0.4);
}

/* 卡片金币动画 */
.card-coin-anim {
    position: absolute;
    font-size: 1.8rem;
    z-index: 100;
    pointer-events: none;
    animation: coinPopUp 0.8s ease-out forwards;
}
@keyframes coinPopUp {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateY(-10px) scale(1.2); opacity: 1; }
    60% { transform: translateY(-40px) scale(1); opacity: 1; }
    100% { transform: translateY(-70px) scale(0.8); opacity: 0; }
}
.card-plus-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 0 10px rgba(255,215,0,0.5);
    z-index: 101;
    pointer-events: none;
    animation: plusFadeUp 1s ease-out forwards;
}
@keyframes plusFadeUp {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -60%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1); opacity: 0; }
}
.card-carrot-anim {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    z-index: 101;
    pointer-events: none;
    animation: carrotBounce 1.2s ease-out forwards;
}
@keyframes carrotBounce {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-30deg); opacity: 0; }
    40% { transform: translate(-50%, -60%) scale(1.4) rotate(10deg); opacity: 1; }
    60% { transform: translate(-50%, -55%) scale(1) rotate(-5deg); opacity: 1; }
    80% { transform: translate(-50%, -58%) scale(1.1) rotate(3deg); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(0.8) rotate(0deg); opacity: 0; }
}
/* 按钮点击反馈 */
.quick-btn:active {
    transform: scale(0.9) !important;
}


/* 胡萝卜大小变化过渡 */
.carrot-icon-wrap {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.5s ease;
}
.carrot-icon-wrap .carrot-icon-large {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* 模态框抽卡样式 */
.modal-draw {
    max-width: 600px;
    width: 95%;
}
.modal-draw .modal-body {
    padding: 1.5rem;
}
.draw-settings {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.draw-settings label {
    font-weight: 600;
    color: #555;
}
.draw-settings input {
    width: 65px;
    padding: 0.4rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}
.draw-settings span {
    font-size: 1.2rem;
    color: #999;
}
.btn-refresh {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s;
}
.btn-refresh:hover {
    transform: scale(1.05);
}

/* 管理积分规则弹窗里的抽卡设置 */
.draw-config-box {
    background: linear-gradient(135deg, #f6f8ff 0%, #ecefff 100%);
    border: 1px solid #dfe4ff;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}
.draw-config-box h3 {
    margin: 0 0 0.6rem;
    font-size: 0.98rem;
    color: #444;
}
.draw-config-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.draw-config-row label {
    font-weight: 600;
    color: #555;
    min-width: 6.5rem;
}
.draw-config-row input {
    width: 72px;
    padding: 0.4rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}
.draw-config-row input:focus {
    border-color: #667eea;
    outline: none;
}
.draw-config-unit {
    font-size: 0.8rem;
    color: #888;
}
.draw-config-actions button {
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
}

/* 抽卡网格 */
.draw-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

/* 翻牌卡片 */
.draw-card {
    perspective: 800px;
    height: 100px;
    cursor: pointer;
}
.draw-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}
.draw-card.flipped .draw-card-inner {
    transform: rotateY(180deg);
}
.draw-card-front, .draw-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.draw-card-front {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    font-size: 1.8rem;
    color: white;
}
.draw-card-back {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    transform: rotateY(180deg);
}
.draw-coin-num {
    font-size: 1.3rem;
    font-weight: bold;
    color: #5D4037;
}
.draw-coin-icon {
    font-size: 1rem;
}
.draw-coin-burst {
    position: absolute;
    font-size: 1rem;
    z-index: 10;
    pointer-events: none;
    animation: drawCoinBurst 0.6s ease-out forwards;
}
@keyframes drawCoinBurst {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.3) translateY(-15px); opacity: 0; }
}

/* 抽卡结果区域 */
.draw-result-area {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 10px;
    margin-top: 1rem;
}
.draw-total {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
}
.draw-total span {
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.btn-confirm-draw {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-confirm-draw:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(56,239,125,0.4);
}

/* 学生卡片上的抽卡按钮 */
.card-draw-trigger {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
    width: 100%;
}
.card-draw-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* 抽卡信息 */
.draw-info {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
}
.draw-info span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 抽卡操作按钮 */
.draw-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}
.btn-confirm-draw {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-confirm-draw:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(56,239,125,0.4);
}
.btn-cancel-draw {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-cancel-draw:hover {
    transform: scale(1.05);
}

/* 可点击的统计项 */
.stat-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    user-select: none;
}
.stat-clickable:hover {
    background: rgba(76, 175, 80, 0.2) !important;
    transform: scale(1.05);
}
.stat-clickable:active {
    transform: scale(0.95);
}

/* 积分商店样式 */
.store-actions {
    margin-bottom: 1.5rem;
}
.store-actions button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.store-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 商品图片 */
.product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-placeholder {
    font-size: 3rem;
    opacity: 0.5;
}

/* 商品信息 */
.product-info {
    padding: 1rem;
}
.product-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
}
.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #FF9800;
    margin-bottom: 0.5rem;
}
.product-stock {
    font-size: 0.9rem;
    color: #666;
}

/* 商品操作按钮 */
.product-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}
.btn-buy {
    flex: 1;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    padding: 0.6rem;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-buy:hover {
    transform: scale(1.02);
}
.btn-edit {
    flex: 1;
    background: linear-gradient(135deg, #a8a8a8 0%, #888 100%);
    border: none;
    padding: 0.6rem;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-edit:hover {
    transform: scale(1.02);
}

/* 模态框样式 */
.modal-product, .modal-buy {
    max-width: 500px;
    width: 95%;
}

/* 图片上传 */
.image-upload {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.image-upload input[type="file"] {
    width: 100%;
    margin-bottom: 0.5rem;
}
.image-preview {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
}

/* 购买界面 */
.buy-product-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}
.buy-product-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.buy-product-price {
    font-size: 1.2rem;
    color: #FF9800;
    font-weight: bold;
}
.buy-product-stock {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}
.buy-student-info {
    margin: 1rem 0;
    padding: 0.8rem;
    background: #f5f5f5;
    border-radius: 8px;
}
.student-balance {
    font-size: 1.1rem;
    text-align: center;
}
.student-balance strong {
    color: #FF9800;
    font-size: 1.3rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}
.form-group input:focus,
.form-group select:focus {
    border-color: #667eea;
    outline: none;
}

/* 已兑换商品区域 */
.purchased-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.purchased-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 10px;
    border-left: 4px solid #FF9800;
}
.purchased-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}
.purchased-placeholder {
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.purchased-info {
    flex: 1;
}
.purchased-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.2rem;
}
.purchased-date {
    font-size: 0.8rem;
    color: #666;
}

/* 自动备份到文件夹 */
.auto-backup-card {
    border-left: 4px solid #4CAF50;
}
.auto-backup-box {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.ab-status {
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.6;
}
.ab-status.ok {
    background: #e8f5e9;
    color: #2e7d32;
}
.ab-status.warn {
    background: #fff3e0;
    color: #e65100;
}
.ab-status.idle {
    background: #f5f5f5;
    color: #555;
}
.ab-meta {
    font-size: 0.85rem;
    color: #777;
}
.ab-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.ab-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.92rem;
}
.ab-result {
    font-size: 0.85rem;
    color: #2e7d32;
}
.ab-tip {
    font-size: 0.82rem;
    color: #999;
    line-height: 1.6;
}

/* 删除已兑换商品按钮 */
.btn-delete-purchased {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}
.btn-delete-purchased:hover {
    color: #F44336;
    background: rgba(244, 67, 54, 0.1);
}

/* ============ 数据备份与存储容量 ============ */

.storage-panel {
    margin-top: 1.5rem;
}

.storage-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border-left: 5px solid var(--primary-green);
}

.storage-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.storage-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--dark-gray);
}

.storage-sub {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.2rem;
}

.storage-num {
    text-align: right;
    line-height: 1.2;
}

.storage-num span#storage-percent {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark-green);
}

.storage-num-sub {
    font-size: 0.85rem;
    color: #777;
}

.storage-bar {
    margin-top: 1rem;
    height: 14px;
    background: var(--light-green);
    border-radius: 999px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.storage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.9rem;
    font-size: 0.9rem;
    color: #555;
}

.storage-meta strong {
    color: var(--dark-gray);
}

.storage-tip {
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.storage-tip.ok {
    background: #E8F5E9;
    color: #2E7D32;
}

.storage-tip.warn {
    background: #FFF3E0;
    color: #E65100;
}

.storage-tip.danger {
    background: #FFEBEE;
    color: #C62828;
}

.storage-detail-title {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--light-brown);
    font-weight: bold;
    color: var(--brown);
}

.storage-detail {
    margin-top: 0.8rem;
}

.storage-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #F0F0F0;
}

.storage-row:last-child {
    border-bottom: none;
}

.storage-row-main {
    flex: 0 0 210px;
    display: flex;
    flex-direction: column;
}

.storage-row-label {
    font-weight: 600;
    color: var(--dark-gray);
}

.storage-row-desc {
    font-size: 0.78rem;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-row-bar {
    flex: 1;
    min-width: 60px;
    height: 8px;
    background: #EFEFEF;
    border-radius: 999px;
    overflow: hidden;
}

.storage-row-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--light-green), var(--primary-green));
    border-radius: 999px;
}

.storage-row-size {
    flex: 0 0 92px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #444;
    font-size: 0.9rem;
}

.backup-card {
    margin-top: 1.5rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border-left: 5px solid var(--orange);
}

.backup-card h2 {
    font-size: 1.15rem;
    color: var(--brown);
    margin-bottom: 1rem;
}

.backup-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.backup-stat {
    background: var(--cream);
    border-radius: 10px;
    padding: 0.8rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.bs-num {
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--dark-green);
    line-height: 1.3;
}

.bs-label {
    font-size: 0.8rem;
    color: #777;
}

.backup-desc {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.7;
    background: #FAFAFA;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.backup-actions button {
    min-height: 44px;
}

button.btn-danger {
    background-color: #E53935;
}

button.btn-danger:hover {
    background-color: #B71C1C;
}

.import-file {
    font-size: 0.9rem;
    color: #555;
    word-break: break-all;
    margin-bottom: 0.8rem;
}

.import-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem 1rem;
    margin-bottom: 1rem;
}

.import-grid > div {
    display: flex;
    flex-direction: column;
    background: #FAFAFA;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
}

.import-grid span {
    font-size: 0.8rem;
    color: #888;
}

.import-grid strong {
    font-size: 0.98rem;
    color: var(--dark-gray);
}

.import-warn {
    background: #FFF3E0;
    color: #E65100;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.import-warn.danger {
    background: #FFEBEE;
    color: #C62828;
}

.backup-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(51, 51, 51, 0.92);
    color: #fff;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-size: 0.95rem;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 90vw;
    text-align: center;
}

.backup-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ================= 荣誉颁奖台 ================= */

.honor-actions-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.honor-tip {
    margin: 0;
    font-size: 0.85rem;
    color: #888;
}

.honor-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}
.honor-empty {
    text-align: center;
    color: #999;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
}

.honor-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border-top: 4px solid #FFC107;
}
.honor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.15);
}
.honor-image {
    width: 100%;
    height: 170px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.honor-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.honor-placeholder {
    font-size: 3rem;
    opacity: 0.45;
}
.honor-info {
    padding: 0.9rem 1rem 0.4rem;
}
.honor-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #333;
}
.honor-type {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    color: #fff;
    margin-right: 0.4rem;
}
.honor-type.type-match { background: #FF7043; }
.honor-type.type-exam { background: #42A5F5; }
.honor-type.type-season { background: #66BB6A; }

/* 颁奖等级标签（金牌 / 一等奖 / 3级 …） */
.honor-level {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: #FF9800;
    color: #fff;
    vertical-align: middle;
    white-space: nowrap;
}
.honor-level.lv-gold {
    background: linear-gradient(135deg, #FFE082 0%, #FFB300 100%);
    color: #6b4b00;
    font-weight: bold;
}
.honor-level.lv-silver {
    background: linear-gradient(135deg, #F5F5F5 0%, #BDBDBD 100%);
    color: #424242;
    font-weight: bold;
}
.honor-level.lv-bronze {
    background: linear-gradient(135deg, #D7A86E 0%, #A0672B 100%);
    font-weight: bold;
}
.honor-level.lv-grade {
    background: linear-gradient(135deg, #64B5F6 0%, #1E88E5 100%);
    font-weight: bold;
}
.honor-date {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
}
.honor-desc {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
}
.honor-count {
    font-size: 0.8rem;
    color: #FF9800;
    font-weight: bold;
    margin-top: 0.4rem;
}
.honor-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
    flex-wrap: wrap;
}
.honor-actions button {
    flex: 1;
    min-width: 70px;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
}
.btn-award {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}
.btn-award:hover {
    box-shadow: 0 4px 12px rgba(255,152,0,0.4);
}

/* 颁奖弹窗 */
.modal-award .modal-body {
    max-height: 65vh;
    overflow-y: auto;
}
.modal-honor .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
.award-honor {
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
}
.award-student-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.award-student {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}
.award-student:hover { background: #f5f7ff; }
.award-student input, .award-pick-all input {
    width: 18px;
    height: 18px;
}
.award-pick-all {
    font-weight: bold;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed #eee;
}
.award-hint {
    color: #999;
    font-size: 0.9rem;
    margin: 0;
}

/* 学生农场里的荣誉墙 */
.honor-wall {
    margin-top: 1.2rem;
}
.honor-wall h4 {
    margin-bottom: 0.6rem;
}
.honor-wall-empty {
    color: #aaa;
    font-size: 0.9rem;
    margin: 0;
}
.honor-wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.honor-badge {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.9rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #fffde7 0%, #ffe9a8 100%);
    border-radius: 10px;
    border-left: 4px solid #FFC107;
}
.honor-badge-img {
    width: 180px;
    height: 128px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #f2e2ae;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* contain 而不是 cover：证书多为横幅，保持原始比例不裁切 */
.honor-badge-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.honor-badge-placeholder {
    font-size: 2.4rem;
}
.honor-badge-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}
.honor-badge-name {
    font-weight: bold;
    color: #333;
    font-size: 1.02rem;
    line-height: 1.35;
    word-break: break-all;
}
.honor-badge-date {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.2rem;
}
.honor-badge-del {
    background: none;
    border: none;
    color: #bbb;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
}
.honor-badge-del:hover { color: #F44336; }

@media (max-width: 768px) {
    .honor-list {
        grid-template-columns: 1fr;
    }
    .honor-wall-grid {
        grid-template-columns: 1fr;
    }
    .honor-badge-img {
        width: 130px;
        height: 95px;
    }
    .honor-badge-name {
        font-size: 0.98rem;
    }
    .draw-config-row label {
        min-width: auto;
    }
    .draw-config-row input {
        width: 64px;
    }
    .honor-actions button {
        font-size: 0.95rem;
        padding: 0.6rem;
    }
}

@media (max-width: 768px) {
    .storage-card,
    .backup-card {
        padding: 1.1rem;
    }

    .storage-head {
        flex-direction: column;
    }

    .storage-num {
        text-align: left;
    }

    .storage-num span#storage-percent {
        display: inline;
        font-size: 1.5rem;
    }

    .storage-num-sub {
        margin-left: 0.4rem;
    }

    .storage-meta {
        gap: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .storage-row {
        flex-wrap: wrap;
        gap: 0.4rem 0.6rem;
    }

    .storage-row-main {
        flex: 1 1 140px;
    }

    .storage-row-bar {
        order: 3;
        flex: 1 1 100%;
    }

    .storage-row-size {
        flex: 0 0 auto;
    }

    .backup-actions button {
        flex: 1 1 100%;
    }

    /* 导航项增加到 6 个后，保证移动端点击区域不小于 44px */
    .nav-links {
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.7rem 1rem;
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

/* ============ 卡通农场场景 ============ */

.farm-scene {
    margin-top: 1.5rem;
}

.farm-svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(62, 39, 35, 0.18);
    background: linear-gradient(180deg, #C8E6C9 0%, #A5D6A7 100%);
}

/* 破土而出：从格子中心由小放大并向上顶出 */
@keyframes farmSprout {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.45);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* 叶缨随风摆动，transform-origin 由 SVG 内联到叶根位置 */
@keyframes farmSway {
    0%, 100% { transform: rotate(-2.5deg); }
    50% { transform: rotate(2.5deg); }
}

/* 星星 / 水滴标签闪烁 */
@keyframes farmTwinkle {
    0%, 100% { opacity: 0.75; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.08); }
}

.farm-plant {
    transform-origin: 0 0;
    animation: farmSprout 0.58s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}

.farm-hole {
    animation: farmFadeIn 0.5s ease-out backwards;
}

.farm-leaves,
.farm-leaves-sm {
    animation: farmSway 3.6s ease-in-out infinite;
}

.farm-star,
.farm-drop {
    transform-origin: center;
    animation: farmTwinkle 1.9s ease-in-out infinite;
}

.farm-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.4rem;
    margin-top: 0.9rem;
    font-size: 0.9rem;
    color: #555;
}

.farm-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.farm-meta .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.farm-meta .dot-big { background: #E65100; }
.farm-meta .dot-small { background: #FFA726; }
.farm-meta .dot-empty { background: #6D4C41; }

@media (prefers-reduced-motion: reduce) {
    .farm-plant,
    .farm-hole,
    .farm-leaves,
    .farm-leaves-sm,
    .farm-star,
    .farm-drop {
        animation: none;
    }
}

/* ============ 商品图片本地存储 ============ */

.media-status-box {
    margin: 0 0 1.2rem;
}

.media-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    border-left: 4px solid #9E9E9E;
}

.media-status.idle {
    background: #F5F5F5;
    color: #555;
}

.media-status.ok {
    background: #E8F5E9;
    color: #2E7D32;
    border-left-color: #4CAF50;
}

.media-status.warn {
    background: #FFF3E0;
    color: #E65100;
    border-left-color: #FF9800;
}

.media-status strong {
    font-weight: 700;
}

.media-status button {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    min-height: 36px;
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    .media-status {
        font-size: 0.85rem;
    }

    .media-status button {
        flex: 1 1 100%;
    }
}

/* ===== 云端同步：状态标签 + 轻提示 ===== */
.sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f0f2f5;
    color: #7a828a;
    border: 1px solid #e2e6ea;
    white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s;
}
.sync-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b6bcc3;
    flex: 0 0 auto;
}
.sync-pill[data-state="syncing"] {
    background: #fff7e6; color: #b7791f; border-color: #f2dfb8;
}
.sync-pill[data-state="syncing"]::before { background: #e8a33d; }
.sync-pill[data-state="ready"] {
    background: #eafaf1; color: #1e7d4f; border-color: #c6ecd8;
}
.sync-pill[data-state="ready"]::before { background: #2fae6a; }
.sync-pill[data-state="error"] {
    background: #fdecea; color: #c0392b; border-color: #f5c6c1;
}
.sync-pill[data-state="error"]::before { background: #e74c3c; }

.sync-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 12px);
    background: rgba(40, 44, 52, .94);
    color: #fff;
    font-size: 0.86rem;
    padding: 10px 20px;
    border-radius: 22px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 9999;
    max-width: 80vw;
    text-align: center;
}
.sync-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
@media (max-width: 768px) {
    .sync-pill { font-size: 0.72rem; padding: 2px 8px; }
}