:root {
  color-scheme: light;
  --ink: #142b2a;
  --muted: #4e6260;
  --line: #dbe6e2;
  --accent: #145849;
  --mint: #e3f2eb;
  --canvas: #f5f8f6;
  font: 16px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 3px solid #087d6a; outline-offset: 3px; }
h1, h2, p { margin: 0; }
.shell { width: min(1240px, calc(100% - 72px)); margin-inline: auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 730; }
.brand-mark {
  background: #145849; width: 34px; height: 34px; border-radius: 10px;
  display: grid; grid-template: repeat(2, 5px) / repeat(2, 5px); place-content: center; gap: 3px;
}
.brand-mark i { background: #a6e7cb; border-radius: 2px; }
.brand-mark i:last-child { background: #fff; }
time { font: 0.88rem ui-monospace, monospace; color: var(--muted); }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 206px; margin: 30px 0 32px; padding: 32px 42px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  color: #fff; background: #123e37; border-radius: 20px;
}
.hero::after {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background:
    repeating-radial-gradient(ellipse at 94% 132%, transparent 0 21px, #b0e6cf1e 22px 23px, transparent 24px 31px),
    linear-gradient(110deg, #123e37 30%, #1b5e4d);
  mask-image: linear-gradient(90deg, transparent 25%, #000 73%);
}
.hero h1 { font-size: clamp(1.85rem, 4.1vw, 3rem); font-weight: 740; letter-spacing: 0.035em; line-height: 1.18; }
.hero p { color: #c4e3d8; margin-top: 15px; }
.stats { display: flex; margin: 0; }
.stats div {
  display: flex; flex-direction: column-reverse; gap: 4px; padding-inline: clamp(15px, 2.15vw, 34px);
  min-width: 94px; border-left: 1px solid #c4e3d84c;
}
.stats div:last-child { padding-right: 0; }
.stats dt { font-size: 0.875rem; color: #d1e9e0; white-space: nowrap; }
.stats dd { margin: 0; color: #f4fff9; font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.workspace { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 30px; padding-bottom: 48px; }
.sidebar { align-self: start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.sidebar h2 { margin: 1px 0 12px 8px; font-size: 1rem; }
.people { display: grid; gap: 5px; }
.person {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center;
  padding: 8px; min-width: 0; border: 1px solid transparent; border-radius: 10px;
  background: transparent; text-align: left; font-size: 0.94rem;
}
.avatar { display: grid; place-items: center; height: 32px; border-radius: 8px; background: #eff4f2; font-size: 0.86rem; color: var(--accent); }
.person-count { color: var(--muted); font-size: 0.81rem; }
.person:hover { background: #f3f7f5; }
.person[aria-pressed="true"] { color: var(--accent); background: var(--mint); border-color: #bfded1; font-weight: 680; }
.person[aria-pressed="true"] .avatar { background: #cbe7dc; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-heading h2 { font-size: clamp(1.35rem, 2.4vw, 1.68rem); letter-spacing: 0.015em; }
.section-heading p { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.filter {
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  padding: 7px 14px; font-size: 0.875rem; white-space: nowrap;
}
.filter:hover { border-color: #7eb5a4; }
.filter[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  padding: 8px; width: 100%; min-width: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; text-align: left; transition: border-color 160ms, box-shadow 160ms;
}
.card:hover { border-color: #7eb5a4; box-shadow: 0 4px 16px #17453813; }
.preview {
  position: relative; display: grid; place-items: center; aspect-ratio: 1.25;
  padding: 12px; border-radius: 8px; overflow: hidden; background: #eaf0ee;
}
.preview img {
  display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain;
  filter: drop-shadow(0 2px 4px #172c2630);
}
.card-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 5px 4px; }
.card-info strong { font-size: 0.94rem; }
.card-info span { font-size: 0.81rem; color: var(--muted); white-space: nowrap; }
dialog {
  width: min(940px, calc(100% - 24px)); max-height: 94dvh; padding: 0;
  border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #fff;
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #0d201ece; }
body:has(dialog[open]) { overflow: hidden; }
.viewer-header, .viewer-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 15px;
}
.viewer-header h2 { font-size: 1rem; }
.viewer-header p, .viewer-footer span { color: var(--muted); font-size: 0.875rem; }
.viewer-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.viewer-actions a, .viewer-actions button, .viewer-footer button {
  background: #fff; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.875rem; text-decoration: none;
}
.viewer-actions button { font-size: 1.1rem; padding: 2px 10px; }
.viewer-footer button:disabled { color: #707d79; background: #f0f3f1; cursor: default; }
.viewer-image { min-height: 0; overflow: auto; background: #eaf0ee; padding: 10px; }
#zoom { display: block; width: max-content; max-width: 100%; padding: 0; margin: auto; border: 0; background: none; cursor: zoom-in; }
#viewer-image { display: block; max-width: 100%; max-height: 70dvh; }
#zoom[aria-pressed="true"] { max-width: none; cursor: zoom-out; }
#zoom[aria-pressed="true"] img { max-width: none; max-height: none; }
@media (max-width: 990px) {
  .workspace { grid-template-columns: 182px minmax(0, 1fr); gap: 22px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 58px; }
  .hero { align-items: flex-start; flex-direction: column; margin: 16px 0 20px; padding: 24px; gap: 20px; }
  .hero p { margin-top: 9px; }
  .stats div { min-width: 0; padding-inline: clamp(9px, 3vw, 24px); }
  .stats div:first-child { padding-left: 0; border-left: 0; }
  .stats dd { font-size: 1.65rem; }
  .workspace { display: block; }
  .sidebar { margin-bottom: 20px; padding: 11px; }
  .sidebar h2 { margin-bottom: 6px; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { gap: 10px; }
  .card { padding: 5px; }
  .preview { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

[hidden] { display: none !important; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1; }
.brand { color: var(--ink); text-decoration: none; line-height: 1.3; }
.brand-mark { flex: 0 0 34px; }
.platform-nav { display: flex; align-items: center; gap: 5px; }
.platform-nav a {
  padding: 8px 12px; border-radius: 8px; color: var(--muted);
  font-size: 0.9rem; white-space: nowrap; text-decoration: none;
}
.platform-nav a:hover, .platform-nav a[aria-current="page"] { color: var(--accent); background: var(--mint); }
.platform-panel { padding-bottom: 38px; }
.platform-panel > .section-heading { margin-bottom: 15px; }
.directory-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.directory-entry {
  min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 22px; border: 1px solid var(--line); background: #fff; border-radius: 14px;
}
.directory-entry h3, .model-top h3 { margin: 5px 0; font-size: 1.12rem; }
.entry-category, .directory-entry p, .model-top p, .model-bottom p { color: var(--muted); font-size: 0.88rem; }
.entry-action, .model-controls button {
  display: inline-block; border: 1px solid #bfded1; border-radius: 8px; padding: 7px 11px;
  color: var(--accent); background: var(--mint); font-size: 0.875rem; white-space: nowrap; text-decoration: none;
}
.entry-action:hover, .model-controls button:hover { background: #d0ebe0; }
.model-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.model-top, .model-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.model-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.model-stage { position: relative; background: radial-gradient(ellipse at 50% 45%, #23594e, #112f2a 72%); }
#foot-model { display: block; width: 100%; height: clamp(300px, 49vw, 520px); cursor: grab; }
#foot-model:active { cursor: grabbing; }
#foot-model:focus-visible { outline: 3px solid #9de3cc; outline-offset: -4px; }
.model-message {
  position: absolute; inset: auto 12px 18px; display: grid; justify-items: center; gap: 8px;
  color: #fff; text-align: center; font-size: 0.9rem; pointer-events: none;
}
.model-message p { background: #112f2a; padding: 6px 10px; border-radius: 6px; }
.model-file { display: grid; gap: 4px; background: #112f2a; padding: 8px 10px; border-radius: 6px; pointer-events: auto; }
.model-file input { width: min(220px, 60vw); }
.model-controls button:disabled { opacity: 0.55; cursor: default; }
.model-selection { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.model-selection label { font-size: 0.875rem; font-weight: 650; }
#scan-select {
  max-width: 100%; min-width: 198px; padding: 6px 32px 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit;
  appearance: none; background:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%) right 15px center / 5px 5px no-repeat,
    linear-gradient(135deg, var(--accent) 50%, transparent 50%) right 10px center / 5px 5px no-repeat,
    #fff;
}
#scan-select:focus-visible { outline: 3px solid #087d6a; outline-offset: 2px; }
.platform-footer { border-top: 1px solid var(--line); padding-block: 19px; color: var(--muted); background: #fff; font-size: 0.875rem; }

@media (max-width: 850px) {
  .directory-list { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; justify-content: flex-start; gap: 7px; padding-block: 9px; }
  .brand { flex-basis: 100%; font-size: 0.94rem; }
  .platform-nav a { padding: 5px 9px; }
  .directory-entry { padding: 15px; }
  .model-top { flex-wrap: wrap; }
  .model-bottom p { font-size: 0.82rem; }
}

@media (max-width: 700px) {
  .hero h1 { font-size: clamp(1.4rem, 5.2vw, 1.85rem); }
}
