:root {
  --bg: #eef5f8;
  --bg-accent: #d8e9ef;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --ink: #14333f;
  --muted: #59707a;
  --line: rgba(20, 51, 63, 0.12);
  --brand: #1f7a8c;
  --brand-deep: #175563;
  --danger: #b94b5d;
  --danger-soft: #fae3e7;
  --warn: #b98635;
  --warn-soft: #fbf0d6;
  --safe: #2f8f62;
  --safe-soft: #e2f3ea;
  --shadow: 0 22px 60px rgba(20, 51, 63, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(92, 174, 191, 0.18), transparent 26%),
    radial-gradient(circle at 80% 20%, rgba(31, 122, 140, 0.1), transparent 24%),
    linear-gradient(180deg, #f6fbfd 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 360px;
  gap: 20px;
  margin-bottom: 22px;
}

.hero-copy,
.hero-side,
.search-panel,
.panel,
.focus-card,
.summary-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy,
.search-panel,
.panel,
.focus-card {
  background: var(--panel);
  border-radius: 28px;
  backdrop-filter: blur(10px);
}

.hero-copy {
  padding: 34px;
}

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

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1;
}

.lead {
  margin: 18px 0 0;
  max-width: 48rem;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  background: var(--brand);
  color: #fff;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

button.secondary,
button.ghost {
  background: #deedf1;
  color: var(--brand-deep);
}

.disclaimer,
.status-text,
.search-head p,
.section-meta,
.focus-meta,
.record-meta,
.empty-state {
  color: var(--muted);
}

.disclaimer {
  margin: 18px 0 0;
  line-height: 1.7;
}

.status-text {
  min-height: 24px;
  margin: 12px 0 0;
  font-size: 14px;
}

.hero-side {
  display: grid;
  gap: 14px;
}

.summary-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
}

.summary-card.critical {
  background: linear-gradient(180deg, #eef9fc 0%, #ffffff 100%);
}

.summary-label {
  display: block;
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.4;
}

.summary-card p {
  margin: 10px 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.search-panel,
.panel {
  padding: 24px;
}

.search-panel {
  margin-bottom: 22px;
}

.search-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.search-head h2,
.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.search-head p {
  margin: 8px 0 0;
  line-height: 1.7;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 18px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--ink);
  padding: 14px 16px;
}

textarea {
  resize: vertical;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quick-tags button {
  padding: 10px 14px;
  border-radius: 999px;
  background: #f1f8fa;
  color: var(--brand-deep);
}

.focus-section,
.catalog-section {
  margin-bottom: 22px;
}

.focus-card {
  padding: 26px;
  min-height: 260px;
  position: relative;
  overflow: hidden;
}

.focus-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(31, 122, 140, 0.12), transparent 65%);
  pointer-events: none;
}

.focus-badge,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tone-safe {
  background: var(--safe-soft);
  color: var(--safe);
}

.tone-steady {
  background: var(--warn-soft);
  color: #8a5e10;
}

.tone-avoid {
  background: var(--danger-soft);
  color: var(--danger);
}

.tone-warning {
  background: #f4ebe0;
  color: #8a5e10;
}

.focus-card h3 {
  margin: 18px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}

.focus-summary {
  margin: 0;
  max-width: 56rem;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.highlight-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.focus-list,
.bullet-list,
.source-list {
  margin: 16px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.result-grid,
.dashboard-grid,
.knowledge-grid {
  display: grid;
  gap: 16px;
}

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

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.knowledge-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--shadow);
}

.result-card h3 {
  margin: 14px 0 8px;
  font-size: 24px;
}

.result-card.tone-safe {
  border-left: 7px solid var(--safe);
}

.result-card.tone-steady {
  border-left: 7px solid var(--warn);
}

.result-card.tone-avoid {
  border-left: 7px solid var(--danger);
}

.result-card.tone-warning {
  border-left: 7px solid #9c7025;
}

.record-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.record-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfeff;
  padding: 14px 16px;
}

.record-item strong {
  display: block;
  font-size: 16px;
}

.record-meta {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.reminder-card {
  margin-top: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #f7fbfc;
  line-height: 1.8;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.8;
}

.sources-panel {
  margin-bottom: 10px;
}

.source-list a {
  color: var(--brand-deep);
}

@media (max-width: 1080px) {
  .hero,
  .dashboard-grid,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 18px;
  }

  .search-box,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .search-panel,
  .panel,
  .focus-card,
  .result-card {
    border-radius: 22px;
  }

  .hero-actions,
  .search-head,
  .section-head {
    flex-direction: column;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .hero-actions,
  .search-panel,
  .dashboard-grid,
  .quick-tags,
  .search-actions,
  #pageStatus {
    display: none !important;
  }

  .hero,
  .result-grid,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .panel,
  .focus-card,
  .result-card {
    box-shadow: none;
    border: 1px solid #cfd8dc;
    background: #ffffff;
  }
}
