:root {
  --ink: #17342f;
  --ink-2: #244942;
  --paper: #f5f1e8;
  --paper-2: #fffdf7;
  --line: #d8d2c5;
  --muted: #6e776f;
  --coral: #e46f51;
  --coral-dark: #c84d31;
  --sage: #9ab29f;
  --sun: #eabf62;
  --red: #b64233;
  --green: #27745f;
  --shadow: 0 18px 50px rgba(23, 52, 47, .08);
  --radius: 22px;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% 0%, rgba(228,111,81,.12), transparent 22rem),
    radial-gradient(circle at 88% 8%, rgba(234,191,98,.16), transparent 24rem),
    var(--paper);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgba(228,111,81,.45); outline-offset: 3px; }

.pin-wall {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 28px 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 20%, rgba(234,191,98,.2), transparent 18rem),
    radial-gradient(circle at 80% 10%, rgba(228,111,81,.16), transparent 20rem),
    rgba(245,241,232,.96);
}
.pin-wall.hidden { display: none; }
.pin-card {
  width: min(560px, 100%);
  margin: auto;
  padding: 48px 40px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255,253,247,.94);
  box-shadow: var(--shadow);
}
.pin-card .brand-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  font-size: 34px;
}
.pin-card .eyebrow {
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: .2em;
}
.pin-card h1 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(34px, 6.5vw, 48px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.pin-copy {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}
.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 26px;
}
.role-option {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 14px;
  background: #fffefa;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.role-option.active { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.pin-card label {
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: .06em;
}
.pin-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: stretch; }
.pin-card input {
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 17px;
}
.pin-card .button {
  min-height: 52px;
  min-width: 108px;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 15px;
}
.pin-card .form-message { margin-top: 14px; font-size: 14px; }

@media (max-width: 520px) {
  .pin-card { padding: 36px 22px; }
  .role-switch { grid-template-columns: 1fr; gap: 10px; }
  .role-option { min-height: 52px; font-size: 16px; }
  .pin-row { grid-template-columns: 1fr; }
  .pin-card .button { width: 100%; }
  .balance-card .points-row { gap: 14px; }
  .balance-card .points { font-size: 30px; }
  .balance-card .points-block + .points-block .points { font-size: 24px; }
}

.site-header {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid rgba(23,52,47,.11);
  background: rgba(245,241,232,.9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; letter-spacing: .08em; }
.brand b { display: block; font-size: 13px; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .15em; }
.brand-mark {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50% 50% 48% 52% / 46% 54% 46% 54%;
  background: var(--coral);
  color: #fffaf0;
  font: italic 700 28px/1 var(--serif);
  box-shadow: 8px 8px 0 rgba(23,52,47,.08);
  transform: rotate(-4deg);
}
.brand-mark.small { width: 38px; height: 38px; font-size: 18px; box-shadow: 4px 4px 0 rgba(23,52,47,.08); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.role-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}
.text-button { border: 0; background: none; color: var(--muted); padding: 8px 0; font-size: 12px; }
.text-button:hover { color: var(--coral-dark); }

.tab-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 12px max(24px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid rgba(23,52,47,.1);
  background: var(--paper);
  position: sticky;
  top: 78px;
  z-index: 18;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.tab.active { color: var(--paper-2); background: var(--ink); }
.tab[hidden] { display: none; }

main { width: min(1100px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 90px; }
.view { display: none; animation: enter .28s ease both; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral-dark);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 12px; font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 4vw, 48px); letter-spacing: -.025em; line-height: 1.08; }
h3 { margin-bottom: 8px; font-size: 18px; letter-spacing: -.02em; }
.hero-copy { max-width: 640px; margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.hero-panel {
  min-height: 180px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
  padding: 36px 40px;
  color: #f9f5ea;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.04), transparent 55%), var(--ink);
  position: relative;
  overflow: hidden;
}
.hero-panel::after {
  content: "S";
  position: absolute;
  right: 40px;
  top: -36px;
  color: rgba(255,255,255,.04);
  font: 220px/1 var(--serif);
}
.hero-panel .eyebrow { color: var(--sun); }
.hero-panel h2 { margin: 0 0 10px; color: #fff; }
.hero-panel .hero-copy { color: rgba(255,255,255,.7); }
.stat-stamp {
  min-width: 120px;
  padding: 18px 16px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 20px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.stat-stamp span { display: block; color: var(--sun); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.stat-stamp strong { display: block; margin-top: 6px; font: 40px/1 var(--serif); }
.stat-stamp small { display: block; margin-top: 8px; color: rgba(255,255,255,.65); font-size: 11px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,253,247,.86);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
}
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.balance-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffefa;
}
.balance-card .name { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.balance-card .points-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: 8px;
}
.balance-card .points-block { min-width: 0; }
.balance-card .points-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.balance-card .points { font: 36px/1 var(--serif); }
.balance-card .points-block + .points-block .points { font-size: 28px; color: var(--ink-2); }
.balance-card .cny { margin-top: 8px; color: var(--muted); font-size: 13px; }

label { display: grid; gap: 7px; color: var(--ink-2); font-size: 11px; font-weight: 750; letter-spacing: .03em; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefa;
  color: var(--ink);
  padding: 12px 13px;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(228,111,81,.12);
  outline: 0;
}
textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
.field-grid { display: grid; gap: 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid .wide { grid-column: 1 / -1; }

.button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.button.primary { background: var(--coral); color: white; box-shadow: 0 7px 18px rgba(228,111,81,.2); }
.button.primary:hover { background: var(--coral-dark); }
.button.secondary { border: 1px solid var(--line); background: #fffefa; color: var(--ink); }
.button.danger { background: var(--red); color: white; }
.button.ghost { background: transparent; border: 1px solid rgba(255,255,255,.28); color: #fff; }
.button.full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.list { display: grid; gap: 10px; }
.list-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefa;
}
.list-item .title { font-size: 14px; font-weight: 700; }
.list-item .meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge.pending { background: rgba(234,191,98,.22); color: #8a6410; }
.badge.approved { background: rgba(39,116,95,.14); color: var(--green); }
.badge.rejected { background: rgba(182,66,51,.12); color: var(--red); }
.badge.earn { background: rgba(39,116,95,.14); color: var(--green); }
.badge.redeem { background: rgba(228,111,81,.14); color: var(--coral-dark); }

.form-message { min-height: 1.2em; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.form-message.error { color: var(--red); }
.form-message.ok { color: var(--green); }
.helper { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.empty { padding: 28px 8px; color: var(--muted); text-align: center; font-size: 14px; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .22s ease;
}
.toast.show { opacity: 1; transform: none; }

@media (max-width: 820px) {
  .hero-panel, .grid-2, .grid-3, .field-grid.two, .role-switch { grid-template-columns: 1fr; }
  .hero-panel { padding: 28px 24px; }
  main { width: min(1100px, calc(100% - 32px)); padding-top: 24px; }
  .site-header, .tab-bar { padding-left: 16px; padding-right: 16px; }
}
