/* =============================================================
   学生用餐请假系统 - 样式表
   1. 基础重置与通用组件
   2. 手机端前台
   3. 管理后台（顶栏 / 面板 / 表格 / 分屏 TAB / 弹窗）
   4. 响应式适配
   说明：避免使用 inset、flex gap 等低版本浏览器不支持的特性，
        统一用 margin / top-right-bottom-left 实现，保证兼容性。
   ============================================================= */

/* ========== 1. 基础重置 ==========
   跨浏览器一致性要点：
   1) 显式重置 box-sizing / margin / padding（各内核 UA 默认值不同）；
   2) 表单控件强制继承字体与行高（Chrome/Edge 默认控件字号为 13.333px）；
   3) 固定纵向滚动条占位，避免是否出现滚动条造成 15~17px 的内容宽度差；
   4) color-scheme: light 禁止 Edge 跟随系统深色自动反色。
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    color-scheme: light;
    background: #eef1f6;
}
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #1f2937;
    background: #eef1f6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-size: inherit; font-weight: 700; margin: 0; }
p { margin: 0; }
a { color: inherit; }
table { border-collapse: collapse; border-spacing: 0; }
img, svg { max-width: 100%; }

/* 控件字体统一继承：消除 UA 默认字体/字号/行高差异（表单“错行”的主因之一） */
input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: inherit;
    margin: 0;
}
/* Edge / IE 的清除按钮与下拉展开箭头会额外占位 */
input::-ms-clear, input::-ms-reveal { display: none; }
select::-ms-expand { display: none; }
/* 日期控件自带最小内容宽度，不置 0 会在 flex 中撑破容器导致换行错位 */
input[type="date"] { min-width: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }

/* ---------- 表单控件 ---------- */
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.field label i { color: #ef4444; font-style: normal; }
.field .tip { font-size: 12px; color: #8a94a6; margin-top: 5px; line-height: 1.6; }
.card .tip { font-size: 12px; color: #8a94a6; line-height: 1.6; margin: 0 0 14px; }
.tip { font-size: 12px; color: #8a94a6; line-height: 1.6; margin: 0 0 12px; }

input[type="text"], input[type="tel"], input[type="date"], input[type="password"], input[type="search"], textarea, select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1.5px solid #dfe3ea;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 16px;
    line-height: 1.4;
    background: #fafbfc;
    color: #1f2937;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
}
/* 日期控件保留各浏览器原生选择器（图标/弹层），只统一外框 */
input[type="date"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    /* iOS Safari：font-size < 16px 聚焦会触发视口自动缩放，使原生日期控件固有最小宽溢出容器 */
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
/* 触摸设备（iOS/Android）：原生日期控件带固有最小宽、即便 width:100% 也不收缩会溢出，
   改回 appearance:none 即可正常贴合容器；iOS 聚焦时仍会弹出原生滚轮选择器，功能不受影响。
   桌面端（hover 精确指针）保留 appearance:auto 以显示日历图标。 */
@media (hover: none) and (pointer: coarse) {
    input[type="date"] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
}
input:focus, textarea:focus, select:focus {
    border-color: #4f7cff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, .15);
}
/* 自动填充底色：Chrome/Edge 的黄色底色与内阴影实现不同，统一强制 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1f2937;
    -webkit-box-shadow: 0 0 0 1000px #fafbfc inset;
    box-shadow: 0 0 0 1000px #fafbfc inset;
    transition: background-color 9999s ease-in-out 0s;
}
textarea { resize: vertical; }
select {
    padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, #9aa3b2 50%), linear-gradient(135deg, #9aa3b2 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    background-clip: padding-box;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform .1s, box-shadow .15s, background .15s, color .15s;
}
.btn:active { transform: scale(.98); }
/* 键盘焦点环统一（Chrome 默认黑色实线、Edge 默认蓝色，需显式声明） */
.btn:focus-visible, .side-item:focus-visible, .anchor-nav a:focus-visible {
    outline: 2px solid #4f7cff; outline-offset: 2px;
}
.btn-primary {
    background: #4f7cff;
    background: linear-gradient(135deg, #4f7cff, #6a5cff);
    color: #fff; box-shadow: 0 4px 12px rgba(79, 124, 255, .3);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(79, 124, 255, .42); }
.btn-outline { background: #fff; color: #4f7cff; border-color: #c9d6ff; }
.btn-outline:hover { background: #f2f6ff; }
.btn-light { background: #fff; color: #4f7cff; border-color: #c9d6ff; margin-top: 8px; }
.btn-danger { background: #fff; color: #ef4444; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { display: flex; width: 100%; margin-top: 18px; }

/* 按钮组：flex gap 控制间距，换行后不会出现“首项缩进”或上下错行 */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

/* ---------- 提示 ---------- */
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.7; }
.alert p + p { margin-top: 4px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.hint { font-size: 12px; color: #8a94a6; margin-top: 6px; line-height: 1.6; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.6; }
.tag-single { background: #eef4ff; color: #3b6fe0; }
.tag-multi { background: #f3ecff; color: #7c4fd8; }

/* ========== 2. 手机端前台 ========== */
.page-front { min-height: 100vh; }
.phone { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #eef1f6; padding-bottom: 32px; overflow-x: hidden; }

.hero {
    background: #6a5cff;
    background: linear-gradient(135deg, #4f7cff 0%, #6a5cff 60%, #8f4fff 100%);
    color: #fff;
    padding: 14px 18px;
    border-radius: 0 0 18px 18px;
    display: flex;
    align-items: center;
}
.hero-text { flex: 1; min-width: 0; }
.hero h1 { font-size: 18px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; }
.hero-sub { margin-top: 4px; font-size: 12px; opacity: .92; line-height: 1.4; }

.notice-card {
    margin: 14px 16px 0;
    background: #fffdf6;
    background: linear-gradient(135deg, #fff9e8, #fff);
    border: 1px solid #ffe3a3;
    border-radius: 14px;
    padding: 14px 16px;
}
.notice-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.notice-tag { background: #ff9f43; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; letter-spacing: 1px; }
.notice-date { font-size: 12px; color: #b47b2a; }
.notice-title { font-size: 15px; font-weight: 700; color: #8a5a12; margin-bottom: 4px; }
.notice-content { font-size: 13px; color: #7c6a4a; line-height: 1.7; white-space: pre-wrap; }

.card { margin: 14px 16px; background: #fff; border-radius: 14px; padding: 16px 16px 18px; box-shadow: 0 4px 16px rgba(31, 41, 55, .06); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

/* 提交成功反馈 */
.success-box { text-align: center; padding: 8px 4px 4px; }
.success-icon { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.success-text { font-size: 15px; font-weight: 700; color: #047857; margin: 0 0 6px; }
.success-sub { font-size: 12.5px; color: #8a94a6; margin: 0 0 16px; line-height: 1.6; }

/* 二次提交确认层 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 18px 16px 16px; box-shadow: 0 12px 40px rgba(15,23,42,.25); }
.modal-title { font-size: 16px; font-weight: 700; color: #1f2a44; margin-bottom: 6px; }
.modal-desc { font-size: 12.5px; color: #8a94a6; margin: 0 0 12px; line-height: 1.6; }
.diff-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.diff-table th, .diff-table td { padding: 7px 8px; text-align: left; border-bottom: 1px solid #eef1f6; }
.diff-table th { color: #8a94a6; font-weight: 600; font-size: 12px; }
.diff-table td { color: #1f2a44; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
.tag-added { background: #e6f7ec; color: #1f7a45; }
.tag-removed { background: #fdecec; color: #c0392b; }
.tag-changed { background: #fff4e0; color: #b9770e; }

/* 年级提示中的年级高亮（浅橙） */
.hl-grade { color: #c8740a; background: #fff3e2; padding: 0 4px; border-radius: 4px; font-weight: 600; }

.field-row { display: flex; }
.field-row .field { flex: 1; min-width: 0; }
.field-row .field + .field { margin-left: 10px; }

.seg { display: flex; background: #eef1f6; border-radius: 10px; padding: 4px; }
.seg-item { flex: 1; position: relative; }
.seg-item + .seg-item { margin-left: 4px; }
.seg-item input { position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; cursor: pointer; }
.seg-item span {
    display: block; text-align: center; padding: 9px 0;
    font-size: 14px; font-weight: 600; color: #6b7280;
    border-radius: 8px; cursor: pointer; transition: all .15s;
}
.seg-item input:checked + span { background: #fff; color: #4f7cff; box-shadow: 0 2px 6px rgba(31, 41, 55, .12); }

.footer { text-align: center; margin-top: 22px; padding: 0 24px; font-size: 12px; color: #9aa3b2; line-height: 1.8; }
.alert-success.page-tip { margin: 14px 16px 0; }

/* ========== 3. 管理后台 ==========
   统一基准：正文 12px / 辅助 11px / 标题 12.5px / 数字 18px
   所有尺寸在此固定，不依赖任何运行时设置，刷新后保持一致。
   ============================================================= */
body.page-admin { background: #f4f6fa; font-size: 12px; line-height: 1.5; color: #1f2937; }

/* ---------- 顶栏 ---------- */
.admin-topbar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 40;
    background: #1e293b;
    color: #fff;
    padding: 0 16px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.admin-topbar .brand { font-size: 13.5px; font-weight: 700; padding: 7px 0; }
.admin-topbar .brand small { font-weight: 400; opacity: .6; margin-left: 5px; font-size: 10.5px; }
.admin-user { display: flex; align-items: center; font-size: 11.5px; color: #cbd5e1; padding: 5px 0; }
.admin-user a {
    color: #cbd5e1; text-decoration: none; font-size: 11.5px;
    padding: 4px 10px; border-radius: 6px; margin-left: 8px;
    background: rgba(255, 255, 255, .1);
    transition: background .15s, color .15s;
}
.admin-user a:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- 左右结构外壳 ---------- */
.admin-shell {
    display: flex;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 14px 32px;
}
.admin-side {
    flex: 0 0 168px;
    width: 168px;
    margin-right: 12px;
    background: #fff;
    border: 1px solid #eceff4;
    border-radius: 10px;
    padding: 8px;
    position: -webkit-sticky;
    position: sticky;
    top: 54px;
}
.admin-main { flex: 1; min-width: 0; }
.side-menu { display: flex; flex-direction: column; }
.side-item {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 7px;
    border-left: 3px solid transparent;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s, box-shadow .15s;
}
.side-item + .side-item { margin-top: 3px; }
.side-item:hover { background: #f2f6ff; color: #4f7cff; }
.side-item.active {
    background: #4f7cff;
    background: linear-gradient(135deg, #4f7cff, #6a5cff);
    color: #fff;
    border-left-color: #fff;
    box-shadow: 0 3px 9px rgba(79, 124, 255, .26);
}
.side-item .ico { margin-right: 7px; font-size: 13px; }
.side-foot {
    margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed #e5e9f0;
    font-size: 10.5px; color: #9aa3b2; line-height: 1.6;
}

/* ---------- 页内锚点导航 ---------- */
.anchor-nav { display: flex; flex-wrap: wrap; }
.anchor-nav a {
    display: inline-block; margin-right: 6px; margin-bottom: 6px;
    padding: 4px 10px; border-radius: 999px; text-decoration: none;
    font-size: 11.5px; color: #4b5563; background: #f2f4f8;
}
.anchor-nav a:hover { background: #e8edff; color: #4f7cff; }

/* ---------- 面板 ---------- */
.panel {
    background: #fff;
    border: 1px solid #eceff4;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.panel:last-child { margin-bottom: 0; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 1px solid #f1f3f7;
}
.panel-head h2 { font-size: 12.5px; font-weight: 700; color: #111827; }
.panel-head .range { font-size: 11.5px; color: #8a94a6; font-weight: 400; }
.panel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.panel-body-title { font-size: 12px; font-weight: 700; color: #374151; margin: 2px 0 6px; }

/* ---------- 两列栅格 ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 12px; gap: 12px; align-items: start; margin-bottom: 12px; }
.grid-2 .panel { margin-bottom: 0; }

/* ---------- 数据卡片 ---------- */
.stat-grid { display: flex; flex-wrap: wrap; margin: 0 -5px 6px; }
.stat {
    flex: 1 1 150px;
    min-width: 128px;
    margin: 0 5px 10px;
    background: #fff;
    border: 1px solid #eceff4;
    border-radius: 8px;
    padding: 10px 12px;
}
.stat .num { font-size: 18px; font-weight: 800; color: #4f7cff; line-height: 1.2; }
.stat .lbl { font-size: 11px; color: #6b7280; margin-top: 1px; }

/* ---------- 表格 ----------
   不设 min-width、允许单元格换行：宽表在窄容器内自动压缩，保证不横向溢出。
   宽屏（≥1140px）足够空间时再恢复 nowrap，避免文字被无谓折行。
   ------------------------------------------------------------------ */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; min-width: 0; max-width: 100%; table-layout: auto; border-collapse: collapse; font-size: 11.5px; }
table.data th, table.data td {
    padding: 6px 8px; text-align: left; vertical-align: middle;
    border-bottom: 1px solid #f1f3f7;
    white-space: normal; word-break: break-word; overflow-wrap: anywhere;
}
table.data th { background: #f8fafc; color: #475569; font-weight: 600; border-bottom: 1px solid #e8ecf3; white-space: nowrap; }
table.data tr:hover td { background: #f8faff; }
table.data.compact { width: 100%; }   /* 汇总类小表：完全自适应，不做最小宽度限制 */
table.data td.sub { max-width: 190px; color: #6b7280; }
table.data td.center { text-align: center; }
.empty { text-align: center; color: #9aa3b2; padding: 16px 0 !important; }

@media (min-width: 1240px) {
    .page-admin table.data th,
    .page-admin table.data td:not(.sub) { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
}

/* ========== 3.5 表格组件统一规范 ==========
   目标：全后台表格风格一致、易读、操作高效。
   结构约定：<div class="table-wrap[ sticky]"><table class="data [zebra][compact]">…</div>
   对齐：th/td 加 .center（居中，已内置）/ .right（数字右对齐）/ .num（等宽数字）。
   操作列：th 加 .col-actions（窄列居中），td 加 .actions（内含 .btn-sm，次要操作可用 .btn-text 弱化）。
   ------------------------------------------------------------------ */
/* 列对齐工具类 */
table.data th.right, table.data td.right { text-align: right; }
table.data .num { font-variant-numeric: tabular-nums; }
/* 列宽工具类（仅作用于表格单元格，不污染全局） */
table.data .w-xs { width: 56px; } table.data .w-sm { width: 88px; }
table.data .w-md { width: 140px; } table.data .w-lg { width: 220px; }
.col-actions, th.col-actions { width: 1%; white-space: nowrap; text-align: center; }
.col-check { width: 34px; text-align: center; padding-left: 5px; padding-right: 5px; }

/* 斑马纹（可选 .zebra 启用） */
table.data.zebra tbody tr:nth-child(even) td { background: #fcfdff; }
/* 悬停（加强，确保压过斑马纹） */
table.data tbody tr:hover td { background: #f0f5ff; }
/* 选中行 / 可点击行 */
table.data tbody tr.selected td { background: #eef4ff; box-shadow: inset 3px 0 0 #4f7cff; }
table.data tbody tr.row-link { cursor: pointer; }

/* 排序表头 */
table.data th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 18px; }
table.data th.sortable:hover { background: #eef2f8; color: #1f2937; }
table.data th.sortable::after { content: "\2195"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: #b6bfce; font-size: 10px; }
table.data th.sortable.asc::after { content: "\2191"; color: #4f7cff; }
table.data th.sortable.desc::after { content: "\2193"; color: #4f7cff; }

/* 表头吸顶（长表滚动时固定） */
.table-wrap.sticky { max-height: 70vh; overflow: auto; }
.table-wrap.sticky table.data thead th { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 0 #e8ecf3; }

/* 分页控件 */
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pager a, .pager .page {
    min-width: 30px; height: 30px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; color: #4b5563; font-size: 12px; text-decoration: none;
    transition: all .15s;
}
.pager a:hover { border-color: #4f7cff; color: #4f7cff; background: #f5f8ff; }
.pager .page.current { background: #4f7cff; border-color: #4f7cff; color: #fff; font-weight: 700; }
.pager .page.disabled, .pager a.disabled { color: #cbd5e1; border-color: #eef1f6; background: #fafbfc; pointer-events: none; }
.pager .pager-gap { color: #cbd5e1; padding: 0 2px; }
.pager .pager-info { margin-left: auto; font-size: 11.5px; color: #8a94a6; }

/* 批量操作工具条（选中行后出现） */
.bulk-bar { display: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px; background: #eef4ff; border: 1px solid #c9d6ff; border-radius: 8px; }
.bulk-bar.show { display: flex; }
.bulk-bar .bulk-count { font-size: 12px; font-weight: 600; color: #2f5bd0; }
.bulk-bar .bulk-count b { color: #4f7cff; }
.bulk-bar .bulk-info { font-size: 11.5px; color: #6b7280; }

/* 操作列：弱化次要操作，成组间距统一 */
table.data td.actions { white-space: nowrap; }
table.data td.actions .btn-sm + .btn-sm,
table.data td.actions .inline-form + .btn-sm { margin-left: 6px; }
.actions .btn-text { background: none; border: none; padding: 4px 8px; font-size: 12px; font-weight: 600; color: #4f7cff; cursor: pointer; border-radius: 6px; font-family: inherit; }
.actions .btn-text:hover { background: #f2f6ff; }
.actions .btn-text.danger { color: #ef4444; }
.actions .btn-text.danger:hover { background: #fef2f2; }

/* 空状态 / 加载状态 */
table.data td.empty { color: #9aa3b2; font-size: 12px; }
.table-empty { padding: 30px 12px; text-align: center; color: #9aa3b2; }
.table-empty .te-ico { font-size: 30px; opacity: .5; display: block; }
.table-empty .te-txt { margin-top: 8px; font-size: 12.5px; }
.table-empty .te-sub { margin-top: 3px; font-size: 11.5px; color: #b6bdc9; }
.spinner { width: 22px; height: 22px; border: 2.5px solid #dbe4ff; border-top-color: #4f7cff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.table-loading { position: relative; }
.table-loading.is-loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6); border-radius: 8px; z-index: 2; }
.skeleton-row td { padding: 0 !important; }
.skeleton-bar { height: 10px; margin: 9px 8px; border-radius: 5px; background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 查询工具条 ----------
   gap 统一行/列间距，align-items: flex-end + 统一控件高度，避免换行后错位。
   ------------------------------------------------------------------ */
.toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.toolbar > * { min-width: 0; }
.toolbar .field { flex: 0 0 auto; margin-bottom: 0; min-width: 120px; }
.toolbar .grow { flex: 1 1 220px; min-width: 0; }
.toolbar .btn { flex: 0 0 auto; }
.toolbar input, .toolbar select { width: 100%; }

/* ---------- 后台表单 / 按钮尺寸 ----------
   统一控件高度（输入/下拉/按钮同一 32px 基线），彻底消除“错行”。
   ------------------------------------------------------------------ */
.page-admin input[type="text"], .page-admin input[type="date"], .page-admin input[type="password"],
.page-admin input[type="search"], .page-admin select {
    height: 32px; min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 7px;
}
.page-admin select { padding-right: 30px; line-height: 29px; }
.page-admin textarea { min-height: 88px; padding: 8px 10px; font-size: 12.5px; line-height: 1.6; border-radius: 7px; }
.page-admin .field { margin-bottom: 10px; }
.page-admin .field label { font-size: 11.5px; margin-bottom: 4px; }
.page-admin .field .tip { font-size: 11px; margin-top: 4px; }
.page-admin .btn { height: 32px; padding: 0 14px; font-size: 12.5px; border-radius: 7px; }
.page-admin .btn-sm { height: 26px; padding: 0 10px; font-size: 11.5px; }
.page-admin .hint { font-size: 11.5px; margin-top: 5px; }
.page-admin .alert { padding: 8px 10px; font-size: 11.5px; margin-bottom: 10px; }
.page-admin .btn-block { margin-top: 12px; }
.page-admin .tag { font-size: 10.5px; padding: 1px 7px; }
.form-narrow { max-width: 620px; }

/* ---------- 请假公示 ---------- */
.pub-head {
    display: flex; align-items: center; justify-content: space-between;
    background: #f6f8ff; border: 1px solid #e6ecff; border-radius: 8px;
    padding: 8px 10px; margin-bottom: 8px;
}
.pub-head .pub-date { font-size: 12.5px; font-weight: 700; color: #1f2937; }
.pub-head .pub-total { font-size: 11.5px; color: #6b7280; }
.pub-list { border: 1px solid #eceff4; border-radius: 8px; overflow: hidden; }
.pub-item { display: flex; align-items: center; padding: 7px 10px; border-bottom: 1px solid #f1f3f7; }
.pub-item:last-child { border-bottom: none; }
.pub-item:nth-child(odd) { background: #fcfdff; }
.pub-no {
    width: 20px; height: 20px; border-radius: 50%; margin-right: 8px;
    background: #eef2ff; color: #4f7cff;
    font-size: 10.5px; font-weight: 700; flex: 0 0 20px;
    display: flex; align-items: center; justify-content: center;
}
.pub-name { font-size: 12.5px; font-weight: 700; color: #111827; width: 80px; flex: 0 0 auto; }
.pub-cls { font-size: 11.5px; color: #6b7280; flex: 1; min-width: 0; }
.pub-chk { font-size: 11.5px; font-weight: 700; color: #16a34a; white-space: nowrap; }
.pub-chk i { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center;
    border-radius: 50%; background: #dcfce7; color: #16a34a; font-style: normal; margin-right: 4px; font-size: 10px; }
.pub-empty { text-align: center; color: #9aa3b2; padding: 16px 0; font-size: 11.5px; }

/* ---------- 公示文本复制框 ---------- */
.copy-box {
    width: 100%; min-height: 100px; font-size: 11.5px; line-height: 1.65;
    border: 1.5px solid #dfe3ea; border-radius: 8px; padding: 8px 10px;
    background: #fafbfc; color: #1f2937; resize: vertical; font-family: inherit;
    margin-top: 10px;
}

/* ---------- 前台效果预览 ---------- */
.phone-preview {
    width: 300px; max-width: 100%; margin: 0 auto;
    background: #eef1f6; border-radius: 18px; overflow: hidden;
    border: 1px solid #dfe3ea; padding-bottom: 12px;
}
.phone-preview .hero { border-radius: 0 0 16px 16px; }
.phone-preview .footer { margin-top: 12px; }
.preview-body { margin: 12px; padding: 18px 0; text-align: center; background: #fff; border-radius: 10px; color: #b6bdc9; font-size: 11px; }
.preview-label { color: #b6bdc9; font-size: 11px; }

/* ---------- 登录页 ---------- */
body.page-login {
    background: #6a5cff;
    background: linear-gradient(135deg, #4f7cff, #8f4fff);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    font-size: 12.5px;
}
.login-box {
    background: #fff; border-radius: 14px; padding: 24px 22px;
    width: 100%; max-width: 340px; box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}
.login-box h1 { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.login-box .sub { text-align: center; font-size: 12px; color: #8a94a6; margin-bottom: 16px; }
.login-box .btn-block { margin-top: 14px; }
.page-login .field { margin-bottom: 10px; }
.page-login .field label { font-size: 11.5px; margin-bottom: 4px; }
.page-login input[type="text"], .page-login input[type="password"] {
    height: 34px; min-height: 34px; padding: 0 10px; font-size: 12.5px; border-radius: 7px;
}
.page-login .btn { height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: 8px; }
.page-login .alert { padding: 8px 10px; font-size: 11.5px; margin-bottom: 10px; }

/* ========== 4. 响应式适配 ========== */
@media (max-width: 1240px) {
    .admin-shell { max-width: 100%; }
}
@media (max-width: 992px) {
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .admin-side { flex: 0 0 158px; width: 158px; }
}
@media (max-width: 820px) {
    .admin-shell { display: block; padding: 10px 10px 28px; }
    .admin-side { width: 100%; margin-right: 0; margin-bottom: 10px; position: static; }
    .side-menu { flex-direction: row; flex-wrap: wrap; }
    .side-item + .side-item { margin-top: 0; margin-left: 5px; }
    .side-foot { display: none; }
}
@media (max-width: 640px) {
    .admin-topbar { padding: 0 12px; }
    .panel { padding: 10px 12px; }
    .stat { flex: 1 1 45%; min-width: 120px; }
    .toolbar .grow { flex: 1 1 100%; }
}
@media (max-width: 520px) {
    .field-row { display: block; }
    .field-row .field + .field { margin-left: 0; }
    table.data { font-size: 11px; }
    table.data th, table.data td { padding: 5px 6px; }
}

/* 报名记录管理：操作列与单元格居中 */
table.data th.center { text-align: center; }
.actions { white-space: nowrap; }
.actions .inline-form { display: inline-block; margin-left: 6px; vertical-align: middle; }

/* ---------- 请假：手机号拉取候选列表 ---------- */
.cand-box { margin: 0 0 14px; }
.cand-item {
    display: flex; align-items: center; justify-content: space-between;
    border: 1.5px solid #dfe3ea; border-radius: 10px;
    padding: 10px 12px; margin-top: 8px; cursor: pointer;
    background: #fafbfc; transition: border-color .15s, background .15s;
}
.cand-item:hover { border-color: #4f7cff; background: #f5f8ff; }
.cand-item:active { background: #eef3ff; }
.cand-name { font-size: 15px; font-weight: 700; color: #1f2937; }
.cand-meta { font-size: 12px; color: #6b7280; margin-left: 10px; text-align: right; }

/* 请假页：补录手机号模块（区别于常规表单区的独立卡片） */
.bind-card { background: #fff8ec; border: 1px solid #ffe0a3; border-radius: 12px; padding: 12px 14px; margin: 10px 0 4px; }
.bind-card .bind-title { font-size: 14px; font-weight: 700; color: #b06f00; margin-bottom: 4px; }
.bind-card .bind-desc { font-size: 12px; color: #8a6d1f; line-height: 1.6; margin: 0 0 10px; }
.bind-card .bind-status { font-size: 12.5px; font-weight: 600; margin: 8px 2px 0; line-height: 1.6; }
.bind-card .bind-status.ok { color: #1f7a45; }
.bind-card .bind-status.err { color: #c0392b; }
.bind-card .bind-contact { font-size: 11.5px; color: #9a7b2e; margin: 10px 2px 0; line-height: 1.6; }

/* ---------- 请假：家长手机号输入（拉取主键，视觉强调） ---------- */
.field-phone input {
    border-color: #c9d6ff;
    background-color: #fbfcff;
    padding-left: 44px;
    font-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%239aa3b2'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M22%2016.92v3a2%202%200%200%201-2.18%202%2019.79%2019.79%200%200%201-8.63-3.07%2019.5%2019.5%200%200%201-6-6%2019.79%2019.79%200%200%201-3.07-8.67A2%202%200%200%201%204.11%202h3a2%202%200%200%201%202%201.72c.13.96.36%201.9.7%202.81a2%202%200%200%201-.45%202.11L8.09%209.91a16%2016%200%200%200%206%206l1.27-1.27a2%202%200%200%201%202.11-.45c.91.34%201.85.57%202.81.7A2%202%200%200%201%2022%2016.92z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 15px center;
    background-size: 18px 18px;
}
.field-phone input:focus {
    border-color: #4f7cff;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, .15);
}
/* 手机号下方引导提示：清晰易读、与输入框间距合理、移动/桌面一致 */
.phone-hint {
    font-size: 12.5px;
    color: #6b7280;
    margin: 7px 2px 0;
    line-height: 1.6;
}

/* 报名页：家长手机号关键性提示（醒目信息框，与 .alert-info 同色系） */
.phone-note {
    margin: 9px 0 0;
    padding: 9px 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #1d4ed8;
}
.phone-note b { color: #1e40af; }

/* ---------- 后台：请假日历（按日期维度统计） ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 4px; }
.cal-dow { text-align: center; font-size: 12px; color: #8a94a6; padding: 4px 0; }
.cal-cell {
    min-height: 78px; border: 1px solid #eef1f6; border-radius: 10px;
    padding: 8px; background: #fff; display: flex; flex-direction: column;
}
.cal-cell.cal-empty { background: transparent; border: none; }
.cal-cell.cal-past { background: #f7f8fa; }
.cal-cell.cal-past .cal-daynum { color: #aab2c0; }
.cal-cell.cal-today { border-color: #4f7cff; box-shadow: 0 0 0 2px rgba(79, 124, 255, .15); }
.cal-cell.cal-future { background: #fbfcff; }
.cal-daynum { font-size: 13px; font-weight: 600; color: #374151; }
.cal-badge {
    margin-top: auto; align-self: flex-start; font-size: 12px; line-height: 1.4;
    background: #4f7cff; color: #fff; border-radius: 999px; padding: 2px 9px;
    text-decoration: none; white-space: nowrap;
}
.cal-badge:hover { background: #3f6af0; }
.cal-legend { font-size: 12px; color: #8a94a6; margin: 10px 2px 0; line-height: 1.8; }
/* 年级/班级下钻筛选条 */
.cal-filter { margin: 12px 0; }
.cal-filter .field { min-width: 120px; }
/* 当月趋势折线 */
.trend-wrap { padding: 6px 0; }
.trend-svg { width: 100%; height: auto; display: block; }

/* ---------- 后台：管理中控（仪表台） ---------- */
.dash-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.dash-link {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 10px; border: 1px solid #eef1f6; border-radius: 12px;
    background: #fff; color: #374151; text-decoration: none; font-size: 13px; font-weight: 600;
    transition: border-color .15s, box-shadow .15s, transform .05s;
}
.dash-link span { font-size: 13px; }
.dash-link:hover { border-color: #4f7cff; box-shadow: 0 4px 14px rgba(79,124,255,.12); }
.dash-link:active { transform: translateY(1px); }
.dash-notices { display: flex; flex-direction: column; gap: 8px; }
.dash-notice { padding: 10px 12px; border: 1px solid #eef1f6; border-radius: 10px; background: #fff; }
.dn-title { font-size: 14px; font-weight: 600; color: #1f2937; }
.dn-meta { font-size: 12px; color: #8a94a6; margin-top: 3px; }
.stat-phase { color: #2f9e6e; }
.cal-legend .lg { display: inline-block; padding: 1px 8px; border-radius: 6px; margin-right: 4px; }
.lg-today { background: #eaf0ff; color: #2f5bd0; }
.lg-future { background: #fbfcff; color: #4f7cff; border: 1px solid #dbe4ff; }
.lg-past { background: #f1f2f4; color: #aab2c0; }
@media (max-width: 768px) {
    .cal-grid { gap: 4px; }
    .cal-cell { min-height: 58px; padding: 5px; border-radius: 8px; }
    .cal-daynum { font-size: 12px; }
    .cal-badge { font-size: 11px; padding: 1px 6px; }
}
