:root {
  --green: #007a3d;
  --green-dark: #0b3d2e;
  --green-light: #e6f2ec;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --gold: #b8860b;
}
* { 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", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  max-width: 560px; margin: 0 auto; min-height: 100vh;
}
.hidden { display: none !important; }
.view { padding: 0 16px 32px; }

.hero { background: var(--green-dark); color: #fff; margin: 0 -16px 16px; padding: 30px 24px 22px; text-align: center; }
.hero-small { padding: 24px 24px 20px; }
.hero-emblem { width: 128px; margin: 0 auto 14px; }
.emblem { width: 100%; height: auto; display: block; }
.hero h1 { font-size: 1.45rem; font-weight: 700; margin-bottom: 8px; letter-spacing: .06em; }
.hero-sub { font-size: .9rem; opacity: .85; line-height: 1.6; }
.motto {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(217,194,122,.35);
  font-size: .78rem; color: #e8d5a0; letter-spacing: .14em;
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 16px; margin-bottom: 14px; }
.field-label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 8px; }
input[type=text] {
  width: 100%; font-size: 1.1rem; padding: 14px 12px; border: 1px solid var(--line);
  border-radius: 8px; outline: none; background: #fafafa;
}
input[type=text]:focus { border-color: var(--green); background: #fff; }

.btn-primary {
  width: 100%; margin-top: 16px; padding: 14px; font-size: 1.05rem; font-weight: 600;
  color: #fff; background: var(--green); border: none; border-radius: 8px; cursor: pointer;
}
.btn-primary:active { background: var(--green-dark); }
.btn-primary:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.btn-ghost {
  width: 100%; margin-top: 10px; padding: 12px; font-size: .95rem;
  color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.hint { margin-top: 14px; font-size: .8rem; color: var(--muted); line-height: 1.8; }

/* 匹配卡片 */
.match-card {
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 12px; cursor: pointer;
}
.match-card.selected { border-color: var(--green); background: var(--green-light); }
.match-name { font-size: 1.15rem; font-weight: 700; }
.match-meta { font-size: .88rem; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.match-tag {
  display: inline-block; font-size: .75rem; color: var(--green); background: var(--green-light);
  border-radius: 4px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}
.match-tag.done { color: var(--gold); background: #fdf6e3; }

/* 结果页 */
.success-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--green); color: #fff; border-radius: 12px; padding: 18px 16px; margin: 16px 0 14px;
}
.success-icon {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.success-title { font-size: 1.2rem; font-weight: 700; }
.success-sub { font-size: .82rem; opacity: .9; margin-top: 4px; }

.me-card { display: flex; align-items: center; gap: 18px; }
.me-table {
  width: 84px; height: 84px; border-radius: 12px; background: var(--green-dark); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
}
.me-table-num { font-size: 2.2rem; font-weight: 800; line-height: 1; color: #e8b64c; }
.me-table-label { font-size: .8rem; margin-top: 4px; opacity: .85; }
.me-name { font-size: 1.3rem; font-weight: 700; }
.me-position { font-size: .9rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.section-note { font-size: .75rem; font-weight: 400; color: var(--muted); margin-left: 6px; }

.member-list { list-style: none; }
.member-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.member-list li:last-child { border-bottom: none; }
.member-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: .98rem; white-space: nowrap; }
.member-name .me-mark { color: var(--green); font-size: .75rem; margin-left: 6px; }
.member-position { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.badge-in {
  font-size: .72rem; color: var(--green); background: var(--green-light);
  border-radius: 4px; padding: 2px 6px; white-space: nowrap; flex-shrink: 0;
}
.badge-out { font-size: .72rem; color: #6b7280; background: #f3f4f6; border-radius: 4px; padding: 2px 6px; white-space: nowrap; flex-shrink: 0; }

/* 找校友搜索卡片 */
.search-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.search-label { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--green); font-weight: 600; }
.search-label .dash { width: 18px; height: 3px; background: #e8b64c; border-radius: 2px; display: inline-block; }
.search-tag { font-size: .72rem; color: var(--green); background: var(--green-light); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.search-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; min-width: 0; font-size: 1rem; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; outline: none; }
.search-row input:focus { border-color: var(--green); background: #fff; }
.btn-search { padding: 12px 22px; font-size: .95rem; font-weight: 600; color: #fff; background: var(--green-dark); border: none; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.btn-search:active { background: var(--green); }
.search-results { margin-top: 6px; }
.search-hit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.search-hit:last-child { border-bottom: none; }
.search-hit .member-name { white-space: normal; }
.table-chip { font-size: .72rem; font-weight: 400; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; margin-left: 8px; vertical-align: middle; white-space: nowrap; }
.search-empty { font-size: .85rem; color: var(--muted); padding: 10px 2px 4px; }

/* 其他桌：全部展开，不折叠 */
.table-block { border-bottom: 1px solid var(--line); padding-top: 4px; }
.table-block:last-child { border-bottom: none; }
.table-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px 8px; background: none; border: none; font-size: .95rem; font-weight: 600;
  color: var(--text);
}
.table-names { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px 14px; }
.name-chip { font-size: .85rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; }

.footer-hint { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.page-footer { text-align: center; margin-top: 18px; font-size: .75rem; color: var(--muted); line-height: 2; }
.motto-small { color: var(--green); letter-spacing: .12em; }

/* 提示与加载 */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(17,24,39,.92); color: #fff; font-size: .9rem;
  padding: 12px 20px; border-radius: 8px; max-width: 86vw; text-align: center; z-index: 50; line-height: 1.5;
}
.loading { position: fixed; inset: 0; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; z-index: 40; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--green-light); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }