:root {
  --ink-950: #0b1217;
  --ink-900: #152029;
  --ink-800: #223646;
  --ink-700: #466075;
  --stone-50: #f7f2e8;
  --stone-100: #ece2d1;
  --stone-200: #d6c1a1;
  --amber-300: #efbf76;
  --amber-400: #d89b44;
  --amber-500: #ae6917;
  --green-300: #bfe6c9;
  --green-500: #2f7a46;
  --red-200: #f2c4bb;
  --red-500: #a1442f;
  --blue-200: #c6dcff;
  --blue-500: #275fa5;
  --white: #ffffff;
  --shadow-soft: 0 20px 60px rgba(8, 15, 21, 0.12);
  --shadow-deep: 0 36px 90px rgba(8, 15, 21, 0.22);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Bricolage Grotesque", "Noto Sans SC", sans-serif;
  --font-sans: "Noto Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-900);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(239, 191, 118, 0.18), transparent 24%),
    radial-gradient(circle at 90% 10%, rgba(191, 230, 201, 0.14), transparent 18%),
    linear-gradient(180deg, #fbf8f1 0%, #f0e7d7 100%);
}

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

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar,
.hero-panel,
.panel,
.workflow-card {
  border: 1px solid rgba(21, 32, 41, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.brand-block,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 18px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(21, 32, 41, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.92);
}

.brand-block strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
}

.brand-block p,
.topbar-note {
  margin: 2px 0 0;
  color: rgba(21, 32, 41, 0.62);
  font-size: 0.86rem;
}

.action-button,
.page-button,
.chip-button,
.case-row {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.action-button:hover,
.page-button:hover,
.chip-button:hover,
.case-row:hover {
  transform: translateY(-1px);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--white);
  text-decoration: none;
  background: linear-gradient(135deg, var(--ink-900), var(--amber-500));
  box-shadow: 0 14px 28px rgba(174, 105, 23, 0.2);
}

.action-button.secondary {
  color: var(--ink-900);
  background: rgba(21, 32, 41, 0.08);
  box-shadow: none;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(320px, 0.66fr);
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-xl);
  margin-bottom: 14px;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 191, 118, 0.2), transparent 70%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(21, 32, 41, 0.5);
}

.hero-copy h1 {
  margin: 0;
  max-width: 13ch;
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 3.2vw, 3.6rem);
  line-height: 1.02;
}

.hero-text {
  max-width: 68ch;
  margin: 12px 0 0;
  line-height: 1.62;
  color: rgba(21, 32, 41, 0.76);
}

.hero-copy {
  min-width: 0;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}

.lookup-form input {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid rgba(21, 32, 41, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 1rem;
}

.search-tools {
  margin-top: 10px;
}

.tool-field {
  display: grid;
  gap: 8px;
  max-width: 320px;
}

.tool-field span {
  color: rgba(21, 32, 41, 0.62);
  font-size: 0.86rem;
}

.tool-field select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(21, 32, 41, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.hero-copy .hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.chip-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(21, 32, 41, 0.07);
  color: rgba(21, 32, 41, 0.78);
}

.chip-button.is-active {
  color: var(--white);
  background: linear-gradient(135deg, var(--ink-900), var(--amber-500));
}

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

.stat-card,
.source-card,
.summary-card,
.timeline-item,
.case-row {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 32, 41, 0.08);
  background: rgba(249, 247, 241, 0.94);
}

.stat-card {
  padding: 14px 16px;
}

.stat-card span {
  display: block;
  color: rgba(21, 32, 41, 0.58);
  font-size: 0.84rem;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.52rem;
}

.content-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 14px;
}

.content-grid {
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  align-items: stretch;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 20px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.panel-head p {
  margin: 6px 0 0;
  color: rgba(21, 32, 41, 0.6);
}

.contact-card {
  width: 100%;
  max-width: 300px;
  justify-self: end;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 32, 41, 0.08);
  background: rgba(249, 247, 241, 0.92);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.contact-methods,
.contact-grid {
  display: grid;
  gap: 10px;
}

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

.contact-methods {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-900);
  text-decoration: none;
  background: rgba(21, 32, 41, 0.07);
}

.qr-card {
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 32, 41, 0.08);
  background: var(--white);
  box-shadow: 0 14px 34px rgba(8, 15, 21, 0.06);
  text-align: center;
}

.qr-card p {
  margin: 8px 0 0;
  color: rgba(21, 32, 41, 0.68);
  line-height: 1.55;
  font-size: 0.9rem;
}

.qr-image {
  display: block;
  width: 100%;
  max-width: 118px;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px dashed rgba(21, 32, 41, 0.16);
  background: rgba(247, 242, 232, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.contact-note {
  color: rgba(21, 32, 41, 0.62);
  line-height: 1.55;
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.results-head {
  margin-bottom: 12px;
  color: rgba(21, 32, 41, 0.52);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-list {
  display: grid;
  gap: 12px;
}

.case-row {
  width: 100%;
  padding: 18px;
  text-align: left;
}

.case-row.is-active {
  border-color: rgba(174, 105, 23, 0.44);
  box-shadow: 0 18px 34px rgba(174, 105, 23, 0.1);
}

.case-row-top,
.summary-grid,
.pagination-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.case-row-top {
  align-items: flex-start;
  justify-content: space-between;
}

.case-docket {
  display: inline-block;
  color: var(--amber-500);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
}

.case-row h3,
.timeline-item h3,
.detail-header h3 {
  margin: 8px 0 0;
  font-size: 1.04rem;
}

.case-row p,
.timeline-item p,
.detail-note p,
.detail-empty p {
  margin: 0;
  color: rgba(21, 32, 41, 0.72);
  line-height: 1.68;
}

.case-meta,
.case-foot,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: rgba(21, 32, 41, 0.58);
  font-size: 0.86rem;
}

.case-summary {
  margin-top: 12px;
}

.tag-row,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill,
.highlight-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-pill {
  color: var(--amber-500);
  background: rgba(239, 191, 118, 0.18);
}

.highlight-pill {
  color: var(--blue-500);
  background: rgba(198, 220, 255, 0.48);
}

.status-pill.live,
.status-pill.good {
  color: var(--green-500);
  background: rgba(191, 230, 201, 0.85);
}

.status-pill.blocked,
.status-pill.warn,
.status-pill.manual-only {
  color: #7a5012;
  background: rgba(239, 191, 118, 0.3);
}

.status-pill.disabled,
.status-pill.neutral,
.status-pill.muted {
  color: rgba(21, 32, 41, 0.64);
  background: rgba(21, 32, 41, 0.08);
}

.status-pill.danger {
  color: var(--red-500);
  background: rgba(242, 196, 187, 0.85);
}

.detail-panel {
  position: static;
  min-height: 640px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 242, 232, 0.94)),
    rgba(255, 255, 255, 0.92);
}

.cases-panel,
.detail-panel {
  height: min(72vh, 820px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.detail-header h3 {
  font-size: 1.18rem;
}

.summary-grid {
  margin: 16px 0;
}

.summary-card {
  flex: 1 1 160px;
  padding: 14px;
}

.summary-card span {
  display: block;
  color: rgba(21, 32, 41, 0.56);
  font-size: 0.82rem;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}

.detail-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(239, 191, 118, 0.16), rgba(198, 220, 255, 0.18)),
    rgba(255, 255, 255, 0.75);
}

.detail-highlight-row {
  margin-top: 14px;
}

.focus-text {
  margin-top: 12px;
  color: rgba(21, 32, 41, 0.62);
}

.timeline-toolbar,
.timeline-head,
.timeline-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.timeline-toolbar,
.timeline-head {
  align-items: flex-start;
  justify-content: space-between;
}

.timeline-toolbar {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 32, 41, 0.08);
  background: rgba(247, 242, 232, 0.92);
}

.timeline-toolbar-copy strong,
.timeline-head h3 {
  display: block;
  margin: 0;
  font-size: 1rem;
}

.timeline-toolbar-copy p,
.timeline-head p,
.timeline-source-note {
  margin: 6px 0 0;
  color: rgba(21, 32, 41, 0.62);
  line-height: 1.66;
}

.timeline-toolbar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.timeline-item {
  padding: 16px;
}

.timeline-item-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.timeline-item time {
  display: block;
  color: rgba(21, 32, 41, 0.56);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-tags {
  margin: 10px 0 8px;
}

.timeline-item .timeline-zh {
  margin-top: 8px;
  font-family: var(--font-serif);
  color: rgba(21, 32, 41, 0.88);
}

.pagination-row {
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.page-button {
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(21, 32, 41, 0.08);
}

.detail-empty {
  display: grid;
  place-content: center;
  min-height: 480px;
  gap: 10px;
  text-align: center;
}

@media (max-width: 1180px) {
  .hero-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    max-width: none;
    justify-self: stretch;
  }

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

  .cases-panel,
  .detail-panel {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 28px;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-panel,
  .panel {
    padding: 18px;
  }

  .hero-copy h1 {
    max-width: none;
  }

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

  .lookup-form .action-button {
    width: 100%;
    min-height: 56px;
  }

  .lookup-form input {
    min-height: 60px;
    font-size: 1.02rem;
  }

  .search-tools,
  .tool-field {
    max-width: none;
  }

  .contact-methods,
  .hero-copy .hero-stats {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 18px;
  }

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

  .qr-image {
    max-width: 132px;
  }

  .pagination-row {
    flex-direction: column;
    gap: 12px;
  }
}
