:root {
  --bg: #101516;
  --bg-layer: radial-gradient(circle at top left, rgba(244, 186, 98, 0.18), transparent 30%), radial-gradient(circle at 84% 12%, rgba(89, 176, 154, 0.16), transparent 28%), linear-gradient(160deg, #0b0f10 0%, #15201f 52%, #0b1111 100%);
  --panel: rgba(17, 22, 22, 0.76);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(244, 186, 98, 0.42);
  --text: #f3efe5;
  --muted: #cabfae;
  --accent: #f4ba62;
  --accent-soft: rgba(244, 186, 98, 0.16);
  --cool: #8bd5c0;
  --cool-soft: rgba(139, 213, 192, 0.16);
  --shadow: 0 32px 72px rgba(0, 0, 0, 0.28);
  --serif: "Iowan Old Style", "Songti SC", "Noto Serif SC", serif;
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background: var(--bg);
  background-image: var(--bg-layer);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 92%);
}

button,
input,
a {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.status-card,
.toolbar,
.catalog,
.file-card,
.doc-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-copy,
.hero-panel,
.catalog {
  border-radius: 28px;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 32px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -62px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 186, 98, 0.3) 0%, rgba(244, 186, 98, 0) 72%);
}

.brand-row,
.brand-copy {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 14px;
  margin-bottom: 20px;
}

.brand-copy {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.brand-logo {
  display: block;
  width: 62px;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.22));
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.eyebrow-small {
  margin-bottom: 8px;
}

.hero h1,
.catalog h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
}

.hero h1 {
  max-width: 9ch;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.96;
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.transfer-panel {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(244, 186, 98, 0.2);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(244, 186, 98, 0.12), rgba(255, 255, 255, 0.03));
}

.transfer-title,
.doc-note {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.transfer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.transfer-url {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}

.transfer-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.hero-panel {
  padding: 24px;
}

.hero-panel-head,
.catalog-head,
.file-card-head,
.file-card-actions,
.status-strip,
.toolbar,
.filter-bar,
.badge-row,
.doc-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-panel-head,
.catalog-head,
.file-card-head,
.doc-card-head {
  justify-content: space-between;
}

.panel-kicker {
  color: var(--cool);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel-browser {
  color: var(--muted);
  font-size: 13px;
}

.recommendation-box {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(244, 186, 98, 0.12), rgba(255, 255, 255, 0.04));
}

.recommendation-box.loading {
  opacity: 0.78;
}

.recommendation-box.recommended {
  border-color: var(--line-strong);
}

.recommendation-box.warning {
  background: linear-gradient(145deg, rgba(139, 213, 192, 0.12), rgba(255, 255, 255, 0.04));
}

.recommendation-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.recommendation-box strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.2;
}

.recommendation-meta,
.environment-hint,
.catalog-summary,
.file-meta,
.doc-meta {
  color: var(--muted);
  line-height: 1.7;
}

.environment-hint {
  margin: 14px 0 0;
  font-size: 13px;
}

.status-strip {
  margin-top: 18px;
  flex-wrap: wrap;
}

.status-card {
  min-width: 180px;
  flex: 1 1 0;
  padding: 18px 20px;
  border-radius: 22px;
}

.status-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
}

.toolbar {
  justify-content: flex-start;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 24px;
}

.filter-bar {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.filter-chip,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.filter-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.filter-chip.active,
.filter-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.button:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.button-primary {
  border: 1px solid rgba(244, 186, 98, 0.48);
  background: linear-gradient(135deg, rgba(244, 186, 98, 0.28), rgba(244, 186, 98, 0.18));
}

.button-secondary,
.button-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.catalog {
  margin-top: 18px;
  padding: 24px;
}

.catalog-summary {
  margin: 0;
  max-width: 420px;
  text-align: right;
  font-size: 14px;
}

.doc-grid,
.file-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

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

.file-card,
.doc-card {
  padding: 18px 20px;
  border-radius: 22px;
}

.file-card.is-highlighted {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgba(244, 186, 98, 0.15), rgba(255, 255, 255, 0.03));
}

.file-card.is-related {
  border-color: rgba(139, 213, 192, 0.36);
}

.file-card h3,
.doc-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  word-break: break-all;
}

.file-meta,
.doc-meta {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
}

.doc-card {
  background: linear-gradient(145deg, rgba(139, 213, 192, 0.12), rgba(255, 255, 255, 0.03));
}

.doc-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.badge-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.badge.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.badge-cool {
  background: var(--cool-soft);
  color: var(--cool);
}

.file-card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}

.empty-state {
  padding: 44px 18px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
}

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

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

  .toolbar,
  .catalog-head,
  .file-card-head,
  .doc-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-bar,
  .badge-row {
    justify-content: flex-start;
  }

  .catalog-summary {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding: 18px 0 40px;
  }

  .hero-copy,
  .hero-panel,
  .catalog,
  .toolbar,
  .status-card,
  .file-card,
  .doc-card {
    border-radius: 22px;
  }

  .hero-copy,
  .hero-panel,
  .catalog {
    padding: 20px;
  }

  .hero h1 {
    max-width: none;
    font-size: 42px;
  }

  .hero-actions,
  .transfer-bar,
  .file-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .status-card {
    min-width: 100%;
  }

  .toolbar {
    gap: 8px;
    padding: 12px;
  }

  .filter-bar {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    width: auto;
    min-height: 36px;
    padding: 0 13px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 13px;
  }

  .file-card h3,
  .doc-card h3 {
    font-size: 18px;
  }

  .transfer-url {
    width: 100%;
    min-height: auto;
    padding: 12px 16px;
    white-space: normal;
    word-break: break-all;
  }
}
