:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-subtle: #f4f4f0;
  --ink: #111110;
  --ink-muted: #575753;
  --line: #e4e4de;
  --accent: #0f766e;
  --accent-hover: #0d5e57;
  --danger: #b91c1c;
  --warn: #b45309;
  --ok: #0f766e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.muted {
  color: var(--ink-muted);
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* Header */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--ink);
}

.lang-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.lang-btn:hover {
  border-color: var(--ink);
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 760px;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin: 0 0 14px;
}

.hero-sub {
  font-size: 17px;
  color: var(--ink-muted);
  margin: 0 0 28px;
  max-width: 640px;
}

.scan-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.scan-form input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-family: var(--mono);
}

.scan-form input:focus,
.unlock-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sep {
  color: var(--line);
}

.scan-status {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  font-size: 13px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.scan-error {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--danger);
  border-radius: 8px;
  font-size: 14px;
}

/* Report Section */
.report-section {
  padding: 40px 0 24px;
}

.report-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.report-header h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-muted);
  font-family: var(--mono);
}

.score-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 18px;
  border-radius: 10px;
}

.score-num-wrap {
  font-variant-numeric: tabular-nums;
}

.score-num {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.score-denom {
  font-size: 14px;
  color: var(--ink-muted);
}

.score-grade-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.grade-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.grade-badge {
  font-size: 20px;
  font-weight: 700;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.panel-head-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-head-row .panel-title {
  margin-bottom: 0;
}

/* Dimensions */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dim-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--bg);
}

.dim-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dim-score {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

.dim-bar {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  background: var(--accent);
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 600;
}

.status-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.status-allow {
  color: var(--ok);
  background: #f0fdfa;
  border-color: #99f6e4;
}

.status-block {
  color: var(--danger);
  background: #fef2f2;
  border-color: #fecaca;
}

.status-unspecified {
  color: var(--warn);
  background: #fffbeb;
  border-color: #fde68a;
}

/* Issues */
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issue-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--bg);
}

.issue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sev-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.sev-critical { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.sev-high { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }
.sev-medium { background: var(--surface); color: var(--ink-muted); border: 1px solid var(--line); }

.issue-evidence {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 6px;
  word-break: break-word;
}

.issue-fix {
  font-size: 14px;
}

/* Fix Pack */
.fixpack-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
}

.clean-list {
  margin: 16px 0 20px;
  padding-left: 18px;
  font-size: 14px;
}

.clean-list li {
  margin-bottom: 6px;
}

.unlock-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.unlock-row {
  display: flex;
  gap: 8px;
}

.unlock-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface);
}

.unlock-row .btn {
  height: 40px;
}

.demo-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

.demo-hint code {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.unlock-msg {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

.unlock-msg.ok { color: var(--ok); }
.unlock-msg.err { color: var(--danger); }

.buy-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tier-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--bg);
}

.tier-name {
  font-size: 13px;
  font-weight: 600;
}

.tier-price {
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0 10px;
  font-variant-numeric: tabular-nums;
}

.preview-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.preview-tab {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}

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

.code-preview {
  flex: 1;
  margin: 0;
  padding: 16px;
  background: #171716;
  color: #ededeb;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  max-height: 390px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Done-For-You Service */
.service-section {
  padding: 24px 0 64px;
}

.service-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 28px;
  align-items: center;
}

.service-box h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.contact-strip {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
}

.service-cta-col {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.small-note {
  font-size: 13px;
  margin-bottom: 14px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 860px) {
  .dimensions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fixpack-grid,
  .service-box {
    grid-template-columns: 1fr;
  }
  .service-cta-col {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 20px;
  }
}

@media (max-width: 600px) {
  .scan-form,
  .unlock-row {
    flex-direction: column;
  }
  .dimensions-grid,
  .buy-tiers {
    grid-template-columns: 1fr;
  }
  .nav-links a {
    display: none;
  }
}
