/* ============================================================
   课时查询系统 样式表
   主色：墨绿 / 朱砂 / 宣纸米白
   ============================================================ */
:root {
  --ink: #1b2a26;
  --ink-2: #43564f;
  --muted: #7d8b86;
  --paper: #f7f2e8;
  --paper-2: #efe6d5;
  --line: #e4dac6;
  --jade: #c0392b;
  --jade-deep: #922b21;
  --cinnabar: #b4472f;
  --gold: #b28f51;
  --white: #fffdf8;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(27, 42, 38, .08);
  --shadow-sm: 0 4px 14px rgba(27, 42, 38, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 8% -10%, rgba(178, 143, 81, .10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(192, 57, 43, .10), transparent 55%),
    repeating-linear-gradient(0deg, rgba(180, 165, 135, .07) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(180, 165, 135, .05) 0 1px, transparent 1px 28px);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: "STZhongsong", "Songti SC", "SimSun", "Noto Serif SC", serif;
  color: var(--ink);
  letter-spacing: .5px;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }
.muted { color: var(--muted); }

.wrap { width: min(1080px, 100% - 40px); margin: 0 auto; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 242, 232, .88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(228, 218, 198, .9);
}

.topbar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0 8px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-seal {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--jade), var(--jade-deep));
  color: #f6efe1;
  font-family: "SimHei", "Microsoft YaHei", sans-serif;
  font-size: 26px;
  font-weight: 900;
  -webkit-text-stroke: 0.5px #f6efe1;
  text-shadow: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), var(--shadow-sm);
}

.brand-seal.small { width: 34px; height: 34px; font-size: 17px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; letter-spacing: 1px; }
.brand-text small { color: var(--muted); font-size: 12px; letter-spacing: 2px; }
.brand-logo { height: 38px; width: auto; display: block; }

.topnav { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; flex-wrap: wrap; }

.topnav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: bold;
  color: var(--jade-deep);
  transition: .2s;
  white-space: nowrap;
}

.topnav a:hover { background: rgba(192, 57, 43, .08); color: var(--jade-deep); }
.topnav a.active { background: var(--jade); color: #f5f1e6; box-shadow: var(--shadow-sm); }

/* ---------------- 首页主视觉 ---------------- */
.hero { padding: 56px 0 46px; position: relative; overflow: hidden; }

.hero::after {
  content: "課";
  position: absolute;
  right: 3%; top: 4%;
  font-family: "STZhongsong", "SimSun", serif;
  font-size: clamp(90px, 22vw, 210px);
  color: rgba(44, 86, 72, .055);
  line-height: 1;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; display: grid; gap: 34px; }

.hero-copy { max-width: 640px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.15;
  letter-spacing: 6px;
  margin-bottom: 14px;
}

.hero-sub { font-size: 18px; color: var(--jade); letter-spacing: 3px; margin-bottom: 12px; }
.hero-desc { color: var(--ink-2); max-width: 520px; }

/* ---------------- 查询卡 ---------------- */
.query-card {
  background: linear-gradient(180deg, #fffefb, var(--white));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 28px 22px;
  box-shadow: var(--shadow);
  position: relative;
}

.query-card::before {
  content: "";
  position: absolute;
  left: 28px; right: 28px; top: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--jade), var(--gold) 55%, var(--cinnabar));
  opacity: .75;
}

.field-label { display: block; font-size: 13px; color: var(--ink-2); letter-spacing: 1px; margin-bottom: 10px; }

.query-row { display: flex; gap: 12px; }

.input-lg {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 20px;
  font-size: 17px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: .22s;
}

.input-lg::placeholder { color: #b3b0a6; font-size: 15px; }
.input-lg:focus { border-color: var(--jade); box-shadow: 0 0 0 4px rgba(192, 57, 43, .10); }

.btn-primary {
  height: 54px;
  padding: 0 34px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(160deg, #c0392b, #922b21);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  letter-spacing: 4px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(192, 57, 43, .3);
  transition: .22s;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(192, 57, 43, .4); }
.btn-primary:active { transform: translateY(0); }

.query-hint { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------------- 提示条 ---------------- */
.alert {
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14.5px;
  margin-bottom: 22px;
  border: 1px solid transparent;
}
.alert-warn { background: #fdf1ed; border-color: #f0cfc4; color: #8c3a24; }
.alert-info { background: #eef5f1; border-color: #cfe2d8; color: #245244; }

/* ---------------- 查询结果 ---------------- */
.result-section { padding-bottom: 10px; }

.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.result-head h2 { font-size: 24px; letter-spacing: 2px; }
.result-head .muted { font-size: 13px; }

.student-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.student-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--jade), var(--gold));
}

.sc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }

.sc-id h3 { font-size: 26px; letter-spacing: 3px; margin-bottom: 8px; }

.sc-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }

.tag {
  font-size: 12.5px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(192, 57, 43, .10);
  color: var(--jade-deep);
}
.tag.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }

.state { font-size: 12px; padding: 3px 10px; border-radius: 999px; letter-spacing: 1px; }
.state-ok { background: #eaf4ee; color: #256b4f; }
.state-warn { background: #fdf1e6; color: #a05a1c; }
.state-danger { background: #fbe9e5; color: #a1391f; }
.state-muted { background: #f0eee9; color: #7c7a72; }

.sc-meta { font-size: 13px; color: var(--muted); }

.sc-balance { text-align: left; min-width: 100%; margin-bottom: 16px; padding: 20px; background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%); border-radius: 12px; border: 2px solid #ff4d4f; }
.balance-num {
  font-family: "STZhongsong", "SimSun", serif;
  font-size: 72px;
  line-height: 1;
  color: #ff4d4f;
  letter-spacing: 2px;
  font-weight: bold;
  text-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}
.balance-unit { font-size: 20px; color: #ff4d4f; margin-left: 6px; font-weight: bold; }
.balance-label { display: block; font-size: 16px; color: #cf1322; letter-spacing: 4px; margin-top: 8px; font-weight: bold; text-align: left; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--paper-2);
  margin: 20px 0 6px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--jade), #e74c3c);
  transition: width .7s ease;
}
.progress-bar.warn { background: linear-gradient(90deg, #c8862f, #d9a851); }
.progress-bar.danger { background: linear-gradient(90deg, var(--cinnabar), #d07153); }

.sc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 6px;
  padding: 0;
}
.sc-stats > div {
  background: #fbf8f1;
  border: 1px solid #f0e9db;
  border-radius: 12px;
  padding: 10px 14px;
}
.sc-stats dt { font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.sc-stats dd { margin: 2px 0 0; font-size: 15px; color: var(--ink); }

.balance-tip {
  margin-top: 14px;
  font-size: 13px;
  color: #9a4a1d;
  background: #fdf3e7;
  border: 1px dashed #edcfab;
  border-radius: 10px;
  padding: 9px 14px;
}

.sc-lessons { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 16px; }
.sc-lessons h4 { font-size: 15px; letter-spacing: 2px; margin-bottom: 10px; color: var(--ink-2); }

.record-list { display: flex; flex-direction: column; }

.record-row {
  display: grid;
  grid-template-columns: 132px 1fr 92px 68px;
  gap: 12px;
  align-items: center;
  padding: 9px 8px;
  border-bottom: 1px solid #f3eee3;
  font-size: 14px;
}
.record-row:last-child { border-bottom: 0; }
.record-head { color: var(--muted); font-size: 12px; padding: 4px 8px 6px; }
.record-head .record-date,
.record-head .record-content,
.record-head .record-teacher,
.record-head .record-hours { color: var(--muted); font-size: 12px; }
.record-date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.sc-time { margin: 8px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.sc-time .sc-time-label { color: var(--muted); font-size: 12.5px; letter-spacing: 1px; }
.sc-time strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-time .sc-term { color: var(--muted); font-size: 12px; }
.sc-note { margin: 8px 0 0; display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.sc-note strong { color: var(--ink); font-weight: 500; line-height: 1.6; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.record-content { color: var(--ink); }
.record-teacher { color: var(--ink-2); font-size: 13px; }
.record-hours { text-align: right; color: var(--cinnabar); font-size: 13.5px; }

.empty { color: var(--muted); font-size: 14px; padding: 10px 0; }

/* ---------------- 查询须知 ---------------- */
.info-section { padding: 26px 0 56px; }
.section-title { font-size: 22px; letter-spacing: 3px; margin-bottom: 20px; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.info-card {
  background: rgba(255, 253, 248, .82);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 18px;
  position: relative;
}
.info-step {
  font-family: "STZhongsong", "SimSun", serif;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 2px;
}
.info-card h3 { font-size: 17px; margin: 8px 0 8px; letter-spacing: 1px; }
.info-card p { font-size: 13.5px; color: var(--ink-2); }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--line); background: rgba(239, 230, 213, .5); padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { font-size: 15px; letter-spacing: 1px; }
.footer-brand p { font-size: 12.5px; }
.footer-meta { text-align: right; font-size: 12.5px; color: var(--ink-2); }
.footer-meta .muted { margin-top: 2px; }
.footer-icp a { color: var(--ink-2); text-decoration: none; }
.footer-icp a:hover { color: var(--cinnabar); text-decoration: underline; }

/* ============================================================
   后台
   ============================================================ */
body.admin { background: #f4f0e7; }

.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: linear-gradient(180deg, #213a32, #1a2f29);
  color: #e9e3d5;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand .brand-seal { background: rgba(255, 255, 255, .12); box-shadow: none; }
.sidebar-brand strong { display: block; font-size: 15px; letter-spacing: 1px; }
.sidebar-brand small { font-size: 11.5px; color: rgba(233, 227, 213, .55); letter-spacing: 2px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  color: rgba(233, 227, 213, .78);
  transition: .2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-nav a .dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(233, 227, 213, .35); }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .13); color: #fff; }
.side-nav a.active .dot { background: var(--gold); }

.sidebar-foot { margin-top: auto; font-size: 12.5px; color: rgba(233, 227, 213, .6); }
.sidebar-foot a { display: inline-block; padding: 8px 0; }
.sidebar-foot a:hover { color: #fff; }

.admin-main { flex: 1; min-width: 0; padding: 28px 32px 60px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 26px; letter-spacing: 2px; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head { padding: 16px 20px; border-bottom: 1px solid #f0e9db; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; letter-spacing: 1px; }
.panel-body { padding: 20px; }
.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.75; }
.alert p { margin: 0 0 6px; }
.alert p:last-child { margin: 0; }
.alert-err { background: #fdf2ee; border: 1px solid #f0d2c6; color: #a1391f; }
.alert-ok { background: #eef4ea; border: 1px solid #cfe0c5; color: #33552f; }
.hint-block h3 { font-size: 15px; margin: 0 0 8px; color: var(--ink); letter-spacing: 1px; }
.hint-block p { margin: 0 0 5px; font-size: 13px; color: var(--muted); line-height: 1.75; }
.panel-flush { padding: 0; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card .k { font-size: 12.5px; color: var(--muted); letter-spacing: 1px; }
.stat-card .v {
  font-family: "STZhongsong", "SimSun", serif;
  font-size: 30px;
  line-height: 1.4;
  color: var(--jade-deep);
}
.stat-card .v small { font-size: 13px; color: var(--muted); margin-left: 4px; font-family: inherit; }
.stat-card .foot { font-size: 12px; color: var(--muted); }
.stat-card::after { content: ""; position: absolute; right: -18px; top: -18px; width: 62px; height: 62px; border-radius: 50%; background: rgba(44, 86, 72, .06); }
.stat-card.alert::after { background: rgba(180, 71, 47, .08); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  background: #faf7f0;
  padding: 12px 16px;
  border-bottom: 1px solid #f0e9db;
  white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid #f5f0e6; vertical-align: middle; line-height: 1.6; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fdfbf6; }
.table .num { font-variant-numeric: tabular-nums; }
.table .remain { font-weight: 600; color: var(--jade-deep); }
.table .remain.low { color: var(--cinnabar); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.badge-ok { background: #eaf4ee; color: #256b4f; }
.badge-warn { background: #fdf1e6; color: #a05a1c; }
.badge-danger { background: #fbe9e5; color: #a1391f; }
.badge-muted { background: #f0eee9; color: #7c7a72; }

/* 按钮 */
.btn, .btn-ghost, .btn-danger, .btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  border-radius: 10px;
  transition: .18s;
  white-space: nowrap;
}

.btn-ghost {
  padding: 9px 16px;
  font-size: 13.5px;
  background: #faf7f0;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { background: #f3ede0; color: var(--ink); }

.btn-danger {
  padding: 9px 16px;
  font-size: 13.5px;
  background: #fbece8;
  color: #a1391f;
  border: 1px solid #f2d3c9;
}
.btn-danger:hover { background: #f7dfd8; }

.btn-sm { padding: 5px 12px; font-size: 12.5px; background: #f4efe4; color: var(--ink-2); }
.btn-sm:hover { background: #eae3d3; }

.btn-primary.sm { height: 40px; padding: 0 20px; font-size: 14px; letter-spacing: 2px; border-radius: 10px; }

/* 表单 */
.form-card { max-width: 780px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-item { display: flex; flex-direction: column; gap: 7px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; color: var(--ink-2); }
.form-item label .req { color: var(--cinnabar); margin-left: 3px; }
.input, select.input, textarea.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: .18s;
}
textarea.input { height: auto; min-height: 88px; padding: 11px 14px; line-height: 1.6; resize: vertical; }
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(192, 57, 43, .09); }
.form-item .hint { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.form-actions .btn-primary { letter-spacing: 2px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input { height: 40px; width: 230px; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 20px;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(178, 143, 81, .16), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(44, 86, 72, .18), transparent 60%),
    var(--paper);
}
.login-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 32px 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute; left: 32px; right: 32px; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--jade), var(--gold), var(--cinnabar));
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand h1 { font-size: 22px; letter-spacing: 3px; }
.login-tip { font-size: 12.5px; color: var(--muted); margin-bottom: 24px; }
.login-card .form-item { margin-bottom: 16px; }
.login-card .btn-primary { width: 100%; letter-spacing: 6px; margin-top: 6px; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.login-back:hover { color: var(--jade); }

/* 提示 */
.toast {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.toast-ok { background: #edf6f0; border-color: #cce4d6; color: #205a42; }
.toast-err { background: #fdeeea; border-color: #f0cfc4; color: #97381f; }

/* 空状态 */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
  .sc-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 10;
    flex-direction: column; gap: 12px; padding: 14px 16px;
  }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .side-nav a { white-space: nowrap; padding: 9px 13px; font-size: 13.5px; }
  .side-nav a .dot { display: none; }
  .sidebar-foot { display: none; }
  .admin-main { padding: 20px 16px 50px; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { padding: 10px 0 6px; gap: 8px; align-items: center !important; flex-direction: column !important; }
  .brand { gap: 8px; min-width: 0; flex-shrink: 0; justify-content: center; align-items: center; }
  .brand-seal { width: 36px; height: 36px; font-size: 19px; border-radius: 8px; }
  .brand-text strong { font-size: 15px; letter-spacing: 0; white-space: nowrap; }
  .brand-text small { display: none; }
  .brand-logo { height: 30px; }
  .topnav { gap: 4px; flex-shrink: 1; justify-content: center !important; flex-wrap: wrap !important; width: 100% !important; display: flex !important; }
  .topnav a { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .hero { padding: 34px 0 30px; }
  .hero h1 { letter-spacing: 4px; }
  .query-card { padding: 22px 18px 18px; }
  .query-row { flex-direction: column; }
  .btn-primary { width: 100%; letter-spacing: 6px; }
  .student-card { padding: 20px 18px 16px; }
  .sc-head { flex-direction: column; align-items: flex-start; }
  .sc-id h3 { font-size: 22px; }
  .sc-balance { text-align: left; }
  .balance-num { font-size: 38px; }
  .record-row { grid-template-columns: 96px 1fr; row-gap: 2px; padding: 10px 4px; }
  .record-date { white-space: normal; font-size: 12.5px; line-height: 1.45; }
  .record-teacher { display: none; }
  .record-hours { grid-column: 2; text-align: left; }
  .record-content { grid-column: 2; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .input { width: 100%; }
  .table th, .table td { padding: 10px 12px; }
  .page-head h1 { font-size: 22px; }
  .login-card { padding: 28px 22px 22px; }
}

@media print {
  .topbar, .footer, .hero::after, .query-card, .info-section { display: none !important; }
  body { background: #fff; }
}

/* ---------------- 学员作品 ---------------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.work-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
}

.work-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.work-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.work-info {
  padding: 16px;
}

.work-info h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--ink);
}

.work-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.work-actions {
  margin-top: 10px;
  display: flex;
  gap: 12px;
}

.work-actions a {
  font-size: 13px;
  color: var(--jade-deep);
}

@media (max-width: 720px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .work-item img {
    aspect-ratio: 3/4;
  }
  .work-info {
    padding: 10px;
  }
  .work-info h3 {
    font-size: 14px;
  }
}

/* ---------------- 已上课时 · 日历弹窗 ---------------- */
.used-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--jade-deep);
  background: #fbeeea;
  border: 1px solid #ecc9c0;
  border-radius: 9px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.used-btn:hover { background: #f6ddd6; }
.used-btn-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .5px;
}

.cal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cal-modal[hidden] { display: none; }
.cal-mask {
  position: absolute;
  inset: 0;
  background: rgba(27, 42, 38, .45);
}
.cal-panel {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.cal-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 9px;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
}
.cal-nav:hover { background: #f0e9db; }
.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-week span {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}
.cal-day {
  min-height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 0;
  font-size: 13.5px;
  border-radius: 10px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cal-day.blank { visibility: hidden; }
.cal-day-num { line-height: 1.1; }
.cal-day-badge { font-size: 10px; line-height: 1; opacity: .92; }
.cal-day.has-lesson {
  background: var(--cinnabar);
  color: #fff;
  font-weight: 600;
}
.ce-day-stepper { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; }
.ce-day-step {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .25);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ce-day-step:hover { background: rgba(255, 255, 255, .4); }
.ce-day-hours { font-size: 11px; min-width: 20px; text-align: center; }
.cal-tip {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.cal-close {
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}
.cal-close:hover { background: #f0e9db; }

/* ---------------- 后台：历史上课日期改期 ---------------- */
.cal-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--jade-deep);
  background: #fbeeea;
  border: 1px solid #ecc9c0;
  border-radius: 9px;
  cursor: pointer;
}
.cal-edit-btn:hover { background: #f6ddd6; }
.cal-edit-panel { max-width: 440px; }
.ce-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ce-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
}
.ce-row.active { border-color: var(--cinnabar); background: #fbeeea; }
.ce-row-date-text { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.ce-summary { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.ce-summary strong { color: var(--cinnabar); font-size: 15px; }
.ce-row-time { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.ce-row-content {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ce-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.ce-step {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ce-step:hover { background: #f0e9db; }
.ce-hours-num { font-size: 13px; color: var(--ink); min-width: 44px; text-align: center; }
@media (max-width: 480px) {
  .ce-row { flex-wrap: wrap; }
  .ce-row-content { white-space: normal; }
}
