:root {
  --brand: #0b6bcb;
  --brand-strong: #064e96;
  --brand-soft: #e7f2ff;
  --accent: #18a999;
  --warning: #a85d00;
  --warning-soft: #fff1d7;
  --danger: #bd2c32;
  --danger-soft: #ffebec;
  --success: #18794e;
  --success-soft: #e7f6ee;
  --ink: #16202a;
  --ink-muted: #63707d;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --surface-3: #e9eef3;
  --line: #d6dee6;
  --shadow: 0 18px 48px rgba(29, 48, 67, .16);
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --phone-scale: .9;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface-2);
}

body[data-theme="dark"] {
  --brand: #65b3ff;
  --brand-strong: #9bcaff;
  --brand-soft: #11375b;
  --accent: #50d4c4;
  --warning: #ffc46b;
  --warning-soft: #4a3210;
  --danger: #ff8b90;
  --danger-soft: #491d21;
  --success: #62d19b;
  --success-soft: #153e2d;
  --ink: #edf3f8;
  --ink-muted: #a7b4c0;
  --surface: #141a20;
  --surface-2: #0d1217;
  --surface-3: #222b33;
  --line: #34414d;
  --shadow: 0 20px 54px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; letter-spacing: 0; }
button, select, input { font: inherit; letter-spacing: 0; }
button, select { min-height: 44px; }
button { color: inherit; cursor: pointer; }
.review-header {
  height: 68px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong { display: block; font-size: 17px; }
.brand-lockup span { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.review-actions { display: flex; gap: 8px; }
.icon-button {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); display: grid; place-items: center;
}
.icon-button:hover { background: var(--surface-2); }
.icon-button svg, .app-bar svg, .bottom-nav svg, .status-icon svg { width: 21px; height: 21px; stroke-width: 2; }
.review-layout { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 248px minmax(420px, 1fr) 260px; }
.review-panel, .inspection-panel { padding: 24px 20px; background: var(--surface); }
.review-panel { border-right: 1px solid var(--line); }
.inspection-panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 32px; }
.review-panel section { margin-bottom: 24px; }
.panel-label, .eyebrow { display: block; margin: 0 0 8px; color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.review-panel select {
  width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
}
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 3px; margin-top: 10px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented button { min-height: 36px; padding: 0 8px; background: transparent; border: 0; border-radius: var(--r-sm); font-size: 13px; }
.segmented button.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; }
.range-row { display: flex; justify-content: space-between; }
.range-row output { font-size: 12px; color: var(--ink-muted); }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.review-note { display: flex; gap: 10px; color: var(--ink-muted); font-size: 12px; line-height: 1.5; }
.review-note svg { min-width: 20px; color: var(--success); }
.stage { min-width: 0; padding: 30px; display: grid; place-items: start center; overflow: auto; }
.single-view { min-height: 760px; width: 100%; display: grid; place-items: start center; }
.phone-shell {
  position: relative; width: 388px; height: 854px; padding: 10px; border-radius: 34px;
  background: #11171c; box-shadow: var(--shadow); transform: scale(var(--phone-scale)); transform-origin: top center;
}
.phone-shell.frame-hidden { padding: 0; background: transparent; border-radius: 0; box-shadow: none; }
.phone-camera { position: absolute; z-index: 5; top: 17px; left: 50%; transform: translateX(-50%); width: 68px; height: 19px; border-radius: 16px; background: #0a0d10; }
.frame-hidden .phone-camera { display: none; }
.phone-screen { height: 100%; overflow: hidden; border-radius: 25px; background: var(--surface-2); color: var(--ink); }
.frame-hidden .phone-screen { border-radius: 0; }
.phone-ui { position: relative; height: 100%; display: flex; flex-direction: column; background: var(--surface-2); }
.status-bar { height: 36px; padding: 10px 18px 0; display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; }
.status-bar span:last-child { color: var(--ink-muted); }
.app-bar { height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-title { min-width: 0; }
.app-bar h2 { margin: 0; font-size: 19px; }
.app-bar p { margin: 2px 0 0; color: var(--ink-muted); font-size: 11px; }
.app-bar button { border: 0; background: transparent; width: 44px; display: grid; place-items: center; }
.app-bar-actions { display: flex; align-items: center; gap: 4px; }
.app-connection {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap;
}
.app-connection span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.app-connection.online { color: var(--success); background: var(--success-soft); }
.app-connection.offline { color: var(--danger); background: var(--danger-soft); }
.screen-content { flex: 1; overflow-y: auto; padding: 16px 16px 92px; }
.bottom-nav { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 68px; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 25px 25px; }
.frame-hidden .bottom-nav { left: 0; right: 0; bottom: 0; border-radius: 0; }
.bottom-nav button { border: 0; background: transparent; color: var(--ink-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10px; }
.bottom-nav button.active { color: var(--brand); font-weight: 700; }
.connection-strip, .inline-status { border-radius: var(--r-md); padding: 10px 12px; display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; }
.connection-strip.online { background: var(--success-soft); color: var(--success); }
.connection-strip.offline { background: var(--danger-soft); color: var(--danger); }
.connection-strip svg, .inline-status svg { width: 17px; height: 17px; }
.hero-control { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.mode-name { font-size: 14px; font-weight: 700; }
.toggle-action {
  width: 50px; height: 50px; border: 0; border-radius: 50%; background: var(--brand); color: white;
  display: grid; place-items: center; box-shadow: 0 7px 16px rgba(11, 107, 203, .25);
}
.toggle-action svg { width: 23px; }
.temperature { text-align: center; padding: 14px 0 18px; }
.temperature strong { font-size: 68px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.temperature span { font-size: 22px; color: var(--ink-muted); vertical-align: top; }
.temp-controls { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 10px; }
.temp-controls button { height: 50px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-md); font-size: 22px; }
.temp-scale { text-align: center; color: var(--ink-muted); font-size: 11px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.mode-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); font-size: 13px; }
.mode-tabs button.active { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); font-weight: 700; }
.control-section { margin-top: 14px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 8px; }
.section-title h3 { margin: 0; font-size: 13px; }
.section-title span { color: var(--ink-muted); font-size: 11px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice-grid button, .action-row button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); font-size: 12px; }
.choice-grid button.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 700; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-row button { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.action-row svg { width: 18px; }
.disclaimer { margin-top: 12px; color: var(--ink-muted); font-size: 11px; line-height: 1.45; display: flex; gap: 7px; }
.disclaimer svg { min-width: 16px; width: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; }
.card h3 { margin: 0 0 5px; font-size: 14px; }
.card p { margin: 0; font-size: 12px; color: var(--ink-muted); line-height: 1.5; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.row-button { width: 100%; border: 0; background: transparent; text-align: left; color: inherit; }
.compact-list { padding-top: 2px; padding-bottom: 2px; }
.list-icon { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--surface-3); display: grid; place-items: center; color: var(--brand); }
.list-icon svg { width: 19px; }
.list-copy { flex: 1; min-width: 0; }
.list-copy strong { display: block; font-size: 13px; }
.list-copy span { display: block; color: var(--ink-muted); font-size: 11px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.tag.success { color: var(--success); background: var(--success-soft); }
.tag.warning { color: var(--warning); background: var(--warning-soft); }
.tag.danger { color: var(--danger); background: var(--danger-soft); }
.tag.neutral { color: var(--ink-muted); background: var(--surface-3); }
.primary-button, .secondary-button, .danger-button { width: 100%; border-radius: var(--r-md); font-weight: 800; }
.primary-button { border: 0; background: var(--brand); color: white; }
.secondary-button { border: 1px solid var(--brand); background: transparent; color: var(--brand-strong); }
.danger-button { border: 1px solid var(--danger); background: transparent; color: var(--danger); }
.text-button { width: 100%; border: 0; background: transparent; color: var(--brand-strong); font-weight: 800; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.filter-bar button { border: 0; background: transparent; color: var(--ink-muted); font-size: 11px; }
.danger-dot { color: var(--danger); background: var(--danger-soft); }
.empty-state { min-height: 330px; display: grid; place-content: center; text-align: center; padding: 24px; }
.empty-state .list-icon { margin: auto; width: 56px; height: 56px; }
.empty-state h3 { margin: 16px 0 6px; }
.empty-state p { margin: 0 0 18px; color: var(--ink-muted); font-size: 12px; line-height: 1.5; }
.dialog-backdrop { position: absolute; inset: 10px; z-index: 8; background: rgba(10, 18, 25, .45); display: grid; place-items: end center; padding: 16px; border-radius: 25px; }
.frame-hidden .dialog-backdrop { inset: 0; border-radius: 0; }
.dialog { position: relative; width: 100%; background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.dialog h3 { margin: 0 0 7px; font-size: 18px; }
.dialog p { margin: 0 0 16px; color: var(--ink-muted); font-size: 12px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.field input, .field select { width: 100%; height: 48px; padding: 0 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.dialog-close {
  position: absolute; top: 10px; right: 10px; width: 40px; border: 0;
  background: transparent; display: grid; place-items: center;
}
.compact-dialog { padding-top: 48px; }
.option-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.option-list button {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  color: var(--ink); font-size: 12px;
}
.option-list button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; }
.menu-list { display: grid; gap: 8px; }
.menu-list button {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  color: var(--ink); display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.mock-toast {
  position: absolute; z-index: 12; left: 26px; right: 26px; bottom: 90px;
  min-height: 46px; padding: 10px 12px; border-radius: var(--r-md);
  display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--surface);
  font-size: 11px; font-weight: 700; box-shadow: var(--shadow);
  animation: toast-in .18s ease-out;
}
.mock-toast svg { width: 17px; min-width: 17px; }
.splash {
  width: 100%; height: 100%; border: 0; color: var(--ink);
  display: grid; place-content: center; text-align: center; background: var(--surface);
}
.app-mark { width: 90px; height: 90px; margin: auto; border-radius: 24px; background: var(--brand); position: relative; overflow: hidden; }
.app-mark::before { content: ""; position: absolute; width: 54px; height: 54px; border: 8px solid white; border-radius: 50%; left: 18px; top: 18px; }
.app-mark::after { content: ""; position: absolute; width: 32px; height: 13px; background: var(--brand); left: 29px; top: 4px; }
.app-mark span { position: absolute; width: 8px; height: 27px; background: white; border-radius: 6px; left: 41px; top: 11px; z-index: 2; }
.app-mark.small { width: 38px; height: 38px; border-radius: 10px; margin: 0; }
.app-mark.small::before { width: 22px; height: 22px; border-width: 4px; left: 8px; top: 8px; }
.app-mark.small::after { width: 14px; height: 6px; left: 12px; top: 2px; }
.app-mark.small span { width: 4px; height: 12px; left: 17px; top: 5px; }
.splash h1 { margin: 22px 0 6px; font-size: 28px; }
.splash p { margin: 0; color: var(--ink-muted); font-size: 13px; }
.splash-loader {
  width: 54px; height: 3px; margin: 26px auto 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand) 50%, var(--surface-3) 50%);
  background-size: 200% 100%; animation: splash-load .8s ease-in-out forwards;
}
.phone-home { overflow: hidden; background: var(--surface-2); }
.home-date { padding: 78px 28px 0; display: flex; flex-direction: column; }
.home-date strong { font-size: 32px; line-height: 1.15; }
.home-date span { margin-top: 7px; color: var(--ink-muted); font-size: 13px; }
.home-apps { flex: 1; padding: 62px 28px; display: grid; grid-template-columns: repeat(4, 1fr); align-content: start; }
.home-app {
  min-width: 72px; border: 0; background: transparent; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.home-app .app-mark { width: 58px; height: 58px; margin: 0; border-radius: 15px; }
.home-app .app-mark::before { width: 34px; height: 34px; border-width: 5px; left: 12px; top: 12px; }
.home-app .app-mark::after { width: 21px; height: 8px; left: 19px; top: 3px; }
.home-app .app-mark > span { width: 5px; height: 18px; left: 27px; top: 7px; }
.home-app strong { font-size: 11px; white-space: nowrap; }
.home-dock {
  height: 84px; margin: 0 18px 18px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); display: grid; grid-template-columns: repeat(4, 1fr); place-items: center;
}
.home-dock span { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); }
.guide { height: 100%; display: flex; flex-direction: column; padding: 52px 24px 28px; background: var(--surface); }
.guide-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.guide-nav span { color: var(--ink-muted); font-size: 11px; font-weight: 800; }
.guide-nav button {
  width: 44px; border: 0; border-radius: var(--r-md); background: var(--surface-2);
  display: grid; place-items: center;
}
.guide-nav button:disabled { opacity: .3; cursor: default; }
.guide-back { transform: rotate(180deg); }
.guide-visual { height: 250px; display: grid; place-items: center; }
.guide-rings { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; position: relative; }
.guide-rings::before, .guide-rings::after { content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.guide-rings::before { width: 132px; height: 132px; }
.guide-rings::after { width: 84px; height: 84px; background: var(--brand-soft); border-color: var(--brand); }
.guide-rings svg { z-index: 2; width: 36px; color: var(--brand); }
.guide h1 { margin: 22px 0 8px; font-size: 25px; }
.guide p { margin: 0; color: var(--ink-muted); line-height: 1.6; font-size: 13px; }
.guide .primary-button { margin-top: auto; }
.progress-steps { display: flex; gap: 6px; margin-top: 18px; }
.progress-steps button { min-height: 8px; width: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-3); transition: width .16s ease, background .16s ease; }
.progress-steps button.active { width: 24px; border-radius: 5px; background: var(--brand); }
.timeline-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding-bottom: 14px; }
.timeline-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; }
.timeline-dot svg { width: 13px; }
.timeline-item strong { font-size: 12px; }
.timeline-item p { margin: 3px 0 0; font-size: 11px; color: var(--ink-muted); }
.about-mark { display: flex; align-items: center; gap: 12px; padding: 8px 4px 20px; }
.about-mark .app-mark { margin: 0; }
.about-mark h2 { margin: 0; font-size: 20px; }
.about-mark p { margin: 3px 0 0; color: var(--ink-muted); font-size: 11px; }
.icon-showcase { display: flex; gap: 18px; align-items: center; margin-top: 16px; }
.icon-showcase .app-mark { margin: 0; }
.circle-mark { border-radius: 50%; }
.color-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.color-row span { height: 42px; border-radius: var(--r-sm); }
.type-xl { font-size: 24px !important; color: var(--ink) !important; }
.type-md { font-size: 16px !important; color: var(--ink) !important; }
.overview-view { width: 100%; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 20px; align-items: start; }
.overview-view:not([hidden]) { display: grid; }
.overview-card { min-width: 0; }
.overview-card h3 { margin: 0 0 8px; font-size: 13px; }
.mini-phone { aspect-ratio: 388 / 854; overflow: hidden; border: 5px solid #11171c; border-radius: 18px; background: var(--surface-2); box-shadow: 0 8px 20px rgba(24, 41, 58, .12); }
.mini-phone .phone-ui { width: 388px; height: 854px; transform: scale(calc((100vw - 590px) / 388)); transform-origin: top left; }
.inspection-panel h1 { font-size: 20px; line-height: 1.3; margin: 6px 0 8px; }
.inspection-panel p { font-size: 12px; line-height: 1.6; color: var(--ink-muted); }
#auditTags { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-summary dl { margin: 0; }
.spec-summary dl div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.spec-summary dt { color: var(--ink-muted); }
.spec-summary dd { margin: 0; text-align: right; }
.sending-banner { background: var(--brand-soft); color: var(--brand-strong); }
.failed-banner { background: var(--danger-soft); color: var(--danger); }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.spinner { animation: spin .75s linear infinite; }
.screen-content, .guide, .splash { animation: screen-in .16s ease-out; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes screen-in { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splash-load { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (max-width: 1120px) {
  .review-layout { grid-template-columns: 220px 1fr; }
  .inspection-panel { display: none; }
}
@media (max-width: 720px) {
  .review-header { height: 58px; padding: 0 12px; }
  .review-layout { display: block; }
  .review-panel {
    position: sticky; top: 58px; z-index: 18; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px;
  }
  .review-panel section { margin: 0; }
  .review-panel section:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
  .review-panel section:nth-child(n+4) { display: none; }
  .review-panel .panel-label { display: none; }
  .review-panel select { min-height: 38px; }
  .segmented { margin: 0; }
  .segmented button { min-height: 32px; font-size: 11px; }
  .stage { padding: 12px 0 0; overflow: hidden; }
  .single-view { min-height: auto; }
  .phone-shell { width: min(100vw, 430px); height: calc(100dvh - 202px); min-height: 600px; padding: 0; border-radius: 0; box-shadow: none; transform: none; background: transparent; }
  .phone-camera { display: none; }
  .phone-screen { border-radius: 0; }
  .bottom-nav { left: 0; right: 0; bottom: 0; border-radius: 0; }
  .dialog-backdrop { inset: 0; border-radius: 0; }
  .overview-view { padding: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-phone .phone-ui { transform: scale(calc((50vw - 24px) / 388)); }
}
