:root {
    --primary: #1a56db;
    --primary-hover: #1e40af;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1f2937;
    --text2: #6b7280;
    --border: #e5e7eb;
    --green: #059669;
    --red: #dc2626;
    --orange: #d97706;
    --radius: 8px;
    --orange-dark: #f39c12;
    --green-dark: #2ecc71;
    --red-dark: #e74c3c;
    --blue-light: #3498db;
    --gray-bg: #f8f9fa;
}

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

body {
    font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-bottom: 40px;
}

/* ========== 头部三列布局 ========== */
header {
    display: flex;
    align-items: center;
    background: var(--primary);
    color: #fff;
    padding: 16px 32px;
}

.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-center {
    flex: 0 1 auto;
    text-align: center;
}

.header-right {
    flex: 1;
    /* 透明占位，仅用于平衡 */
}

#school-logo {
    max-height: 48px;
    border-radius: 8px;
    object-fit: contain;
}

.school-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.95);
    font-family: '楷体', 'KaiTi', 'Microsoft YaHei', serif;
}

.system-title {
    font-size: 38px;
    font-weight: 600;
    letter-spacing: 7px;
    text-shadow: 3px 3px 7px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    white-space: nowrap;
}

#main-nav {
    background: transparent;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-btn {
    flex: 0 1 auto;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 48px;
    background: #f0f2f5;
    color: #2c3e50;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 6px 14px rgba(26, 86, 219, 0.35);
}

/* ========== 公共容器 ========== */
.view {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.toolbar label {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.toolbar input,
.toolbar select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

/* ========== 汇总表类别标签 ========== */
.category-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cat-btn {
    background: var(--card);
    border: 1.5px solid #cbd5e1;
    border-radius: 40px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cat-btn:hover {
    border-color: var(--primary);
    background: #f0f7ff;
    transform: translateY(-1px);
}

.cat-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(26, 86, 219, 0.25);
}

/* ========== 表格通用 ========== */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
}

th,
td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text2);
}

tbody tr:hover {
    background: #f0f7ff;
}

/* 检查汇总表专属美化 */
#dash-table {
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#dash-table th {
    background: #f1f5f9;
    padding: 12px 8px;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-bottom-color: #cbd5e1;
    transition: background 0.2s;
}
#dash-table th:hover {
    background: #e6edf5;
}

#dash-table td {
    border: 1px solid #e2e8f0;
    padding: 10px 8px;
}
#dash-body tr.class-row:nth-child(even) {
    background-color: #fafcff;
}

#dash-body tr.class-row:nth-child(odd) {
    background-color: #fff;
}

.grade-header td {
    background: #e6f0ff;
    font-size: 1rem;
    font-weight: 700;
    color: #1e40af;
    border-top: 2px solid #b9d0f0;
    border-bottom: 1px solid #b9d0f0;
}

.grade-avg td {
    background: #f8fafc;
    border-top: 2px solid #cbd5e1;
    font-weight: 600;
    color: #0f172a;
}

td.sc.avg {
    background-color: #fef9e3;
    font-weight: 700;
    color: #b45309;
}

.sc.good {
    background-color: #dff9e6;
    color: #2e6b3e;
}

.sc.mid {
    background-color: #fff3d1;
    color: #b45f06;
}

.sc.bad {
    background-color: #ffe6e5;
    color: #b91c1c;
}

/* ========== 按钮 ========== */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--card);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #eff6ff;
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
}

.btn-danger:hover {
    opacity: 0.85;
}

/* ========== 弹窗 ========== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: var(--card);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.modal h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.modal input,
.modal select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ========== 录入分数 ========== */
.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.entry-card {
    padding: 14px 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.entry-card:hover {
    border-color: #90caf9;
}

.entry-card.active {
    border-color: #1a73e8;
    background: #e3f2fd;
}

.card-name {
    font-weight: bold;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.card-score {
    font-size: 1.5em;
    font-weight: bold;
    color: #2e7d32;
}

.card-score.low {
    color: #d32f2f;
}

.preset-item {
    display: inline-block;
    background: #e0e0e0;
    padding: 4px 8px;
    border-radius: 16px;
    cursor: pointer;
    margin: 4px;
}

.preset-item .pts {
    color: var(--red);
    font-weight: 600;
}

.preset-item .pts.pts-positive {
    color: #1eda0d;
}

.ded-item {
    background: #fff;
    margin: 4px 0;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
}

.remove {
    color: red;
    cursor: pointer;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
}

.grade-actions-row {
    display: flex;
    gap: 16px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.btn-grade-action {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #f0f0f0;
    transition: 0.2s;
}

.btn-grade-action:hover {
    opacity: 0.85;
}

#grade-bypass {
    background: var(--orange-dark);
    color: white;
}

#grade-good {
    background: var(--green-dark);
    color: white;
}

#grade-normal {
    background: var(--red-dark);
    color: white;
}

/* 眼操室内面板 */
.eye-session-panel {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    background: #f9f9f9;
}

.absent-toggle {
    font-size: 12px;
    padding: 2px 8px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
}

.eye-custom {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ========== 排班表 ========== */
.sched-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    margin-bottom: 8px;
}

.sched-table th,
.sched-table td {
    border: 1px solid #ccc;
    padding: 6px 4px;
    text-align: center;
    white-space: nowrap;
}

.sched-corner {
    min-width: 80px;
    font-size: 0.85em;
    line-height: 1.4;
}

.sched-day {
    font-weight: bold;
    background: #f5f5f5;
    min-width: 60px;
}

.sched-cell {
    min-width: 56px;
}

.sched-cell.skipped {
    color: #999;
    background: #f0f0f0 !important;
}

.sched-sel {
    width: 100%;
    font-size: 0.8em;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.sched-cell.multi-duty {
    border: 2px solid #d32f2f;
    background-color: #ffebee !important;
}

.multi-badge {
    color: #d32f2f;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 2px;
}

.sched-content {
    overflow-x: auto;
}
.sched-split {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}
.sched-main {
    flex: 1;
    min-width: 0;
}
.pioneer-panel {
    width: 360px;
    min-width: 280px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.pioneer-panel .sched-table {
    width: 100%;
    margin-bottom: 0;
}
.pioneer-panel .sched-day {
    background: #f0f0f0;
}
.pioneer-panel .pioneer-disabled {
    color: #999;
    background: #fafafa;
}
.pioneer-panel button {
    margin-bottom: 8px;
}

.grade-header td {
    background: #e3f2fd;
    font-weight: bold;
    font-size: 0.9em;
    padding: 6px 8px;
}

.grade-avg td {
    background: #f5f5f5;
    border-top: 2px solid #ccc;
    border-bottom: 1px solid var(--border);
}

.sched-pool {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pool-tag {
    padding: 3px 10px;
    background: #e3f2fd;
    border-radius: 12px;
    font-size: 13px;
}

.pool-tag.used {
    background: #ddd;
    color: #888;
    text-decoration: line-through;
    opacity: 0.7;
}

/* 排班表颜色加深 */
.sched-table td[style*="background:#fff3e0"],
.sched-table th[style*="background:#fff3e0"] {
    background-color: #ffe0b5 !important;
}

.sched-table td[style*="background:#e8f5e9"],
.sched-table th[style*="background:#e8f5e9"] {
    background-color: #c8e6d9 !important;
}

.sched-table td[style*="background:#e3f2fd"],
.sched-table th[style*="background:#e3f2fd"] {
    background-color: #bbdef5 !important;
}

.sched-table td[style*="background:#fce4ec"],
.sched-table th[style*="background:#fce4ec"] {
    background-color: #f8bbd0 !important;
}

.sched-table td[style*="background:#e0f7fa"],
.sched-table th[style*="background:#e0f7fa"] {
    background-color: #b2ebf2 !important;
}

.sched-table td[style*="background:#f3e5f5"],
.sched-table th[style*="background:#f3e5f5"] {
    background-color: #e1bee7 !important;
}

.sched-table td[style*="background:#f5f5f5"],
.sched-table th[style*="background:#f5f5f5"] {
    background-color: #e0e0e0 !important;
}

.sched-table th {
    font-weight: 700;
    background-color: #eef2f6 !important;
}

/* ========== 流动红旗 ========== */
.flag-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border-left: 4px solid var(--border);
}

.flag-card.winner {
    border-left-color: var(--orange);
    background: #fffbeb;
}

.flag-card .rank {
    font-size: 20px;
    font-weight: 700;
    color: var(--orange);
    width: 36px;
}

.flag-card .score {
    font-size: 18px;
    font-weight: 600;
}

.flag-cat {
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.flag-cat-title {
    padding: 12px 16px;
    background: #fff3e0;
    font-weight: bold;
    font-size: 1.05em;
    cursor: pointer;
}

.flag-grade {
    margin: 0 12px 8px;
    border: 1px solid #eee;
    border-radius: 6px;
}

.flag-grade-title {
    padding: 8px 12px;
    background: #f5f5f5;
    font-weight: bold;
    cursor: pointer;
}

.flag-cat>summary::before,
.flag-grade>summary::before {
    content: "▶ ";
    font-size: 0.8em;
}

.flag-cat[open]>summary::before,
.flag-grade[open]>summary::before {
    content: "▼ ";
}

.flag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.flag-row.winner {
    background: #fff8e1;
    font-weight: bold;
}

.flag-rank {
    width: 24px;
    text-align: center;
    color: #888;
}

.flag-name {
    flex: 1;
}

.flag-score {
    font-weight: bold;
}

.flag-icon {
    margin-left: 4px;
}

.flag-empty {
    padding: 8px 16px;
    color: #999;
    font-size: 0.9em;
}

/* ========== 系统设置 ========== */
.settings-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stab-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    font-size: 13px;
}

.stab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.stab-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

.list-item .actions {
    display: flex;
    gap: 6px;
}

.cadre-group {
    margin-bottom: 16px;
}

.cadre-group h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--text2);
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.cadre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cadre-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f0f4f8;
    border-radius: 16px;
    font-size: 13px;
}

.cadre-tag .tag-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    opacity: 0.5;
}

.cadre-tag .tag-btn.del:hover {
    color: red;
}

.cfg-row {
    margin-bottom: 14px;
}

.cfg-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cfg-row input[type="text"] {
    flex: 1;
    max-width: 400px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.cfg-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* ========== 今日看板（最终优化版） ========== */
.dash-fold {
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.dash-fold summary {
    list-style: none;
}

.dash-fold summary::-webkit-details-marker {
    display: none;
}

.dash-fold summary::marker {
    display: none;
}

.dash-fold-title {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 14px 24px;
    background: linear-gradient(135deg, #d4e6d4, #b8d9b8);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.dash-fold-title::before {
    content: "▶";
    font-size: 1.1rem;
    margin-right: 12px;
    transition: transform 0.2s;
    color: #1b4d1b;
    font-weight: bold;
}

.dash-fold[open] .dash-fold-title::before {
    transform: rotate(90deg);
}

.title-main {
    font-size: 1.9rem;
    font-weight: 800;
    color: #0a3b0a;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1), 0 0 8px rgba(255, 255, 200, 0.6);
    letter-spacing: 1px;
    white-space: nowrap;
    transition: all 0.2s;
}

.dash-fold-title:hover .title-main {
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.15);
}

.title-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin-left: 30px;
    margin-right: 10px;
}

.dash-date {
    font-size: 1.1rem;
    font-weight: 500;
    background: rgba(255, 255, 240, 0.4);
    padding: 4px 10px;
    border-radius: 30px;
    color: #2a5e2a;
    backdrop-filter: blur(2px);
    white-space: nowrap;
    box-shadow: none;
}

.dash-status {
    font-size: 1rem;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.dash-status.normal {
    background: rgba(232, 245, 233, 0.8);
    border-left: 3px solid #2e7d32;
    color: #2c6e2c;
}

.dash-status.holiday {
    background: rgba(255, 243, 224, 0.8);
    border-left: 3px solid #e65100;
    color: #b34e00;
}

.dash-cat-detail,
.dash-grade-detail {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.dash-cat-title,
.dash-grade-title {
    padding: 10px 12px;
    font-weight: bold;
    cursor: pointer;
    background-color: #f5f7fa;
}

.dash-cat-detail>summary::before,
.dash-grade-detail>summary::before {
    content: "▶ ";
    font-size: 0.8em;
    margin-right: 6px;
}

.dash-cat-detail[open]>summary::before,
.dash-grade-detail[open]>summary::before {
    content: "▼ ";
}

.dash-item-pending {
    background: #ffebee;
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-go {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

.btn-go:hover {
    background: #b71c1c;
}

.dash-person {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 6px;
    background: #fff;
}

.dash-person.done {
    border-left: 3px solid #4caf50;
    opacity: 0.7;
}

.dash-person.pending {
    border-left: 3px solid #d32f2f;
    background: #fff5f5;
}

.pn {
    font-weight: bold;
    min-width: 60px;
}

.pd {
    color: #666;
    flex: 1;
}

.ps {
    font-size: 0.9em;
}

.dash-empty {
    color: #999;
    padding: 12px;
    text-align: center;
}

.dash-ranking {
    margin-top: 16px;
}

/* ========== 导出栏 ========== */
.export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    padding: 12px;
    background: var(--gray-bg);
    border-radius: 12px;
}

.export-bar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
}

.export-bar input[type="date"] {
    border: none;
    background: transparent;
    padding: 6px 0;
    font-size: 13px;
    outline: none;
}

.export-bar button {
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 13px;
}

/* ========== 状态标签 ========== */
.status-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    background: #eee;
}

.status-badge.bypass {
    background: var(--orange-dark);
    color: white;
}

.status-badge.good {
    background: var(--green-dark);
    color: white;
}

.status-badge.absent {
    background: var(--blue-light);
    color: white;
}

/* ========== 其他辅助 ========== */
.msg-ok {
    color: var(--green);
    font-size: 13px;
    margin-top: 8px;
}

.msg-err {
    color: var(--red);
    font-size: 13px;
    margin-top: 8px;
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.class-row {
    cursor: pointer;
}

.class-row.selected {
    background-color: #e6f7ff;
}

.detail-row .detail-cell {
    background-color: #fafafa;
    padding: 8px;
}

.detail-content table {
    font-size: 12px;
}

.detail-content th,
.detail-content td {
    border: 1px solid #ddd;
    padding: 4px 6px;
}

/* ========== 移动端专项优化 ========== */
@media (max-width: 700px) {

    /* 全局容器 */
    .view {
        padding: 12px;
    }

    /* 头部和导航 */
    header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-left,
    .header-center,
    .header-right {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }

    .system-title {
        font-size: 24px;
        white-space: normal;
    }

    #page-title {
        font-size: 15px;
    }

    .nav-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* 工具栏改为垂直布局，增大触摸目标 */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar label {
        width: 100%;
    }

    .toolbar input,
    .toolbar select {
        width: 100%;
        padding: 10px 12px;
        /* 增大触摸区域 */
    }

    /* 汇总表类别按钮可横向滚动，保持紧凑 */
    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .cat-btn {
        flex: 0 0 auto;
        padding: 6px 16px;
    }

    /* 表格字体略小，保持可读 */
    th,
    td {
        padding: 8px 6px;
        font-size: 12px;
    }

    /* 录入卡片网格 */
    .entry-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }

    .entry-card {
        padding: 10px 6px;
    }

    .card-score {
        font-size: 1.3rem;
    }

    /* 排班表缩小内边距，允许横向滚动 */
    .sched-table th,
    .sched-table td {
        padding: 4px 2px;
        font-size: 11px;
    }

    .sched-sel {
        font-size: 10px;
        padding: 2px;
    }

    .sched-corner {
        min-width: 60px;
        font-size: 0.75em;
    }

    .pool-tag {
        font-size: 11px;
        padding: 2px 8px;
    }

    /* 今日看板折叠区域 */
    .dash-fold-title {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .title-main {
        font-size: 1.5rem;
    }

    .title-right {
        margin-left: 0;
        flex-basis: 100%;
        margin-top: 8px;
        justify-content: space-between;
    }

    .dash-date,
    .dash-status {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    /* 弹窗 */
    .modal {
        width: 95%;
        padding: 16px;
    }

    /* 导出栏按钮换行 */
    .export-bar {
        justify-content: center;
    }

    .export-bar button {
        padding: 8px 16px;
        font-size: 12px;
    }

    /* 年级操作按钮 */
    .grade-actions-row {
        gap: 8px;
    }

    .btn-grade-action {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* 汇总表班级行年级底色 */
.class-row.grade-6 td:first-child {
    background-color: #fdd9b7;
}

.class-row.grade-7 td:first-child {
    background-color: #f3cd7c;
}

.class-row.grade-8 td:first-child {
    background-color: #f7b34d;
}

.class-row.grade-9 td:first-child {
    background-color: #fce4ec;
}

/* 可根据实际年级继续添加 */
#dash-ranking {
    display: none;
}

#entry-weekday {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0f7ff, #e6f0ff);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e40af;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #b9d0f0;
    margin-left: 12px;
    white-space: nowrap;
}

.sched-cell.pool-highlight {
    background-color: #FFD700 !important;
    font-weight: bold;
    outline: 3px solid #e74c3c;
    outline-offset: -2px;
    position: relative;
    z-index: 5;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}

/* ========== 顶部右侧快捷入口菜单样式 ========== */
.quick-menu {
    position: relative;
    display: inline-block;
}

/* ========== 头部布局 ========== */
.header-right {
    flex: 1;
    /* 占据左侧和中间剩下的所有空间 */
    display: flex;
    justify-content: flex-end;
    /* 内容靠右对齐 */
    align-items: center;
}

/* ========== 顶部右侧快捷入口菜单样式 ========== */
.quick-menu {
    position: relative;
    display: inline-block;
}

/* 菜单切换按钮（三条横线） */
.menu-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* 下拉面板 */
.menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 100;
}

/* 面板内链接样式 */
.menu-dropdown a {
    display: block;
    padding: 12px 18px;
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.menu-dropdown a:hover {
    background: #f1f5f9;
    color: #1a56db;
}

/* 悬停或点击时显示面板（桌面端悬停） */
.quick-menu:hover .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 移动端适配 */
@media (max-width: 700px) {
    .header-right {
        position: static;
    }

    .menu-toggle-btn {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .menu-dropdown {
        right: -10px;
        min-width: 180px;
    }
}
/* ========== 编辑器自定义输入框优化 ========== */
#custom-label,
#custom-points,
#eye-custom-label,
#eye-custom-points,
#indoor-custom-label,
#indoor-custom-points {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: auto;
}

#custom-add-btn,
#eye-custom-add,
#indoor-custom-add {
    padding: 10px 16px;
    font-size: 14px;
}
/* 升旗排班 */
.sched-flag-table td, .sched-flag-table th {
    border: 1px solid #ccc;
}

/* ========== 浮动泡泡看板 ========== */
.bubble-container {
    position: fixed;
    z-index: 1000;
    pointer-events: none; /* 容器本身不拦截事件 */
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    pointer-events: auto; /* 泡泡本身可交互 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.6),
                inset 0 2px 6px rgba(255, 255, 255, 0.4);
}

/* 主泡泡 */
.bubble-main {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bubble-main .bubble-content {
    flex-direction: column;
    gap: 4px;
}

.bubble-main .bubble-icon {
    font-size: 32px;
    margin-bottom: 2px;
}

.bubble-main .bubble-title {
    font-size: 18px;
    white-space: nowrap;
    max-width: none;
}

.bubble-main.dragging {
    cursor: grabbing;
    transform: scale(1.05);
}

/* 类别泡泡 */
.bubble-category {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bubble-category.status-complete {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bubble-category.status-pending {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* 年级泡泡 */
.bubble-grade {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.bubble-grade.status-complete {
    background: linear-gradient(135deg, #96fbc4 0%, #f9f586 100%);
}

.bubble-grade.status-pending {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

/* 任务泡泡 */
.bubble-task {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    font-size: 14px;
}

.bubble-task.status-complete {
    background: linear-gradient(135deg, #c3f0ca 0%, #86f7c7 100%);
}

.bubble-task.status-pending {
    background: linear-gradient(135deg, #ffb88c 0%, #de6262 100%);
}

/* 泡泡内容 */
.bubble-content {
    text-align: center;
    color: white;
    font-weight: 600;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.bubble-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.bubble-title {
    font-size: 16px;
    line-height: 1.2;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bubble-status {
    font-size: 12px;
    opacity: 0.9;
}

/* 类别和年级泡泡的内容调整 */
.bubble-category .bubble-icon {
    font-size: 22px;
}

.bubble-category .bubble-title {
    font-size: 14px;
}

.bubble-grade .bubble-icon {
    font-size: 18px;
}

.bubble-grade .bubble-title {
    font-size: 12px;
}

.bubble-task .bubble-icon {
    font-size: 16px;
}

.bubble-task .bubble-title {
    font-size: 12px;
}

/* 子泡泡容器 */
.bubble-sub-container {
    position: absolute;
    pointer-events: none;
}

.bubble-sub-container.visible {
    pointer-events: auto;
}

/* 泡泡展开动画 */
.bubble-appear {
    animation: bubbleAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 泡泡消失动画 */
.bubble-disappear {
    animation: bubbleDisappear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bubbleDisappear {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* 泡泡提示文字 */
.bubble-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.bubble:hover .bubble-tooltip {
    opacity: 1;
}

/* 泡泡详情气泡 */
.bubble-detail-tooltip {
    position: fixed;
    background: white;
    color: #333;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    min-width: 150px;
    left: 0;
    top: 0;
}

.bubble-detail-tooltip.visible {
    opacity: 1;
}

.bubble-detail-tooltip .detail-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a56db;
    font-size: 14px;
}

.bubble-detail-tooltip .detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}

.bubble-detail-tooltip .detail-row:last-child {
    margin-bottom: 0;
}

.bubble-detail-tooltip .detail-label {
    color: #666;
    min-width: 50px;
}

.bubble-detail-tooltip .detail-value {
    color: #333;
    font-weight: 500;
}

.bubble-detail-tooltip .detail-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.bubble-detail-tooltip .detail-status.pending {
    background: #ffebee;
    color: #d32f2f;
}

.bubble-detail-tooltip .detail-status.complete {
    background: #e8f5e9;
    color: #2e7d32;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .bubble-main {
        width: 120px;
        height: 120px;
    }

    .bubble-category {
        width: 85px;
        height: 85px;
    }

    .bubble-grade {
        width: 70px;
        height: 70px;
    }

    .bubble-task {
        width: 55px;
        height: 55px;
    }

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

    .bubble-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .bubble-main {
        width: 100px;
        height: 100px;
    }

    .bubble-category {
        width: 75px;
        height: 75px;
    }

    .bubble-grade {
        width: 60px;
        height: 60px;
    }

    .bubble-task {
        width: 50px;
        height: 50px;
    }

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

    .bubble-title {
        font-size: 12px;
    }
}