:root {
  --ink: #171612;
  --muted: #6f695e;
  --line: #ded5c5;
  --paper: #f5efe3;
  --panel: #fffaf0;
  --deep: #10100d;
  --accent: #2d8a62;
  --accent-soft: #d9efe4;
  --gold: #b98427;
  --danger: #b84e39;
  --shadow: 0 20px 60px rgba(48, 39, 24, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(23, 22, 18, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 22, 18, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", "Microsoft YaHei", serif;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--deep);
  color: #f8edd9;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #c99031;
  color: var(--deep);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.rail-note span {
  color: rgba(248, 237, 217, 0.68);
}

.rail nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(248, 237, 217, 0.8);
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff8ea;
}

.rail-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

main {
  padding: 28px;
  max-width: 1240px;
  width: 100%;
}

.topbar,
.workspace-head,
.review-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  margin-bottom: 14px;
}

h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

p {
  color: var(--muted);
  line-height: 1.8;
}

.top-actions,
.review-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dark-button,
.ghost-button,
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.dark-button {
  background: var(--deep);
  color: #fff7e8;
  border-color: var(--deep);
  box-shadow: 0 12px 24px rgba(23, 22, 18, 0.16);
}

.ghost-button,
.tab {
  background: rgba(255, 250, 240, 0.75);
  color: var(--ink);
}

.full {
  width: 100%;
}

.panel,
.table-card,
.visual-card,
.phone-preview {
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  margin-top: 28px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: stretch;
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #176243;
  font-weight: 800;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.login-card {
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 26px;
}

.login-card .full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 138, 98, 0.14);
}

.visual-card {
  margin: 0;
  padding: 16px;
}

.visual-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.visual-card figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 24px 0;
}

.metrics article {
  padding: 20px;
  border-right: 1px solid var(--line);
}

.metrics article:last-child {
  border-right: 0;
}

.metrics span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 18px;
}

.workspace {
  display: grid;
  gap: 18px;
}

.hidden {
  display: none;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.two-col .panel,
.table-card,
.compliance-grid {
  padding: 20px;
}

.check-list,
.boundary-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}

.table-card {
  margin-top: 16px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: rgba(185, 132, 39, 0.09);
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--accent-soft);
  color: #176243;
  font-weight: 800;
  font-size: 12px;
}

.badge.waiting {
  background: #efe4cf;
  color: #7a5b1c;
}

.confirm-panel {
  display: grid;
  gap: 14px;
}

.phone-preview {
  min-height: 500px;
  padding: 34px;
  background: #14120e;
  color: #fff8e9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.phone-preview::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.phone-preview span,
.phone-preview small {
  color: rgba(255, 248, 233, 0.62);
}

.phone-preview h3 {
  color: #e5b23c;
  font-size: 26px;
}

.phone-preview strong {
  display: block;
  font-size: clamp(34px, 5vw, 58px);
  color: #fff;
  margin: 24px 0 12px;
}

.phone-preview p {
  color: rgba(255, 248, 233, 0.82);
}

.compliance-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
}

.review-strip {
  margin: 28px 0 10px;
  padding: 24px;
  background: var(--deep);
  color: #fff7e8;
  border-radius: 8px;
}

.review-strip p {
  color: rgba(255, 247, 232, 0.72);
}

.review-links a {
  color: #fff7e8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  text-decoration: none;
}

.doc {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.doc-card {
  padding: 34px;
}

.doc-card h1 {
  font-size: 44px;
  margin-bottom: 16px;
}

.doc-card h2 {
  font-size: 24px;
  margin-top: 30px;
}

.doc-card li {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.8;
}

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

  .rail {
    position: static;
    height: auto;
  }

  .rail nav {
    grid-template-columns: repeat(2, 1fr);
  }

  main {
    padding: 20px;
  }

  .topbar,
  .workspace-head,
  .review-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel,
  .two-col,
  .compliance-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-card {
    grid-template-columns: 1fr;
  }
}
