:root {
  --ink: #171713;
  --ink-soft: #2a2a24;
  --paper: #f6f5f0;
  --surface: #ffffff;
  --line: #d8d5ca;
  --muted: #6f6d65;
  --gold: #c89b3c;
  --gold-dark: #7c5b1c;
  --gold-pale: #f2e7cc;
  --green: #297553;
  --red: #a64132;
  --shadow: 0 14px 34px rgba(23, 23, 19, 0.09);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tap-min: 44px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

button:disabled:active {
  transform: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(200, 155, 60, 0.32);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px;
  color: #f5f1e7;
  background: var(--ink);
  border-right: 1px solid #3b3a32;
}

.brand-block {
  padding: 6px 6px 22px;
  border-bottom: 1px solid #3c3a31;
}

.brand-mark,
.eyebrow,
.dialog-kicker {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.brand-block h1 {
  margin: 10px 0 5px;
  font-size: 27px;
  line-height: 1.2;
}

.brand-block p {
  margin: 0;
  color: #bdb9ac;
  font-size: 14px;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 18px 0;
  padding: 4px;
  background: #24241f;
  border: 1px solid #3c3a31;
  border-radius: 7px;
}

.view-tabs button {
  min-height: 38px;
  color: #aaa69a;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-weight: 700;
}

.view-tabs button.active {
  color: var(--ink);
  background: var(--gold);
}

.side-section {
  padding: 2px 0 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-bottom: 8px;
  color: #cbc7bb;
  font-size: 13px;
  font-weight: 700;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--ink);
  background: var(--gold);
  border: 0;
  border-radius: 5px;
  font-size: 22px;
  line-height: 1;
}

.project-list {
  display: grid;
  gap: 5px;
}

.project-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  color: #dedbd1;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.project-item:hover {
  background: #24241f;
}

.project-item.active {
  color: #fff;
  background: #2d2c25;
  border-color: #5a513b;
}

.project-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  background: var(--gold-pale);
  border-radius: 6px;
  font-weight: 800;
}

.project-item span:last-child {
  min-width: 0;
}

.project-item strong,
.project-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item strong {
  font-size: 14px;
}

.project-item small {
  margin-top: 3px;
  color: #8f8b80;
  font-size: 11px;
}

.store-profile {
  padding: 16px 8px 8px;
  border-top: 1px solid #3c3a31;
}

.profile-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
}

.store-profile h2 {
  margin: 6px 0;
  font-size: 18px;
}

.profile-name-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.type-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--ink);
  background: var(--gold);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.store-profile > p {
  margin: 0 0 13px;
  color: #a8a499;
  font-size: 12px;
  line-height: 1.6;
}

.profile-facts {
  margin: 0;
}

.profile-facts div {
  padding: 9px 0;
  border-top: 1px solid #34332c;
}

.profile-facts dt {
  margin-bottom: 3px;
  color: #7f7b71;
  font-size: 11px;
}

.profile-facts dd {
  margin: 0;
  color: #d3d0c5;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.coach-chip {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 13px;
  padding: 11px;
  background: #24241f;
  border: 1px solid #3c3a31;
  border-radius: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  background: #4db47e;
  border-radius: 50%;
}

.coach-chip strong,
.coach-chip small {
  display: block;
}

.coach-chip strong {
  color: #f1eee4;
  font-size: 12px;
}

.coach-chip small {
  margin-top: 3px;
  color: #8f8b80;
  font-size: 11px;
  line-height: 1.45;
}

.config-alert {
  margin: 14px 6px;
  padding: 12px;
  color: #ffdad3;
  background: #4b2822;
  border: 1px solid #79433a;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.main {
  min-width: 0;
  padding: 24px 30px 40px;
}

.topbar {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  max-width: 1320px;
  min-height: 66px;
  margin: 0 auto 18px;
}

.topbar h2 {
  margin: 5px 0 0;
  font-size: 25px;
  line-height: 1.25;
}

.model-status {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.model-status label {
  display: flex;
  gap: 7px;
  align-items: center;
}

.model-status select {
  max-width: 180px;
  height: 34px;
  padding: 0 28px 0 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.focus-band {
  display: flex;
  gap: 30px;
  align-items: end;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto 14px;
  padding: 22px 24px;
  color: #f7f3e9;
  background: var(--ink-soft);
  border-left: 5px solid var(--gold);
  border-radius: 6px;
}

.focus-band h3 {
  max-width: 820px;
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.45;
}

.focus-band p {
  margin: 0;
  color: #aaa69b;
  font-size: 13px;
  white-space: nowrap;
}

.focus-tag {
  display: inline-block;
  padding: 4px 8px;
  color: var(--gold-pale);
  background: var(--gold-dark);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.demo-questions {
  max-width: 1320px;
  margin: 0 auto 14px;
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.demo-question-head {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.demo-question-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.demo-question-head > span {
  color: var(--muted);
  font-size: 11px;
}

.question-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.demo-question {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  color: var(--ink-soft);
  background: #f7f3e8;
  border: 1px solid #d7c99f;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.demo-question:hover {
  color: var(--gold-dark);
  background: var(--gold-pale);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto 14px;
}

.result-card {
  display: flex;
  min-width: 0;
  min-height: 244px;
  padding: 18px;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.result-card-primary {
  border-top: 4px solid var(--gold);
  padding-top: 15px;
}

.result-number {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
}

.result-card h3 {
  margin: 12px 0 7px;
  font-size: 18px;
}

.result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.result-card strong {
  display: block;
  margin: auto 0 12px;
  padding-top: 14px;
  color: var(--green);
  font-size: 12px;
}

.primary,
.secondary,
.package-btn,
.text-btn,
.mini-actions button {
  min-height: 38px;
  border-radius: 5px;
  font-weight: 700;
}

.primary {
  color: var(--ink);
  background: var(--gold);
  border: 1px solid var(--gold);
}

.primary:hover {
  background: #d4aa50;
}

.secondary,
.package-btn {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #b8b3a4;
}

.secondary:hover,
.package-btn:hover {
  border-color: var(--gold-dark);
  background: #fbf7ed;
}

.work-panel {
  min-width: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(280px, 0.75fr);
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto;
}

.work-panel-head {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.work-panel-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.mini-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-actions button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--ink-soft);
  background: #f7f5ee;
  border: 1px solid var(--line);
  font-size: 12px;
}

.chat-window {
  min-height: 300px;
  max-height: 540px;
  overflow-y: auto;
  padding: 20px;
  background: #faf9f5;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 250px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.empty-state span {
  max-width: 520px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.message {
  max-width: 880px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.message.user {
  margin-left: auto;
  background: #f3ead5;
  border-color: #ddc999;
}

.message.assistant {
  margin-right: auto;
  border-left: 4px solid var(--gold);
}

.message-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.message-meta span {
  color: var(--ink);
  font-weight: 800;
}

.message-meta time {
  margin-right: auto;
}

.copy-btn {
  padding: 4px 7px;
  color: var(--gold-dark);
  background: transparent;
  border: 1px solid #ccb77c;
  border-radius: 4px;
  font-size: 11px;
}

.message-content {
  color: #33332e;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.composer {
  padding: 15px;
  border-top: 1px solid var(--line);
}

.composer textarea,
dialog textarea,
dialog input {
  width: 100%;
  color: var(--ink);
  background: #fbfaf7;
  border: 1px solid #c9c5ba;
  border-radius: 5px;
}

.composer textarea {
  min-height: 84px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

.composer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.composer-actions > div {
  display: flex;
  gap: 5px;
}

.composer-actions .primary {
  min-width: 158px;
  padding: 0 16px;
}

.text-btn {
  min-height: 34px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
}

.text-btn:hover {
  color: var(--ink);
  background: #f1efe8;
}

.memory-panel {
  min-width: 0;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.memory-head {
  padding: 17px;
  border-bottom: 1px solid var(--line);
}

.memory-head h3 {
  margin: 5px 0;
  font-size: 18px;
}

.memory-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.record-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 10px;
  background: #f7f5ee;
  border-bottom: 1px solid var(--line);
}

.record-filters button {
  display: flex;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
}

.record-filters button.active {
  color: var(--ink);
  background: var(--gold-pale);
  border-color: #cdb779;
  font-weight: 800;
}

.record-filters button strong {
  color: var(--gold-dark);
}

.records-list {
  display: grid;
  gap: 0;
  max-height: 560px;
  overflow-y: auto;
}

.record-item {
  border-bottom: 1px solid var(--line);
}

.record-item:last-child {
  border-bottom: 0;
}

.record-item summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.record-item summary::-webkit-details-marker {
  display: none;
}

.record-item summary span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.record-item summary strong {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.45;
}

.record-item summary time {
  color: var(--muted);
  font-size: 9px;
}

.record-item[open] summary {
  background: #faf7ef;
}

.record-content {
  padding: 0 12px 13px;
}

.record-content small {
  display: block;
  padding: 7px;
  color: var(--gold-dark);
  background: var(--gold-pale);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.5;
}

.record-content p {
  margin: 9px 0 0;
  color: #4e4c45;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.records-empty {
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
}

.coach-page {
  padding-bottom: 60px;
}

/* 会员增长页面样式 */
.membership-page {
  padding-bottom: 60px;
}

.membership-hero {
  max-width: 1320px;
  margin: 0 auto 12px;
  padding: 34px;
  color: #f6f1e6;
  background: var(--ink-soft);
  border-left: 5px solid var(--gold);
  border-radius: 7px;
}

.membership-hero h3 {
  max-width: 850px;
  margin: 12px 0 10px;
  font-size: 28px;
  line-height: 1.45;
}

.membership-hero p {
  max-width: 800px;
  margin: 0;
  color: #bdb9ad;
  line-height: 1.75;
}

.four-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto 28px;
}

.four-steps article {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.four-steps span {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 800;
}

.four-steps h3 {
  margin: 10px 0 7px;
  font-size: 17px;
}

.four-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.membership-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(280px, 0.75fr);
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto;
}

.membership-panel {
  min-width: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.membership-panel-head {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.membership-panel-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.membership-summary {
  min-width: 0;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.summary-head {
  padding: 17px;
  border-bottom: 1px solid var(--line);
}

.summary-head h3 {
  margin: 5px 0;
  font-size: 18px;
}

.summary-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.summary-content {
  padding: 17px;
  max-height: 600px;
  overflow-y: auto;
}

.summary-empty {
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}

.summary-item {
  margin-bottom: 16px;
  padding: 12px;
  background: #faf9f5;
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}

.summary-item h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink);
}

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

.summary-item .metric {
  display: inline-block;
  margin: 4px 8px 4px 0;
  padding: 4px 8px;
  background: var(--gold-pale);
  border-radius: 3px;
  font-size: 11px;
  color: var(--gold-dark);
  font-weight: 600;
}

.coach-hero {
  max-width: 1320px;
  margin: 0 auto 12px;
  padding: 34px;
  color: #f6f1e6;
  background: var(--ink-soft);
  border-left: 5px solid var(--gold);
  border-radius: 7px;
}

.coach-hero h3 {
  max-width: 850px;
  margin: 12px 0 10px;
  font-size: 28px;
  line-height: 1.45;
}

.coach-hero p {
  max-width: 800px;
  margin: 0;
  color: #bdb9ad;
  line-height: 1.75;
}

.five-step {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto 28px;
}

.five-step article {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.five-step span {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 800;
}

.five-step h3 {
  margin: 10px 0 7px;
  font-size: 17px;
}

.five-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.restaurant-type-section,
.coach-dialogue {
  max-width: 1320px;
  margin: 0 auto 28px;
}

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

.restaurant-types article {
  display: grid;
  gap: 7px;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 7px;
}

.restaurant-types strong {
  font-size: 17px;
}

.restaurant-types span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.coach-dialogue {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.coach-dialogue article {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.coach-dialogue h3 {
  margin: 6px 0 12px;
  font-size: 18px;
}

.coach-dialogue ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.service-section {
  max-width: 1320px;
  margin: 0 auto 28px;
}

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

.section-heading h3 {
  margin: 5px 0;
  font-size: 23px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.price-card {
  display: flex;
  min-height: 290px;
  padding: 22px;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.price-card.featured {
  border-top: 5px solid var(--gold);
  padding-top: 18px;
  box-shadow: var(--shadow);
}

.price-card > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.price-card h3 {
  margin: 14px 0 2px;
  font-size: 15px;
}

.price-card h3 strong {
  margin-right: 3px;
  font-size: 38px;
}

.price-card h4 {
  margin: 4px 0 10px;
  font-size: 18px;
}

.price-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.price-card button {
  width: 100%;
  margin-top: auto;
  padding: 0 12px;
}

.coach-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 30px;
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px;
  background: #ece9df;
  border-left: 5px solid var(--green);
  border-radius: 7px;
}

.profile-seal {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.coach-profile h3 {
  max-width: 700px;
  margin: 8px 0 0;
  font-size: 21px;
  line-height: 1.55;
}

.coach-profile ul {
  margin: 0;
  padding-left: 20px;
  color: #55534c;
  font-size: 13px;
  line-height: 2;
}

dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: 88vh;
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #bdb8aa;
  border-radius: 7px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(18, 18, 15, 0.66);
}

dialog form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

dialog h3 {
  margin: 0 0 5px;
  font-size: 22px;
}

dialog label {
  display: grid;
  gap: 6px;
  color: #4c4b45;
  font-size: 13px;
  font-weight: 700;
}

dialog input,
dialog textarea,
dialog select {
  padding: 10px;
  font-weight: 400;
  line-height: 1.55;
  resize: vertical;
}

dialog select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  color: var(--ink);
  background: #fbfaf7;
  border: 1px solid #c9c5ba;
  border-radius: 5px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 4px;
}

.dialog-actions button {
  min-width: 100px;
  padding: 0 14px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

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

  .work-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .memory-panel {
    align-self: stretch;
  }

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

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

  .result-card {
    min-height: 220px;
  }

  .model-status span {
    display: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--safe-top));
    padding: 16px;
    padding-top: calc(16px + var(--safe-top));
    border-right: none;
    border-bottom: 1px solid #3b3a32;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .brand-block {
    padding-bottom: 12px;
  }

  .brand-block h1 {
    font-size: 22px;
  }

  .side-section {
    padding-bottom: 8px;
  }

  .project-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .project-list::-webkit-scrollbar {
    display: none;
  }

  .project-item {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 220px;
  }

  .store-profile {
    display: none;
  }

  .main {
    padding: 16px 12px 32px;
    padding-bottom: calc(32px + var(--safe-bottom));
  }

  .topbar,
  .focus-band,
  .work-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .model-status {
    width: 100%;
  }

  .model-status label {
    width: 100%;
    justify-content: space-between;
  }

  .model-status select {
    flex: 1;
  }

  .focus-band {
    gap: 12px;
    padding: 16px;
  }

  .focus-band h3 {
    font-size: 18px;
  }

  .focus-band p {
    white-space: normal;
    font-size: 12px;
  }

  .five-step,
  .coach-dialogue,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .price-card {
    min-height: 250px;
  }

  .coach-profile {
    grid-template-columns: 1fr;
  }

  .chat-window {
    min-height: 280px;
    max-height: 60vh;
  }

  .message {
    padding: 12px 14px;
  }

  .message-content {
    font-size: 14px;
    line-height: 1.7;
  }

  .composer {
    padding: 12px;
  }

  .composer textarea {
    min-height: 70px;
    font-size: 15px;
  }

  .composer-actions {
    gap: 8px;
  }

  .composer-actions .primary {
    min-width: 120px;
  }

  .memory-panel {
    max-height: 50vh;
  }

  .records-list {
    max-height: 40vh;
  }

  .record-item summary {
    padding: 14px 12px;
  }

  .record-content {
    padding: 0 12px 14px;
  }

  dialog {
    width: min(100vw - 24px, 620px);
    max-height: 90vh;
    margin: auto;
  }

  dialog form {
    padding: 20px 16px;
    gap: 12px;
  }

  dialog h3 {
    font-size: 20px;
  }

  dialog textarea,
  dialog input {
    font-size: 15px;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 12px 8px 24px;
    padding-bottom: calc(24px + var(--safe-bottom));
  }

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

  .result-card {
    min-height: 210px;
  }

  .focus-band,
  .coach-hero {
    padding: 16px;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    border-left-width: 4px;
  }

  .focus-band h3,
  .coach-hero h3 {
    font-size: 18px;
  }

  .work-panel-head {
    padding: 12px;
    min-height: 60px;
  }

  .work-panel-head h3 {
    font-size: 15px;
  }

  .mini-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .mini-actions button {
    flex: 1;
    min-height: var(--tap-min);
  }

  .demo-question-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .demo-question-head h3 {
    font-size: 15px;
  }

  .question-row {
    width: 100%;
    gap: 8px;
  }

  .demo-question {
    min-height: var(--tap-min);
    padding: 0 14px;
    font-size: 13px;
  }

  .chat-window {
    padding: 10px;
    max-height: 55vh;
  }

  .message {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 10px 12px;
  }

  .message.assistant {
    border-left-width: 3px;
  }

  .message-meta {
    font-size: 10px;
  }

  .message-content {
    font-size: 13px;
    line-height: 1.65;
  }

  .composer {
    padding: 10px;
    padding-bottom: calc(10px + var(--safe-bottom));
  }

  .composer textarea {
    min-height: 60px;
    padding: 10px;
    font-size: 14px;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .composer-actions .primary {
    width: 100%;
    min-height: var(--tap-min);
  }

  .composer-actions > div {
    width: 100%;
    justify-content: space-between;
  }

  .text-btn {
    min-height: var(--tap-min);
    padding: 0 12px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .dialog-actions button {
    width: 100%;
    min-height: var(--tap-min);
  }

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

  .restaurant-types {
    grid-template-columns: 1fr;
  }

  .record-filters {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px;
  }

  .record-filters button {
    min-height: var(--tap-min);
    padding: 0 10px;
    font-size: 11px;
  }

  .view-tabs button {
    min-height: var(--tap-min);
  }

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

/* 超小屏幕优化 */
@media (max-width: 375px) {
  .brand-block h1 {
    font-size: 20px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .focus-band h3,
  .coach-hero h3 {
    font-size: 16px;
  }

  .project-item {
    min-width: 160px;
  }
}

/* Toast 提示样式 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(23, 23, 19, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Loading 动画 */
.message-content:has(.loading-dots) {
  display: flex;
  align-items: center;
  gap: 4px;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: loading-bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loading-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* 错误消息样式 */
.message-content:has(.error-icon) {
  color: var(--red);
}

.error-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 16px;
}
