/* 页面样式。颜色、圆角、阴影以 css/tokens.css 与 docs/ui-design-spec.md 为准。 */

:root {
  --muted: var(--text-secondary);
  --accent: var(--primary-2);
  --accent-deep: var(--primary);
  --accent-soft: var(--peach-soft);
  --success: var(--mint-text);
  --warning: var(--primary-2);
  --error: var(--primary);
  --shadow: var(--shadow-card);
  --shadow-lift: var(--shadow-btn);
  --radius: var(--radius-card);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
}

img {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.page-main .panel {
  animation: rise 0.45s ease both;
}

.page-main .panel:nth-child(2) { animation-delay: 0.04s; }
.page-main .panel:nth-child(3) { animation-delay: 0.08s; }
.page-main .panel:nth-child(4) { animation-delay: 0.12s; }
.page-main .panel:nth-child(5) { animation-delay: 0.16s; }
.page-main .panel:nth-child(6) { animation-delay: 0.2s; }

@keyframes rise {
  from {
    transform: translateY(8px);
  }
  to {
    transform: none;
  }
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 78%, var(--accent-deep)));
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover:not(:disabled) {
  box-shadow: var(--shadow-lift);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 顶栏 */
.topbar {
  background: color-mix(in srgb, var(--card) 86%, var(--accent));
  border-bottom: 1px solid var(--border);
}

.topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 8px;
}

.brand {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--card), var(--accent));
  box-shadow: var(--shadow);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 12px;
  width: 14px;
  height: 18px;
  border-radius: 8px 8px 8px 3px;
  background: var(--accent-deep);
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.brand-sub {
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.compliance-badge {
  flex: 0 1 auto;
  max-width: 100%;
  margin: 4px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 70%, var(--card));
}

.anchor-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  line-height: var(--lh-small);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.anchor-nav a:hover,
.anchor-nav a:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* 免责声明横幅：浅蓝底、细边框，不用警示色铺底 */
.disclaimer {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 12px 14px 14px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--peach-soft);
}

.disclaimer-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

.disclaimer-icon svg {
  width: var(--icon-logo);
  height: var(--icon-logo);
}

.disclaimer-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1.5;
  text-align: left;
}

.disclaimer-close {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.disclaimer-close:hover {
  border-color: var(--accent);
}

/* 骨架分区：后续步骤再填入业务内容 */
.page-main {
  padding-top: 16px;
  padding-bottom: 24px;
}

.panel {
  margin-bottom: 16px;
  scroll-margin-top: 16px;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.section-title {
  margin-bottom: 8px;
}

/* 建档表单 */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.express-alert {
  margin: 0;
  color: #D1242F;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: 1.5;
}

.field.is-express-required .field-label {
  color: #D1242F;
}

.field.is-express-required textarea {
  border-color: #D1242F;
}

.panel-note.is-alert,
.practice-steps .is-alert {
  color: #D1242F;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
}

.field-note,
.form-hint,
.scene-hint {
  margin: 0;
}

.field-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.field-inline input {
  flex: 1 1 160px;
  min-width: 0;
}

.field-suffix {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="date"]:focus-visible,
input[type="number"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

select {
  appearance: auto;
}

.form .btn {
  align-self: flex-start;
  justify-self: start;
}

/* 场景卡片：多列随宽度折行，窄屏由 flex-basis 撑满 */
.scene-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.scene-card {
  flex: 1 1 280px;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.scene-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.scene-card:active {
  transform: translateY(0);
}

.scene-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent-deep);
}

.scene-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.scene-summary {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.scene-hint {
  margin-top: 12px;
}

/* 话术手风琴：可同时展开多条，不依赖悬停 */
.line-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.line-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.line-item.is-open {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}

.line-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.role-mark,
.mini-tag,
.basis-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
}

.role-mark {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}

.line-quote {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.6;
}

.line-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--accent-deep);
  font-size: 12px;
  line-height: 1.5;
}

.line-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--accent-deep);
  border-bottom: 2px solid var(--accent-deep);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.line-toggle[aria-expanded="true"] .line-state::before {
  transform: rotate(225deg) translateY(-1px);
}

.line-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.line-item.is-open .line-body {
  grid-template-rows: 1fr;
}

.line-body-clip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px 16px;
}

.line-row {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.mini-tag {
  margin-right: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  vertical-align: middle;
}

.mini-tag-tactic {
  border-color: var(--warning);
  color: var(--text);
}

.mini-tag-risk {
  border-color: var(--error);
  color: var(--error);
}

.reply-title,
.example-label {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.reply-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  user-select: text;
}

.basis-line,
.note-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.basis-badge {
  margin-left: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.library-split {
  margin: 22px 0 0;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: 1.5;
}

.library-count {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.role-mark.is-trap {
  border-color: var(--primary-2);
  background: #fff4e8;
  color: #8a4b12;
}

.role-mark.is-sham {
  border-color: var(--primary);
  background: var(--peach-soft);
  color: var(--primary);
}

.best-answer {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

/* 模式切换与静态示例 */
.mode-tabs,
.difficulty,
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-tabs {
  margin-top: 16px;
}

.mode-tab,
.diff-tag,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mode-tab:active,
.btn-ghost:active {
  transform: translateY(1px);
}

.mode-tab.is-active,
.diff-tag.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

.mode-panel {
  margin-top: 16px;
}

.panel-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.difficulty {
  margin-bottom: 8px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.bubble-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.bubble-row.is-them {
  align-items: flex-start;
}

.bubble-row.is-me {
  align-items: flex-end;
}

.bubble-role {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.bubble {
  max-width: min(100%, 520px);
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.bubble-them {
  background: var(--bubble-neutral);
  color: var(--text);
}

.bubble-me {
  background: var(--mint);
  color: var(--mint-text);
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.static-tip {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 13.5px;
  line-height: 1.6;
}

.example-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.example-block p,
.review-list,
.review-points {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.review-list {
  padding-left: 20px;
}

.review-list li + li {
  margin-top: 12px;
}

.review-k {
  display: inline-block;
  min-width: 3em;
  margin-right: 8px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
}

.review-points {
  padding-left: 20px;
}

.review-points li + li {
  margin-top: 8px;
}

/* 提示词预览：练习区共用一块，随模式与建档刷新 */
.prompt-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

#prompt-preview {
  width: 100%;
  min-height: 180px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  cursor: text;
}

.practice-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.practice-steps li + li {
  margin-top: 8px;
}

.compliance-inline {
  margin-top: 12px;
}

.composer-actions {
  margin-top: 12px;
}

/* 文书模板 */
.template-grid,
.explainer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.template-card,
.explainer-card {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.template-card::before,
.explainer-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
}

.template-card:hover,
.explainer-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}

.template-title,
.explainer-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.template-scene {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

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

.template-body,
.modal-body {
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

body.modal-open {
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 52, 46, 0.45);
}

.modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  height: min(640px, calc(100vh - 48px));
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

.modal-head,
.modal-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.modal-head {
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.5;
}

.modal-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
}

.modal-foot {
  flex-wrap: wrap;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

.modal-foot .template-fixed-note,
.modal-foot .copy-feedback {
  flex: 1 1 220px;
  margin: 0;
}

.placeholder {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

.template-fixed-note,
.copy-feedback,
.explainer-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.copy-feedback.is-ok {
  color: var(--success);
}

.copy-feedback:not(:empty) {
  animation: rise 0.25s ease;
}

.explainer-card p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.6;
}

.footer {
  margin-top: 8px;
  padding: 8px 0 10px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.footer p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.footer-version {
  margin-bottom: 0;
}

@media (min-width: 481px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--card) 82%, transparent);
    backdrop-filter: blur(12px);
  }

  .panel {
    padding: 24px;
    scroll-margin-top: 96px;
  }
}

@media (min-width: 720px) {
  .form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .form .field:first-child,
  .form-hint,
  .form .btn {
    grid-column: 1 / -1;
  }
}

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

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

@media (max-width: 480px) {
  .topbar-row,
  .anchor-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .compliance-badge {
    align-self: flex-start;
  }

  .anchor-nav a,
  .form .btn,
  .scene-card,
  .mode-tab,
  .composer-actions .btn,
  .composer-actions .btn-ghost,
  .template-card,
  .explainer-card,
  .template-actions .btn,
  .template-actions .btn-ghost {
    width: 100%;
  }

  .scene-card {
    flex-basis: 100%;
  }
}

/* v2 首屏：奶油底、胶囊导航、便签对话卡。令牌见 tokens.css */

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg);
  background-image: url("../assets/home-bg.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.page-bg .bg-blob {
  display: none;
}

.page-bg .bg-blob {
  position: absolute;
}

.blob-tl {
  top: -220px;
  left: -180px;
  width: 560px;
  height: 560px;
  filter: blur(18px);
}

.blob-bl {
  bottom: -260px;
  left: -200px;
  width: 620px;
  height: 620px;
  filter: blur(16px);
}

.blob-br {
  right: -220px;
  bottom: -180px;
  width: 680px;
  height: 680px;
  filter: blur(12px);
}

.blob-warm {
  top: 40px;
  right: -80px;
  width: 720px;
  height: 720px;
  background: rgba(247, 230, 211, 0.72);
  filter: blur(28px);
}

.topbar,
.container,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  background: rgb(251, 246, 238);
  border-bottom: 0;
}

.topbar-row {
  align-items: center;
  min-height: 72px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--icon-orange);
}

.brand-mark::after {
  content: none;
}

.brand-mark svg {
  width: var(--icon-logo);
  height: var(--icon-logo);
}

.btn svg,
.tag svg {
  flex: none;
}

.btn svg {
  width: var(--icon-btn);
  height: var(--icon-btn);
}

.tag svg {
  width: var(--icon-tag);
  height: var(--icon-tag);
}

.brand-name {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  line-height: var(--lh-h3);
}

.anchor-nav {
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.anchor-nav a {
  border-color: transparent;
  background: transparent;
  font-weight: 500;
}

.compliance-badge {
  border-color: var(--border);
  background: var(--card);
  color: var(--text-secondary);
  margin: 0 0 0 8px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

.disclaimer {
  border-color: var(--primary);
  background: var(--peach-soft);
}

.disclaimer-close {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.section-kicker {
  border-color: transparent;
  background: var(--mint-soft);
  color: var(--mint-text);
}

.home {
  padding-top: 8px;
  padding-bottom: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 48px;
  min-height: 520px;
  padding: 36px 0 8px;
}

.hero-copy {
  flex: 1 1 320px;
}

.hero-kicker {
  margin-bottom: 16px;
}

.hero-title {
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
}

.hero-lead {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.hero-actions,
.hero-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 24px;
}

.hero-modes {
  margin-top: 16px;
}

.hero-mode {
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.page-head {
  margin-top: 28px;
}

.page-head h2 {
  margin-top: 8px;
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-h1);
}

.page-head p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: var(--fs-body);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--text-secondary);
  font-size: var(--fs-small);
  text-decoration: none;
}

.back-link svg {
  width: var(--icon-deco);
  height: var(--icon-deco);
  flex: none;
}

.anchor-nav a[aria-current="page"] {
  background: var(--peach-soft);
  color: var(--text);
  font-weight: 600;
}

.next-step {
  margin-top: 16px;
}

a.hero-mode.tag-mint { color: var(--mint-text); }
a.hero-mode.tag-peach { color: var(--primary); }
a.hero-mode.tag-lilac { color: var(--icon-lilac); }

.tag-mint {
  background: var(--mint-soft);
  color: var(--mint-text);
}

.tag-peach {
  background: var(--peach-soft);
  color: var(--text);
}

.tag-lilac {
  background: var(--lilac-soft);
  color: var(--icon-lilac);
}

a.btn {
  text-decoration: none;
}

.btn {
  border-radius: var(--radius-pill);
  background: var(--primary-grad);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

.hero-stage {
  position: relative;
  min-width: 0;
  min-height: 420px;
}

.note-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  margin: 28px auto 20px;
}

.doodle {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.doodle-star {
  width: var(--icon-deco);
  height: var(--icon-deco);
}

.doodle-star-a,
.doodle-star-c {
  color: var(--primary-2);
}

.doodle-star-b {
  color: var(--mint-text);
}

.doodle-star-a {
  top: 118px;
  left: 42px;
}

.doodle-star-b {
  top: 168px;
  left: 18px;
  width: 12px;
  height: 12px;
}

.doodle-star-c {
  right: 28px;
  bottom: 92px;
  width: 14px;
  height: 14px;
}

.doodle-bubble {
  top: 86px;
  left: 8px;
  width: 36px;
  height: 28px;
  opacity: 0.75;
}

.doodle-smile {
  top: 8px;
  right: 18px;
  width: 46px;
  height: 38px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.doodle-swirl {
  left: 6px;
  bottom: 28px;
  width: 40px;
  height: 54px;
  opacity: 0.8;
}

.doodle-arrow {
  top: 46%;
  left: 18px;
  width: 64px;
  height: 26px;
  opacity: 0.8;
}

.note-card {
  position: relative;
  width: 100%;
  min-height: 280px;
  padding: 36px 28px 40px;
  border-radius: 26px;
  background: #fffdf8;
  box-shadow: var(--shadow-note);
  transform: rotate(1.2deg);
}

.note-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-h3);
}

.note-card .bubble {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 78%;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-bubble);
  font-size: var(--fs-body);
}

.note-card .bubble-them {
  max-width: 18em;
  border-bottom-left-radius: 6px;
}

.note-card .bubble-me {
  max-width: 18em;
  margin-left: auto;
  border-bottom-right-radius: 6px;
}

.note-card .bubble-them::after,
.note-card .bubble-me::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 12px;
  height: 12px;
}

.note-card .bubble-them::after {
  left: 16px;
  background: var(--bubble-neutral);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.note-card .bubble-me::after {
  right: 16px;
  background: var(--mint);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.tape {
  position: absolute;
  border-radius: 3px;
}

.tape-top {
  top: -12px;
  right: 42px;
  width: 86px;
  height: 20px;
  background: var(--tape-orange);
  transform: rotate(8deg);
}

.tape-side {
  top: 18px;
  right: -8px;
  width: 22px;
  height: 64px;
  background: var(--tape-pink);
  transform: rotate(12deg);
}

.tape-foot {
  bottom: -8px;
  left: 28px;
  width: 72px;
  height: 18px;
  background: var(--lilac);
  transform: rotate(-16deg);
  opacity: 0.9;
}

.sticky {
  position: absolute;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.sticky-orange {
  top: -6px;
  right: -4px;
  background: #f7b56a;
  color: var(--text);
  transform: rotate(8deg);
}

.sticky-orange i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #e07a4a;
}

.sticky-green {
  right: 6px;
  bottom: -18px;
  background: var(--mint);
  color: var(--mint-text);
  transform: rotate(-8deg);
}

.home-scenes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.home-scene {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-height: 148px;
  padding: 22px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-h3);
  text-decoration: none;
}

.home-scene:hover {
  transform: translateY(-2px);
}

.home-disclaimer {
  margin-top: 28px;
}

.scene-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.scene-icon-orange {
  background: var(--peach-soft);
  color: var(--icon-orange);
}

.scene-icon svg {
  width: var(--icon-scene);
  height: var(--icon-scene);
}

.scene-icon-lilac {
  background: var(--lilac-soft);
  color: var(--icon-lilac);
}

.scene-icon-mint {
  background: var(--mint-soft);
  color: var(--mint-text);
}

.scene-icon-coral {
  background: var(--peach-soft);
  color: var(--primary);
}

.scene-icon-mauve {
  background: var(--lilac-soft);
  color: var(--icon-mauve);
}

.scene-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.scene-card.is-selected {
  border-color: var(--primary-2);
  background: var(--peach-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

@media (min-width: 481px) {
  .topbar {
    background: rgb(251, 246, 238);
    backdrop-filter: none;
  }
}

@media (max-width: 959px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 28px;
  }

  .home-scenes {
    grid-template-columns: 1fr 1fr;
  }

  .doodle-swirl,
  .doodle-bubble {
    display: none;
  }
}

@media (max-width: 639px) {
  .anchor-nav {
    justify-content: flex-start;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .home-scenes {
    grid-template-columns: 1fr;
  }

  .home-scene {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
  }

  .hero-kicker,
  .hero-mode,
  .anchor-nav a,
  .scene-chip {
    width: auto;
  }

  .hero-stage {
    min-height: 0;
  }

  .note-wrap,
  .note-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .note-card {
    min-height: 0;
    padding: 28px 16px 32px;
    transform: none;
  }

  .note-card .bubble-me {
    max-width: 100%;
    margin-left: 28px;
    margin-right: 0;
  }

  .sticky-orange,
  .sticky-green {
    right: 0;
  }
}

/* 首页三层：大背景、便签底图、标题精灵。坐标按 1024×576 原稿。 */

.hero-stage .doodle {
  display: none;
}

.note-wrap {
  position: relative;
  width: min(100%, 440px);
  max-width: 440px;
  aspect-ratio: 420 / 365;
  margin: 8px 0 0 auto;
  container-type: size;
  background: none;
}

.note-art {
  position: absolute;
  inset: 0;
  background-image: url("../assets/home-note.png");
  background-repeat: no-repeat;
  background-size: calc(1024 / 420 * 100cqi) calc(576 / 365 * 100cqb);
  background-position: calc(-550 / 420 * 100cqi) calc(-88 / 365 * 100cqb);
}

.sheet-frame {
  container-type: size;
}

.sheet-bit {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  line-height: 0;
  background-image: url("../assets/home-sprite.png");
  background-repeat: no-repeat;
  background-size: calc(1024 / var(--sw) * 100cqi) calc(576 / var(--sh) * 100cqb);
  background-position: calc(var(--sx) / var(--sw) * -100cqi) calc(var(--sy) / var(--sh) * -100cqb);
}

.hero-title.sheet-frame {
  display: block;
  width: min(100%, 560px);
  height: auto;
  aspect-ratio: 425 / 49;
}

.note-wrap .sheet-frame {
  position: absolute;
  left: calc((var(--sx) - 550) / 420 * 100%);
  top: calc((var(--sy) - 88) / 365 * 100%);
  width: calc(var(--sw) / 420 * 100%);
  height: calc(var(--sh) / 365 * 100%);
  margin: 0;
}

@media (max-width: 639px) {
  .topbar {
    z-index: 30;
  }

  .topbar-row {
    position: relative;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  .nav-toggle {
    display: inline-flex;
    margin-right: 28px;
  }

  .anchor-nav {
    display: none;
  }

  .topbar-row.is-nav-open .anchor-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 31;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow-card);
  }

  .topbar-row.is-nav-open .anchor-nav a {
    justify-content: flex-start;
    width: 100%;
    border-color: transparent;
  }

  .compliance-badge {
    position: absolute;
    top: 18px;
    right: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    cursor: pointer;
  }

  .compliance-badge::before {
    content: "i";
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
    font-weight: 600;
    line-height: 1;
  }

  .compliance-badge-label {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 3;
    width: max-content;
    max-width: 210px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--text);
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
  }

  .compliance-badge:hover .compliance-badge-label,
  .compliance-badge:focus .compliance-badge-label,
  .compliance-badge:focus-visible .compliance-badge-label {
    opacity: 1;
  }

  .hero-copy,
  .hero-stage,
  .note-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .hero-title.sheet-frame,
  .note-wrap {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
}
