/* ============================================================
   星光小站 v3.26 · 华彩国庆主题（基础层）
   用法：在页面其他 css 之后引入本文件即可全局生效
   说明：不改动任何业务逻辑，仅统一视觉体系
   背景图：根目录 bg-festival.jpg / bg-festival-login.jpg
   ============================================================ */

/* ---------- 设计令牌：航天启航（亮色） ---------- */
:root {
    --primary-color: #d84a3a;          /* 柔和中国红 */
    --primary-light: #ef6a5a;
    --primary-dark: #b03a2e;
    --secondary-color: #e0a800;        /* 华彩金 */
    --accent-color: #f5c518;           /* 节日金 */
    --light-bg: #faf3e8;               /* 暖米底 */
    --light-card: rgba(255, 250, 242, 0.58);
    --light-text: #4a3b32;             /* 深暖灰正文 */
    --light-border: rgba(216, 74, 58, 0.28);
    --success-color: #22a85a;
    --warning-color: #f59e0b;
    --error-color: #e64545;
    --shadow: 0 8px 24px rgba(120, 60, 30, 0.14);
    --shadow-hover: 0 14px 34px rgba(216, 74, 58, 0.22);
    --glass-blur: 14px;
}

/* ---------- 全局：浅蓝天 + 宇航员背景图 ---------- */
body,
.zr-body {
    background-color: #e8f4fd !important;
    background-image:
        radial-gradient(circle at 80% 6%, rgba(255, 255, 255, 0.9) 0%, transparent 38%),
        radial-gradient(circle at 12% 88%, rgba(255, 255, 255, 0.7) 0%, transparent 42%),
        url('../bg-festival.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* 登录页：专属竖版宇航员背景 */
.login-container {
    background-image:
        radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.85) 0%, transparent 55%),
        url('../bg-festival-login.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

/* 柔和光斑（替代原星光层） */
body::after,
.zr-body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 250, 242, 0.42) 0%, transparent 30%),
        radial-gradient(circle at 78% 74%, rgba(224, 168, 0, 0.18) 0%, transparent 36%);
}

/* 页面内容置于装饰层之上 */
body > *:not(script),
.zr-body > *:not(script),
.login-container > *:not(script) {
    position: relative;
    z-index: 1;
}

/* ---------- 玻璃卡片体系（白色半透明） ---------- */
header,
.panel,
.login-box,
.system-container,
.zr-container,
.error-container,
.period-item,
.control-panel,
.result-panel,
.stat-item,
.selector-content,
.history-list,
.analysis-results,
.info-panel,
.bottom-quote {
    background: var(--light-card) !important;
    backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
    border-color: var(--light-border) !important;
    box-shadow: var(--shadow) !important;
}

/* ---------- 通用文字与输入 ---------- */
body, .login-container, .zr-body {
    color: var(--light-text);
}

label,
.period-title,
.panel-title,
.tool-title,
.history-title,
.selected-count,
.stat-value,
.zr-task-title,
.login-footer a,
.page-footer a,
.beian-info a,
.zr-footer a {
    color: var(--primary-color) !important;
}

.time,
.zr-date,
.zr-footer,
.page-footer,
.login-footer,
.login-system-info,
.beian-info,
.error-description,
.student-count,
.zr-task-people,
.group-info,
.stat-label,
.last-update {
    color: #8a7a6a !important;
}

select, input {
    background-color: rgba(255, 255, 255, 0.92) !important;
    color: #4a3b32 !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
}

select:focus, input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

input::placeholder {
    color: #94a3b8;
}

/* ---------- 按钮：航空蓝主按钮 ---------- */
button,
.btn,
.login-btn,
.admin-btn,
.tool-btn,
.download-btn,
.selector-toggle {
    background-image: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.30);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease !important;
}

button:hover,
.btn:hover,
.login-btn:hover,
.admin-btn:hover,
.tool-btn:hover,
.download-btn:hover,
.selector-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(59, 130, 246, 0.40);
    filter: brightness(1.06);
}

button:disabled,
.download-btn:disabled {
    background-image: linear-gradient(135deg, #cbd5e1 0%, #b6c2d1 100%) !important;
    color: #8a7a6a !important;
    box-shadow: none;
}

/* 次级 / 语义按钮 */
.tool-btn.secondary {
    background: linear-gradient(135deg, #e0a800 0%, #0ea5e9 100%) !important;
    color: #fff !important;
}

.tool-btn.reset,
#doResetBtn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #fff !important;
}

.logout-btn {
    background: linear-gradient(135deg, #ff9f43 0%, #f97316 100%) !important;
    color: #fff !important;
}

.duty-edit-btn,
.zr-edit-btn {
    background: rgba(59, 130, 246, 0.10) !important;
    border: 1.5px dashed rgba(59, 130, 246, 0.55) !important;
    color: var(--primary-color) !important;
}

.duty-cancel-btn,
.zr-cancel-btn {
    background: rgba(148, 163, 184, 0.18) !important;
    color: #8a7a6a !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

/* ---------- 登录页 ---------- */
.login-box {
    border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 24px 60px rgba(30, 64, 120, 0.22) !important;
    animation: fadeUp 0.7s ease both;
}

.login-header {
    background: linear-gradient(135deg, #3b82f6 0%, #e0a800 100%) !important;
    color: #fff !important;
}

.login-header h1, .login-header p {
    color: #fff !important;
}

.login-header .class-badge {
    position: static !important;
    display: inline-block;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.login-footer {
    background: rgba(255, 255, 255, 0.9) !important;
    border-top: 1px solid rgba(59, 130, 246, 0.18) !important;
}

.login-success-message {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #15803d !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
}

/* ---------- 主页统计卡：航空蓝 + 语义点缀 ---------- */
.stats .stat-box {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.28);
    border: none !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.stats .stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.42);
}

.stats .stat-box:nth-child(4) {
    background: linear-gradient(135deg, #ff9f43 0%, #f97316 100%) !important;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.28);
}

.stats .stat-box:nth-child(5) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);
}

.current-period {
    background: linear-gradient(135deg, #e0a800 0%, #0ea5e9 100%) !important;
    color: #fff !important;
}

/* ---------- 学生网格 ---------- */
.student-item {
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1.5px solid rgba(216, 74, 58, 0.20) !important;
    color: #4a3b32 !important;
    box-shadow: 0 2px 8px rgba(30, 64, 120, 0.08);
}

.student-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color) !important;
    box-shadow: 0 10px 22px rgba(216, 74, 58, 0.20);
}

.student-item.checked {
    background: #effaf3 !important;
    border-color: rgba(34, 197, 94, 0.6) !important;
    color: #166534 !important;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.16);
}

.student-item.late {
    background: #fff8ed !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    color: #9a5b04 !important;
}

.student-item.absent {
    background: #fef2f2 !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
    color: #b91c1c !important;
}

.status-badge.on-time {
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
    animation: badgeGlow 2.2s ease-in-out infinite;
}

.status-badge.late {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.55);
    animation: badgeGlow 2.2s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* 签到弹窗：入场弹跳 */
.checkin-popup {
    animation: popIn 0.28s ease both;
}

@keyframes popIn {
    from { transform: translate(-50%, -100%) scale(0.8); opacity: 0; }
    to   { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}

/* ---------- 榜单 / 最近签到 ---------- */
.leaderboard li, .recent-checkins li {
    color: var(--light-text) !important;
    border-bottom-color: rgba(224, 168, 0, 0.12) !important;
}

.leaderboard li:hover, .recent-checkins li:hover {
    background: rgba(59, 130, 246, 0.06) !important;
}

.leaderboard li:nth-child(1) {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.16) 0%, rgba(255, 193, 7, 0.04) 100%) !important;
    border-left: 4px solid #fbbf24 !important;
    color: #92400e !important;
}

.leaderboard li:nth-child(2),
.leaderboard li:nth-child(3) {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.14) 0%, rgba(56, 189, 248, 0.03) 100%) !important;
    border-left: 4px solid #e0a800 !important;
}

.rank {
    color: var(--primary-color) !important;
}

/* 迟到 / 缺勤列表 */
.late-list, .absent-list, .error-panel {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(59, 130, 246, 0.18) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px !important;
}

.error-panel {
    color: #b91c1c !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

/* ---------- 值日面板 ---------- */
.duty-panel {
    background: var(--light-card) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.duty-group-btn, .zr-group-btn {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
    color: #4a3b32 !important;
}

.duty-group-btn:hover, .zr-group-btn:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.duty-group-btn.active, .zr-group-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.45);
}

.duty-group-title {
    color: var(--primary-color) !important;
    border-bottom-color: rgba(59, 130, 246, 0.35) !important;
}

.duty-students {
    color: #7a3b2e !important;
}

.duty-divider {
    background: rgba(216, 74, 58, 0.20) !important;
}

.duty-slide {
    background: transparent !important;
}

/* 全屏模式（教室大屏）：半透明保持背景可见 */
body.fullscreen-mode .bottom-panel .panel,
body.fullscreen-mode .duty-panel {
    background: rgba(255, 250, 242, 0.42) !important;
    box-shadow: none !important;
}

body.fullscreen-mode .student-item {
    background: rgba(255, 253, 248, 0.60) !important;
}

/* ---------- 管理后台 ---------- */
.magic-wand,
.parent-tip,
.fun-message,
.no-period-message {
    background: rgba(224, 168, 0, 0.12) !important;
    color: #7a5200 !important;
    border-left: 4px solid #e0a800 !important;
}

.period-item {
    border: 1.5px solid rgba(216, 74, 58, 0.20) !important;
}

.time-control input {
    background-color: rgba(255, 255, 255, 0.92) !important;
    color: #4a3b32 !important;
}

.analysis-results {
    border-color: rgba(216, 74, 58, 0.20) !important;
}

.analysis-table {
    background: transparent !important;
}

.analysis-table th,
.analysis-table td {
    color: var(--light-text) !important;
    border-bottom: 1px solid rgba(224, 168, 0, 0.12) !important;
}

.analysis-table th {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0.05) 100%) !important;
    color: var(--primary-color) !important;
}

.analysis-table tr:nth-child(even) {
    background-color: rgba(59, 130, 246, 0.03) !important;
}

.analysis-table tr:hover {
    background: rgba(59, 130, 246, 0.07) !important;
}

.success-message {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #15803d !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
}

.error-message-panel {
    background: rgba(239, 68, 68, 0.10) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.reset-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #92400e !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

/* ---------- 抽签工具 ---------- */
.current-result {
    color: var(--primary-color) !important;
    text-shadow: 0 0 26px rgba(59, 130, 246, 0.35);
}

.group-number {
    color: var(--primary-color) !important;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.45);
}

.group-result {
    color: var(--primary-color) !important;
}

.selector-toggle span {
    color: #ffffff;
}

.selector-content {
    border-color: rgba(59, 130, 246, 0.3) !important;
    border-radius: 0 0 10px 10px;
}

.selector-content.expanded {
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
    border-top: none !important;
}

.selector-controls {
    border-bottom-color: rgba(59, 130, 246, 0.16) !important;
}

.student-checkbox label {
    color: var(--light-text) !important;
}

.student-checkboxes {
    color: var(--light-text) !important;
}

/* ---------- 值日页 zr ---------- */
.zr-container {
    border: 1.5px solid rgba(59, 130, 246, 0.3) !important;
}

.zr-group-value {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.4);
}

.zr-task-card {
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1.5px solid rgba(216, 74, 58, 0.20) !important;
}

.zr-task-card:hover {
    border-color: rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.18);
}

.zr-task-title {
    border-bottom-color: rgba(59, 130, 246, 0.25) !important;
}

.zr-loading, .zr-empty {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(216, 74, 58, 0.20) !important;
    color: #8a7a6a !important;
}

.zr-footer {
    border-top-color: rgba(59, 130, 246, 0.16) !important;
}

/* ---------- 404 ---------- */
.error-code {
    color: var(--primary-color) !important;
    text-shadow: 0 0 34px rgba(59, 130, 246, 0.4) !important;
}

.lost-illustration {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
    box-shadow: 0 10px 30px rgba(30, 64, 120, 0.12) !important;
}

.lost-illustration i {
    color: var(--primary-color) !important;
    text-shadow: 0 0 22px rgba(59, 130, 246, 0.4);
}

.fun-message {
    background: rgba(224, 168, 0, 0.12) !important;
    color: #7a5200 !important;
    border-left: 4px solid #e0a800 !important;
}

/* ---------- 通用动画 ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

header, .panel, .duty-panel, .login-box, .zr-container, .error-container {
    animation: fadeUp 0.55s ease both;
}

/* 主按钮呼吸光晕 */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(59, 130, 246, 0.28); }
    50%      { box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5); }
}

.stats .stat-box:nth-child(1),
.login-btn,
#drawBtn {
    animation: glowPulse 3s ease-in-out infinite;
}

/* 名言区 */
.bottom-quote {
    border: 1px solid rgba(59, 130, 246, 0.28) !important;
    color: #7a3b2e !important;
    font-style: normal !important;
}

/* 滚动条适配亮色 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.30);
    border-radius: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.5);
}

/* 无背景媒体：保留可读性 */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
