:root {
  --primary: #A61B29;
  --primary-dark: #7E1220;
  --secondary: #D8A13A;
  --secondary: #D8A13A;
  --wash: #F8E6E8;
  --wash: #F8E6E8;
  --page: #FAF6EF;
  --page: #FAF6EF;
  --card: #ffffff;
  --line: #E7DFD2;
  --ink: #2B2B2B;
  --mute: #8A8A8A;
  --on: #ffffff;
  --shadow: 0 8px 24px rgba(166, 27, 41, 0.08);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "Source Sans 3", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--page);
  color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}
h1, h2, h3, .serif { font-family: "Noto Serif SC", "Songti SC", serif; }
a { color: var(--primary); text-decoration: none; }
button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: rgba(250,246,239,.92);
  backdrop-filter: blur(10px);
}
.brand-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.8); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 6px;
  box-shadow: 0 2px 8px rgba(43,43,43,.04);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.brand-pill img { width: 32px; height: 32px; object-fit: contain; border-radius: 0; }
.brand-pill span { font-family: "Noto Serif SC", serif; font-weight: 700; letter-spacing: .18em; font-size: 14px; }
.topbar h1 { font-size: 16px; flex: 1; text-align: center; }
.back { border: 0; background: none; font-size: 22px; color: var(--ink); width: 36px; }

.wrap { padding: 12px 16px 96px; max-width: 430px; margin: 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px;
}
.card + .card, .stack > * + * { margin-top: 12px; }
.muted { color: var(--mute); font-size: 13px; }
.num { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; border: 0; border-radius: var(--radius); padding: 12px 16px;
  background: var(--primary); color: var(--on); font-weight: 600; cursor: pointer;
}
.btn:active { background: var(--primary-dark); }
.btn-ghost {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
}
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 999px; }

.input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; background: #fff; color: var(--ink);
}
.label { display: block; font-size: 13px; margin: 10px 0 6px; color: var(--mute); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 10px 0 12px; color: var(--mute); font-size: 12px;
}
.tabbar a.on { color: var(--primary); font-weight: 700; position: relative; }
.tabbar a.on:after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 18px; height: 3px;
  margin-left: -9px; background: var(--primary); border-radius: 2px;
}

.fu-row { display: flex; justify-content: space-between; gap: 6px; margin-top: 12px; }
.fu-dot {
  flex: 1; text-align: center; font-size: 12px; color: var(--mute);
}
.fu-dot i {
  display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 6px;
  border-radius: 50%; border: 1.5px solid var(--line); font-style: normal;
  font-family: "Noto Serif SC", serif;
}
.fu-dot.on i { background: var(--primary); color: #fff; border-color: var(--secondary); box-shadow: 0 0 0 2px var(--secondary); }
.fu-dot.on { color: var(--ink); }
.fu-dot.just i { animation: fu-pop .45s .35s both; }
.fu-stamp {
  width: 132px; height: 132px; margin: 0 auto;
  border: 5px solid var(--primary); border-radius: 50%;
  display: grid; place-items: center;
  color: var(--primary); box-shadow: 0 0 0 3px var(--secondary), inset 0 0 0 3px rgba(166,27,41,.35);
  animation: fu-stamp .7s cubic-bezier(.15,1.4,.35,1) both;
  transform: rotate(-8deg);
}
.fu-stamp b {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 52px; font-weight: 900; letter-spacing: .08em;
}
.fu-stamp.full { box-shadow: 0 0 0 4px var(--secondary), 0 12px 28px rgba(166,27,41,.22); }
.fu-open-lab {
  margin-top: 12px; font-family: "Noto Serif SC", serif;
  font-size: 20px; letter-spacing: .28em; color: var(--primary);
}
@keyframes fu-stamp {
  0% { transform: scale(1.7) rotate(-22deg); opacity: 0; }
  58% { transform: scale(.94) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 1; }
}
@keyframes fu-pop {
  0% { transform: scale(.6); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.list-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--wash);
  color: var(--primary); display: grid; place-items: center; font-weight: 700;
}
.grow { flex: 1; min-width: 0; }
.chip {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--wash); color: var(--primary);
}
.seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg button {
  flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; color: var(--mute); cursor: pointer;
}
.seg button.on { background: var(--wash); color: var(--primary); font-weight: 700; }

.hero-land {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 24px 96px; text-align: center;
}
.hero-land img.lockup {
  width: min(220px, 58vw); height: auto;
  filter: drop-shadow(0 12px 24px rgba(166,27,41,.12));
}
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; height: 56px;
  background: var(--wash); display: flex; align-items: center; justify-content: center;
  padding: 0 12px 0 16px;
}
.dock p { font-size: 13px; }
.dock .btn-sm { margin-left: auto; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; z-index: 50;
}

.site-filing {
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--mute);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
.site-filing p + p { margin-top: 2px; }
.site-filing a { color: var(--mute); }
.site-filing a:hover { color: var(--primary); }
.site-filing .filing-police { display: inline-block; margin-left: 10px; }
.site-filing--inpage { padding: 8px 0 0; }
body[data-chrome="land"] .site-filing:not(.site-filing--inpage) {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 56px;
  z-index: 25;
  padding-bottom: 8px;
  background: linear-gradient(180deg, transparent, var(--page) 28%);
}
body[data-chrome="app"] .site-filing:not(.site-filing--inpage) { display: none; }
body[data-chrome="form"]:not(.h5-root) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body[data-chrome="form"]:not(.h5-root) #app { flex: 1; }
body[data-chrome="form"]:not(.h5-root) .login-center {
  min-height: 100%;
  padding: 40px 16px 16px;
}
body[data-chrome="admin"] {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body[data-chrome="admin"] #app { flex: 1; min-height: 0; }
body[data-chrome="admin"] .admin-body { min-height: 100%; }
body[data-chrome="admin"] .site-filing {
  border-top: 1px solid var(--line);
  background: var(--page);
  padding: 12px 24px;
}

/* admin */
.admin-body { display: flex; min-height: 100%; background: var(--page); }
.side {
  width: 240px; background: var(--page); border-right: 1px solid var(--line);
  padding: 24px 0; flex-shrink: 0;
}
.side .logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 28px; }
.side .logo img { width: 64px; height: 64px; object-fit: contain; }
.side .logo img.word { width: 108px; height: auto; }
.login-word { display: block; width: 168px; height: auto; margin: 10px auto 0; }
.side a {
  display: block; padding: 12px 24px; color: var(--ink); border-left: 4px solid transparent;
}
.side a.on { color: var(--primary); font-weight: 700; border-left-color: var(--primary); background: var(--wash); }
.admin-main { flex: 1; min-width: 0; }
.admin-top {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 20px 24px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.kpi .n { font-size: 28px; font-weight: 700; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; padding: 0 24px 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--mute); font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.bars i { flex: 1; background: var(--primary); border-radius: 6px 6px 0 0; display: block; opacity: .9; }
.login-center { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 380px; }

textarea.input { min-height: 88px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.codes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-top: 14px; }
.qr-tile { text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; background: #fff; }
.qr-tile img { width: 140px; height: 140px; display: block; margin: 0 auto 8px; }
.qr-tile .muted { margin: 4px 0 8px; }
.pad { padding: 20px 24px; }
.admin-body .card { margin: 0; }
.kpi .muted { font-size: 13px; }
.side a.out { margin-top: 24px; color: var(--mute); }

.live-hero {
  margin: 20px 24px 0;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 28px 32px 24px;
  color: var(--on);
  background: linear-gradient(152deg, var(--primary) 0%, var(--primary-dark) 78%);
  box-shadow: 0 18px 40px rgba(166, 27, 41, 0.22);
}
.live-hero:before, .live-hero:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.live-hero:before {
  width: 240px; height: 240px; right: -48px; top: -88px;
  background: rgba(255,255,255,.08);
}
.live-hero:after {
  width: 140px; height: 140px; left: 36%; bottom: -70px;
  background: rgba(216, 161, 58, .16);
}
.live-hero-top {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.live-hero .kicker {
  font-size: 12px; letter-spacing: .28em;
  color: rgba(255,255,255,.72);
}
.live-hero h2 {
  font-size: 28px; font-weight: 900; margin-top: 6px; letter-spacing: .08em;
}
.live-hero-note {
  position: relative; z-index: 1;
  margin-top: 8px; font-size: 13px; color: rgba(255,255,255,.82); max-width: 520px; line-height: 1.45;
}
.live-hero-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.live-hero-tools .input {
  width: 200px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff;
}
.live-hero-tools .input option { color: var(--ink); }
.live-hero-tools .btn-sm { background: #fff; color: var(--primary); }
.live-hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px;
}
.live-hero-stat {
  padding: 12px 14px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
}
.live-hero-stat .lab { font-size: 12px; color: rgba(255,255,255,.7); }
.live-hero-stat .val {
  font-family: "Noto Serif SC", serif;
  font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums;
}
.live-board { padding: 16px 24px 24px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.live-board .card h3 { font-size: 16px; }
.live-ring {
  display: flex; align-items: center; gap: 18px; margin-top: 12px;
}
.live-ring svg { flex-shrink: 0; }
.live-ring .pct { font-size: 32px; font-weight: 700; color: var(--primary); line-height: 1; }
.hbar { margin-top: 10px; }
.hbar-row { margin: 10px 0 12px; }
.hbar-row .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.hbar-track {
  height: 10px; background: var(--wash); border-radius: 999px; overflow: hidden;
}
.hbar-track i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}
.hbar-row.dim .hbar-track i { background: #C9BBA8; }
.live-hist {
  display: flex; align-items: flex-end; gap: 10px; height: 168px; margin-top: 16px;
}
.live-hist-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.live-hist-col b {
  display: block; width: 100%; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  min-height: 6px;
}
.live-hist-col span { margin-top: 8px; font-size: 11px; color: var(--mute); text-align: center; line-height: 1.3; }
.live-hist-col em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.live-rank { margin-top: 8px; }
.live-rank .list-row { padding: 10px 0; }
.live-rank .rk {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--wash); color: var(--primary); font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.live-rank .rk.gold { background: var(--secondary); color: #fff; }
.live-rank .bar {
  height: 6px; background: var(--wash); border-radius: 999px; margin-top: 6px; overflow: hidden;
}
.live-rank .bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.live-bind { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.live-bind .input { width: 132px; padding: 6px 8px; }
.live-ops { margin: 0 24px 24px; }
.live-ops details.card { padding: 14px 16px; }
.live-ops summary { cursor: pointer; font-weight: 700; list-style: none; }
.live-ops summary::-webkit-details-marker { display: none; }
.live-dash { margin: 0 24px 14px; padding: 18px 20px; }
.live-dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.live-dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.live-dash-kpis > div {
  background: var(--wash); border-radius: 12px; padding: 10px 12px;
}
.live-dash-kpis .n { font-size: 20px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.live-h5-watch { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; }
.live-h5-watch .n { font-size: 28px; }

.fill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 24px 14px; }
.fill-card { position: relative; }
.fill-card:before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  background: var(--primary); border-radius: 2px;
}
.fill-card h3 { font-size: 16px; padding-left: 8px; }
.fill-line {
  display: grid; grid-template-columns: 108px 1fr; gap: 8px; align-items: center; margin-top: 8px;
}
.fill-line .lab { font-size: 13px; color: var(--ink); }
.fill-account-row {
  display: grid; grid-template-columns: 1.1fr 1fr 90px 1.2fr; gap: 6px; margin-top: 8px;
}
.live-fill { margin: 16px 24px 0; }
.live-fill .fill-card { max-width: 560px; }
.live-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 16px 24px 0;
}
.live-brief {
  display: grid; grid-template-columns: 0.85fr 1.35fr; gap: 0;
  margin: 16px 24px 0; padding: 0; overflow: hidden;
}
.brief-col { padding: 16px 18px; }
.brief-col + .brief-col { border-left: 1px solid var(--line); }
.brief-col h3 { font-size: 16px; }
.ops-list { margin: 8px 0 0 18px; font-size: 13px; line-height: 1.65; }
.ops-table { margin-top: 8px; font-size: 13px; }
.ops-table th, .ops-table td { vertical-align: top; }
.live-step {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 14px 16px;
}
.live-step b {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on); font-size: 13px;
}
.live-step strong { font-size: 14px; }
.live-step p { margin-top: 4px; color: var(--mute); font-size: 13px; line-height: 1.45; }
.team-live-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 14px 24px 0;
}
.team-live-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.team-live-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.team-live-kpis .n { font-size: 26px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.team-live-kpis .n.team-dur { font-size: 16px; padding-top: 8px; }
.pill {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--wash); color: var(--primary); white-space: nowrap;
}
.pill.on { background: var(--primary); color: var(--on); }
.live-save-bar { margin: 12px 24px 0; }
.live-save-bar .btn { max-width: 320px; }
.live-import { margin: 14px 24px 0; }
.live-import .btn-sm { width: auto; }

@media (max-width: 960px) {
  .brief-col + .brief-col { border-left: 0; border-top: 1px solid var(--line); }
  .kpis, .grid2, .live-hero-grid, .live-board, .live-dash-kpis, .fill-grid, .fill-account-row, .fill-line, .live-steps, .team-live-grid, .live-brief { grid-template-columns: 1fr; }
  .side { width: 72px; }
  .side a { font-size: 0; padding-left: 16px; }
  .side a.on { font-size: 0; }
}
