:root {
  --bg: #eef3f9;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-soft: #f4f7fb;
  --ink: #162033;
  --muted: #607086;
  --line: rgba(96, 112, 134, 0.18);
  --accent: #2463eb;
  --accent-strong: #1d4fd7;
  --accent-soft: rgba(36, 99, 235, 0.1);
  --accent-cyan: #0f766e;
  --danger: #c94848;
  --danger-soft: rgba(201, 72, 72, 0.12);
  --warn: #b7791f;
  --warn-soft: rgba(183, 121, 31, 0.14);
  --success: #17785d;
  --success-soft: rgba(23, 120, 93, 0.14);
  --shadow-lg: 0 28px 80px rgba(25, 40, 72, 0.12);
  --shadow-md: 0 14px 32px rgba(25, 40, 72, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(36, 99, 235, 0.12), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(15, 118, 110, 0.12), transparent 18%),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 52%, #e9eef6 100%);
  min-height: 100dvh;
}

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

button {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

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

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(36, 99, 235, 0.22);
  outline-offset: 2px;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.hero {
  position: relative;
  padding: 12px 0 28px;
}

.hero__main {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 420px);
  gap: 20px;
  align-items: stretch;
}

.hero__copy,
.hero__stage {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  border-radius: 32px;
  padding: 30px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.24;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 14ch;
}

.hero__desc {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.hero__actions,
.hero__chips,
.action-row,
.example-toolbar,
.rule-chip-list,
.outline-list,
.empty-state__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__actions {
  margin-top: 24px;
}

.hero__chips {
  margin-top: 18px;
}

.hero__chips span,
.rule-chip,
.outline-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  padding: 9px 14px;
  font-size: 14px;
}

.watchboard-card,
.disclaimer-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(244, 247, 251, 0.92));
}

.watchboard-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.watchboard-card__label {
  font-size: 13px;
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.watchboard-card__head strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.4;
}

.watchboard-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.watchboard-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.watchboard-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(244, 247, 251, 0.9);
  border: 1px solid rgba(96, 112, 134, 0.14);
}

.watchboard-item__index {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(22, 32, 51, 0.08);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.watchboard-item__content strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.watchboard-item__content span,
.watchboard-note,
.disclaimer-card p {
  color: var(--muted);
  line-height: 1.7;
}

.watchboard-note {
  margin: 14px 0 0;
  font-size: 14px;
}

.disclaimer-card {
  margin-top: 14px;
}

.disclaimer-card p {
  margin: 10px 0 0;
  font-size: 14px;
}

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

.hero-stat {
  border-radius: 20px;
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  text-align: center;
}

.hero-stat strong {
  display: block;
  font-size: 18px;
}

.hero-stat span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.hero-point {
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-md);
}

.hero-point strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.hero-point span {
  color: var(--muted);
  line-height: 1.75;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 470px) minmax(0, 1fr);
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  min-width: 0;
}

.panel__head {
  padding: 26px 26px 0;
}

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

.panel__head h2 {
  margin: 0;
  font-size: 26px;
}

.panel__head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.helper-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 26px 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.helper-strip__label,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
}

.helper-strip__label {
  border: 1px solid rgba(36, 99, 235, 0.16);
  background: rgba(36, 99, 235, 0.08);
  color: var(--accent-strong);
  flex-shrink: 0;
}

.helper-strip span {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 26px 0;
}

.example-card {
  text-align: left;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  min-height: 148px;
}

.example-card strong {
  display: block;
  font-size: 20px;
  margin-bottom: 10px;
}

.example-card span:last-child {
  color: var(--muted);
  line-height: 1.7;
}

.example-card--active {
  border-color: rgba(36, 99, 235, 0.24);
  background:
    linear-gradient(140deg, rgba(36, 99, 235, 0.12), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 32px rgba(36, 99, 235, 0.12);
}

.example-toolbar {
  margin: 14px 26px 0;
}

.contract-form {
  padding: 22px 26px 26px;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

select,
input[type="file"],
textarea {
  width: 100%;
  border: 1px solid rgba(96, 112, 134, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px 16px;
  color: var(--ink);
}

select,
input[type="file"],
.ghost-btn,
.primary-btn {
  min-height: 52px;
}

textarea {
  min-height: 300px;
  resize: vertical;
  line-height: 1.8;
}

.file-meta,
.text-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.notice-card {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(36, 99, 235, 0.08), rgba(255, 255, 255, 0.84)),
    rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(36, 99, 235, 0.12);
}

.notice-card__title {
  font-weight: 700;
  margin-bottom: 10px;
}

.notice-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.85;
}

.ghost-btn,
.primary-btn {
  appearance: none;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-strong);
}

.ghost-btn--strong {
  border-color: rgba(36, 99, 235, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(244, 247, 251, 0.96));
}

.primary-btn {
  width: 100%;
  border: 0;
  color: white;
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, #0d7ff2 100%);
  box-shadow: 0 18px 30px rgba(36, 99, 235, 0.22);
}

.primary-btn--auto {
  width: auto;
}

.ghost-btn:disabled,
.primary-btn:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.panel--result {
  min-height: 780px;
}

.status-badge {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-strong);
}

.empty-state {
  padding: 34px 26px 30px;
  color: var(--muted);
}

.empty-state__title {
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
}

.empty-state__desc {
  margin-top: 10px;
  line-height: 1.8;
  max-width: 760px;
}

.empty-state__steps {
  margin-top: 18px;
}

.hidden {
  display: none;
}

.result-view {
  padding: 20px 26px 30px;
}

.result-view.is-loading {
  opacity: 0.72;
}

.summary-card,
.insight-card,
.metric-card,
.action-plan-card,
.risk-item {
  animation: rise-in 340ms ease;
}

.summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 320px);
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(36, 99, 235, 0.1), rgba(255, 255, 255, 0.86)),
    rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(36, 99, 235, 0.12);
}

.summary-card__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.summary-card__label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.summary-card__opening {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.8;
  max-width: 34em;
}

.summary-card__meta {
  display: grid;
  gap: 16px;
}

.focus-line {
  line-height: 1.7;
  font-weight: 700;
}

.risk-badge,
.mode-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
}

.risk-badge--low {
  background: var(--success-soft);
  color: var(--success);
}

.risk-badge--medium {
  background: var(--warn-soft);
  color: var(--warn);
}

.risk-badge--high {
  background: var(--danger-soft);
  color: var(--danger);
}

.mode-badge {
  background: rgba(22, 32, 51, 0.08);
  color: var(--ink);
}

.metric-row,
.insight-grid,
.action-plan,
.detail-grid {
  display: grid;
  gap: 12px;
}

.metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.metric-card {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.metric-card--high {
  background: linear-gradient(135deg, rgba(201, 72, 72, 0.12), rgba(255, 255, 255, 0.8));
}

.metric-card--medium {
  background: linear-gradient(135deg, rgba(183, 121, 31, 0.12), rgba(255, 255, 255, 0.8));
}

.metric-card--low {
  background: linear-gradient(135deg, rgba(23, 120, 93, 0.12), rgba(255, 255, 255, 0.8));
}

.metric-card__label {
  color: var(--muted);
  font-size: 13px;
}

.metric-card__value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.insight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.insight-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.summary-block {
  margin-top: 24px;
}

.summary-block h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.summary-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.action-plan-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(244, 247, 251, 0.96)),
    rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.action-plan-card__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(36, 99, 235, 0.1);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.action-plan-card strong {
  display: block;
  font-size: 18px;
}

.action-plan-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.outline-list {
  gap: 10px;
}

.outline-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  cursor: pointer;
}

.outline-chip--high {
  background: var(--danger-soft);
  color: var(--danger);
}

.outline-chip--medium {
  background: var(--warn-soft);
  color: var(--warn);
}

.outline-chip--low {
  background: var(--success-soft);
  color: var(--success);
}

.outline-chip--empty {
  background: rgba(22, 32, 51, 0.08);
  color: var(--muted);
  cursor: default;
}

.risk-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.risk-item {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.risk-item--high {
  background: linear-gradient(135deg, rgba(201, 72, 72, 0.08), rgba(255, 255, 255, 0.86));
}

.risk-item--medium {
  background: linear-gradient(135deg, rgba(183, 121, 31, 0.08), rgba(255, 255, 255, 0.86));
}

.risk-item--low {
  background: linear-gradient(135deg, rgba(23, 120, 93, 0.08), rgba(255, 255, 255, 0.86));
}

.risk-item--empty {
  background: rgba(255, 255, 255, 0.84);
}

.risk-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.risk-item__index {
  color: var(--accent-strong);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.risk-item__tag {
  font-size: 20px;
  font-weight: 700;
}

.confidence {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.clause-box,
.detail-box {
  border-radius: 18px;
  padding: 15px;
  line-height: 1.8;
}

.clause-box {
  background: var(--surface-soft);
  border-left: 4px solid rgba(36, 99, 235, 0.42);
}

.detail-box {
  background: rgba(244, 247, 251, 0.92);
}

.detail-grid {
  margin-top: 12px;
}

.detail-box strong {
  display: block;
  margin-bottom: 6px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero__main,
  .workspace,
  .summary-card,
  .insight-grid,
  .action-plan {
    grid-template-columns: 1fr;
  }

  .example-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .hero__points,
  .hero__stats,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .panel__head--result,
  .helper-strip,
  .file-meta,
  .text-meta,
  .risk-item__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-shell {
    padding-inline: 14px;
  }

  .hero__copy,
  .hero__stage,
  .panel {
    border-radius: 26px;
  }

  .panel__head,
  .contract-form,
  .result-view {
    padding-inline: 18px;
  }

  .helper-strip,
  .example-grid,
  .example-toolbar {
    margin-inline: 18px;
  }

  .empty-state {
    padding-inline: 18px;
  }

  textarea {
    min-height: 260px;
  }
}

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

  .hero {
    padding: 8px 0 22px;
  }

  .hero__copy,
  .hero__stage,
  .panel {
    border-radius: 24px;
  }

  .hero__copy,
  .hero__stage {
    padding: 22px 18px;
  }

  .hero h1 {
    font-size: clamp(26px, 8vw, 34px);
    line-height: 1.34;
  }

  .hero__desc {
    font-size: 15px;
    line-height: 1.8;
  }

  .hero__actions,
  .example-toolbar,
  .action-row,
  .empty-state__steps {
    flex-direction: column;
  }

  .hero__actions .primary-btn,
  .hero__actions .ghost-btn,
  .example-toolbar .ghost-btn,
  .action-row .ghost-btn {
    width: 100%;
  }

  .watchboard-card__head {
    flex-direction: column;
  }

  .watchboard-badge {
    white-space: normal;
  }

  .summary-card,
  .insight-card,
  .metric-card,
  .action-plan-card,
  .risk-item {
    padding: 16px;
  }

  .outline-list {
    flex-direction: column;
  }

  .outline-chip {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .panel__head h2 {
    font-size: 22px;
  }

  .watchboard-card__head strong,
  .risk-item__tag {
    font-size: 18px;
  }

  .hero__chips span,
  .rule-chip,
  .outline-chip {
    width: 100%;
    justify-content: center;
  }

  .file-meta,
  .text-meta {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
