/* 易到家 · Product Audit */

:root {
  --teal: #00a896;
  --teal-deep: #007a6d;
  --teal-ink: #063f39;
  --teal-mist: #e8f7f5;
  --ink: #15201e;
  --muted: #5a6a67;
  --line: rgba(6, 63, 57, 0.12);
  --paper: #f3f8f7;
  --white: #fff;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --info: #0369a1;
  --info-bg: #f0f9ff;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Plus Jakarta Sans", "Noto Sans SC", system-ui, sans-serif;
  --max: 1180px;
  --toc: 200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(0, 168, 150, 0.14), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(6, 63, 57, 0.06), transparent 55%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 50;
  background: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

a {
  color: var(--teal-deep);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(6, 63, 57, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.shell {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  background: rgba(243, 248, 247, 0.88);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--teal-ink);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.brand em {
  font-style: normal;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.35rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--line);
}

.topbar__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--teal-mist);
  color: var(--teal-ink);
}

.pill--muted {
  background: rgba(6, 63, 57, 0.06);
  color: var(--muted);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--toc) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.5rem 0 4rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 90px);
  overflow: auto;
  padding: 0.25rem 0;
}

.toc__label {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.toc a:hover,
.toc a.is-active {
  color: var(--teal-ink);
  background: rgba(0, 168, 150, 0.08);
  border-left-color: var(--teal);
  text-decoration: none;
}

.main > section {
  margin-bottom: 3.25rem;
  scroll-margin-top: 80px;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.hero-doc h1,
.sec-head h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--teal-ink);
}

.lede,
.sec-head p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.sec-head {
  margin-bottom: 1.25rem;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  box-shadow: 0 1px 0 rgba(6, 63, 57, 0.03);
}

.stat__k {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin: 0.25rem 0;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  color: var(--teal-ink);
}

.stat__d {
  font-size: 0.8rem;
  color: var(--muted);
}

.callout {
  background: linear-gradient(135deg, rgba(0, 168, 150, 0.08), rgba(255, 255, 255, 0.9));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
}

.callout h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: var(--teal-ink);
}

.callout ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink);
}

.callout li + li {
  margin-top: 0.35rem;
}

.role-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.role-strip > div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
}

.role-strip span {
  display: block;
  font-weight: 700;
  color: var(--teal-ink);
  font-size: 0.92rem;
}

.role-strip p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Filters / chips */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: 0.2s var(--ease);
}

.chip:hover {
  border-color: rgba(0, 168, 150, 0.4);
  color: var(--teal-ink);
}

.chip.is-on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* Features (expandable) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.feat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.feat[hidden] {
  display: none;
}

.feat.is-open {
  border-color: rgba(0, 168, 150, 0.35);
  box-shadow: 0 8px 24px rgba(6, 63, 57, 0.06);
}

.feat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.95rem 1rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.feat__head:hover {
  background: rgba(0, 168, 150, 0.04);
}

.feat__head:focus-visible {
  outline: 2px solid rgba(0, 168, 150, 0.45);
  outline-offset: -2px;
}

.feat__head-main {
  min-width: 0;
  flex: 1;
}

.feat__role {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
  background: var(--teal-mist);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.45rem;
}

.feat h3 {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
  color: var(--teal-ink);
}

.feat__head p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.feat .path {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #3d524e;
  word-break: break-all;
}

.feat__chev {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 0.15rem;
  border-radius: 999px;
  background: var(--teal-mist);
  position: relative;
}

.feat__chev::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--teal-deep);
  border-bottom: 2px solid var(--teal-deep);
  transform: translateY(-15%) rotate(45deg);
  transition: transform 0.2s var(--ease);
}

.feat.is-open .feat__chev::before {
  transform: translateY(15%) rotate(225deg);
}

.feat__panel {
  padding: 0;
}

.feat__detail {
  margin: 0 0.85rem 0.95rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 168, 150, 0.1), rgba(0, 168, 150, 0.05));
  border: 1px solid rgba(0, 168, 150, 0.18);
}

.feat__detail[hidden] {
  display: none;
}

.feat__detail h4 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  color: var(--teal-ink);
}

.feat__bullets,
.feat__notes {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  font-size: 0.84rem;
}

.feat__bullets li + li,
.feat__notes li + li {
  margin-top: 0.35rem;
}

.feat__math {
  margin: 0.75rem 0;
}

.feat__notes {
  margin-top: 0.65rem;
  color: var(--muted);
}

.feat__notes strong {
  color: var(--teal-ink);
}

/* Flow */
.flow {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.flow__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.flow__row--bad {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
}

.node {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--mono);
  background: var(--teal-mist);
  color: var(--teal-ink);
  border: 1px solid rgba(0, 168, 150, 0.25);
}

.node--start {
  background: var(--info-bg);
  border-color: rgba(3, 105, 161, 0.25);
  color: var(--info);
}

.node--pay {
  background: #fef9c3;
  border-color: rgba(161, 98, 7, 0.25);
  color: #92400e;
}

.node--done {
  background: var(--ok-bg);
  border-color: rgba(4, 120, 87, 0.3);
  color: var(--ok);
}

.node--bad {
  background: var(--danger-bg);
  border-color: rgba(185, 28, 28, 0.2);
  color: var(--danger);
}

.arrow {
  color: var(--muted);
  font-weight: 600;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data th,
.data td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data th {
  background: rgba(0, 168, 150, 0.06);
  color: var(--teal-ink);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.data tr:last-child td {
  border-bottom: 0;
}

/* Formulas */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.formula {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.formula--wide {
  grid-column: 1 / -1;
}

.formula h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--teal-ink);
}

.math {
  margin: 0;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  background: #0f1c1a;
  color: #d7ece8;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

.hint {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.split-viz {
  margin-top: 0.85rem;
}

.bar {
  display: flex;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(6, 63, 57, 0.08);
}

.bar--lg {
  height: 36px;
  margin: 0.85rem 0 0.55rem;
}

.seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  min-width: 0;
}

.seg-p {
  background: #0e7490;
}
.seg-w {
  background: var(--teal);
}
.seg-m {
  background: #ea580c;
}

/* Money */
.money-steps {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.money-steps li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--teal);
}

.money-steps strong {
  color: var(--teal-ink);
}

.money-steps p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.flow-ascii {
  margin: 0;
  padding: 1rem;
  border-radius: 14px;
  background: #0f1c1a;
  color: #b8d4cf;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-x: auto;
}

/* Issues */
.issue-list {
  display: grid;
  gap: 0.65rem;
}

.issue {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
}

.issue[hidden] {
  display: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: fit-content;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badge--p0 {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge--p1 {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge--p2 {
  background: var(--info-bg);
  color: var(--info);
}

.issue h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  color: var(--teal-ink);
}

.issue p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* Recommendations */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.rec {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.rec__tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ok);
  background: var(--ok-bg);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.45rem;
}

.rec h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--teal-ink);
}

.rec p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* Playground */
.play-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.play-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem;
}

.play-card h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: var(--teal-ink);
}

.play-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.play-card--wide {
  grid-column: 1 / -1;
}

.play-card input[type="number"],
.play-card select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}

.play-card input[type="number"]:focus,
.play-card select:focus {
  outline: 2px solid rgba(0, 168, 150, 0.35);
  border-color: var(--teal);
}

.check {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500 !important;
}

.play-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.65rem;
}

.play-out {
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--teal-mist);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--teal-ink);
  white-space: pre-wrap;
}

.doc-foot {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.doc-foot p + p {
  margin-top: 0.5rem;
}

/* Audit additions */
.stat--danger {
  border-color: rgba(185, 28, 28, 0.25);
  background: linear-gradient(180deg, var(--danger-bg), var(--white));
}
.stat--danger strong {
  color: var(--danger);
}

.arrow--muted {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.callout--spaced,
.formula--spaced {
  margin-top: 1rem;
}

.rec-grid--spaced {
  margin-top: 1rem;
}

.urgent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.issue--urgent {
  border-color: rgba(185, 28, 28, 0.3);
  border-left: 3px solid var(--danger);
}

.issue__area {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(6, 63, 57, 0.06);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  margin-bottom: 0.35rem;
}

.issue p + p {
  margin-top: 0.45rem;
}

.issue__meta code {
  word-break: break-all;
}

.issue__meta b,
.issue__fix b {
  display: inline-block;
  min-width: 2.6em;
  color: var(--teal-ink);
  font-size: 0.76rem;
}

.issue__fix {
  color: var(--muted) !important;
}

.issue__state {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  margin-bottom: 0.35rem;
}

.issue__state--fixed {
  color: var(--ok);
  background: var(--ok-bg);
}
.issue__state--partial {
  color: var(--warn);
  background: var(--warn-bg);
}
.issue__state--open {
  color: var(--danger);
  background: var(--danger-bg);
}
.issue__state--invalid {
  color: var(--info);
  background: var(--info-bg);
}

.issue__done {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.86rem;
}

.issue__done b {
  margin-right: 0.3rem;
  font-size: 0.76rem;
}

.issue__done--fixed {
  background: var(--ok-bg);
  color: var(--ok) !important;
}
.issue__done--partial {
  background: var(--warn-bg);
  color: var(--warn) !important;
}
.issue__done--open {
  background: var(--danger-bg);
  color: var(--danger) !important;
}
.issue__done--invalid {
  background: var(--info-bg);
  color: var(--info) !important;
}

.issue[data-state="fixed"],
.issue[data-state="invalid"] {
  opacity: 0.82;
}

.chip--sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.74rem;
}

.feat__new {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.66rem;
  font-weight: 800;
  color: #fff;
  background: #ea580c;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  vertical-align: top;
}

.phase-list {
  display: grid;
  gap: 0.75rem;
}

.phase {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.phase--p0 {
  border-left-color: var(--danger);
}
.phase--p1 {
  border-left-color: var(--warn);
}
.phase--p2 {
  border-left-color: var(--info);
}

.phase h3 {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
  color: var(--teal-ink);
}

.phase ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
}

.phase li + li {
  margin-top: 0.35rem;
}

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

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
  }

  .toc nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .toc a {
    border-left: 0;
    background: var(--white);
    border: 1px solid var(--line);
  }

  .stat-grid,
  .role-strip,
  .feature-grid,
  .formula-grid,
  .rec-grid,
  .play-grid {
    grid-template-columns: 1fr;
  }

  .play-fields {
    grid-template-columns: 1fr;
  }
}

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

  .brand em {
    display: none;
  }
}
