/* 数字人文案例库 · 账号 / 留言 / 管理端样式（沿用站点淡蓝渐变风格） */
* { box-sizing: border-box; }
body.dh-auth-page { margin: 0; }

/* ---------- 顶部用户条 ---------- */
.user-bar {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: #475569;
}
.user-bar .who { font-weight: 600; color: #1e293b; }
.user-bar .pill {
  background: rgba(255,255,255,.8); border: 1px solid #e2e8f0; border-radius: 20px;
  padding: 4px 12px; color: #475569;
}
.user-bar .spacer { flex: 1; }
.user-bar a {
  text-decoration: none; color: #4338ca; background: #eef2ff; padding: 6px 14px;
  border-radius: 9px; font-weight: 500; transition: .2s;
}
.user-bar a:hover { background: #e0e7ff; }
.user-bar a.exit { color: #b91c1c; background: #fef2f2; }
.user-bar a.exit:hover { background: #fee2e2; }
.user-bar a.admin-link { color: #047857; background: #ecfdf5; }

/* ---------- 未登录：左侧概要 / 右侧登录-注册（同一栏内切换） ---------- */
.gate {
  max-width: 1160px; margin: 26px auto 40px; padding: 0 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 26px; align-items: start;
}
@media (max-width: 900px) { .gate { grid-template-columns: 1fr; } }

.gate-left { background: #fff; border: 1px solid #eef2f7; border-radius: 16px; padding: 24px; box-shadow: 0 6px 22px rgba(15,23,42,.07); }
.gate-left h2 { font-size: 21px; color: #0f172a; margin: 0 0 10px; padding-left: 12px; border-left: 4px solid #6366f1; }
.gate-left p { font-size: 13.5px; color: #475569; line-height: 1.75; margin: 0 0 14px; }
.gate-left .gate-byline { font-size: 12.5px; color: #64748b; line-height: 1.8; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px dashed #eef2f7; }
.gate-left .gate-byline a { color: #4338ca; font-weight: 600; text-decoration: none; }
.gate-left .gate-byline a:hover { text-decoration: underline; }
.gate-facts { list-style: none; display: flex; gap: 12px; margin: 0 0 16px; padding: 0; }
.gate-facts li { flex: 1; background: linear-gradient(135deg,#eef4fb,#e6eef8); border-radius: 12px; padding: 12px 10px; text-align: center; }
.gate-facts b { display: block; font-size: 22px; color: #4338ca; line-height: 1.2; }
.gate-facts span { font-size: 12px; color: #64748b; }
.gate-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.gate-chip { font-size: 12px; color: #475569; background: #f6f8fb; border: 1px solid #e8eef6; border-radius: 999px; padding: 4px 10px; }
.gate-chip::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #6366f1); margin-right: 6px; vertical-align: 1px; }
.gate-note { font-size: 12.5px; color: #94a3b8; margin: 0; padding-top: 12px; border-top: 1px dashed #eef2f7; }
.gate-right { display: flex; flex-direction: column; gap: 16px; }

.switch { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #eef2f7; font-size: 13px; color: #64748b; text-align: center; }
.switch a { color: #4338ca; font-weight: 700; text-decoration: none; }
.switch a:hover { text-decoration: underline; }

.auth-box {
  background: #fff; border: 1px solid #eef2f7; border-radius: 16px; padding: 24px 24px 20px;
  box-shadow: 0 6px 22px rgba(15,23,42,.07);
}
.auth-box h3 {
  font-size: 18px; color: #0f172a; margin: 0 0 4px; padding-left: 12px;
  border-left: 4px solid #6366f1;
}
.auth-box .sub { font-size: 12.5px; color: #94a3b8; margin: 0 0 16px; padding-left: 12px; }
.gate-tip { background: #eef2ff; border: 1px solid #c7d2fe; color: #4338ca; border-radius: 10px;
            padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; color: #475569; font-weight: 600; margin-bottom: 5px; }
.field label .req { color: #dc2626; }
.field input[type=text], .field input[type=password], .field select {
  width: 100%; padding: 10px 12px; font-size: 14px; color: #1e293b;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fbfcfe; transition: .18s;
  font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.field .hint { font-size: 11.5px; color: #94a3b8; margin-top: 4px; }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; }
.captcha-row img {
  height: 42px; width: 116px; border: 1px solid #e2e8f0; border-radius: 10px;
  cursor: pointer; background: #f8fafc; user-select: none;
}
.btn {
  display: inline-block; width: 100%; padding: 11px 18px; font-size: 15px; font-weight: 600;
  color: #fff; background: #4338ca; border: none; border-radius: 11px; cursor: pointer;
  transition: .2s; font-family: inherit; margin-top: 6px;
}
.btn:hover { background: #3730a3; transform: translateY(-1px); }
.btn:disabled { background: #a5b4fc; cursor: not-allowed; transform: none; }
.btn.ghost { background: #eef2ff; color: #4338ca; }
.btn.ghost:hover { background: #e0e7ff; }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.err { color: #b91c1c; }
.msg.ok { color: #047857; }

/* ---------- 学校选择器（uni-app school-picker 范式：底部弹出 + 只选学校） ---------- */
.sp-input { display: flex; gap: 8px; }
.sp-input input { flex: 1; background: #fbfcfe; }
/* 同行字段：输入框/下拉 + 复选框 */
.inline-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline-row > input[type=text], .inline-row > select { flex: 1; min-width: 150px; }
.inline-row .chk {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 13px; font-weight: 600; color: #475569; white-space: nowrap; cursor: pointer;
}
.inline-row .chk input[type=checkbox] {
  width: 15px; height: 15px; margin: 0; accent-color: #6366f1; cursor: pointer;
}
.sp-input .sp-btn {
  padding: 0 16px; font-size: 13.5px; color: #4338ca; background: #eef2ff;
  border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.sp-input .sp-btn:hover { background: #e0e7ff; }
.sp-mask { position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 900; display: none; }
.sp-mask.on { display: block; }
.sp-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901; background: #fff;
  border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(15,23,42,.2);
  max-height: 68vh; display: none; flex-direction: column;
}
.sp-panel.on { display: flex; }
.sp-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid #eef2f7;
}
.sp-hd .cancel { color: #64748b; font-size: 15px; cursor: pointer; }
.sp-hd .title { font-size: 15px; font-weight: 600; color: #0f172a; }
.sp-hd .confirm { color: #4338ca; font-size: 15px; font-weight: 600; cursor: pointer; }
.sp-search { padding: 12px 20px 6px; }
.sp-search input {
  width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #e2e8f0;
  border-radius: 10px; background: #fbfcfe; font-family: inherit;
}
.sp-list { overflow-y: auto; padding: 6px 12px 22px; }
.sp-item {
  padding: 11px 12px; font-size: 14.5px; color: #334155; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.sp-item:hover { background: #f8fafc; }
.sp-item.sel { background: #eef2ff; color: #4338ca; font-weight: 600; }
.sp-item .prov { font-size: 12px; color: #94a3b8; }
.sp-none { padding: 20px; text-align: center; color: #94a3b8; font-size: 13.5px; }

/* ---------- 留言区 ---------- */
.comments { margin: 34px 0 10px; padding: 22px 24px; background: rgba(255,255,255,.78); border: 1px solid #e2e8f0; border-radius: 14px; }
.comments h2 { font-size: 19px; color: #0f172a; margin: 0 0 16px; padding-left: 13px; border-left: 4px solid #6366f1; }
.cm-form textarea {
  width: 100%; min-height: 82px; padding: 12px; font-size: 14.5px; font-family: inherit;
  color: #1e293b; border: 1px solid #e2e8f0; border-radius: 11px; background: #fbfcfe; resize: vertical;
}
.cm-form textarea:focus { outline: none; border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.cm-form .row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cm-form .row .msg { flex: 1; margin: 0; }
.cm-form .row button {
  padding: 9px 22px; font-size: 14px; font-weight: 600; color: #fff; background: #4338ca;
  border: none; border-radius: 10px; cursor: pointer; font-family: inherit;
}
.cm-form .row button:hover { background: #3730a3; }
.cm-list { margin-top: 20px; }
.cm { padding: 14px 0; border-top: 1px dashed #e2e8f0; }
.cm:first-child { border-top: none; }
.cm-hd { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #94a3b8; }
.cm-hd .nm { font-weight: 600; color: #334155; font-size: 14px; }
.cm-hd .meta2 { color: #94a3b8; }
.cm-hd .del {
  margin-left: auto; color: #b91c1c; background: #fef2f2; border: 1px solid #fee2e2;
  padding: 3px 10px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
}
.cm-hd .del:hover { background: #fee2e2; }
.cm-body { margin-top: 7px; font-size: 15px; color: #334155; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.cm-empty { color: #94a3b8; font-size: 14px; padding: 12px 0; }
.cm-gate { margin-top: 14px; padding: 14px 16px; background: #f8fafc; border-radius: 11px; font-size: 14px; color: #475569; }

/* ---------- 管理端 ---------- */
.admin-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px 70px; }
.admin-wrap h1 { font-size: 28px; color: #0f172a; margin: 22px 0 4px; }
.admin-wrap .sub { color: #64748b; font-size: 14px; margin-bottom: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat {
  background: #fff; border: 1px solid #eef2f7; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 3px 14px rgba(15,23,42,.05);
}
.stat .k { font-size: 13px; color: #64748b; margin-bottom: 6px; }
.stat .v { font-size: 28px; font-weight: 700; color: #4338ca; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; color: #94a3b8; font-weight: 500; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
@media (max-width: 980px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-box { background: #fff; border: 1px solid #eef2f7; border-radius: 14px; padding: 18px 20px 10px; box-shadow: 0 3px 14px rgba(15,23,42,.05); }
.chart-box h3 { font-size: 16px; color: #0f172a; margin: 0 0 10px; }
.chart { width: 100%; height: 320px; }
.chart.tall { height: 420px; }
.panel { background: #fff; border: 1px solid #eef2f7; border-radius: 14px; padding: 20px 22px; box-shadow: 0 3px 14px rgba(15,23,42,.05); margin-bottom: 24px; }
.panel h3 { font-size: 17px; color: #0f172a; margin: 0 0 14px; padding-left: 12px; border-left: 4px solid #6366f1; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; }
table.tbl th { color: #64748b; font-weight: 600; font-size: 13px; background: #f8fafc; }
table.tbl tr:hover td { background: #fbfcfe; }
table.tbl .acts { display: flex; gap: 6px; }
table.tbl .acts button {
  font-size: 12.5px; padding: 4px 10px; border-radius: 8px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #475569; cursor: pointer; font-family: inherit;
}
table.tbl .acts button:hover { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
table.tbl .acts button.danger { color: #b91c1c; background: #fef2f2; border-color: #fee2e2; }
table.tbl .acts button.danger:hover { background: #fee2e2; }
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 7px; background: #f1f5f9; color: #475569; }
.badge.admin { background: #ecfdf5; color: #047857; }
.badge.off { background: #fef2f2; color: #b91c1c; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select {
  padding: 9px 12px; font-size: 14px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #fbfcfe; font-family: inherit;
}
.toolbar .btn { width: auto; margin: 0; padding: 10px 20px; font-size: 14px; }
.toolbar .spacer { flex: 1; }
