:root {
  --bg: #f5efe4;
  --bg-accent: #efe2c8;
  --panel: rgba(255, 250, 241, 0.92);
  --panel-strong: rgba(255, 246, 231, 0.98);
  --line: rgba(111, 78, 55, 0.16);
  --line-strong: rgba(111, 78, 55, 0.24);
  --text: #2c241b;
  --muted: #75624f;
  --brand: #8b4a1f;
  --brand-strong: #663111;
  --brand-soft: #d7b98d;
  --shadow: 0 18px 40px rgba(92, 62, 34, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(215, 185, 141, 0.42), transparent 32%),
    radial-gradient(circle at bottom left, rgba(139, 74, 31, 0.12), transparent 30%),
    linear-gradient(180deg, #fcf8f1 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px;
}

.detail-shell {
  max-width: 1180px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 20px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 246, 230, 0.96), rgba(243, 230, 207, 0.92)),
    linear-gradient(180deg, #fff 0%, #f7eede 100%);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.hero h1,
.detail-title {
  margin: 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.05;
  font-weight: 800;
}

.detail-title {
  font-size: clamp(28px, 3vw, 44px);
}

.hero-text,
.panel-subtitle {
  color: var(--muted);
}

.hero-text {
  margin: 14px 0 0;
  max-width: 760px;
  font-size: 16px;
  line-height: 1.7;
}

.hero-meta {
  display: grid;
  gap: 14px;
  align-content: center;
}

.meta-card,
.meta-box,
.toolbar,
.status-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, 0.84);
}

.meta-card,
.meta-box {
  padding: 16px 18px;
}

.meta-label,
.status-label,
.section-note,
.panel-subtitle {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.panel-subtitle {
  margin-top: 6px;
}

.toolbar,
.status-strip {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--panel);
  box-shadow: 0 10px 20px rgba(92, 62, 34, 0.06);
}

.toolbar {
  grid-template-columns:
    minmax(220px, 1.3fr)
    minmax(150px, 0.55fr)
    minmax(150px, 0.55fr)
    minmax(150px, 0.55fr)
    minmax(170px, 0.6fr)
    auto
    auto;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
}

.field-wide {
  min-width: 0;
}

.field input,
.field select {
  height: 46px;
  width: 100%;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(139, 74, 31, 0.18);
  border-color: rgba(139, 74, 31, 0.42);
}

.checkbox-field {
  align-self: stretch;
}

.checkbox-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.checkbox-card input {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.status-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.primary-button,
.ghost-button,
.link-button,
.ghost-link,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.link-button:hover,
.ghost-link:hover,
.primary-link:hover {
  transform: translateY(-1px);
}

.primary-button,
.primary-link {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff8ee;
}

.ghost-button,
.ghost-link {
  background: rgba(255, 252, 246, 0.8);
  border-color: rgba(111, 78, 55, 0.18);
  color: var(--text);
}

.link-button {
  background: rgba(255, 246, 230, 0.9);
  border-color: rgba(139, 74, 31, 0.18);
  color: var(--brand-strong);
}

.compact-button,
.compact-link,
.small-link {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.disabled-link,
.disabled-link:hover {
  pointer-events: none;
  opacity: 0.45;
  transform: none;
}

.list-layout,
.detail-layout {
  margin-top: 18px;
}

.solo-panel {
  min-height: 620px;
}

.panel {
  padding: 22px;
}

.panel-head,
.section-head,
.detail-topbar,
.result-topline,
.result-meta,
.result-actions,
.timeline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-actions,
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-head h2,
.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.results,
.attachment-list,
.timeline-list {
  display: grid;
  gap: 14px;
}

.results {
  margin-top: 18px;
}

.result-card,
.content-card,
.attachment-item,
.timeline-item,
.detail-pane {
  border-radius: 18px;
  border: 1px solid rgba(111, 78, 55, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

.result-card,
.attachment-item,
.timeline-item {
  padding: 18px;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 74, 31, 0.12);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
}

.result-time,
.result-source,
.timeline-meta,
.attachment-meta {
  font-size: 12px;
  color: var(--muted);
}

.result-title,
.timeline-title,
.attachment-name {
  margin: 12px 0 0;
  font-weight: 700;
}

.result-title {
  font-size: 20px;
  line-height: 1.55;
}

.result-hint {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.result-actions,
.timeline-actions {
  margin-top: 14px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.pager .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.detail-topbar {
  margin-bottom: 18px;
}

.detail-nav-actions {
  display: inline-flex;
  gap: 10px;
}

.detail-hero,
.detail-main-panel {
  display: grid;
  gap: 20px;
}

.detail-stage {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.notice-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tab-bar {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(139, 74, 31, 0.08);
  width: fit-content;
}

.tab-button,
.toggle-button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.active,
.toggle-button.active {
  background: rgba(255, 252, 246, 0.92);
  border-color: rgba(139, 74, 31, 0.18);
  color: var(--brand-strong);
}

.tab-button:disabled,
.toggle-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.detail-pane {
  padding: 20px;
}

.content-card {
  margin-top: 12px;
  padding: 18px;
  min-height: 200px;
}

.content-card.plain-text {
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}

.content-card.rich-text {
  line-height: 1.7;
  overflow-x: auto;
  padding: 22px;
}

.content-card.rich-text .notice-document {
  max-width: 1000px;
  margin: 0 auto;
  font-size: 14px;
}

.content-card.rich-text .title,
.content-card.rich-text .notice-title {
  margin: 4px auto 18px;
  text-align: center;
  font-size: 24px;
  line-height: 1.6;
  font-weight: 700;
  color: var(--brand-strong);
}

.content-card.rich-text .content-wrapper {
  width: 100%;
  margin: 0 auto;
}

.content-card.rich-text .beizhu {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(111, 78, 55, 0.16);
  border-radius: 14px;
  background: rgba(255, 249, 239, 0.72);
}

.content-card.rich-text .beizhu p {
  margin: 0;
}

.content-card.rich-text .beizhu p + p {
  margin-top: 8px;
}

.content-card.rich-text a {
  color: var(--brand-strong);
  text-decoration: none;
}

.content-card.rich-text a:hover {
  text-decoration: underline;
}

.content-card.rich-text table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  table-layout: auto;
  background: rgba(255, 252, 246, 0.84);
  font-size: 14px;
}

.content-card.rich-text td,
.content-card.rich-text th {
  padding: 10px 8px;
  border: 1px solid var(--line-strong);
  vertical-align: top;
  text-align: left;
  line-height: 1.8;
  word-break: break-word;
}

.content-card.rich-text th,
.content-card.rich-text td:first-child {
  background: rgba(139, 74, 31, 0.08);
  font-weight: 700;
  color: var(--brand-strong);
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timeline-item {
  border-left: 4px solid var(--brand-soft);
}

.timeline-item.active {
  border-left-color: var(--brand);
}

.inline-empty {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(111, 78, 55, 0.22);
  color: var(--muted);
}

@media (max-width: 1080px) {
  .app-shell {
    padding: 18px;
  }

  .hero,
  .toolbar,
  .status-strip,
  .notice-meta-grid {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .panel {
    padding: 18px;
  }

  .detail-topbar,
  .panel-head,
  .section-head,
  .result-topline,
  .result-meta,
  .result-actions,
  .attachment-item,
  .timeline-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero h1,
  .detail-title {
    font-size: 30px;
  }

  .tab-bar,
  .view-toggle {
    width: 100%;
  }

  .tab-button,
  .toggle-button,
  .ghost-link,
  .primary-link,
  .link-button {
    width: 100%;
  }

  .pager {
    flex-direction: column;
  }
}
