:root {
  --bg: #fdfcfa;
  --ink: #1a1814;
  --muted: #8a847c;
  --line: #ece9e3;
  --line-strong: #d4cfc6;
  --accent: #1a1814;
  --accent-muted: #f5f3ef;
  --ok: #2d6a35;
  --no: #9b3a2e;
  --radius: 8px;
  --font-display: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --font-body:    "Noto Serif SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 18px 80px;
}

/* Admin wider */
.wrap.wide {
  max-width: 760px;
}

/* Hero */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.hero .names-large {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.05;
  margin-bottom: 14px;
  /* soft ligature-style amp */
}
.hero .names-large .amp {
  font-style: italic;
  font-weight: 300;
  opacity: 0.55;
  margin: 0 0.15em;
}
.hero .meta {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-top: 10px;
  line-height: 2;
}
.divider {
  position: relative;
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 32px 0;
}
.divider::before {
  content: "\2665";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 10px;
  font-size: 9px;
  color: var(--line-strong);
  letter-spacing: 0;
}

/* Bilingual helpers */
.meta-zh  { font-size: 14px; color: var(--ink); font-weight: 400; }
.meta-en  { font-family: var(--font-display); font-style: italic; font-size: 13px; color: var(--muted); font-weight: 300; }
.meta-sep { color: var(--line-strong); opacity: 0.6; }
.bilingual-sub { font-family: var(--font-display); font-style: italic; font-size: 0.9em; color: var(--muted); font-weight: 300; }
.section-head-en { font-family: var(--font-display); font-style: italic; font-weight: 300; letter-spacing: 0.04em; text-transform: none; }

/* Section heading */
.section-head {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Cards */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Form */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin: 18px 0 6px;
}
label:first-child { margin-top: 0; }
.hint { font-weight: 400; color: var(--muted); letter-spacing: 0; }

input[type="text"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ink);
  box-shadow: none;
}
textarea { resize: vertical; min-height: 72px; }

/* Choice pills */
.choice { display: flex; gap: 8px; margin-top: 6px; }
.choice button {
  flex: 1;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.choice button.active.yes  { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice button.active.no   { background: var(--no); border-color: var(--no); color: #fff; }
.choice button small { display: block; font-size: 11px; font-weight: 400; opacity: 0.8; margin-top: 2px; }

/* Toggle switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.switch-row:first-of-type { border-top: none; padding-top: 0; }
.switch-row .label { font-size: 14px; font-weight: 600; }
.switch-row .label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #d8d8d8;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.slider::before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch input:checked + .slider { background: var(--ink); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Buttons */
.btn {
  display: inline-block;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  text-align: center;
  transition: opacity 0.12s;
}
.btn:active { opacity: 0.8; }
.btn.secondary { background: #fff; color: var(--ink); }
.btn.ghost    { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn:disabled  { opacity: 0.35; cursor: default; }
.btn.small     { width: auto; padding: 7px 12px; font-size: 13px; }
.btn.xsmall    { width: auto; padding: 5px 10px; font-size: 12px; }

/* Misc */
.hidden   { display: none !important; }
.center   { text-align: center; }
.muted    { color: var(--muted); }
.mt8      { margin-top: 8px; }
.mt16     { margin-top: 16px; }

.error {
  background: #fdf0ee;
  color: #7d2c22;
  border: 1px solid #f0cdc7;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}

.success-wrap { padding: 32px 0; }
.check {
  width: 42px; height: 42px;
  border: 2px solid var(--ok);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--ok);
  font-size: 18px;
}
.loading { color: var(--muted); font-size: 14px; padding: 40px 0; text-align: center; }

/* Inline section tag */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-muted);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* ---- Admin specific ---- */
.admin-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.admin-header h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.admin-header .sub { font-size: 13px; color: var(--muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }

.create-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
}
.create-toggles {
  display: flex;
  flex-direction: column;
  margin: 12px 0 0;
}

.inv-list { margin-bottom: 28px; }
.inv-item {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.inv-item:first-child { border-top: 1px solid var(--line); }
.inv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.inv-name { font-weight: 600; font-size: 15px; }
.inv-actions { display: flex; gap: 6px; align-items: center; }
.inv-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.inv-link {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
}
.inv-link input {
  flex: 1; font-size: 12px; padding: 6px 10px;
  background: var(--accent-muted); border-color: var(--line); color: var(--muted);
}
.inv-response {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-muted);
  border-radius: var(--radius);
  font-size: 13px;
}
.inv-response .resp-row { display: flex; justify-content: space-between; padding: 3px 0; }
.inv-response .resp-row:not(:last-child) { border-bottom: 1px solid var(--line); }

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge.yes     { background: #e5f0e6; color: var(--ok); }
.badge.no      { background: #f5e5e3; color: var(--no); }
.badge.pending { background: var(--accent-muted); color: var(--muted); }

.drink-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.drink-row:last-child { border-bottom: none; }
.drink-count { font-weight: 700; }

.link-result {
  margin-top: 14px;
  padding: 12px;
  background: var(--accent-muted);
  border-radius: var(--radius);
  font-size: 13px;
}
.link-result .new-link-row { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.link-result input { flex: 1; font-size: 12px; padding: 6px 10px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; opacity: 0; transition: opacity 0.18s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; }
