/* UGagent — "drafting sheet" design system.
   Light: drawing paper + ink. Dark: blueprint. No web fonts (blocked in mainland China). */
:root {
  --paper: #f4f2ec;
  --sheet: #fbfaf6;
  --ink: #1a2230;
  --ink-2: #3d4757;
  --muted: #6e7685;
  --rule: #cfcabd;
  --rule-strong: #1a2230;
  --grid: rgba(26, 34, 48, .055);
  --accent: #c8461a;          /* red pencil: actions and corrections */
  --accent-ink: #fff;
  --line: #1f4f8f;            /* construction line blue */
  --ok: #24724a;
  --warn: #a8640a;
  --bad: #b3261e;
  --code-bg: #ebe7dc;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d2033; --sheet: #102a42; --ink: #e6eef7; --ink-2: #b9c8d8; --muted: #8aa0b6;
    --rule: #28496a; --rule-strong: #9cc4e8; --grid: rgba(156, 196, 232, .07);
    --accent: #ff8a4c; --accent-ink: #10202f; --line: #7cc4ff;
    --ok: #5cc98d; --warn: #f0b04a; --bad: #ff7d72; --code-bg: #17344f;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 15px/1.7 var(--sans);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
}
a { color: var(--line); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .88em; background: var(--code-bg); padding: 1px 6px; border-radius: 3px; word-break: break-all; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 30px; line-height: 1.3; margin: 0 0 12px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 460px; }
.narrow-wide { max-width: 800px; }
.section { padding: 44px 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.fine { color: var(--muted); font-size: 13px; margin-top: 16px; }
.inline { display: inline; margin: 0; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* top bar: the sheet's header strip */
.topbar { background: var(--sheet); border-bottom: 2px solid var(--rule-strong); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); font-family: var(--mono); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { border: 2px solid var(--ink); padding: 0 6px; line-height: 1.35; }
.brand-sub { font: 12px var(--sans); color: var(--muted); }
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.nav a { color: var(--ink-2); }
.nav .nav-strong { color: var(--ink); font-weight: 600; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--accent); padding: 9px 20px; border-radius: 4px; font: 600 15px var(--sans); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease; box-shadow: 3px 3px 0 var(--rule-strong); }
.btn:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--rule-strong); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--rule-strong); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
.btn-ghost { background: var(--sheet); color: var(--ink); border-color: var(--rule-strong); }
.btn-small { padding: 4px 12px; font-size: 13px; box-shadow: 2px 2px 0 var(--rule-strong); }
.nav .btn-small { color: var(--accent-ink); }
.btn-block { width: 100%; }
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* drawing sheet frame with zone markers */
.sheet { position: relative; background: var(--sheet); border: 2px solid var(--rule-strong); margin: 32px auto; }
.sheet::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--rule); pointer-events: none; }
.zones { position: absolute; left: 0; right: 0; top: -1px; display: flex; justify-content: space-around; font: 10px var(--mono); color: var(--muted); pointer-events: none; }
.zones span { transform: translateY(-120%); }

/* hero */
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; padding: 56px 40px 48px; align-items: center; }
.hero h1 { font-size: 42px; line-height: 1.25; }
.hero h1 em { font-style: normal; color: var(--accent); }
.eyebrow { font: 12px var(--mono); color: var(--line); margin: 0 0 14px; letter-spacing: .08em; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 34em; }
.figure { position: relative; }
.figure svg { width: 100%; height: auto; display: block; }
.figure .part { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.figure .hidden { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 4; }
.figure .dim { fill: none; stroke: var(--line); stroke-width: 1; }
.figure .dim-text { fill: var(--line); font: 12px var(--mono); }
.figure .note { fill: var(--accent); font: 12px var(--sans); }
.figure .draw { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.2s ease forwards; }
.figure .d2 { animation-delay: .5s; } .figure .d3 { animation-delay: 1s; } .figure .d4 { animation-delay: 1.6s; }
.figure .fade { opacity: 0; animation: fade .6s ease forwards; animation-delay: 2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.figure-caption { font: 11px var(--mono); color: var(--muted); text-align: right; margin-top: 6px; }

/* title block (标题栏) */
.title-block { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--rule-strong); }
.title-block > div { padding: 12px 16px; border-right: 1px solid var(--rule); }
.title-block > div:last-child { border-right: 0; }
.title-block b { display: block; font: 700 15px var(--serif); margin-top: 2px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 2px solid var(--rule-strong); background: var(--sheet); }
.step { padding: 22px; border-right: 1px solid var(--rule); position: relative; }
.step:last-child { border-right: 0; }
.step h3 { margin: 10px 0 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: 14px; }
.num { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 50%; font: 700 14px var(--mono); }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head::after { content: ""; flex: 1; border-bottom: 1px dashed var(--rule); transform: translateY(-4px); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 2px solid var(--rule-strong); background: var(--sheet); }
.two-col > div { padding: 24px; }
.two-col > div + div { border-left: 1px solid var(--rule); }
.checks, .crosses { padding: 0; margin: 0; list-style: none; display: grid; gap: 10px; }
.checks li, .crosses li { padding-left: 26px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.crosses li::before { content: "△"; position: absolute; left: 0; color: var(--warn); font-size: 13px; top: 1px; }

/* cards and forms */
.card { background: var(--sheet); border: 2px solid var(--rule-strong); padding: 22px; margin-bottom: 20px; position: relative; }
.card-title { font-size: 18px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-tag { position: absolute; top: -11px; right: 16px; background: var(--sheet); padding: 0 8px; font: 11px var(--mono); color: var(--muted); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.form label.check { display: block; font-size: 13px; line-height: 1.6; }
input[type=email], input[type=password], textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--rule); border-radius: 3px; background: var(--paper);
  color: var(--ink); font: 15px var(--sans); transition: border-color .15s; }
input[type=email]:focus, input[type=password]:focus, textarea:focus { border-color: var(--line); outline: none; }
.drop { display: grid; place-items: center; gap: 6px; border: 2px dashed var(--rule); padding: 22px 16px; background: var(--paper); text-align: center; cursor: pointer; transition: border-color .15s; }
.drop:hover, .drop.has-file { border-color: var(--line); }
.drop input { max-width: 100%; font-size: 13px; }
.drop-name { font: 13px var(--mono); color: var(--line); word-break: break-all; }
.alert { border-left: 4px solid var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); color: var(--bad); padding: 10px 14px; margin: 0 0 18px; }

/* dashboard */
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { margin: 0; word-break: break-all; }
.dash-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 20px; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 2px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--rule); font-size: 14px; }
.checklist li:last-child { border-bottom: 0; }
.mark { width: 16px; height: 16px; border: 2px solid var(--muted); border-radius: 50%; margin-top: 3px; }
.checklist li.done .mark { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 2px var(--sheet); }
.checklist li.done { color: var(--ink); }
.checklist li:not(.done) { color: var(--muted); }
.checklist small { display: block; color: var(--muted); font-size: 12px; }
.device-row { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.pair { margin: 4px 0 10px; display: grid; gap: 10px; justify-items: start; }
.pair-out { display: grid; gap: 4px; }
.pair-code { font-size: 30px; letter-spacing: .3em; padding: 6px 12px; border: 2px dashed var(--accent); background: transparent; color: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); }
.table th { font: 11px var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--rule-strong); }
.table td:first-child { word-break: break-all; }
.status { font: 12px var(--mono); padding: 2px 8px; border: 1.5px solid var(--rule); white-space: nowrap; }
.s-queued { color: var(--line); border-color: var(--line); }
.s-running { color: var(--accent); border-color: var(--accent); }
.s-completed { color: var(--ok); border-color: var(--ok); }
.s-failed { color: var(--bad); border-color: var(--bad); }
.s-cancelled { color: var(--muted); }
.badge { font: 500 12px var(--sans); color: var(--warn); border: 1.5px solid var(--warn); padding: 0 8px; }
.empty { padding: 26px 0; text-align: center; color: var(--muted); }

/* job */
.facts { display: grid; grid-template-columns: 190px 1fr; margin: 0; border-top: 1px solid var(--rule); }
.facts dt, .facts dd { padding: 10px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { word-break: break-word; }
.warn-title { color: var(--warn); }
.list-warn { padding-left: 20px; }
.list-warn li { margin-bottom: 6px; }
.progress { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); border-left: 2px solid var(--rule); }
.progress li { position: relative; padding: 4px 0 8px 18px; }
.progress li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--line); }
.progress li:last-child::before { background: var(--line); }
.howto { padding-left: 22px; display: grid; gap: 10px; }
.prose p { color: var(--ink-2); }

.footer { border-top: 2px solid var(--rule-strong); background: var(--sheet); margin-top: 48px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.footer-inner .mono { font-size: 12px; }

@media (max-width: 820px) {
  .hero-grid, .two-col, .dash-grid, .steps { grid-template-columns: 1fr; }
  .hero-grid { padding: 36px 22px 28px; }
  .hero h1 { font-size: 30px; }
  .step { border-right: 0; border-bottom: 1px solid var(--rule); }
  .step:last-child { border-bottom: 0; }
  .two-col > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .title-block { grid-template-columns: 1fr 1fr; }
  .title-block > div:nth-child(2) { border-right: 0; }
  .title-block > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .zones { display: none; }
  .nav { gap: 12px; }
  .brand-sub { display: none; }
  .sheet { margin: 20px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .figure .draw { animation: none; stroke-dashoffset: 0; }
  .figure .fade { animation: none; opacity: 1; }
  .btn { transition: none; }
}
