/* 文泉考研 · 督学打卡 —— 简洁活泼风格（橙 + 青） */
:root {
  --primary: #FF6B35;
  --primary-2: #FF9A3C;
  --teal: #2BC4B0;
  --pink: #FF5E7E;
  --success: #34C77B;
  --warn: #FFA114;
  --danger: #FF4D4F;
  --text: #2D2A32;
  --text-2: #8A8590;
  --bg: #FFF8F2;
  --card: #FFFFFF;
  --line: #F0E9E2;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(255, 107, 53, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  min-height: 100vh; min-height: 100dvh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
[hidden] { display: none !important; }
img { display: block; }

/* ---------- 通用 ---------- */
.container { max-width: 520px; margin: 0 auto; padding: 14px 16px 90px; }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 600;
  transition: transform .12s, opacity .12s; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 16px rgba(255,107,53,.35); }
.btn-teal { background: linear-gradient(135deg, #2BC4B0, #3EDBC5); color: #fff; box-shadow: 0 6px 16px rgba(43,196,176,.3); }
.btn-ghost { background: #FFF1E8; color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 13px; font-size: 16px; }
.btn-danger { background: #FFECEC; color: var(--danger); }
.btn-danger-ghost { background: none; border: 1.5px solid var(--line); color: var(--danger); margin-top: 4px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 16px; outline: none; background: #FFFCFA; color: var(--text);
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { resize: none; min-height: 64px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-approved { background: #E5F8EE; color: #17A55C; }
.badge-pending { background: #FFF3E0; color: #E8890C; }
.badge-rejected { background: #FFECEC; color: var(--danger); }
.badge-makeup { background: #E6F7FB; color: #0C87C9; }
.badge-gray { background: #F1EEF2; color: var(--text-2); }

/* ---------- 登录页 ---------- */
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 56px 22px 40px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.brand-emoji { font-size: 54px; line-height: 1; }
.brand-title { font-size: 26px; margin-top: 8px; letter-spacing: 1px; }
.brand-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.auth-card { padding: 22px; }
.seg { display: flex; background: #F6F1EC; border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.seg-btn { flex: 1; padding: 9px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--text-2); transition: all .15s; }
.seg-btn.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; padding: 10px 14px; font-size: 14px; }
.auth-tip { text-align: center; color: var(--text-2); font-size: 12px; margin-top: 12px; }

/* ---------- 顶部 ---------- */
.hero {
  background: linear-gradient(135deg, #FF8A5C 0%, #FF5E7E 60%, #FF7AB2 100%);
  padding: 22px 18px 30px; border-radius: 0 0 26px 26px; color: #fff;
  box-shadow: 0 8px 24px rgba(255,94,126,.25);
}
.hero-top { max-width: 520px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; }
.hero-brand { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.hero-date { opacity: .92; font-size: 13px; margin-top: 4px; }
.streak-chip {
  background: rgba(255,255,255,.22); backdrop-filter: blur(4px);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600;
}
.streak-chip b { font-size: 16px; }

/* ---------- 统计 chips ---------- */
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  background: var(--card); border-radius: 12px; padding: 8px 12px;
  font-size: 12px; color: var(--text-2); box-shadow: var(--shadow);
}
.chip b { display: block; font-size: 18px; color: var(--text); }
.chip b.green { color: var(--success); }
.chip b.orange { color: var(--warn); }
.chip b.red { color: var(--danger); }
.chip b.blue { color: #0C87C9; }

/* ---------- 任务卡 ---------- */
.task-card { position: relative; overflow: hidden; }
.task-card::before {
  content: "📚"; position: absolute; right: -6px; top: -10px; font-size: 74px; opacity: .08;
}
.task-label { font-size: 12px; font-weight: 700; color: var(--teal); letter-spacing: 2px; margin-bottom: 6px; }
.task-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.task-content { color: var(--text-2); font-size: 14px; white-space: pre-wrap; margin-bottom: 12px; }
.task-drive {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #2BC4B0, #3EDBC5); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  text-decoration: none; box-shadow: 0 5px 14px rgba(43,196,176,.35);
}
.task-empty { text-align: center; padding: 30px 10px; }
.task-empty .big { font-size: 44px; }
.task-empty p { color: var(--text-2); margin-top: 8px; font-size: 14px; }

/* ---------- 补卡提示条 ---------- */
.makeup-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #E6F7FB, #E0F3FF);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  font-size: 13px; color: #0B6B9E; box-shadow: var(--shadow);
}
.makeup-banner .txt { flex: 1; }
.makeup-banner b { font-size: 14px; }

/* ---------- 打卡区 ---------- */
.upload-box {
  border: 2px dashed #FFC9A8; background: #FFFBF7; border-radius: 14px;
  min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--text-2); font-size: 13px; width: 100%; overflow: hidden;
}
.upload-box .cam { font-size: 30px; }
.upload-box img { width: 100%; max-height: 260px; object-fit: contain; }
.checkin-note { margin-top: 12px; }
.checkin-actions { margin-top: 14px; }
.mode-tag {
  display: inline-block; background: #E6F7FB; color: #0C87C9;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; margin-bottom: 10px;
}
.my-checkin-photo { width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; background: #FAF6F2; }
.status-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.reject-reason {
  background: #FFF5F5; border-radius: 10px; padding: 10px 12px;
  color: #C43A3C; font-size: 13px; margin-bottom: 12px;
}

/* ---------- 记录页 ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-head { font-size: 12px; color: var(--text-2); font-weight: 600; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 14px; border-radius: 12px; position: relative; background: #FAF6F1; color: var(--text);
}
.cal-day.blank { background: none; }
.cal-day.today { outline: 2px solid var(--primary); outline-offset: -2px; font-weight: 700; }
.cal-day.s-approved { background: var(--success); color: #fff; font-weight: 700; }
.cal-day.s-pending { background: var(--warn); color: #fff; font-weight: 700; }
.cal-day.s-rejected { background: var(--danger); color: #fff; font-weight: 700; }
.cal-day.s-missed { background: #E9E4EE; color: #B4AEBB; }
.cal-day .makeup-dot {
  position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1.5px #0C87C9;
}
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 11px; color: var(--text-2); }
.cal-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; }
.dot-approved { background: var(--success); }
.dot-pending { background: var(--warn); }
.dot-rejected { background: var(--danger); }
.dot-missed { background: #D8D2DE; }
.dot-makeup { background: #9ADCF0; }

.record-item { display: flex; gap: 12px; }
.record-photo { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: #F5F0EA; }
.record-body { flex: 1; min-width: 0; }
.record-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.record-meta { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.record-note { font-size: 13px; color: var(--text-2); }
.record-flags { display: flex; gap: 6px; }

/* ---------- 我的 ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.profile-name { font-size: 18px; font-weight: 700; }
.profile-phone { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px; }
.stat-cell { text-align: center; }
.stat-cell b { display: block; font-size: 20px; }
.stat-cell span { font-size: 11px; color: var(--text-2); }
.menu-card { padding: 4px 0; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 14px 18px;
  font-size: 15px; border-bottom: 1px solid var(--line);
}
.menu-item:last-child { border-bottom: none; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  max-width: 520px; margin: 0 auto; display: flex;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; padding: 9px 0 8px; font-size: 11px; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 1px; font-weight: 600;
}
.tab span { font-size: 21px; filter: grayscale(1); opacity: .6; transition: all .15s; }
.tab.active { color: var(--primary); }
.tab.active span { filter: none; opacity: 1; transform: translateY(-1px); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; top: 14%; transform: translateX(-50%);
  background: rgba(45,42,50,.92); color: #fff; padding: 11px 20px;
  border-radius: 999px; font-size: 14px; z-index: 999; max-width: 86vw; text-align: center;
  animation: pop .18s ease-out; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
#toast.success { background: rgba(23,165,92,.95); }
#toast.error { background: rgba(255,77,79,.95); }
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }

/* ---------- 管理后台 ---------- */
.admin-body { background: #F7F4F0; }
.admin-nav {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.admin-nav-inner {
  max-width: 960px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.admin-logo { font-weight: 800; font-size: 17px; color: var(--primary); }
.admin-tabs { display: flex; gap: 6px; flex: 1; }
.admin-tab {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2);
}
.admin-tab.active { background: #FFF1E8; color: var(--primary); }
.admin-tab .cnt { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.admin-main { max-width: 960px; margin: 0 auto; padding: 18px 16px 60px; }
.admin-section-title { font-size: 16px; font-weight: 700; margin: 6px 0 12px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-tile { background: #fff; border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.stat-tile b { display: block; font-size: 26px; }
.stat-tile span { font-size: 12px; color: var(--text-2); }
.review-card { display: flex; gap: 14px; }
.review-photo { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; cursor: zoom-in; background: #F5F0EA; flex-shrink: 0; }
.review-body { flex: 1; min-width: 0; }
.review-meta { font-size: 13px; color: var(--text-2); margin: 2px 0 6px; }
.review-note { font-size: 14px; background: #FAF6F1; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.review-actions { display: flex; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--text-2); font-weight: 600; font-size: 12px; background: #FBF8F5; }
.admin-table tr:last-child td { border-bottom: none; }
.link { color: #0C87C9; text-decoration: none; word-break: break-all; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .review-card { flex-direction: column; }
  .review-photo { width: 100%; height: auto; max-height: 260px; }
  .admin-table { display: block; overflow-x: auto; }
}

/* ---------- 督学视图（仅新增 .admin- 等专用类，不改上方共用类，H5 学生端在用） ---------- */
.sup-undone { background: #FFF6F2; }
.admin-badge-special {
  display: inline-block; background: #FDECEC; color: #C0392B; border: 1px solid #F5C6C6;
  font-size: 11px; border-radius: 999px; padding: 1px 8px; margin-left: 4px; font-weight: 600;
}
.flag-warn { color: var(--warn); font-weight: 600; }
.flag-danger { color: var(--danger); font-weight: 700; }
.pill { display: inline-block; background: #EEF6FF; color: #2F80ED; font-size: 11px; border-radius: 999px; padding: 1px 8px; }
.admin-check-box {
  display: flex; flex-wrap: wrap; gap: 8px; max-height: 180px; overflow: auto;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; background: #fff;
}
.admin-check-item {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  background: #FBF8F5; border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
.admin-select { padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; }
.admin-modal {
  position: fixed; inset: 0; background: rgba(30,30,40,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.admin-modal-box {
  background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 460px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); max-height: 80vh; overflow: auto;
}
.admin-modal-title { font-weight: 700; margin-bottom: 14px; }
#modal-body { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.admin-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.ai-review-box { font-size: 13px; background: #F2F6FF; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; color: #2C5AA8; line-height: 1.5; }

/* 分项打卡 */
.items-box { background: #FAF6F1; border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.item-row { background: #fff; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-media { max-width: 180px; border-radius: 8px; margin: 6px 0; display: block; }
.item-comment { margin: 6px 0 0; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 13px; width: 100%; box-sizing: border-box; }

/* 老师角色隐藏管理员专属控件 */
.is-teacher .teacher-only { display: none !important; }

/* 长文本防溢出：连续英文/数字/URL 在任意字符处断行（全局兜底，各 tab 通用） */
.admin-main div, .admin-main p, .admin-main b, .admin-main span, .admin-main td, .admin-main label {
  overflow-wrap: anywhere;
}
