:root {
  --bg: #f5f5f7;
  --paper: #ffffff;
  --ink: #1d1d1f;
  --soft-ink: #6e6e73;
  --line: #d2d2d7;
  --accent: #0071e3;
  --accent-dark: #0058b0;
  --accent-pale: #e8f3ff;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
  --radius: 8px;
}

@page {
  size: A4 portrait;
  margin: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(210, 210, 215, 0.75);
}

.site-header__inner,
.hero__inner,
.page,
.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a {
  font-size: 14px;
  color: var(--soft-ink);
  text-decoration: none;
}

.hero {
  padding: 28px 20px 16px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.hero-copy {
  max-width: 100%;
  padding-top: 0;
}

.hero-panel {
  position: relative;
  width: 100%;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--soft-ink);
  letter-spacing: 0;
  text-transform: none;
  font-size: 19px;
  font-weight: 600;
}

h1 {
  margin: 0;
  max-width: 920px;
  font-size: 56px;
  line-height: 1.06;
  letter-spacing: 0;
}

.hero__lead {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--soft-ink);
  font-size: 19px;
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.hero__note,
.stat-pill {
  color: var(--soft-ink);
  font-size: 15px;
}

.page {
  padding: 0 0 48px;
}

.card {
  background: var(--paper);
  border: 1px solid rgba(210, 210, 215, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.faq-card,
.result-card,
.scenarios-card,
.sample-feedback-card {
  padding: 28px;
}

.form-card {
  padding: 26px 28px 28px;
}

.form-card h2,
.result-card h2,
.faq-card h2,
.section-heading h2 {
  margin-top: 0;
}

.hero-form {
  position: relative;
  top: auto;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 4px;
  align-items: end;
}

.hero-form h2 {
  grid-column: 1 / -1;
}

.field-topic {
  grid-column: span 6;
}

.field-total,
.field-unit,
.field-date,
.field-time,
.field-mode {
  grid-column: span 3;
}

.unit-help {
  grid-column: 1 / -1;
  margin: -6px 0 6px;
  color: var(--soft-ink);
  font-size: 14px;
  line-height: 1.6;
}

.hero-form .primary-button {
  grid-column: span 3;
  margin-bottom: 16px;
}

.hero-form .form-note {
  grid-column: 1 / -1;
}

.hero-result {
  position: sticky;
  top: 72px;
  padding: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
}

.hero-result__header {
  align-items: flex-start;
}

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

.section-heading {
  margin-bottom: 20px;
}

.section-heading p {
  max-width: 760px;
  color: var(--soft-ink);
}

label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
}

small,
.faq-card p,
#summary,
.empty-state p {
  color: var(--soft-ink);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  background: #fbfbfd;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(0, 113, 227, 0.18);
  border-color: var(--accent);
}

.primary-button,
.secondary-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 13px 20px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.2);
}

.secondary-button,
.link-button {
  border: 1px solid var(--line);
  background: #fbfbfd;
  color: var(--ink);
}

.form-note {
  margin: 12px 0 0;
  color: var(--soft-ink);
  font-size: 14px;
  line-height: 1.7;
}

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

.scenarios-card,
.sample-feedback-card,
.faq-card {
  margin-top: 20px;
}

.more-links {
  margin-top: 20px;
}

.more-links h2 {
  font-size: 22px;
}

.more-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.more-link-list a {
  display: inline-flex;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.scenario-grid,
.feedback-list {
  display: grid;
  gap: 16px;
}

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

.scenario-item {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfd;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.scenario-item:hover {
  border-color: #b8bcc5;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.scenario-item h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 20px;
}

.scenario-item p,
blockquote footer {
  color: var(--soft-ink);
  line-height: 1.75;
}

.scenario-note {
  margin-top: 14px;
  font-size: 14px;
}

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

blockquote {
  margin: 0;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfbfd;
}

blockquote p {
  margin-top: 0;
  line-height: 1.8;
}

blockquote footer {
  margin-top: 12px;
  font-size: 14px;
}

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

.empty-state {
  margin-top: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fffcf6;
}

.hidden {
  display: none;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.table-wrap {
  overflow-x: auto;
}

.hero-table-wrap {
  max-height: calc(100vh - 240px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hero-result table {
  font-size: 14px;
}

.preview-page {
  background: #ececef;
}

.preview-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(245, 245, 247, 0.88);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(210, 210, 215, 0.75);
}

.preview-topbar__inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-topbar__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.preview-print-button {
  width: auto;
}

.preview-main {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.preview-empty__card {
  padding: 32px;
}

.preview-document {
  display: grid;
  gap: 24px;
}

.preview-sheet {
  width: min(720px, 100%);
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  padding: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-table-area {
  flex: 1;
  overflow: hidden;
}

.preview-page-quote {
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e5e5ea;
  color: #56565b;
  font-size: 13px;
  line-height: 1.5;
}

.preview-sheet__header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.preview-kicker {
  margin: 0 0 8px;
  color: #6e6e73;
  font-size: 11pt;
  font-weight: 600;
}

.preview-sheet h1 {
  font-size: 26px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.preview-subtitle,
.preview-meta,
.preview-sheet__stats {
  color: #4f4f53;
  font-size: 13px;
  line-height: 1.6;
}

.preview-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.preview-sheet__stats {
  margin-bottom: 18px;
}

.preview-sheet__footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e5ea;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.5;
}

.preview-brand-mark {
  text-align: right;
  font-weight: 600;
}

.preview-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.preview-table th,
.preview-table td {
  border: 1px solid #d6d6db;
  padding: 9px 8px;
  vertical-align: top;
  text-align: left;
  word-break: break-word;
}

.preview-table th {
  background: #f5f6f8;
  color: #3a3a3c;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

th {
  font-size: 14px;
  color: var(--soft-ink);
  background: #fafafc;
}

tbody tr:hover {
  background: #fafafc;
}

body.is-showing-result .hero__inner {
  grid-template-columns: 1fr;
  width: min(980px, calc(100% - 32px));
  min-height: auto;
}

body.is-showing-result .hero-copy,
body.is-showing-result .page {
  display: none;
}

body.is-showing-result .hero-panel {
  width: 100%;
}

body.is-showing-result .hero-form {
  display: none;
}

body.is-showing-result .hero-result {
  position: static;
  padding: 32px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.05);
}

body.is-showing-result .hero-result h2 {
  font-size: 36px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

body.is-showing-result .stats {
  margin: 18px 0 20px;
}

body.is-showing-result .stat-pill {
  border-radius: 999px;
  padding: 8px 12px;
  background: #f5f7fa;
  border: 1px solid #e2e5ea;
}

body.is-showing-result .hero-table-wrap {
  max-height: none;
  border-radius: 8px;
}

body.is-showing-result th,
body.is-showing-result td {
  padding: 12px 10px;
}

body.is-showing-result th {
  position: sticky;
  top: 0;
}

details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

details:first-of-type {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

.footer {
  padding: 0 0 40px;
  text-align: center;
  color: var(--soft-ink);
}

.footer nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.simple-page {
  width: min(860px, calc(100% - 32px));
  margin: 40px auto;
}

.simple-page .card {
  padding: 32px;
}

.simple-page p,
.simple-page li {
  line-height: 1.8;
  color: var(--soft-ink);
}

.content-page {
  width: min(960px, calc(100% - 32px));
  margin: 36px auto 56px;
}

.content-hero {
  margin-bottom: 24px;
}

.breadcrumb {
  margin: 0 0 18px;
  color: var(--soft-ink);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--soft-ink);
}

.content-hero h1 {
  max-width: 820px;
  font-size: 42px;
  line-height: 1.15;
}

.content-lead {
  max-width: 760px;
  color: var(--soft-ink);
  font-size: 18px;
  line-height: 1.8;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.article-section {
  padding: 28px;
  margin-bottom: 18px;
}

.article-section h2 {
  margin-top: 0;
}

.article-section p,
.article-section li {
  color: var(--soft-ink);
  line-height: 1.85;
}

.article-section ul,
.article-section ol {
  padding-left: 22px;
}

.scenario-aside {
  position: sticky;
  top: 76px;
  padding: 24px;
}

.scenario-aside p {
  color: var(--soft-ink);
  line-height: 1.7;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 860px) {
  .hero {
    padding-top: 28px;
  }

  .hero__inner,
  .form-card,
  .result-card,
  .faq-card {
    padding: 22px;
  }

  .scenario-grid,
  .feedback-list {
    grid-template-columns: 1fr;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .content-hero h1 {
    font-size: 34px;
  }

  .scenario-aside {
    position: static;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 24px;
  }

  .hero-copy {
    padding-top: 0;
  }

  h1 {
    font-size: 42px;
  }

  .hero-form {
    position: static;
    display: block;
  }

  .hero-result {
    position: static;
    padding: 22px;
  }

  .preview-sheet {
    width: 100%;
    aspect-ratio: auto;
    padding: 20px;
    overflow: visible;
    display: block;
  }

  .preview-sheet__header {
    flex-direction: column;
  }

  .preview-meta {
    text-align: left;
  }

  body.is-showing-result .hero__inner {
    width: min(100%, calc(100% - 24px));
  }

  body.is-showing-result .hero-result {
    padding: 18px;
  }

  body.is-showing-result .hero-result h2 {
    font-size: 28px;
  }

  .site-nav {
    gap: 12px;
  }

  .site-nav a {
    font-size: 13px;
  }

  .secondary-button {
    width: 100%;
  }

  .hero-result__actions {
    width: 100%;
  }

  .preview-topbar__inner,
  .preview-main {
    width: min(100%, calc(100% - 24px));
  }

  .preview-topbar__inner,
  .preview-topbar__actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .preview-topbar,
  .hero-copy,
  .hero-form,
  .page,
  .footer,
  .hero-result__actions,
  #editButton,
  #printButton {
    display: none !important;
  }

  .hero,
  .hero__inner,
  .hero-panel,
  .hero-result,
  .preview-main,
  .preview-document,
  .preview-sheet {
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: 0;
    padding: 0;
    min-height: auto;
    display: block !important;
  }

  .hero-result {
    display: block !important;
  }

  .preview-sheet {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    aspect-ratio: auto;
    overflow: hidden;
    page-break-after: always;
    break-after: page;
    padding: 12mm;
    display: flex !important;
    flex-direction: column;
  }

  .preview-sheet:last-child {
    page-break-after: auto;
  }

  .hero-result h2 {
    font-size: 20pt;
    margin: 0 0 6mm;
  }

  #summary {
    font-size: 11pt;
    margin-bottom: 4mm;
  }

  .stats {
    gap: 4mm;
    margin: 0 0 6mm;
  }

  .stat-pill {
    border: 1px solid #bbb;
    padding: 2.5mm 4mm;
    font-size: 10pt;
    color: #222;
    background: #fff;
  }

  .hero-table-wrap {
    max-height: none;
    overflow: visible;
    border: 1px solid #bbb;
    border-radius: 0;
  }

  table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 9.5pt;
  }

  th,
  td {
    padding: 3mm 2.5mm;
    border-bottom: 1px solid #d4d4d4;
    word-break: break-word;
  }

  th {
    color: #111;
    background: #f3f3f3;
  }

  tbody tr:hover {
    background: transparent;
  }

  .preview-table th,
  .preview-table td {
    padding: 3mm 2.5mm;
  }
}

.error-toast {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 1000;
  max-width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  border: 1px solid rgba(126, 44, 44, 0.24);
  border-radius: 8px;
  background: #fff7f4;
  color: #7e2c2c;
  box-shadow: 0 16px 40px rgba(46, 36, 23, 0.14);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.storage-warning {
  width: 100%;
  margin: 10px 0 0;
  color: #8a5a13;
  font-size: 13px;
  line-height: 1.5;
}
