:root {
  --bg: #ece5d6;
  --paper: rgba(255, 251, 245, 0.92);
  --paper-strong: #fffdf9;
  --ink: #1f1a14;
  --muted: #655d53;
  --line: rgba(72, 56, 35, 0.14);
  --line-strong: rgba(72, 56, 35, 0.24);
  --accent: #123c36;
  --accent-2: #8b5e34;
  --accent-soft: rgba(18, 60, 54, 0.08);
  --ok: #23664a;
  --warn: #8e5d17;
  --danger: #a02828;
  --shadow: 0 18px 50px rgba(52, 38, 19, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(18, 60, 54, 0.16), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(139, 94, 52, 0.13), transparent 22%),
    linear-gradient(180deg, #f3ecdf 0%, #e7decd 46%, #ede7dc 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 86%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 34px 24px 56px;
}

.hero,
.subhead,
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.82fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

.hero-copy,
.landing-copy {
  position: relative;
}

.hero h1,
.subhead h1,
.landing-hero h1 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.subhead h1 {
  font-size: clamp(28px, 4vw, 46px);
}

.eyebrow,
.panel-label,
.kicker {
  margin: 0 0 10px;
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow,
.panel-label {
  color: var(--accent);
}

.kicker {
  color: var(--accent-2);
  letter-spacing: 0.12em;
}

.lead {
  margin: 12px 0 0;
  max-width: 840px;
  color: var(--muted);
  line-height: 1.78;
  font-size: 15px;
}

.hero-panel,
.landing-panel,
.panel,
.card,
.success-box,
.auth-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 243, 0.88)),
    var(--paper);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.hero-panel,
.landing-panel {
  padding: 22px;
  backdrop-filter: blur(10px);
}

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

.hero-panel div,
.metric-stack div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(18, 60, 54, 0.09);
}

.hero-panel div:last-of-type,
.metric-stack div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hero-panel strong,
.metric-stack strong {
  font-size: 28px;
  line-height: 1;
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric-stack span {
  color: var(--muted);
}

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

.summary-card {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(18, 60, 54, 0.1);
  background: linear-gradient(180deg, rgba(18, 60, 54, 0.08), rgba(18, 60, 54, 0.02));
}

.summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 12px;
}

.summary-card strong {
  font-size: 30px;
  line-height: 1;
}

.panel,
.card,
.success-box {
  padding: 24px;
}

.panel {
  margin-bottom: 22px;
}

.compact {
  padding: 18px;
}

.feature-panel h2,
.panel h2,
.card h3,
.auth-card h1 {
  margin: 0;
}

.feature-panel h2,
.panel h2 {
  font-size: 28px;
  line-height: 1.18;
}

.card h3 {
  font-size: 24px;
  margin-top: 4px;
}

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

.admin-grid,
.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 22px;
}

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

.feature-panel {
  min-height: 100%;
}

.info-panel {
  align-self: start;
}

.muted,
.empty {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 13px;
}

.form-grid label span {
  color: var(--muted);
}

.full {
  grid-column: 1 / -1;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(72, 56, 35, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--paper-strong);
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(18, 60, 54, 0.4);
  box-shadow: 0 0 0 4px rgba(18, 60, 54, 0.09);
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex !important;
  gap: 12px;
  align-items: flex-start;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #1f6156);
  box-shadow: 0 10px 26px rgba(18, 60, 54, 0.18);
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  opacity: 0.98;
}

.btn-secondary,
.btn-ghost {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(18, 60, 54, 0.16);
  box-shadow: none;
}

.btn-ghost {
  color: var(--accent-2);
  border-color: rgba(139, 94, 52, 0.22);
}

.btn-small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-green {
  background: rgba(35, 102, 74, 0.14);
  color: var(--ok);
}

.badge-amber {
  background: rgba(142, 93, 23, 0.14);
  color: var(--warn);
}

.meta-grid {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.meta-grid dt,
.meta-stack dt {
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.meta-grid dd,
.meta-stack dd {
  margin: 0;
}

.meta-stack {
  display: grid;
  gap: 12px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}

.card-list {
  display: grid;
  gap: 16px;
}

.note-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.plain-list,
.flow-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.78;
}

.flow-list-tight {
  margin-top: 4px;
}

.plain-list li,
.flow-list li {
  margin-bottom: 8px;
}

.sign-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(330px, 0.85fr);
  gap: 18px;
}

.pdf-pane iframe {
  width: 100%;
  min-height: 78vh;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.side-pane {
  display: grid;
  gap: 16px;
  align-content: start;
}

.process-panel {
  background:
    linear-gradient(180deg, rgba(18, 60, 54, 0.08), rgba(18, 60, 54, 0.03)),
    var(--paper);
}

.verification-state {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(18, 60, 54, 0.05);
}

.success-box {
  max-width: 820px;
  margin: 8vh auto 0;
}

.auth-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(540px, 100%);
  padding: 30px;
}

.help-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ok-text {
  color: var(--ok);
}

.error-text {
  margin: 8px 0 16px;
  color: var(--danger);
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.table th {
  font-family: "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .landing-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 920px) {
  .hero,
  .subhead,
  .landing-hero,
  .sign-layout,
  .admin-grid,
  .form-grid,
  .meta-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero h1,
  .subhead h1,
  .landing-hero h1 {
    font-size: 32px;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .hero-panel,
  .landing-panel {
    min-width: 0;
  }

  .pdf-pane iframe {
    min-height: 62vh;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 18px 14px 42px;
  }

  .panel,
  .card,
  .success-box,
  .auth-card,
  .hero-panel,
  .landing-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
