:root {
  color-scheme: light;
  --navy: #16233f;
  --navy-2: #1f2f4f;
  --gold: #c9a227;
  --gold-2: #d9b84a;
  --white: #ffffff;
  --cream: #f6f1e6;
  --ink: #2a3142;
  --muted: #8a8f9c;
  --green: #2d9e4f;
  --red: #c45b4a;
  --hairline: #e8e5df;
  --bg: #f4f3ef;
  --surface: var(--white);
  --border: var(--hairline);
  --shadow-soft: 0 2px 10px rgba(22, 35, 63, 0.06);
  --shadow-card: 0 14px 34px rgba(22, 35, 63, 0.08);
  --radius-card: 14px;
  --radius-pill: 999px;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong",
    "SimSun", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-h3: 17px;
  --fs-body: 15px;
  --fs-meta: 13px;
  --fs-small: 12px;
}

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

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

textarea {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  line-height: 1.55;
}

textarea::placeholder {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-app {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--white);
  box-shadow: 0 0 0 1px rgba(22, 35, 63, 0.04);
}

.view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.home-brand,
.answer-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--navy);
  flex: 0 0 auto;
}

.brand-mark svg,
.icon-button svg,
.btn svg,
.answer-nav svg,
.answer-accordion summary > svg,
.answer-hero__mark {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-lockup strong {
  display: block;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-lockup small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  color: var(--green);
  background: rgba(45, 158, 79, 0.08);
  font-size: var(--fs-small);
  white-space: nowrap;
}

.health-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.health-badge--checking {
  color: var(--gold);
  background: rgba(201, 162, 39, 0.12);
}

.health-badge--error {
  color: var(--red);
  background: rgba(196, 91, 74, 0.1);
}

.home-content,
.answer-content {
  flex: 1;
}

.home-hero {
  padding: 18px 20px 22px;
}

.home-hero h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1.2;
  letter-spacing: 0;
}

.home-hero p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.55;
}

.ask-card {
  margin: 0 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.ask-card textarea {
  min-height: 120px;
  font-size: var(--fs-body);
}

.ask-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: var(--fs-body);
  font-weight: 700;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
}

.btn-full {
  width: 100%;
}

.hot-section {
  padding: 26px 20px 20px;
}

.hot-section h2,
.points-card h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: var(--fs-h3);
  line-height: 1.3;
}

.hot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hot-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  text-align: left;
  font-size: var(--fs-body);
}

.hot-question span {
  min-width: 0;
}

.hot-question i {
  font-style: normal;
  color: var(--muted);
  flex: 0 0 auto;
}

.page-disclaimer {
  padding: 16px 28px calc(14px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.5;
  text-align: center;
}

.answer-nav {
  min-height: 58px;
}

.answer-nav strong {
  font-size: var(--fs-h3);
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
}

.question-card {
  margin: 6px 20px 14px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--cream);
}

.question-card p,
.law-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.question-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.5;
}

.answer-hero {
  position: relative;
  margin: 0 20px 16px;
  padding: 22px 20px 24px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--navy);
  color: var(--white);
}

.answer-hero__mark {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 64px;
  height: 64px;
  color: rgba(255, 255, 255, 0.08);
}

.answer-hero__lead {
  position: relative;
  z-index: 1;
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
}

.answer-hero h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.42;
  letter-spacing: 0;
}

.answer-hero h2 .key-number {
  display: inline-block;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  white-space: nowrap;
}

.answer-hero__subline {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--fs-body);
}

.points-card {
  margin: 0 20px 14px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
}

.point-list {
  display: grid;
  gap: 0;
}

.point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
}

.point:first-child {
  border-top: 0;
  padding-top: 0;
}

.point:last-child {
  padding-bottom: 0;
}

.point i {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(22, 35, 63, 0.08);
  color: var(--navy);
  font-style: normal;
  font-size: 13px;
  flex: 0 0 auto;
}

.point p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.answer-accordion {
  margin: 0 20px 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
}

.answer-accordion summary {
  min-height: 56px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--navy);
  font-weight: 700;
  list-style: none;
}

.answer-accordion summary::-webkit-details-marker {
  display: none;
}

.answer-accordion summary span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.answer-accordion summary > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.answer-accordion[open] summary > svg {
  transform: rotate(180deg);
}

.mini-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--cream);
  color: var(--gold);
  font-style: normal;
  font-size: 13px;
}

.accordion-panel {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.68;
}

.accordion-panel p {
  margin: 0 0 10px;
}

.accordion-panel p:last-child {
  margin-bottom: 0;
}

.accordion-panel ul,
.accordion-panel ol {
  margin: 0;
  padding-left: 20px;
}

.law-card {
  margin: 0 20px 14px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--cream);
}

#lawList {
  color: var(--ink);
  line-height: 1.75;
}

.law-ref {
  display: block;
}

.lawyer-bar {
  margin: 0 20px 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
}

.lawyer-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  flex: 0 0 auto;
}

.lawyer-info {
  min-width: 0;
  flex: 1 1 auto;
}

.lawyer-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.lawyer-name-line strong {
  font-size: var(--fs-body);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(201, 162, 39, 0.12);
  color: var(--gold);
  font-size: var(--fs-small);
  white-space: nowrap;
}

.lawyer-meta {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.35;
}

.lawyer-consult {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: transparent;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.signature-placeholder {
  display: block;
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: 1.55;
}

.answer-actions {
  margin: 0 20px 16px;
}

.answer-footer {
  padding-top: 6px;
}

.assistant-rich h3,
.assistant-rich h4 {
  margin: 14px 0 8px;
  color: var(--navy);
}

.assistant-rich p {
  margin: 0 0 10px;
}

.assistant-rich ul,
.assistant-rich ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.assistant-callout {
  margin: 10px 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--cream);
}

.no-break {
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: rgba(22, 35, 63, 0.92);
  color: var(--white);
  font-size: var(--fs-meta);
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 431px) {
  body {
    background:
      linear-gradient(90deg, rgba(22, 35, 63, 0.04) 1px, transparent 1px),
      var(--bg);
    background-size: 24px 24px;
  }

  .mobile-app {
    margin-top: 18px;
    margin-bottom: 18px;
    min-height: calc(100dvh - 36px);
    border-radius: 28px;
    overflow: hidden;
  }
}
