:root {
  --brand: #1989fa;
  --brand-dark: #0e6fd8;
  --success: #07c160;
  --danger: #ee0a24;
  --warning: #ff976a;
  --text: #323233;
  --text-2: #646566;
  --text-3: #969799;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #ebedf0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-max { max-width: 760px; margin: 0 auto; }
.page { padding: 12px 14px 90px; min-height: 100vh; }

/* 顶部导航 */
.app-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.app-head .title { font-size: 16px; font-weight: 600; }
.app-head .link { color: var(--brand); font-size: 13px; background: none; border: 0; cursor: pointer; }

/* 首页 */
.hero {
  background: linear-gradient(135deg, #1989fa 0%, #38bdf8 100%);
  color: #fff; text-align: center;
  padding: 46px 20px 40px; border-radius: 0 0 26px 26px;
}
.hero h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: 1px; }
.hero p { margin: 0; font-size: 13px; opacity: .92; }
.hero-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; margin-bottom: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.landing-actions { margin-top: 28px; padding: 0 18px; }
.landing-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 14px; padding: 20px 18px;
  margin-bottom: 14px; box-shadow: 0 3px 14px rgba(0,0,0,.05); cursor: pointer;
}
.landing-card .ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; flex: none;
}
.landing-card .name { font-size: 17px; font-weight: 600; }
.landing-card .desc { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.admin-link { margin: 22px 0 26px; text-align: center; font-size: 13px; color: #b8b9bc; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.admin-link:active { color: var(--text-3); }

/* 首页整体撑满一屏，管理员登录固定在底部 */
.home-page { display: flex; flex-direction: column; min-height: 100vh; }
.home-page .admin-link { margin: auto 0 0; padding: 20px 0 26px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: var(--card); border-radius: 12px; padding: 14px 16px; }
.stat-card .num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat-card .lab { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat-card.green .num { color: var(--success); }
.stat-card.blue .num { color: var(--brand); }
.stat-card.orange .num { color: var(--warning); }
.stat-card.red .num { color: var(--danger); }
.stat-card.gray .num { color: var(--text-2); }

/* 区块 */
.section { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }

/* 类别分布 */
.cat-item { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.cat-item .lab { width: 86px; color: var(--text-2); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .bar-wrap { flex: 1; height: 8px; background: #f2f3f5; border-radius: 4px; overflow: hidden; }
.cat-item .bar { height: 100%; background: linear-gradient(90deg, #1989fa, #38bdf8); border-radius: 4px; }
.cat-item .cnt { width: 34px; text-align: right; color: var(--text-3); flex: none; }

/* 表格（小屏横向滚动） */
.table-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
table.grid th {
  text-align: left; color: var(--text-3); font-weight: 400;
  padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; background: #fff;
}
table.grid td { padding: 10px 8px; border-bottom: 1px solid #f2f3f5; white-space: nowrap; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:active { background: #f7f8fa; }

/* 详情 */
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row .k { color: var(--text-3); flex: none; }
.detail-row .v { text-align: right; word-break: break-all; }

/* 签名 */
.sig-wrap { margin-top: 8px; }
.sig-canvas { width: 100%; height: 150px; border: 1px dashed #c8c9cc; border-radius: 8px; background: #fff; touch-action: none; }
.sig-preview img { width: 100%; max-width: 320px; border: 1px solid var(--border); border-radius: 8px; display: block; }

/* 全屏签名 */
.fullsig-mask {
  position: fixed; inset: 0; z-index: 3000; background: #fff;
  display: flex; flex-direction: column;
}
.fullsig-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px calc(14px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid #f2f3f5;
}
.fullsig-title { font-size: 16px; font-weight: 600; }
.fullsig-btn { background: none; border: 0; font-size: 15px; color: var(--text-2); padding: 4px 8px; }
.fullsig-done { color: var(--brand); font-weight: 600; }
.fullsig-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 16px; }
.fullsig-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); text-align: center; }

/* 签名入口 */
.sig-entry {
  border: 1.5px dashed #c8c9cc; border-radius: 12px; text-align: center;
  padding: 22px 12px; color: var(--text-3); background: #fff; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sig-entry:active { background: #f7f8fa; border-color: var(--brand); }
.sig-entry-icon { font-size: 28px; margin-bottom: 6px; }

/* 表单间距 */
.form-block { margin-bottom: 16px; }
.form-label { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.field-note { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* 工具按钮 */
.action-row { display: flex; gap: 10px; margin: 12px 0; }
.action-row .van-button { flex: 1; }

/* 桌面端适配 */
@media (min-width: 768px) {
  .page { padding: 20px 24px 60px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .landing-actions { max-width: 480px; margin: 34px auto 0; }
  .hero { border-radius: 0 0 32px 32px; padding: 56px 20px 48px; }
}

.muted { color: var(--text-3); font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }

/* 班主任端：学生卡片 */
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.stu-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 6px; border-bottom: 1px solid #f2f3f5; cursor: pointer;
}
.stu-card:last-child { border-bottom: 0; }
.stu-card:active { background: #f7f8fa; }
.stu-name { font-size: 16px; font-weight: 500; color: var(--text-3); }
.stu-name.filled { color: #07c160; font-weight: 600; }
.stu-tags { display: flex; gap: 6px; flex: none; }

/* 图形验证码 */
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row .van-cell { flex: 1; }
.captcha-img { height: 42px; width: 120px; border-radius: 8px; border: 1px solid #ebedf0; cursor: pointer; flex: none; background: #f5f7fa; }

/* 网站 Logo 预览 */
.logo-preview { width: 72px; height: 72px; border-radius: 12px; border: 1px solid var(--border); object-fit: cover; }

/* 班级点选 */
.class-pick .van-cell.selected { background: #e8f3ff; }
.class-pick .van-cell.selected .van-cell__title { color: var(--brand); font-weight: 600; }
