:root {
  --ink: #17323c;
  --muted: #60727a;
  --paper: #fffef9;
  --paper-2: #f3f5ec;
  --night: #102f39;
  --night-2: #1d5360;
  --gold: #d8a844;
  --gold-soft: #f7e9bb;
  --green: #22776c;
  --green-2: #0f5d58;
  --green-soft: #e2f2ed;
  --blue-soft: #e8f1f4;
  --warn-soft: #fff3d5;
  --danger-soft: #fff0ec;
  --line: rgba(23, 50, 60, .14);
  --shadow: 0 22px 56px rgba(25, 49, 55, .12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(247, 233, 187, .48), transparent 26rem),
    radial-gradient(circle at 92% 20%, rgba(226, 242, 237, .8), transparent 30rem),
    var(--paper-2);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; left: 12px; top: 12px; width: auto; height: auto; margin: 0; clip: auto;
  z-index: 999; padding: 10px 14px; border-radius: 10px; background: #fff; color: #111;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.site-header {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, rgba(16,47,57,.98), rgba(29,83,96,.95));
}
.site-header::before {
  content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -150px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018);
}
.site-header::after {
  content: ""; position: absolute; width: 7px; height: 7px; left: 10%; top: 30%; border-radius: 50%;
  background: #ffefad; box-shadow: 100px 84px 0 -2px #fff, 310px -38px 0 -2px #f4d178, 550px 78px 0 -2px #fff;
  opacity: .75;
}
.header-inner, .main, .footer-inner { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }
.header-inner { position: relative; z-index: 1; padding: 20px 0 62px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(145deg, #f9e29a, #d8a844); color: #17323c; font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 8px 24px rgba(0,0,0,.18);
}
.brand strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand small { display: block; color: rgba(255,255,255,.68); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.stable-link, .version-chip {
  display: inline-flex; align-items: center; min-height: 34px; padding: 7px 11px; border-radius: 999px;
  font-size: 12px; text-decoration: none; white-space: nowrap;
}
.stable-link { border: 1px solid rgba(255,255,255,.17); color: rgba(255,255,255,.78); }
.stable-link:hover { background: rgba(255,255,255,.08); }
.version-chip { background: rgba(216,168,68,.18); border: 1px solid rgba(247,233,187,.35); color: #ffebb2; }
.version-chip::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #8fe1c8; box-shadow: 0 0 12px #8fe1c8; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 34px; align-items: end; padding-top: 36px; }
.eyebrow { margin: 0 0 8px; color: #f4d987; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 60px); line-height: 1.04; letter-spacing: -.045em; }
.hero-copy { max-width: 730px; margin: 14px 0 0; color: rgba(255,255,255,.78); font-size: clamp(15px, 2vw, 18px); }
.hero-promise { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-promise span { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.86); font-size: 12px; }
.test-note { padding: 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; background: rgba(255,255,255,.07); backdrop-filter: blur(8px); }
.test-note strong { font-size: 15px; }
.test-note p { margin: 7px 0 14px; color: rgba(255,255,255,.7); font-size: 13px; }
.service-status { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.84); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0c65c; box-shadow: 0 0 12px rgba(240,198,92,.75); }
.service-status[data-state="ready"] .status-dot { background: #8fe1c8; box-shadow: 0 0 12px #8fe1c8; }
.service-status[data-state="error"] .status-dot { background: #ff9e88; box-shadow: 0 0 12px #ff9e88; }

.main { margin-top: -30px; padding-bottom: 56px; position: relative; z-index: 2; }
.guide-panel, .response-section { background: rgba(255,254,249,.97); border: 1px solid rgba(255,255,255,.82); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.guide-panel { padding: clamp(22px, 4vw, 34px); }
.step-head, .response-toolbar, .route-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-kicker, .mini-label { margin: 0 0 4px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.guide-panel h2, .response-section h2 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; }
.section-note { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.ghost-button, .secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 12px; cursor: pointer; }
.ghost-button { padding: 8px 12px; }
.ghost-button:hover, .secondary-button:hover { border-color: rgba(34,119,108,.4); background: var(--green-soft); }

.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.role-card { min-height: 112px; padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.role-card:hover { transform: translateY(-2px); border-color: rgba(34,119,108,.38); }
.role-card[aria-pressed="true"] { border: 2px solid var(--green); background: var(--green-soft); padding: 14px; }
.role-icon { display: block; font-size: 20px; margin-bottom: 7px; }
.role-card strong, .role-card small { display: block; }
.role-card strong { font-size: 14px; }
.role-card small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.prompt-area { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.prompt-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 800; }
.prompt-label small { color: var(--muted); font-weight: 400; font-size: 12px; }
.textarea-wrap { position: relative; margin-top: 9px; }
textarea { width: 100%; min-height: 112px; resize: vertical; padding: 15px 16px 30px; border: 1px solid rgba(23,50,60,.18); border-radius: 16px; background: #fff; color: var(--ink); outline: none; }
textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,119,108,.11); }
.char-count { position: absolute; right: 13px; bottom: 8px; color: var(--muted); font-size: 11px; }
.quick-asks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.quick-ask { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; cursor: pointer; }
.quick-ask:hover { border-color: var(--green); color: var(--green-2); background: var(--green-soft); }
.action-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 17px; }
.privacy-note { margin: 0; color: var(--muted); font-size: 12px; }
.primary-button { flex: 0 0 auto; min-width: 160px; min-height: 46px; padding: 11px 18px; border: 0; border-radius: 13px; background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(34,119,108,.2); }
.primary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: wait; transform: none; }

.response-section { margin-top: 20px; padding: clamp(22px, 4vw, 34px); }
.mode-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green-2); border: 1px solid rgba(34,119,108,.18); font-size: 12px; font-weight: 700; }
.mode-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.mode-badge.loading::before { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.72); } }
.understanding-card, .clarification-card, .route-section, .error-card { margin-top: 18px; border-radius: 20px; }
.understanding-card { padding: 20px; background: linear-gradient(135deg, var(--blue-soft), #f7fbfc); border: 1px solid rgba(29,83,96,.13); }
.understanding-heading { display: flex; align-items: flex-start; gap: 13px; }
.understanding-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--night-2); color: #fff; font-weight: 900; }
.understanding-card h3, .clarification-card h3, .route-section h3 { margin: 0; font-size: clamp(19px, 3vw, 24px); line-height: 1.35; }
.understanding-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.fact-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: #fff; border: 1px solid rgba(23,50,60,.12); font-size: 12px; }
.fact-chip strong { color: var(--green-2); }
.understanding-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.clarification-card { padding: 22px; background: var(--warn-soft); border: 1px solid rgba(216,168,68,.28); }
.clarification-note { margin: 8px 0 14px; color: #725d2a; font-size: 13px; }
.clarification-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.clarification-option { padding: 13px 14px; border: 1px solid rgba(174,126,29,.25); border-radius: 14px; background: #fffdf5; color: var(--ink); text-align: left; font-weight: 700; cursor: pointer; }
.clarification-option:hover { border-color: var(--gold); background: #fff; transform: translateY(-1px); }
.route-section { padding-top: 20px; border-top: 1px solid var(--line); }
.route-total { padding: 7px 10px; border-radius: 999px; background: var(--gold-soft); color: #6d531c; font-size: 12px; white-space: nowrap; }
.route-opening { margin: 12px 0 14px; color: var(--muted); }
.route-list { display: grid; gap: 11px; }
.route-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.route-order { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #f8e7b5, #f2d67d); color: #6e541c; font-size: 18px; font-weight: 900; }
.route-copy h4 { margin: 0; font-size: 16px; }
.route-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.route-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.route-meta span { padding: 4px 8px; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 11px; }
.route-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 11px; border: 1px solid rgba(34,119,108,.28); border-radius: 12px; color: var(--green-2); text-decoration: none; font-size: 12px; font-weight: 800; white-space: nowrap; }
.route-link:hover { background: var(--green-soft); }
.route-tip { margin: 13px 0 0; padding: 12px 14px; border-left: 3px solid var(--gold); background: #fff9e9; color: #69582e; font-size: 13px; }
.error-card { padding: 20px; background: var(--danger-soft); border: 1px solid rgba(196,74,52,.18); }
.error-card p { margin: 7px 0 13px; color: #76504a; }
.secondary-button { padding: 9px 13px; }
.loading-box { margin-top: 18px; padding: 18px; border: 1px dashed rgba(34,119,108,.25); border-radius: 16px; background: var(--green-soft); color: var(--green-2); }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.info-card { position: relative; overflow: hidden; min-height: 170px; padding: 22px; border: 1px solid rgba(255,255,255,.8); border-radius: 20px; background: rgba(255,254,249,.86); box-shadow: 0 12px 34px rgba(25,49,55,.07); }
.info-number { position: absolute; right: 15px; top: 7px; color: rgba(34,119,108,.12); font-size: 46px; font-weight: 900; line-height: 1; }
.info-card h3 { position: relative; margin: 0; font-size: 17px; }
.info-card p { position: relative; margin: 9px 0 0; color: var(--muted); font-size: 13px; }

.site-footer { border-top: 1px solid rgba(23,50,60,.1); background: rgba(255,254,249,.76); }
.footer-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--green-2); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: min(90vw, 520px); padding: 11px 15px; border-radius: 12px; background: rgba(16,47,57,.94); color: #fff; font-size: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.2); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .test-note { max-width: 520px; }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
  .route-card { grid-template-columns: 38px minmax(0,1fr); }
  .route-link { grid-column: 2; justify-self: start; }
}
@media (max-width: 620px) {
  .header-inner { padding: 15px 0 48px; }
  .topbar { align-items: flex-start; }
  .brand small { display: none; }
  .stable-link { display: none; }
  .hero-grid { padding-top: 28px; gap: 22px; }
  h1 { font-size: 40px; }
  .main { width: min(calc(100% - 20px), var(--max)); margin-top: -22px; }
  .guide-panel, .response-section { border-radius: 22px; padding: 20px 15px; }
  .step-head, .response-toolbar, .route-head { align-items: flex-start; }
  .ghost-button { font-size: 12px; padding: 7px 9px; }
  .role-grid { gap: 9px; }
  .role-card { min-height: 105px; padding: 13px; }
  .role-card[aria-pressed="true"] { padding: 12px; }
  .prompt-label, .action-row, .footer-inner { align-items: flex-start; flex-direction: column; }
  .primary-button { width: 100%; }
  .clarification-options { grid-template-columns: 1fr; }
  .understanding-facts { gap: 6px; }
  .fact-chip { font-size: 11px; }
  .route-card { padding: 14px; gap: 11px; }
  .route-copy p { font-size: 12px; }
  .footer-inner { padding: 18px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 620px) {
  .brand strong { font-size: 13px; white-space: nowrap; }
  .version-chip { padding: 5px 7px; font-size: 10px; }
  .version-chip::before { width: 6px; height: 6px; margin-right: 5px; }
  .ghost-button { flex: 0 0 auto; min-width: 68px; white-space: nowrap; }
}

/* D.2 真实访客体验优化 */
.understanding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}
.understanding-actions .understanding-note { margin: 0; }
.text-button {
  flex: 0 0 auto;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--green-2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: var(--night); }

.route-card:first-child {
  border-color: rgba(216,168,68,.5);
  box-shadow: 0 10px 28px rgba(216,168,68,.12);
  background: linear-gradient(135deg, #fffdf6, #fff);
}
.route-card:first-child .route-order::after {
  content: "先去";
  position: absolute;
  width: max-content;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  color: #8b6a24;
  font-size: 9px;
  font-weight: 800;
}
.route-card:first-child .route-order { position: relative; margin-bottom: 12px; }

.feedback-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(34,119,108,.17);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(226,242,237,.72), rgba(255,254,249,.92));
}
.feedback-panel h4 { margin: 0; font-size: 17px; }
.feedback-panel > div:first-child > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}
.feedback-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.feedback-button:hover { border-color: var(--green); background: var(--green-soft); }
.feedback-button.positive { border-color: rgba(34,119,108,.28); color: var(--green-2); }
.feedback-button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.feedback-button:disabled { opacity: .62; cursor: default; }
.feedback-status { min-height: 20px; margin: 9px 0 0; color: var(--green-2); font-size: 12px; }

@media (max-width: 620px) {
  .understanding-actions { align-items: flex-start; flex-direction: column; gap: 8px; }
  .feedback-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .feedback-button { text-align: center; }
}
