:root {
  --css-loaded-flag: 1;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --ink: #1d1d1f;
  --ink-secondary: #515154;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-soft: rgba(0, 0, 0, 0.05);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --ok-text: #0f7b3e;
  --ok-bg: #eaf8ef;
  --warn-text: #9a5b00;
  --warn-bg: #fff6e5;
  --err-text: #b42318;
  --err-bg: #fef0ef;
  --neutral-text: #515154;
  --neutral-bg: #f0f1f4;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.05);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 18% 0%, rgba(0, 113, 227, 0.05), transparent 45%),
                    radial-gradient(circle at 85% 12%, rgba(56, 189, 248, 0.05), transparent 40%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-ok {
  color: var(--ok-text);
  background: var(--ok-bg);
}

.status-warn {
  color: var(--warn-text);
  background: var(--warn-bg);
}

.status-error {
  color: var(--err-text);
  background: var(--err-bg);
}

.status-neutral {
  color: var(--neutral-text);
  background: var(--neutral-bg);
}

/* Main & Cards */
.main-content {
  padding-top: 24px;
  padding-bottom: 44px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.notice-banner {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

.notice-error {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid rgba(180, 35, 24, 0.16);
}

/* Hero */
.hero {
  padding: 34px 30px 30px;
  box-shadow: var(--shadow-md);
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.hero-title {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--ink);
}

.hero-subtitle {
  margin: 8px 0 0;
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 500;
  color: var(--ink-secondary);
  letter-spacing: -0.01em;
}

.hero-desc {
  margin: 16px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.kpi-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  min-width: 0;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.kpi-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
}

.kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

/* Section Headers */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.018em;
  color: var(--ink);
}

.section-desc {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.timestamp-tag {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  white-space: nowrap;
}

/* Buttons */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  min-height: 44px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s ease, background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.975);
}

.btn:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.25);
}

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

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

.btn-secondary:hover {
  background: #eceef2;
}

.btn-compact {
  padding: 8px 16px;
  min-height: 36px;
  font-size: 13px;
}

.btn.is-pulsing {
  animation: pulseTap 0.32s ease;
}

@keyframes pulseTap {
  0% { transform: scale(1); }
  50% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.interact-feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--ink-secondary);
}

.interact-feedback.is-active {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: rgba(15, 123, 62, 0.16);
}

.copy-toast {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  background: #eff6ff;
  color: #005bb5;
  border: 1px solid rgba(0, 113, 227, 0.16);
}

/* Timing Note */
.timing-note {
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  background: #f5f9ff;
  border: 1px solid rgba(0, 113, 227, 0.14);
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* Checks Grid */
.checks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-item {
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.check-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.check-name {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.badge-error {
  background: var(--err-bg);
  color: var(--err-text);
}

.badge-pending,
.badge-neutral {
  background: var(--neutral-bg);
  color: var(--neutral-text);
}

.check-summary {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-word;
}

.check-detail {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.zh-specimen {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  font-size: 13px;
  color: var(--ink-secondary);
}

/* Resource Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.resource-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.resource-table th,
.resource-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.resource-table th {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

.resource-table tbody tr:last-child td {
  border-bottom: none;
}

.resource-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-all;
}

.table-empty {
  color: var(--muted);
  text-align: center;
}

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

.sample-card {
  margin: 0;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sample-media {
  background: #eef1f5;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.sample-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-caption {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sample-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14.5px;
}

.sample-meta {
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-all;
}

/* Report Textarea */
.report-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
}

.report-textarea:focus {
  outline: 2px solid rgba(0, 113, 227, 0.25);
}

.privacy-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 max(26px, env(safe-area-inset-bottom));
  font-size: 12.5px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

/* Responsive */
@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .card {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .hero {
    padding: 24px 18px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .button-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .btn-compact {
    width: auto;
  }
}
