/* ===== 基础变量 ===== */
:root {
    --primary: #2D5A4B;
    --primary-light: #E8F0EC;
    --bg: #FAF7F2;
    --card-bg: #FFFFFF;
    --text: #1A1A1A;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --warning: #D4A373;
    --danger: #C94C4C;
    --info: #3B82F6;
    
    --sidebar-bg: #1A2F28;
    --sidebar-text: #CBD5E1;
    --sidebar-active: #D4A373;
    
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    
    --card-attendance: #2D5A4B;
    --card-absence: #6B7280;
    --card-discipline: #D4A373;
    --card-noise: #C94C4C;
    --card-duty: #4A90A4;
    --card-homework: #7C6F9B;
}

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

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== 顶部导航 ===== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 24px; }
.class-name { font-size: 18px; font-weight: 600; }

.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-time { color: var(--text-secondary); font-size: 14px; }
.nav-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}
.nav-btn:hover { background: var(--primary-light); }

.user-menu { position: relative; }
.user-name {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.user-name:hover { background: var(--primary-light); }
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    min-width: 150px;
    display: none;
    overflow: hidden;
}
.user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}
.user-dropdown a:hover { background: var(--primary-light); }
.user-menu:hover .user-dropdown { display: block; }

/* ===== 主内容区 ===== */
body { padding-top: 60px; }

.greeting {
    padding: 32px 24px 16px;
    animation: fadeInUp 0.4s ease-out;
}
.greeting h1 { font-size: 28px; font-weight: 600; }
.greeting p { color: var(--text-secondary); font-size: 16px; margin-top: 4px; }

/* ===== 卡片网格 ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 16px 24px;
}

/* ===== 卡片基础 ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeInUp 0.4s ease-out;
    cursor: default;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card:nth-child(1) { animation-delay: 0.00s; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.20s; }
.card:nth-child(6) { animation-delay: 0.25s; }

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.card-icon { font-size: 20px; }
.card-title { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

/* ===== 环形图卡片 ===== */
.chart-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 12px;
}
.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.card-info { text-align: center; color: var(--text-secondary); font-size: 13px; }

/* ===== 大数字卡片 ===== */
.big-number {
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    margin: 8px 0;
}

/* ===== 标签 ===== */
.tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}
.tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.tag-blue { background: #EFF6FF; color: #3B82F6; }
.tag-purple { background: #F5F3FF; color: #7C3AED; }
.tag-orange { background: #FFF7ED; color: #F97316; }

/* ===== 3D 翻转卡片 ===== */
.flip-card { perspective: 1000px; cursor: pointer; }
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    background: var(--card-bg);
    padding: 24px;
}
.flip-card-back {
    transform: rotateY(180deg);
}

/* ===== 午休值日 ===== */
.duty-name { font-size: 24px; font-weight: 600; text-align: center; margin: 8px 0; }
.duty-role { text-align: center; color: var(--text-secondary); font-size: 14px; }
.duty-desc { text-align: center; font-size: 13px; margin-top: 8px; }
.duty-week { text-align: center; color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

/* ===== 课程表 ===== */
.schedule-section {
    padding: 24px;
    animation: fadeInUp 0.5s ease-out;
}
.schedule-section h2 { font-size: 20px; margin-bottom: 16px; }
.schedule-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.schedule-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.schedule-item:last-child { border-bottom: none; }
.schedule-item:hover { background: var(--primary-light); }
.schedule-item.current {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
}
.schedule-item.past { opacity: 0.5; }
.schedule-time { width: 140px; font-weight: 500; font-variant-numeric: tabular-nums; }
.schedule-name { flex: 1; font-weight: 500; }
.schedule-teacher { color: var(--text-secondary); font-size: 14px; width: 100px; }
.schedule-status { font-size: 12px; padding: 2px 10px; border-radius: 20px; }
.status-current { background: var(--primary-light); color: var(--primary); }
.status-past { background: #F3F4F6; color: var(--text-secondary); }
.status-future { background: #EFF6FF; color: var(--info); }
.schedule-break { text-align: center; padding: 12px; color: var(--text-secondary); font-style: italic; }

/* ===== 违纪名单 ===== */
.discipline-section {
    padding: 24px;
    animation: fadeInUp 0.6s ease-out;
}
.discipline-section h2 { font-size: 20px; margin-bottom: 16px; }
.discipline-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.discipline-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}
.discipline-item:last-child { border-bottom: none; }
.discipline-rank { width: 36px; font-size: 20px; text-align: center; }
.discipline-name { flex: 1; font-weight: 500; margin-left: 12px; }
.discipline-reason { color: var(--text-secondary); font-size: 14px; }
.discipline-count { color: var(--danger); font-weight: 600; font-size: 14px; }
.rank-gold { color: #F59E0B; }
.rank-silver { color: #9CA3AF; }
.rank-bronze { color: #D97706; }

/* ===== 入场动画 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .cards-grid { grid-template-columns: 1fr; }
    .greeting h1 { font-size: 24px; }
    .big-number { font-size: 36px; }
}
