:root {
  --bg: #f6f2e9;
  --card: rgba(255, 252, 245, 0.92);
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e7dcc8;
  --brand: #8a5a20;
  --brand-2: #c58b38;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 20px 60px rgba(71, 44, 15, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(197, 139, 56, 0.22), transparent 28rem),
    radial-gradient(circle at 85% 15%, rgba(138, 90, 32, 0.18), transparent 24rem),
    var(--bg);
}
a { color: var(--brand); }
.shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0; }
.admin-shell { width: min(1180px, calc(100% - 32px)); }
.hero { margin-bottom: 24px; }
.hero.compact { margin-bottom: 18px; }
.eyebrow { color: var(--brand); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
h1 { margin: 8px 0 12px; font-size: clamp(34px, 6vw, 62px); line-height: 1.02; letter-spacing: -0.05em; }
.hero.compact h1 { font-size: clamp(30px, 4vw, 46px); }
p { color: var(--muted); line-height: 1.72; }
.card {
  background: var(--card);
  border: 1px solid rgba(138, 90, 32, 0.14);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(16px);
}
.narrow { max-width: 460px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label, fieldset { display: block; margin: 0 0 20px; }
label > span, legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 700;
}
b { color: var(--danger); }
em { color: var(--muted); font-style: normal; font-weight: 600; }
em.ok { color: var(--success); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(197, 139, 56, 0.16); }
fieldset { border: 0; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}
.chips input, .consent input { width: auto; }
.consent { display: flex; align-items: flex-start; gap: 10px; }
.consent span { display: inline; margin: 0; font-weight: 600; }
.turnstile-wrap { margin-bottom: 16px; }
button, .button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  color: var(--ink);
  background: #ede3d2;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:disabled { opacity: 0.6; cursor: not-allowed; }
.primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  padding: 15px 22px;
}
.ghost { background: transparent; border: 1px solid var(--line); }
.message { margin: 12px 0 0; font-weight: 700; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.hidden { display: none !important; }
footer { margin-top: 20px; text-align: center; color: var(--muted); }
.toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: center; margin-bottom: 18px; }
.toolbar .wide { min-width: min(100%, 260px); }
.counts { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.counts button { padding: 9px 12px; font-size: 14px; background: rgba(255, 252, 245, 0.92); border: 1px solid var(--line); }
.applications { display: grid; gap: 18px; }
.application { padding: 22px; }
.application-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.application h2 { margin: 0 0 4px; font-size: 24px; }
.meta { margin: 0; font-size: 14px; }
.status-pill { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 900; background: #ede3d2; white-space: nowrap; }
.status-pill[data-status="approved"], .status-pill[data-status="joined"] { color: #fff; background: var(--success); }
.status-pill[data-status="rejected"] { color: #fff; background: var(--danger); }
.status-pill[data-status="wechat_added"] { color: #fff; background: #2563eb; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.summary-grid div { border: 1px solid var(--line); background: rgba(255,255,255,.48); border-radius: 16px; padding: 12px; }
.summary-grid strong { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.summary-grid span { font-weight: 700; }
details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin: 14px 0; }
summary { cursor: pointer; font-weight: 800; color: var(--brand); }
.long-fields { display: grid; gap: 12px; margin-top: 12px; }
.long-fields section { background: rgba(255,255,255,.48); border-radius: 16px; padding: 14px; }
.long-fields h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.long-fields p { white-space: pre-wrap; margin: 0; color: var(--ink); }
.admin-edit { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: end; }
.admin-edit label { margin: 0; }
.admin-edit .full { grid-column: 1 / -1; }
.saveMessage { grid-column: 1 / -1; }
.empty { text-align: center; padding: 32px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 980px); padding: 26px 0; }
  .card { padding: 20px; border-radius: 18px; }
  .grid.two, .summary-grid, .toolbar, .admin-edit { grid-template-columns: 1fr; }
  .application-head { flex-direction: column; }
}

.owner-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}
.owner-card h2 { margin: 6px 0 8px; font-size: 28px; letter-spacing: -0.03em; }
.owner-card p { margin: 0; }
.wechat-box {
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255,255,255,.62);
  text-align: center;
}
.wechat-box span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.wechat-box strong { font-size: 22px; color: var(--brand); }
.subcard {
  border: 1px dashed rgba(138, 90, 32, 0.28);
  background: rgba(255, 255, 255, 0.42);
  border-radius: 20px;
  padding: 20px;
  margin: 8px 0 22px;
}
.section-title h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.03em; }
.section-title small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; font-weight: 700; }
.section-title p { margin: 0 0 16px; }

@media (max-width: 760px) {
  .owner-card { grid-template-columns: 1fr; }
  .wechat-box { text-align: left; }
}

.contact-notice {
  border: 1px solid rgba(6, 118, 71, 0.22);
  background: linear-gradient(135deg, rgba(6, 118, 71, 0.10), rgba(255,255,255,0.62));
  border-radius: 18px;
  padding: 16px 18px;
  margin: 6px 0 18px;
}
.contact-notice strong { display: block; color: var(--success); font-size: 17px; margin-bottom: 6px; }
.contact-notice p { margin: 0; color: var(--ink); }
.contact-notice code { color: var(--brand); font-weight: 900; font-size: 18px; background: rgba(255,255,255,.7); padding: 2px 6px; border-radius: 8px; }
