:root {
    --primary-color: #ff8c8c;
    --primary-light: #ffa8a8;
    --primary-dark: #e67373;
    --secondary-color: #ffb86c;
    --accent-color: #ff6c9d;
    --light-bg: #fff0f5;
    --light-card: #ffffff;
    --light-text: #374151;
    --light-border: #ffd1dc;
    --success-color: #7ed957;
    --warning-color: #ffbd59;
    --error-color: #ff6b6b;
    --shadow: 0 2px 6px rgba(255, 140, 140, 0.1);
}

body {
    background-color: var(--light-bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 182, 193, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 182, 193, 0.1) 0%, transparent 20%);
}

.login-container {
    background-color: var(--light-bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 182, 193, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 182, 193, 0.15) 0%, transparent 20%);
}

/* 布局调整 */
.main-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.left-panel {
    flex: 3;
    min-width: 280px;
}

.right-panel {
    flex: 7;
    min-width: 280px;
}

.bottom-panel {
    width: 100%;
}

.bottom-panel .panel {
    padding: 20px;
    background: var(--light-card);
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--light-border);
}

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

.bottom-header .panel-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

/* 全屏按钮样式 */
.fullscreen-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: rgba(255, 140, 140, 0.1);
    border: 1px solid var(--light-border);
}

.fullscreen-btn:hover {
    background: rgba(255, 140, 140, 0.25);
}

.period-info {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(255, 140, 140, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    margin-left: auto;
}

.period-info i {
    margin-right: 4px;
}

.bottom-quote {
    background: linear-gradient(135deg, #fff0f5 0%, #f8f4ff 100%);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--light-border);
    text-align: center;
    font-style: italic;
    color: var(--primary-color);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bottom-quote i {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.bottom-quote .quote-text {
    font-weight: 500;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin: 15px 0 20px;
}

.student-item {
    padding: 12px 6px;
    background: #ffffff;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #ffe4e9;
    position: relative;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.student-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.student-item.checked {
    background: #f0fff4;
    border-color: var(--success-color);
    color: #234e52;
}

.student-item.late {
    background: #fffaf0;
    border-color: var(--warning-color);
    color: #744210;
}

.student-item.absent {
    background: #fff5f5;
    border-color: var(--error-color);
    color: #822727;
}

.status-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-badge.on-time {
    background-color: var(--success-color);
}

.status-badge.late {
    background-color: var(--warning-color);
}

/* 签到弹窗 */
.checkin-popup {
    position: fixed;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    white-space: nowrap;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.checkin-popup.show {
    opacity: 1;
}

.checkin-popup.success {
    background: rgba(74, 222, 128, 0.85);
    color: #0a2f1f;
}

.checkin-popup.error {
    background: rgba(255, 107, 107, 0.85);
    color: #4a0e0e;
}

.checkin-popup.warning {
    background: rgba(245, 158, 11, 0.85);
    color: #4a3400;
}

/* 排行榜和最近签到样式 */
.leaderboard, .recent-checkins {
    list-style-type: none;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard li, .recent-checkins li {
    padding: 12px 15px;
    border-bottom: 1px solid var(--light-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.leaderboard li:hover, .recent-checkins li:hover {
    background-color: #fff0f5;
}

.leaderboard li:nth-child(1) {
    background-color: #fffaf0;
    font-weight: 600;
    border-left: 3px solid var(--warning-color);
}

.leaderboard li:nth-child(2),
.leaderboard li:nth-child(3) {
    background-color: #fff8f8;
    border-left: 3px solid var(--accent-color);
}

.rank {
    font-weight: bold;
    color: var(--primary-color);
    width: 25px;
    display: inline-block;
}

.time {
    color: #6b7280;
    font-size: 0.85rem;
}

/* 迟/缺勤列表 */
.late-list, .absent-list {
    margin-top: 15px;
    width: 100%;
    display: none;
}

.late-list ul, .absent-list ul {
    list-style-type: none;
    columns: 3;
    column-gap: 15px;
}

.late-list li, .absent-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--light-border);
    break-inside: avoid;
}

/* 错误面板 */
.error-panel {
    background-color: rgba(255, 107, 139, 0.1);
    color: #822727;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    width: 100%;
    display: none;
    border: 1px solid rgba(255, 107, 139, 0.3);
    font-weight: 500;
}

/* 统计框 */
.stats .stat-box {
    position: relative;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    min-width: 120px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.stats .stat-box:hover {
    background-color: var(--primary-dark);
}

/* ----- 值日面板（独立，始终显示，白色背景） ----- */
.duty-panel {
    background: var(--light-card);
    border: 1px solid var(--light-border);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-top: 20px;
    width: 100%;
}

.duty-panel .panel-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

/* 值日轮播容器 – 高度增加约 1/4（原 150px → 200px） */
.duty-carousel {
    position: relative;
    min-height: 200px;      /* 从 150px 增加到 200px */
    overflow: hidden;
    border-radius: 8px;
    background: var(--light-card);
    padding: 6px 0;        /* 增加一点内边距，更舒展 */
}

.duty-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
    display: none;
    align-items: stretch;
}

.duty-slide.active {
    opacity: 1;
    transform: translateX(0);
    display: flex;
}

.duty-pair {
    display: flex;
    width: 100%;
    gap: 0;
}

.duty-group-wrapper {
    flex: 1;
    padding: 0 10px;
}

.duty-divider {
    width: 2px;
    background: #ddd;
    margin: 0 10px;
    flex-shrink: 0;
}

.duty-group-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-light);
    font-size: 1.65rem;
}

.duty-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 182, 193, 0.3);
}

.duty-task {
    font-weight: 500;
    color: var(--light-text);
    flex: 1;
    font-size: 1.5rem;
}

.duty-students {
    color: var(--primary-color);
    font-weight: 500;
    text-align: right;
    flex: 2;
    font-size: 1.5rem;
}

.duty-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--primary-color);
    gap: 8px;
    font-size: 1.5rem;
}

/* 响应式：小屏幕改为上下排列 */
@media (max-width: 600px) {
    .duty-pair {
        flex-direction: column;
    }
    .duty-divider {
        width: 100%;
        height: 2px;
        margin: 10px 0;
    }
}

/* ===== 底部面板文字放大（非全屏也适用） ===== */
.bottom-panel .panel-title {
    font-size: 1.8rem;
}
.bottom-panel .bottom-quote {
    font-size: 1.5rem;
}
.bottom-panel .student-item {
    font-size: 1.5rem;
}
.bottom-panel .fullscreen-btn {
    font-size: 1.5rem;
}
.bottom-panel .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

/* ===== 全屏模式样式 ===== */
body.fullscreen-mode {
    background: var(--light-bg);
    overflow: hidden;
}

body.fullscreen-mode .system-container {
    max-width: 100%;
    padding: 10px 20px;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.fullscreen-mode .star-header,
body.fullscreen-mode .main-content,
body.fullscreen-mode .late-list,
body.fullscreen-mode .absent-list,
body.fullscreen-mode .error-panel,
body.fullscreen-mode .logout-btn,
body.fullscreen-mode .beian-info,
body.fullscreen-mode #logoutBtn {
    display: none !important;
}

body.fullscreen-mode .bottom-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
}

body.fullscreen-mode .bottom-panel .panel {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 10px 0;
}

/* 全屏模式下值日面板也保持显示，并调整为透明背景无边框，与底部融合 */
body.fullscreen-mode .duty-panel {
    margin-top: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
}

body.fullscreen-mode .duty-panel .panel-title {
    font-size: 1.8rem;
}

body.fullscreen-mode .duty-carousel {
    min-height: 180px;
}

/* 页脚 */
.logout-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    margin-top: 15px;
    width: 100%;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: #e6a85c;
}

.beian-info {
    text-align: center;
    margin-top: 15px;
    padding: 0 10px;
    font-size: 0.85rem;
    color: #888;
    border-top: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 10px;
}

.beian-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.beian-info a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 登录页脚 */
.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--light-border);
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: var(--primary-dark);
}

.login-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #888;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    .left-panel, .right-panel {
        width: 100%;
        min-width: 100%;
    }
    .bottom-header .panel-title {
        flex-direction: column;
        align-items: flex-start;
    }
    .period-info {
        margin-left: 0;
        white-space: normal;
    }
    .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    .late-list ul, .absent-list ul {
        columns: 2;
    }
    .duty-carousel {
        min-height: 220px;   /* 小屏也相应增大 */
    }
    .duty-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .duty-students {
        text-align: left;
    }
    /* 小屏下底部放大适当缩减 */
    .bottom-panel .panel-title {
        font-size: 1.5rem;
    }
    .bottom-panel .bottom-quote {
        font-size: 1.2rem;
    }
    .bottom-panel .student-item {
        font-size: 1.2rem;
    }
    .bottom-panel .fullscreen-btn {
        font-size: 1.2rem;
    }
    .bottom-panel .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .duty-panel .panel-title {
        font-size: 1.5rem;
    }
    .duty-group-title {
        font-size: 1.4rem;
    }
    .duty-task, .duty-students, .duty-loading {
        font-size: 1.2rem;
    }
    body.fullscreen-mode .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    body.fullscreen-mode .student-item {
        font-size: 1.2rem;
    }
    body.fullscreen-mode .bottom-panel .panel-title {
        font-size: 1.5rem;
    }
    body.fullscreen-mode .bottom-panel .bottom-quote {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    }
    .late-list ul, .absent-list ul {
        columns: 1;
    }
    .duty-carousel {
        min-height: 240px;   /* 小屏进一步增加 */
    }
    .bottom-panel .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .bottom-panel .student-item {
        font-size: 1rem;
    }
    .bottom-panel .panel-title {
        font-size: 1.2rem;
    }
    .bottom-panel .bottom-quote {
        font-size: 1rem;
    }
    .bottom-panel .fullscreen-btn {
        font-size: 1rem;
    }
    .duty-panel .panel-title {
        font-size: 1.2rem;
    }
    .duty-group-title {
        font-size: 1.1rem;
    }
    .duty-task, .duty-students, .duty-loading {
        font-size: 1rem;
    }
    body.fullscreen-mode .student-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    body.fullscreen-mode .student-item {
        font-size: 1rem;
    }
    body.fullscreen-mode .bottom-panel .panel-title {
        font-size: 1.2rem;
    }
    body.fullscreen-mode .bottom-panel .bottom-quote {
        font-size: 1rem;
    }
}