:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #1d2522;
  --muted: #66736d;
  --line: #d9ded8;
  --accent: #276c5c;
  --accent-strong: #174c40;
  --warm: #b66b32;
  --danger: #a64036;
  --shadow: 0 18px 50px rgba(30, 48, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

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

.shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.simple-shell {
  width: min(1120px, calc(100vw - 32px));
}

.simple-header {
  margin-bottom: 18px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.daily-tip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid #cfe1d8;
  border-radius: 8px;
  padding: 18px 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.daily-tip h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.daily-tip p {
  line-height: 1.65;
}

.daily-tip-main p:last-child {
  margin-bottom: 0;
}

.daily-tip-scene {
  color: var(--accent-strong);
  font-weight: 700;
}

.daily-tip-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: 220px;
}

.daily-tip-side span {
  color: var(--muted);
  font-size: 13px;
}

.tip-action {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.tip-action:hover {
  background: var(--accent-strong);
}

.badge {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: #ecf3ef;
  font-size: 14px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.simple-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel {
  align-self: start;
  padding: 20px;
}

.composer {
  padding: 20px;
}

.composer label {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
}

.composer textarea {
  min-height: 210px;
  font-size: 16px;
  line-height: 1.75;
}

.actions {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 10px;
  margin-top: 12px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  color: #34413c;
  font-size: 14px;
  font-weight: 700;
}

.hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd3cc;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcfb;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 108, 92, 0.14);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.voice {
  border: 1px solid #cbd3cc;
  border-radius: 8px;
  padding: 13px 16px;
  color: var(--accent-strong);
  background: #eef5f1;
  cursor: pointer;
  font-weight: 800;
}

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

.primary:hover {
  background: var(--accent-strong);
}

.result-panel {
  padding: 20px;
}

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

.risk {
  border-radius: 999px;
  padding: 7px 10px;
  color: #ffffff;
  background: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.risk.low {
  background: var(--accent);
}

.risk.medium {
  background: var(--warm);
}

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

.section-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfb;
}

.match-card p {
  margin-bottom: 0;
  color: var(--accent-strong);
  font-weight: 800;
  line-height: 1.7;
}

.frame-card {
  background: #f7faf8;
}

.frame-summary {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.frame-step {
  min-height: 124px;
  border: 1px solid #dfe6df;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.frame-step strong {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.frame-step p {
  margin-bottom: 0;
  color: #3d4a45;
  font-size: 14px;
  line-height: 1.65;
}

.methods-list {
  display: grid;
  gap: 10px;
}

.method-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.method-path {
  margin-bottom: 12px;
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  color: #34413c;
  background: #f1f5f2;
  line-height: 1.7;
}

.method-item {
  border: 1px solid #dfe6df;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.method-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
}

.method-item p {
  margin-bottom: 8px;
  color: #3d4a45;
  line-height: 1.65;
}

.method-item small {
  color: var(--muted);
  line-height: 1.6;
}

.copy {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--accent-strong);
  background: #eef5f1;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

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

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #24312c;
  font-family: inherit;
  line-height: 1.75;
}

ul {
  margin: 0;
  padding-left: 20px;
  color: #24312c;
  line-height: 1.75;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.note {
  margin-top: 14px;
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  color: #485650;
  background: #f1f5f2;
  line-height: 1.7;
}

@media (max-width: 880px) {
  .topbar,
  .result-head {
    align-items: start;
    flex-direction: column;
  }

  .workspace,
  .simple-layout,
  .daily-tip,
  .split,
  .frame-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .daily-tip-side {
    justify-items: stretch;
    min-width: 0;
  }

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

  .shell {
    width: min(100vw - 20px, 760px);
    padding-top: 16px;
  }
}

[hidden] { display: none !important; }
summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
#private-alternative .copy { margin: 10px 0; }

/* Mobile-first reading rhythm; shared with the desktop workspace. */
:root {
  --bg: #f5f5ef;
  --line: #e1e7df;
  --accent: #286751;
  --accent-strong: #194b39;
  --shadow: 0 6px 28px rgba(30, 48, 42, .045);
}
body { line-height: 1.6; -webkit-text-size-adjust: 100%; }
.simple-shell { display: flex; flex-direction: column; width: min(1120px, calc(100% - 40px)); padding: 42px 0 max(32px, env(safe-area-inset-bottom)); }
.simple-header { order: 0; margin-bottom: 30px; }
.simple-header .eyebrow { display: inline-block; padding: 5px 12px; border-radius: 24px; background: #e7eee5; font-size: 12px; letter-spacing: .06em; margin-bottom: 16px; }
h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.04em; line-height: 1.3; margin-bottom: 12px; }
.subtitle { max-width: 610px; line-height: 1.8; font-size: 15px; }
.simple-layout { order: 1; gap: 24px; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.3fr); }
.panel { border-radius: 20px; min-width: 0; }
.composer, .result-panel { padding: 26px; }
.composer label { font-size: 18px; line-height: 1.6; margin-bottom: 18px; }
.composer textarea { min-height: 230px; border-radius: 12px; padding: 16px; background: #fafbf8; font-size: 16px; }
textarea::placeholder { color: #7c887f; }
.hint { margin: 10px 0 0; font-size: 12px; line-height: 1.7; }
.actions { grid-template-columns: auto minmax(0, 1fr); margin-top: 20px; }
button { min-height: 44px; touch-action: manipulation; }
.primary, .voice, .tip-action { border-radius: 12px; font-weight: 600; }
.primary { min-height: 50px; }
.voice { font-size: 14px; padding-inline: 14px; background: white; }
.result-head { align-items: flex-start; gap: 12px; }
.result-head h2 { font-size: 21px; line-height: 1.5; }
.result-head .eyebrow { font-size: 12px; color: var(--muted); font-weight: 500; }
.risk { padding: 5px 10px; font-size: 12px; font-weight: 600; }
.risk.low { background: #e7f1e9; color: #285c3d; }
.risk.medium { background: #fbefdc; color: #86571c; }
.risk.high { background: #fbe7e3; color: #973b31; }
.match-card { display: none; }
.section-card { border-radius: 12px; background: white; padding: 18px; margin-top: 18px; }
.result-panel > .section-card:has(#private-message) { background: #f0f5ee; border-color: #dce8d7; }
.section-title { gap: 10px; margin-bottom: 12px; }
.section-title h3 { margin: 0; line-height: 1.5; }
.copy { flex-shrink: 0; min-width: 64px; background: white; border-radius: 9px; padding: 8px 12px; }
pre { font-size: 16px; line-height: 1.95; overflow-wrap: anywhere; }
.split { gap: 16px; }
.split .section-card { border: 0; padding: 6px 0; background: none; }
.split h3 { font-size: 14px; color: var(--muted); }
li { margin-bottom: 8px; font-size: 14px; line-height: 1.85; }
details.section-card { padding: 4px 18px; background: #fcfcfa; }
summary { min-height: 48px; display: list-item; padding: 12px 0; font-size: 14px; color: var(--accent-strong); }
details[open].section-card { padding-bottom: 18px; }
details .section-card { padding: 14px; box-shadow: none; }
.frame-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.frame-step { min-height: 0; }
.note { font-size: 13px; border-radius: 0 10px 10px 0; line-height: 1.8; }
.daily-tip { order: 2; margin: 24px 0 0; border-radius: 18px; padding: 22px 26px; background: #edf1e8; border: 0; box-shadow: none; }
.daily-tip h2 { font-size: 18px; }
.daily-tip p { font-size: 14px; }
.daily-tip-scene { font-weight: 400; }
.tip-action { background: white; color: var(--accent-strong); border: 1px solid #d1dfcc; font-size: 14px; }
.tip-action:hover { background: #e1eadb; }
button:focus-visible, summary:focus-visible { outline: 3px solid #8eb49b; outline-offset: 3px; }
@media (max-width: 880px) {
  .simple-shell { width: min(680px, calc(100% - 28px)); padding-top: 24px; }
  .simple-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .simple-header { margin-bottom: 22px; }
  .result-head { flex-direction: row; }
  .composer, .result-panel { padding: 20px; }
  .composer textarea { min-height: 170px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .daily-tip { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .daily-tip-side { justify-items: start; }
}
@media (max-width: 380px) {
  .simple-shell { width: calc(100% - 20px); }
  .composer, .result-panel { padding: 16px; }
  .section-card { padding: 14px; }
  .frame-grid { grid-template-columns: minmax(0, 1fr); }
  .result-head h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.result-panel { scroll-margin-top: 16px; }
.result-panel:focus { outline: none; }
.result-panel:focus-visible { outline: 2px solid #8eb49b; outline-offset: 4px; }
.frame-step, .method-item, .result-head > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 380px) {
  .section-title { flex-wrap: wrap; }
  .copy { max-width: 100%; }
}
