:root {
  --brand: #e85d04;
  --brand-dark: #d00000;
  --brand-soft: #fff4ec;
  --blue: #1a6cff;
  --blue-soft: #eef4ff;
  --ink: #1a1d26;
  --muted: #6b7280;
  --line: #e8eaef;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ok: #12b76a;
  --warn: #f79009;
  --err: #f04438;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(26, 29, 38, 0.08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 56px;
  --tab-h: 62px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

#app {
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
}

/* Top bar */
.topbar {
  height: var(--nav-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(232, 93, 4, .25);
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .2px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff7a18, #e85d04);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(232, 93, 4, .35);
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink);
}

/* Views */
.views {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  display: none;
  animation: fade .22s ease;
}
.view.active { display: block; }
@keyframes fade {
  from { opacity: .55; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Hero */
.hero {
  margin: 12px 14px 0;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.22), transparent 35%),
    linear-gradient(135deg, #ff8a2b 0%, #e85d04 45%, #c2410c 100%);
  padding: 22px 18px 20px;
  box-shadow: 0 12px 30px rgba(232, 93, 4, .28);
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: rgba(255,255,255,.18);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: 24px;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: .2px;
}
.hero p { font-size: 13px; opacity: .92; margin-bottom: 16px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.hero-stats div {
  background: rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.hero-stats strong { display: block; font-size: 15px; }
.hero-stats span { font-size: 11px; opacity: .85; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #fff; color: #c2410c; }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.55);
}
.btn-solid {
  background: linear-gradient(135deg, #ff7a18, #e85d04);
  color: #fff;
  width: 100%;
  box-shadow: 0 8px 18px rgba(232, 93, 4, .28);
}
.btn-solid:disabled {
  opacity: .55;
  box-shadow: none;
}
.btn-blue {
  background: var(--blue);
  color: #fff;
  width: 100%;
}
.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
  width: 100%;
}

.section {
  margin: 18px 14px 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 17px; }
.section-head .more { font-size: 12px; color: var(--muted); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.8);
}
.product-card {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-bottom: 2px;
}
.product-card h3 { font-size: 14px; }
.product-card p { font-size: 12px; color: var(--muted); flex: 1; }
.product-card .link {
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
}

.feature-list .card + .card { margin-top: 10px; }
.feature-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.feature-row .dot {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.feature-row h3 { font-size: 14px; margin-bottom: 4px; }
.feature-row p { font-size: 12px; color: var(--muted); }

.partner-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.partner-scroll::-webkit-scrollbar { display: none; }
.partner-chip {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}

.cta-banner {
  margin: 18px 14px 8px;
  border-radius: 16px;
  background: linear-gradient(120deg, #1a1d26, #2b3344);
  color: #fff;
  padding: 18px;
}
.cta-banner h3 { font-size: 16px; margin-bottom: 6px; }
.cta-banner p { font-size: 12px; opacity: .8; margin-bottom: 12px; }

/* Forms */
.panel {
  margin: 12px 14px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 18px; margin-bottom: 4px; }
.panel .desc { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  color: var(--ink);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #ffb27a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 93, 4, .12);
}
.field textarea { min-height: 96px; resize: vertical; }
.help {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.counter {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.balance-card {
  margin: 12px 14px 0;
  border-radius: 18px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #1a6cff, #0b4fd6);
  box-shadow: 0 12px 28px rgba(26, 108, 255, .28);
}
.balance-card .label { font-size: 12px; opacity: .85; }
.balance-card .amount {
  font-size: 32px;
  font-weight: 700;
  margin: 6px 0 14px;
  letter-spacing: .5px;
}
.balance-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.balance-meta div {
  background: rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 10px;
}
.balance-meta strong { display: block; font-size: 14px; }
.balance-meta span { font-size: 11px; opacity: .85; }

.tabs-pill {
  display: flex;
  gap: 8px;
  margin: 14px 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-pill::-webkit-scrollbar { display: none; }
.tabs-pill button {
  flex: 0 0 auto;
  border: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
}
.tabs-pill button.active {
  background: var(--brand-soft);
  border-color: #ffd2ad;
  color: var(--brand-dark);
  font-weight: 600;
}

.record {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.record:last-child { border-bottom: 0; }
.record .avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.record .body { flex: 1; min-width: 0; }
.record .title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.record .title span { color: var(--muted); font-weight: 400; font-size: 11px; }
.record .msg {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.badge.ok { background: #e8f8ef; color: var(--ok); }
.badge.warn { background: #fff7e8; color: var(--warn); }
.badge.err { background: #feeeee; color: var(--err); }

.price-card {
  position: relative;
  overflow: hidden;
}
.price-card.hot::after {
  content: "推荐";
  position: absolute;
  top: 12px;
  right: -22px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  padding: 3px 28px;
  transform: rotate(35deg);
}
.price-card h3 { font-size: 15px; margin-bottom: 4px; }
.price-card .price {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 8px 0;
}
.price-card .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.price-card ul { margin: 8px 0 14px; }
.price-card li {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0 4px 16px;
  position: relative;
}
.price-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}

.doc-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; word-break: break-all; text-align: right; }

/* Bottom tabs */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 30;
}
.tabbar button {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #9aa3b2;
  font-size: 10px;
}
.tabbar button .ico { font-size: 18px; line-height: 1; }
.tabbar button.active { color: var(--brand); font-weight: 600; }

/* Modal / toast */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: flex-end;
  z-index: 50;
}
.overlay.show { display: flex; }
.sheet {
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + var(--safe-b));
  animation: up .22s ease;
}
@keyframes up {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.sheet .handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #d7dbe3;
  margin: 0 auto 14px;
}
.toast {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(26, 29, 38, .92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 80;
  max-width: 86%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loading-mask {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
}
.loading-mask.show { display: flex; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ffe0c7;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center;
  padding: 28px 10px;
  color: var(--muted);
  font-size: 13px;
}

.login-hero {
  text-align: center;
  padding: 28px 16px 8px;
}
.login-hero .logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff7a18, #e85d04);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(232, 93, 4, .35);
}
.switch-auth {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.switch-auth button {
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: #edf0f5;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff7a18, #e85d04);
  transition: width .35s ease;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.tag {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.tag.active {
  background: var(--brand-soft);
  border-color: #ffd2ad;
  color: var(--brand-dark);
}

.notice {
  margin: 12px 14px 0;
  background: #fff8eb;
  border: 1px solid #ffe2ad;
  color: #9a6700;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
}

.hidden { display: none !important; }
