:root {
  --ink: #17211b;
  --muted: #657168;
  --line: #dfe5df;
  --paper: #f6f4ef;
  --card: #fffefa;
  --green: #17694a;
  --green-dark: #0e4934;
  --amber: #a46109;
  --red: #a53c32;
  --blue: #315e8a;
  --shadow: 0 24px 60px rgba(32, 47, 38, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(31, 119, 83, .11), transparent 30rem),
    linear-gradient(180deg, #f8f7f2, var(--paper));
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.hidden { display: none !important; }

.topbar {
  height: 76px;
  padding: 0 clamp(24px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 33, 27, .09);
  background: rgba(255, 254, 250, .84);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  color: white; background: var(--green); border-radius: 12px; font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.top-actions { display: flex; gap: 16px; align-items: center; }
.local-chip { padding: 8px 11px; border-radius: 999px; background: #edf6f0; color: var(--green-dark); font-size: 12px; font-weight: 650; }
.local-chip i { width: 7px; height: 7px; display: inline-block; margin-right: 7px; border-radius: 50%; background: #22a56c; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.auth-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: clamp(40px, 8vw, 120px); padding: 64px 0; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.intro-panel h1, .hero-row h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-weight: 500; letter-spacing: -.035em; }
.intro-panel h1 { font-size: clamp(48px, 6vw, 78px); line-height: 1.02; }
.intro-copy { max-width: 590px; color: var(--muted); line-height: 1.8; font-size: 17px; }
.guardrail-list { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.guardrail-list > div { min-height: 118px; padding: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.48); border-radius: 16px; }
.guardrail-list span { color: var(--green); font-family: Georgia, serif; font-size: 15px; }
.guardrail-list p { margin: 18px 0 0; }
.guardrail-list strong, .guardrail-list small { display: block; }
.guardrail-list small { margin-top: 5px; color: var(--muted); }

.auth-card, .panel, .metric-card { background: var(--card); border: 1px solid rgba(23,33,27,.1); box-shadow: var(--shadow); }
.auth-card { border-radius: 24px; padding: 30px; }
.tabs { display: flex; padding: 4px; gap: 4px; background: #eef0eb; border-radius: 12px; }
.tab { flex: 1; border: 0; padding: 10px; border-radius: 9px; background: transparent; color: var(--muted); }
.tab.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); font-weight: 700; }
.auth-card h2 { margin: 30px 0 7px; }
.auth-card form > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }

label { display: grid; gap: 8px; margin-bottom: 16px; color: #344139; font-size: 13px; font-weight: 650; }
input, select {
  width: 100%; border: 1px solid #ccd4cc; border-radius: 11px; padding: 12px 13px;
  color: var(--ink); background: white; outline: none;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,105,74,.11); }
.primary, .secondary, .quiet, .disabled-action { border-radius: 11px; padding: 11px 16px; border: 1px solid transparent; font-weight: 750; }
.primary { width: 100%; color: white; background: var(--green); }
.primary:hover { background: var(--green-dark); }
.secondary { width: 100%; color: var(--green-dark); background: #e7f2eb; border-color: #cbe0d2; }
.quiet { background: white; border-color: var(--line); color: var(--ink); }
.disabled-action { width: 100%; color: #888f89; background: #eff0ed; border-color: var(--line); }

.dashboard { padding: 54px 0 80px; }
.hero-row { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; }
.hero-row h1 { font-size: clamp(36px, 5vw, 58px); }
.hero-row > div:first-child > p:last-child { color: var(--muted); }
.blocked-banner { min-width: 340px; padding: 16px 18px; display: flex; gap: 12px; align-items: center; background: #fff2ec; border: 1px solid #efc9bc; border-radius: 15px; }
.blocked-banner strong, .blocked-banner small { display: block; }
.blocked-banner small { margin-top: 3px; color: #80534b; }
.status-dot { width: 11px; height: 11px; background: var(--red); border-radius: 50%; box-shadow: 0 0 0 5px rgba(165,60,50,.12); }

.metrics { margin: 34px 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.metric-card { padding: 20px; border-radius: 17px; box-shadow: none; }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card strong { display: block; margin: 12px 0 6px; font-size: 30px; }
.wallet-card { background: var(--green-dark); color: white; }
.wallet-card span, .wallet-card small { color: #cbe5d8; }

.workspace-grid { display: grid; grid-template-columns: 1fr 1fr .86fr; gap: 16px; }
.panel { padding: 22px; border-radius: 18px; box-shadow: none; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.panel-head h2 { margin: 0; font-size: 19px; }
.panel-head > span { color: var(--muted); font-size: 12px; }
.state-chip { padding: 6px 8px; border-radius: 7px; font-size: 11px !important; font-weight: 750; white-space: nowrap; }
.state-chip.amber { color: #7b4908; background: #fff1d9; }
.state-chip.red { color: #872c26; background: #ffe8e4; }
.state-chip.blue { color: #285176; background: #e5f0fa; }
.boundary-note { margin-bottom: 16px; padding: 12px; color: #74493f; background: #fff5ef; border-radius: 10px; font-size: 12px; line-height: 1.55; }
.microcopy { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.task-panel, .ledger-panel { margin-top: 16px; }
.task-list { display: grid; gap: 10px; }
.task-row { display: grid; grid-template-columns: minmax(180px,1fr) auto auto; align-items: center; gap: 16px; padding: 15px; background: #f8f8f5; border: 1px solid var(--line); border-radius: 12px; }
.task-row strong, .task-row small { display: block; }
.task-row small { margin-top: 4px; color: var(--muted); }
.task-status { color: var(--red); font-size: 12px; font-weight: 800; }
.task-cost { color: var(--muted); font-size: 12px; text-align: right; }
.empty-state { padding: 34px; text-align: center; color: var(--muted); background: #f8f8f5; border-radius: 12px; }
.ledger-list { display: grid; gap: 8px; }
.ledger-row { display: flex; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row small { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 12px; background: #17211b; color: white; box-shadow: var(--shadow); transition: .2s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8d3029; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .guardrail-list, .workspace-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .wallet-card { grid-column: 1 / -1; }
  .hero-row { align-items: stretch; flex-direction: column; }
  .blocked-banner { min-width: 0; width: 100%; }
}

@media (max-width: 560px) {
  main { width: min(100% - 24px, 1180px); }
  .topbar { height: 68px; padding: 0 12px; }
  .local-chip { display: none; }
  .auth-layout { padding: 32px 0; }
  .intro-panel h1 { font-size: 44px; }
  .guardrail-list { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .wallet-card { grid-column: auto; }
  .task-row { grid-template-columns: 1fr; }
  .task-cost { text-align: left; }
}

textarea {
  width: 100%; min-height: 72px; border: 1px solid #ccd4cc; border-radius: 11px;
  padding: 12px 13px; color: var(--ink); background: white; resize: vertical;
}
.jianpin-grid { grid-template-columns: 1fr 1fr .9fr; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.thumbs img { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.intake-box { font-size: 13px; line-height: 1.6; color: var(--muted); }
.intake-box ul { margin: 8px 0 0; padding-left: 18px; }
.intake-box .ok { color: var(--green-dark); }
.quote-panel { margin-top: 16px; }
.quote-price { font-size: 28px; margin: 8px 0 18px; }
.task-row { grid-template-columns: minmax(180px,1.2fr) 1fr auto; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.downloads a { color: var(--green-dark); font-size: 12px; font-weight: 700; }
.task-progress { color: var(--muted); font-size: 12px; }
video.preview { width: 120px; border-radius: 8px; background: #111; }

@media (max-width: 900px) {
  .jianpin-grid { grid-template-columns: 1fr; }
}
