/* ============================================================
 * 才彦生涯 · 校园活动信息采集平台 —— 家长端样式（移动优先）
 * 四套主题（借鉴 caiji 系统）：红（默认，呼应 logo 红金）/ 紫 / 绿 / 蓝
 * 机制：html[data-theme="…"] 覆盖 --cy-* 令牌，只换色不动布局。
 * ============================================================ */

:root {
  --cy-primary: #c8231e;
  --cy-primary-deep: #a81b16;
  --cy-primary-050: #fdeceb;
  --cy-primary-100: #f2b3ae;
  --cy-grad: linear-gradient(135deg, #c8231e, #e05a2a);
  --cy-bg: #f5f6f8;
  --cy-card: #ffffff;
  --cy-border: #e6e8eb;
  --cy-line: #eef0f2;
  --cy-text: #23252a;
  --cy-text-2: #6b7280;
  --cy-text-3: #9aa1ac;
  --cy-gold: #b8860b;
  --cy-ok: #1e7a45;  --cy-ok-bg: #e8f6ec;
  --cy-warn: #b45309; --cy-warn-bg: #fff7ed;
  --cy-danger: #b3261e; --cy-danger-bg: #fef2f2;
}
html[data-theme="thu"] {
  --cy-primary: #660874; --cy-primary-deep: #4d0957; --cy-primary-050: #f6eef8; --cy-primary-100: #e3cbe9;
  --cy-grad: linear-gradient(135deg, #4d0957, #7d2187);
}
html[data-theme="shnu"] {
  --cy-primary: #1c5a49; --cy-primary-deep: #144437; --cy-primary-050: #e9f3ef; --cy-primary-100: #c2d8ca;
  --cy-grad: linear-gradient(135deg, #144437, #2a7a5f);
}
html[data-theme="xjtlu"] {
  --cy-primary: #12227d; --cy-primary-deep: #010544; --cy-primary-050: #eceefb; --cy-primary-100: #c6cce0;
  --cy-grad: linear-gradient(135deg, #010544, #28409f);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--cy-bg); color: var(--cy-text); line-height: 1.6; font-size: 16px;
}
a { color: var(--cy-primary); text-decoration: none; }

/* ---------- 页头（无顶栏，右下角轻量浮动：⌂ + 四个换色点） ---------- */
.theme-float {
  position: fixed; right: 12px; bottom: 12px; z-index: 99;
  display: flex; align-items: center; gap: 8px;
}
.theme-float .theme-switch { position: static; display: inline-flex; gap: 5px; }
.theme-float .theme-home {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--cy-card); border: 1px solid var(--cy-border);
  font-size: 15px; color: var(--cy-primary); text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.theme-dot {
  width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--cy-border); cursor: pointer; background: var(--dot);
}
.theme-dot.is-on { box-shadow: 0 0 0 2px var(--cy-primary); }

/* ---------- 布局 ---------- */
.container { max-width: 640px; margin: 0 auto; padding: 14px 14px 24px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--cy-card); border-radius: 12px; padding: 18px;
  margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card-title { font-size: 17px; font-weight: 600; color: var(--cy-text); margin-bottom: 4px; }

/* ---------- 活动列表 ---------- */
.act-card {
  display: block; background: var(--cy-card); border-radius: 12px; padding: 16px 18px;
  margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); color: var(--cy-text);
  border-left: 4px solid var(--cy-primary);
}
.act-card .t { font-size: 17px; font-weight: 600; }
.act-card .d { font-size: 14px; color: var(--cy-text-2); margin-top: 6px; white-space: pre-wrap; line-height: 1.7; }
.act-card .meta { font-size: 12px; color: var(--cy-text-3); margin-top: 8px; }
.act-card.archived { border-left-color: var(--cy-text-3); }
.act-card.archived .t { color: var(--cy-text-2); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px;
}
.tag-open { background: var(--cy-ok-bg); color: var(--cy-ok); }
.tag-archived { background: #f0f1f3; color: var(--cy-text-2); }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 15px; font-weight: 500; color: var(--cy-text); margin-bottom: 7px; }
.form-group label .req { color: var(--cy-danger); margin-left: 2px; }
.form-group .hint { font-size: 12px; color: var(--cy-text-3); margin-top: 4px; }
/* 身份证号即时校验提示（ok 绿 / warn 黄 / err 红 / muted 灰） */
.idcard-tip { font-size: 12.5px; line-height: 1.55; margin-top: 6px; color: var(--cy-text-3); word-break: break-all; }
.idcard-tip:empty { margin: 0; }
.idcard-tip.muted { color: var(--cy-text-3); }
.idcard-tip.ok { color: var(--cy-ok); }
.idcard-tip.warn { color: var(--cy-warn); background: var(--cy-warn-bg); border: 1px solid #fed7aa; border-radius: 6px; padding: 6px 9px; }
.idcard-tip.err { color: var(--cy-danger); background: var(--cy-danger-bg); border: 1px solid #fecaca; border-radius: 6px; padding: 6px 9px; }
input[type="text"], input[type="number"], input[type="tel"], input[type="password"], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--cy-border); border-radius: 10px;
  font-size: 16px; background: #fff; color: var(--cy-text); transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cy-primary); box-shadow: 0 0 0 3px var(--cy-primary-050); }
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }

/* 选科勾选块 */
.xuanke-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.xuanke-item {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 6px; border: 1px solid var(--cy-border); border-radius: 10px; cursor: pointer;
  font-size: 15px; user-select: none; background: #fff; transition: all .15s;
}
.xuanke-item.on { border-color: var(--cy-primary); background: var(--cy-primary-050); color: var(--cy-primary); font-weight: 600; }
.xuanke-item input { display: none; }
.xuanke-count { font-size: 13px; color: var(--cy-text-2); margin-top: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: none; border-radius: 10px; padding: 13px 20px; font-size: 16px;
  font-weight: 600; cursor: pointer; text-align: center; transition: opacity .15s; font-family: inherit;
}
.btn:active { opacity: .85; }
.btn-primary { background: var(--cy-primary); color: #fff; width: 100%; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--cy-primary); border: 1px solid var(--cy-primary); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* 验证码按钮 */
.code-btn {
  flex-shrink: 0; border: 1px solid var(--cy-primary); background: #fff; color: var(--cy-primary);
  border-radius: 10px; padding: 0 14px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.code-btn:disabled { color: var(--cy-text-3); border-color: var(--cy-border); }
.phone-row { display: flex; gap: 10px; }
.phone-row input { flex: 1; }

/* ---------- 提示条 ---------- */
.msg { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.msg-error { background: var(--cy-danger-bg); color: var(--cy-danger); }
.msg-success { background: var(--cy-ok-bg); color: var(--cy-ok); }
.msg-info { background: var(--cy-warn-bg); color: var(--cy-warn); }

/* ---------- 登录卡片 ---------- */
.login-hero { text-align: center; padding: 8px 0 4px; }
.login-hero .logo { height: 60px; max-width: 240px; object-fit: contain; }
.login-hero h1 { font-size: 19px; font-weight: 700; margin-top: 10px; }
.login-hero .sub { font-size: 14px; color: var(--cy-text-2); margin-top: 4px; }
.login-tip {
  background: var(--cy-primary-050); border: 1px solid var(--cy-primary-100);
  color: var(--cy-primary-deep); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 14px;
}

/* ---------- 我的 / 详情 ---------- */
.field-list { border-top: 1px solid var(--cy-line); }
.field-row { display: flex; padding: 12px 2px; border-bottom: 1px solid var(--cy-line); font-size: 15px; }
.field-row .k { width: 110px; flex-shrink: 0; color: var(--cy-text-2); }
.field-row .v { flex: 1; word-break: break-all; }

/* ---------- 照片 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-cell { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--cy-line); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-box {
  border: 1.5px dashed var(--cy-border); border-radius: 10px; padding: 22px; text-align: center;
  color: var(--cy-text-2); font-size: 14px; cursor: pointer; background: #fafbfc;
}
.upload-box:active { background: var(--cy-primary-050); }

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

/* ---------- 底部 ---------- */
.footer { text-align: center; color: var(--cy-text-3); font-size: 12px; padding: 8px 0 12px; }
.footer a { color: var(--cy-text-3); }
.footer a.foot-brand { color: var(--cy-text-3); text-decoration: none; }

/* ---------- 只读锁定提示 ---------- */
.lock-banner { background: #f0f1f3; color: var(--cy-text-2); text-align: center; padding: 10px; font-size: 13px; border-radius: 8px; margin-bottom: 14px; }

@media (max-width: 380px) {
  body { font-size: 15px; }
  .xuanke-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- SEO 落地页 ---------- */
.seo-hero {
  background: var(--cy-card); border-radius: 12px; padding: 18px 20px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); text-align: center;
}
.seo-hero h1 { font-size: 21px; font-weight: 700; color: var(--cy-text); line-height: 1.5; margin-bottom: 8px; }
.seo-hero .lead { font-size: 15px; color: var(--cy-text-2); line-height: 1.8; margin-bottom: 14px; }
.seo-hero .lead span { color: var(--cy-primary); font-weight: 600; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { width: auto; min-width: 160px; }

.seo-section { background: var(--cy-card); border-radius: 12px; padding: 16px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.seo-section h2 { font-size: 17px; font-weight: 700; color: var(--cy-text); margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--cy-primary); }

.kw-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kw-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kw-item { border: 1px solid var(--cy-line); border-radius: 10px; padding: 14px 14px; background: #fbfcfd; }
.kw-item b { display: block; font-size: 15px; color: var(--cy-primary); margin-bottom: 6px; }
.kw-item p { font-size: 13px; color: var(--cy-text-2); line-height: 1.7; margin: 0; }

@media (max-width: 600px) {
  .seo-hero h1 { font-size: 18px; }
  .kw-grid, .kw-grid-3 { grid-template-columns: 1fr; }
}

/* ---------- 分享弹窗 ---------- */
.share-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.share-panel {
  background: #fff; border-radius: 16px; padding: 24px 22px 22px; width: 100%; max-width: 320px;
  text-align: center; position: relative;
}
.share-close { position: absolute; top: 10px; right: 14px; font-size: 26px; color: var(--cy-text-3); cursor: pointer; line-height: 1; }
.share-head .share-emoji { font-size: 28px; line-height: 1; margin-bottom: 6px; }
.share-head h3 { font-size: 17px; font-weight: 700; color: var(--cy-text); margin-bottom: 4px; }
.share-title { font-size: 13px; color: var(--cy-text-2); margin-bottom: 14px; }
.share-qr {
  display: flex; justify-content: center; margin-bottom: 10px;
  padding: 10px; border: 1px solid var(--cy-line); border-radius: 12px; background: #fff;
}
.share-qr canvas, .share-qr img { border-radius: 4px; }
.share-tip { font-size: 12px; color: var(--cy-text-3); margin-bottom: 14px; }
.share-url { font-size: 12px; color: var(--cy-text-3); word-break: break-all; margin-bottom: 4px; }

/* ---------- 活动说明富文本 ---------- */
.act-desc img, .act-desc video { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 6px 0; }
.act-desc p { margin: 0 0 8px; }
.act-desc a { color: var(--cy-primary); word-break: break-all; }

/* ---------- 分享合成海报 ---------- */
.share-forward-hint { font-size: 13px; color: #7c3aed; font-weight: 600; margin-top: 12px; text-align: center; }
.share-poster { display: flex; justify-content: center; }
.share-poster canvas { max-width: 100%; height: auto; border-radius: 8px; }

/* ---------- v1.6.0 学段通栏条 ---------- */
/* 位置：首页 hero 之下、「火热报名中」之上。配色全部走 --cy-* 令牌，
   四套主题（红/紫/绿/蓝）自动跟随，无需各主题单独写。 */
.stage-bar {
  background: var(--cy-grad);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .10);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stage-bar-txt { flex: 1 1 200px; min-width: 0; color: #fff; }
.stage-bar-txt b { display: block; font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 3px; }
.stage-bar-txt span { display: block; font-size: 12.5px; line-height: 1.6; opacity: .92; }
.stage-bar-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-bar-btn {
  display: inline-block;
  background: #fff;
  color: var(--cy-primary-deep);
  font-size: 14px; font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.stage-bar-btn:hover { opacity: .9; }
/* 次要按钮：半透明描边，与主按钮并排时层次分明 */
.stage-bar-btn-ghost {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
}
@media (max-width: 400px) {
  .stage-bar-txt b { font-size: 15px; }
  .stage-bar-btn { padding: 7px 13px; font-size: 13px; }
}

/* ---------- v1.6.0 成绩查询页 ---------- */
.stu-switch, .exam-switch { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.stu-chip, .exam-chip {
  font-size: 13px; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  background: var(--cy-card); color: var(--cy-text-2);
  box-shadow: inset 0 0 0 1px var(--cy-border);
}
.stu-chip.on, .exam-chip.on {
  background: var(--cy-primary); color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--cy-primary);
}
.stu-meta { font-size: 14px; font-weight: 600; color: var(--cy-text); margin-bottom: 12px; }

.match-form { background: var(--cy-card); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.match-form label { display: block; font-size: 13px; color: var(--cy-text-2); margin-bottom: 10px; }
.match-form input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--cy-border); border-radius: 8px; background: var(--cy-card); color: var(--cy-text);
}

.score-head {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.score-head > div {
  flex: 1 1 110px; background: var(--cy-card); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.score-head .lab { display: block; font-size: 12.5px; color: var(--cy-text-2); margin-bottom: 2px; }
.score-total b { font-size: 26px; color: var(--cy-primary); font-weight: 800; }
.score-rank { font-size: 13px; color: var(--cy-text-2); line-height: 1.9; }
.score-rank b { font-size: 15px; color: var(--cy-text); }

.score-table { width: 100%; border-collapse: collapse; background: var(--cy-card); border-radius: 12px; overflow: hidden; font-size: 14px; }
.score-table th, .score-table td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--cy-line); }
.score-table th { background: var(--cy-bg); color: var(--cy-text-2); font-weight: 600; font-size: 13px; }
.score-table td:first-child { text-align: left; font-weight: 600; color: var(--cy-text); }
.score-table tr:last-child td { border-bottom: none; }
.score-tip { font-size: 12.5px; color: var(--cy-text-2); line-height: 1.7; margin-top: 10px; }

.guide-card {
  margin-top: 16px; padding: 16px; border-radius: 12px;
  background: var(--cy-primary-050); box-shadow: inset 0 0 0 1px var(--cy-primary-100);
}
.guide-card b { display: block; font-size: 15px; color: var(--cy-primary-deep); margin-bottom: 6px; }
.guide-card p { font-size: 13.5px; color: var(--cy-text-2); line-height: 1.8; margin-bottom: 12px; }
.guide-card .btn { width: auto; min-width: 160px; display: inline-block; }
