:root {
  --bg: #f7efe2;
  --bg-deep: #f2dfc3;
  --card: rgba(255, 252, 246, 0.86);
  --text: #24170f;
  --muted: #6b584a;
  --line: rgba(68, 40, 18, 0.14);
  --accent: #b63e17;
  --accent-2: #d27a1c;
  --accent-soft: rgba(182, 62, 23, 0.12);
  --green: #0d7c52;
  --shadow: 0 24px 80px rgba(93, 55, 24, 0.13);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", serif;
  --font-sans: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 219, 168, 0.72), transparent 28%),
    radial-gradient(circle at top right, rgba(191, 61, 33, 0.18), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, #f4e7d6 100%);
  font-family: var(--font-sans);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 248, 239, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 36px rgba(93, 55, 24, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.brand-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}

.topnav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.topnav a {
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(68, 40, 18, 0.08);
  color: var(--muted);
}

.topnav a:hover {
  border-color: var(--line);
}

.hero,
.dashboard-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 12px;
}

.hero-copy,
.hero-panel,
.toolbar-card,
.summary-card,
.tag-board,
.theme-section,
.stock-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: 0 14px 36px rgba(93, 55, 24, 0.08);
}

.hero-copy,
.dashboard-head > div:first-child {
  padding: 34px;
}

.hero-copy h1,
.dashboard-head h1 {
  margin: 10px 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.2vw, 60px);
  line-height: 1.02;
}

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

.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

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

.hero-panel {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.metric-card,
.summary-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(72, 43, 23, 0.08);
}

.metric-card span,
.summary-card span,
.field-title,
.meta,
.section-head p,
.tag-event p {
  color: var(--muted);
}

.metric-card strong,
.summary-card strong,
.count-badge {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.35;
}

.toolbar-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
  width: min(660px, 100%);
  justify-self: start;
  align-self: start;
}

.toolbar-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.72fr);
  gap: 12px;
}

.toolbar-date {
  min-width: 0;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

select,
.button,
.tag-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border: none;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.72);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.theme-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.theme-chip strong {
  color: var(--accent);
}

.tag-board,
.theme-section {
  margin-top: 22px;
  padding: 22px;
}

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

.section-head h2,
.stock-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
}

.count-badge {
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
}

.tag-event-list,
.stock-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.tag-event-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tag-event,
.stock-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-lg);
}

.tag-event-top,
.stock-header,
.meta-row,
.tag-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tag-pill,
.current-label {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(13, 124, 82, 0.12);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.stock-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.stock-header {
  align-items: start;
}

.stock-header-actions {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 8px;
  flex-shrink: 0;
}

.detail-button {
  border: 1px solid rgba(68, 40, 18, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.stock-header small {
  color: var(--muted);
  font-size: 15px;
}

.stock-body {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.field-title {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.stock-body p,
.tag-event p {
  margin: 0;
  line-height: 1.7;
}

.deep-analysis-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(68, 40, 18, 0.1);
  border-radius: 16px;
  background: rgba(248, 242, 232, 0.72);
}

.deep-analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.deep-analysis-content h4 {
  margin: 14px 0 6px;
  font-size: 16px;
}

.deep-analysis-content h4:first-child {
  margin-top: 0;
}

.deep-analysis-content p {
  margin: 0 0 10px;
  line-height: 1.75;
  color: var(--text);
}

.tag-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.tag-actions form {
  flex: 1 1 100%;
}

.tag-button {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.84);
}

.tag-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
}

.tag-editor select {
  background: rgba(255, 255, 255, 0.84);
}

.tag-button:hover,
.button:hover,
.theme-chip:hover,
.topnav a:hover {
  transform: translateY(-1px);
}

.empty-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
}

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

  .toolbar-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 1240px);
  }

  .topbar,
  .section-head,
  .tag-event-top,
  .meta-row {
    flex-direction: column;
    align-items: start;
  }

  .hero-copy,
  .dashboard-head > div:first-child,
  .toolbar-card,
  .tag-board,
  .theme-section {
    padding: 20px;
  }

  .brand-title {
    font-size: 20px;
  }

  .tag-editor {
    grid-template-columns: 1fr;
  }

  .stock-header {
    flex-direction: column;
    align-items: start;
  }

  .stock-header-actions {
    width: 100%;
    align-items: start;
  }
}
