* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f5f9; color: #2c3e50;
  -webkit-tap-highlight-color: transparent;
}
.page { max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; }
.page.narrow { max-width: 420px; }

.header { text-align: center; padding: 18px 8px 6px; }
.header .school { display: inline-block; background: #c8161d; color: #fff;
  font-size: 14px; padding: 4px 14px; border-radius: 20px; letter-spacing: 2px; }
.header h1 { font-size: 22px; margin: 12px 0 8px; }
.sub { color: #7f8c9a; font-size: 14px; line-height: 1.7; }

.card { background: #fff; border-radius: 14px; padding: 20px 18px;
  margin-top: 16px; box-shadow: 0 2px 10px rgba(30,60,100,.07); }

.lab { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.req { color: #c8161d; }

textarea, input[type=tel], input[type=password], input[type=text] {
  width: 100%; border: 1px solid #d7dee7; border-radius: 10px;
  padding: 12px; font-size: 15px; font-family: inherit; resize: vertical;
  background: #fafbfd;
}
textarea:focus, input:focus { outline: none; border-color: #c8161d; background: #fff; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat input { display: none; }
.cat span { display: inline-block; padding: 7px 14px; border-radius: 20px;
  border: 1px solid #d7dee7; font-size: 14px; background: #fafbfd; cursor: pointer; }
.cat input:checked + span { background: #c8161d; color: #fff; border-color: #c8161d; }

.btn { display: block; width: 100%; margin-top: 20px; background: #c8161d;
  color: #fff; border: none; border-radius: 10px; padding: 13px;
  font-size: 16px; font-weight: 600; cursor: pointer; text-align: center;
  text-decoration: none; }
.btn:active { opacity: .88; }
.btn.small { width: auto; display: inline-block; margin-top: 0; padding: 8px 18px; font-size: 14px; }
.btn.ghost { background: #fff; color: #5a6b7d; border: 1px solid #cfd8e3; }

.footer { text-align: center; color: #9aa8b6; font-size: 12px; margin-top: 28px; }

.msg-card { text-align: center; padding: 36px 20px; }
.msg-icon { font-size: 46px; margin-bottom: 10px; }
.msg-card h1 { font-size: 20px; margin-bottom: 10px; }
.flash { color: #c8161d; font-size: 14px; margin: 10px 0; }

/* ---- 管理后台 ---- */
.admin-body { background: #eef2f7; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.admin-wrap.narrow2 { max-width: 560px; }
.admin-top { display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 10px; margin-bottom: 16px; }
.admin-top h1 { font-size: 20px; }
.admin-links a { margin-left: 14px; color: #c8161d; text-decoration: none; font-size: 14px; }

.stat-row { display: flex; gap: 12px; margin-bottom: 14px; }
.stat { flex: 1; background: #fff; border-radius: 12px; text-align: center;
  padding: 14px 6px; box-shadow: 0 2px 8px rgba(30,60,100,.06); }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 13px; color: #7f8c9a; }
.stat.warn b { color: #e67e22; }
.stat.ok b { color: #27ae60; }

.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter select { border: 1px solid #d7dee7; border-radius: 8px; padding: 8px 10px;
  font-size: 14px; background: #fff; }

.list { width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(30,60,100,.06); font-size: 14px; }
.list th { background: #f5f8fb; text-align: left; padding: 10px; color: #5a6b7d;
  font-size: 13px; white-space: nowrap; }
.list td { padding: 10px; border-top: 1px solid #edf1f6; vertical-align: top; }
.list .nowrap { white-space: nowrap; }
.content-cell { min-width: 200px; max-width: 420px; word-break: break-all; }
.done-row td { color: #9aa8b6; }
.done-row .content-cell { text-decoration: line-through; }
.muted { color: #9aa8b6; font-size: 12px; }
.list a { color: #2d7ff9; text-decoration: none; margin-right: 8px; font-size: 13px; }
.list a.del { color: #c8161d; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.badge.open { background: #fdf1e3; color: #e67e22; }
.badge.done { background: #e8f7ef; color: #27ae60; }

.qr { display: block; margin: 16px auto; width: 280px; height: 280px;
  border: 1px solid #e3e9f0; border-radius: 10px; padding: 8px; background: #fff; }

/* ---- 验证码 ---- */
.captcha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cap-q { font-size: 15px; color: #2c3e50; }
.cap-q b { color: #c8161d; font-size: 18px; margin: 0 2px; }
.captcha input { flex: 1; min-width: 100px; }

/* ---- 免责声明 ---- */
.agree { display: flex; gap: 8px; margin-top: 16px; padding: 12px;
  background: #fff8e6; border: 1px solid #f5d77c; border-radius: 10px;
  font-size: 13px; color: #5a4a1f; line-height: 1.6; }
.agree input { flex-shrink: 0; margin-top: 3px; }
.agree span { flex: 1; }

/* ---- 新消息横幅 ---- */
.new-banner { background: #fff4e5; border: 1px solid #f5c280; color: #a04e0c;
  border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; font-size: 14px; }
.new-banner b { color: #c8161d; font-size: 16px; }

/* ---- 回复区 ---- */
.reply-cell { min-width: 220px; max-width: 360px; }
.reply-text { background: #e8f7ef; border-left: 3px solid #27ae60;
  padding: 6px 10px; border-radius: 4px; font-size: 13px; line-height: 1.5;
  word-break: break-all; margin-bottom: 4px; }
.reply-edit summary { cursor: pointer; color: #2d7ff9; font-size: 12px;
  display: inline-block; margin-top: 4px; }
.reply-form { margin-top: 6px; padding: 8px; background: #f5f8fb;
  border-radius: 6px; }
.reply-form input, .reply-form textarea { width: 100%; margin-bottom: 6px;
  font-size: 13px; padding: 6px 8px; border: 1px solid #d7dee7; border-radius: 6px; }

@media (max-width: 720px) {
  .list { display: block; overflow-x: auto; }
  .content-cell { max-width: 220px; }
  .reply-cell { max-width: 280px; }
}
