/* ═══════════════════════════════════════════════════════
   松赞AI客服 - 松赞风格设计系统
   色调：暖棕 + 藏红 + 金色点缀，温暖高级
   ═══════════════════════════════════════════════════════ */

:root {
  /* 松赞品牌色 */
  --sz-brown:      #5C3D2E;
  --sz-brown-light:#8B6F5E;
  --sz-brown-dark: #3E2518;
  --sz-cream:      #FBF7F2;
  --sz-warm-white: #F5EDE4;
  --sz-gold:       #C9A96E;
  --sz-gold-light: #E5D4B0;
  --sz-red:        #A0382E;
  --sz-red-light:  #C45B52;
  --sz-sage:       #7A8B6F;
  --sz-text:       #3A2E28;
  --sz-text-light: #7A6E66;
  --sz-border:     #E8DDD3;
  --sz-shadow:     rgba(92, 61, 46, 0.08);
  --sz-shadow-md:  rgba(92, 61, 46, 0.12);

  /* 间距 */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-full: 9999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--sz-cream);
  color: var(--sz-text);
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 860px;
  margin: 0 auto;
  background: white;
  box-shadow: 0 0 60px var(--sz-shadow);
}

/* ── 头部 ─────────────────────────────────────────── */
.header {
  background: linear-gradient(135deg, var(--sz-brown-dark) 0%, var(--sz-brown) 100%);
  color: white;
  padding: var(--sp-md) var(--sp-lg);
  flex-shrink: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--sz-gold);
  color: var(--sz-brown-dark);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
}

.brand-text h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
}

.brand-text p {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
  letter-spacing: 1px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.85;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ADE80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── 聊天区域 ────────────────────────────────────── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-lg);
  background: var(--sz-cream);
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(201,169,110,0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(160,56,46,0.03) 0%, transparent 50%);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

/* ── 消息气泡 ────────────────────────────────────── */
.message {
  display: flex;
  gap: var(--sp-md);
  max-width: 85%;
  animation: fadeSlideUp 0.3s ease-out;
}

.msg-timestamp {
  align-self: center;
  font-size: 11px;
  color: #9E9690;
  padding: 2px 12px;
  margin-bottom: -12px;
  line-height: 1.4;
}

.bot-message { align-self: flex-start; }
.user-message { align-self: flex-end; flex-direction: row-reverse; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.bot-avatar {
  background: linear-gradient(135deg, var(--sz-brown) 0%, var(--sz-brown-light) 100%);
  color: var(--sz-gold-light);
  font-family: 'Noto Serif SC', serif;
}

.user-avatar {
  background: linear-gradient(135deg, var(--sz-gold) 0%, var(--sz-gold-light) 100%);
  color: var(--sz-brown-dark);
}

.bubble {
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--r-lg);
  line-height: 1.7;
  font-size: 14.5px;
  position: relative;
}

.bot-bubble {
  background: white;
  color: var(--sz-text);
  border: 1px solid var(--sz-border);
  border-top-left-radius: var(--sp-xs);
  box-shadow: 0 2px 12px var(--sz-shadow);
}

.bot-bubble p { margin-bottom: 4px; }
.bot-bubble p:last-child { margin-bottom: 0; }

/* renderMarkdown 生成的段落：紧凑间距，消除空白行 */
.bot-bubble .md-p {
  margin: 0 0 6px 0;
  line-height: 1.7;
}
.bot-bubble .md-p:last-child { margin-bottom: 0; }

/* 编号标题行（如 "1. 路线名称"）：加粗 + 品牌棕红色 */
.bot-bubble .md-num-title {
  display: block;
  font-weight: 700;
  color: var(--sz-brown-dark);
  font-size: 14.5px;
  margin-bottom: 1px;
}

/* 列表容器 */
.bot-bubble .md-list {
  margin: 6px 0;
  padding: 8px 12px;
  background: var(--sz-cream);
  border-left: 3px solid var(--sz-gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.bot-bubble .md-list:last-child { margin-bottom: 0; }

/* 列表项：加粗高亮 */
.bot-bubble .md-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-weight: 600;
  color: var(--sz-brown);
  line-height: 1.6;
}
.bot-bubble .md-item + .md-item {
  border-top: 1px dashed var(--sz-border);
}
.bot-bubble .md-item::before {
  content: '▸';
  color: var(--sz-gold);
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 标题 */
.bot-bubble .md-h3 {
  font-family: 'Noto Serif SC', serif;
  color: var(--sz-brown);
  font-size: 15px;
  font-weight: 600;
  margin: 10px 0 4px;
}
.bot-bubble .md-h4 {
  font-family: 'Noto Serif SC', serif;
  color: var(--sz-brown);
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 4px;
}

.user-bubble {
  background: linear-gradient(135deg, var(--sz-brown) 0%, var(--sz-brown-light) 100%);
  color: white;
  border-top-right-radius: var(--sp-xs);
}

/* Markdown 样式 */
.bot-bubble strong { color: var(--sz-brown); font-weight: 600; }
.bot-bubble em { color: var(--sz-red); font-style: normal; }
.bot-bubble ul, .bot-bubble ol { padding-left: 20px; margin: 8px 0; }
.bot-bubble li { margin-bottom: 4px; }
.bot-bubble code {
  background: var(--sz-warm-white);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.bot-bubble h3, .bot-bubble h4 {
  font-family: 'Noto Serif SC', serif;
  color: var(--sz-brown);
  margin: 12px 0 6px;
}

/* ── 加载动画 ────────────────────────────────────── */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 14px 20px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--sz-brown-light);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ── 工具调用提示 ──────────────────────────────── */
.tool-indicator {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--sz-warm-white);
  border: 1px dashed var(--sz-border);
  border-radius: var(--r-full);
  font-size: 12px;
  color: var(--sz-text-light);
  animation: fadeSlideUp 0.3s ease-out;
}

.tool-indicator .tool-icon {
  width: 18px;
  height: 18px;
  background: var(--sz-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  animation: spin 1.5s linear infinite;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── 输入区域 ────────────────────────────────────── */
.input-area {
  padding: var(--sp-md) var(--sp-lg) var(--sp-lg);
  background: white;
  border-top: 1px solid var(--sz-border);
  flex-shrink: 0;
}

.input-inner {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-sm);
  background: var(--sz-cream);
  border: 2px solid var(--sz-border);
  border-radius: var(--r-lg);
  padding: var(--sp-sm) var(--sp-sm) var(--sp-sm) var(--sp-md);
  transition: border-color 0.2s;
}

.input-inner:focus-within {
  border-color: var(--sz-gold);
}

#userInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--sz-text);
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 120px;
  padding: 6px 0;
}

#userInput::placeholder {
  color: var(--sz-text-light);
  opacity: 0.6;
}

#sendBtn {
  width: 42px;
  height: 42px;
  background: var(--sz-brown);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

#sendBtn:hover {
  background: var(--sz-brown-dark);
  transform: scale(1.05);
}

#sendBtn:disabled {
  background: var(--sz-border);
  cursor: not-allowed;
  transform: none;
}

/* ── 需求收集表单卡片 ─────────────────────────── */
.form-card {
  background: white;
  border: 1px solid var(--sz-border);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  box-shadow: 0 4px 20px var(--sz-shadow);
  max-width: 520px;
  animation: fadeSlideUp 0.4s ease-out;
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-md);
  border-bottom: 2px solid var(--sz-gold-light);
}

.form-card-header .icon {
  font-size: 24px;
}

.form-card-header h3 {
  font-family: 'Noto Serif SC', serif;
  color: var(--sz-brown);
  font-size: 16px;
}

.form-card-header p {
  font-size: 13px;
  color: var(--sz-text-light);
  margin-top: 2px;
}

/* 表单网格布局 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md) 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field-half {
  grid-column: span 1;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--sz-brown);
  margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--sz-border);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--sz-text);
  background: var(--sz-cream);
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--sz-gold);
  background: white;
}

.form-field .date-row {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
}

.form-field .date-row input { flex: 1; }
.form-field .date-row span { color: var(--sz-text-light); font-size: 13px; }

/* 多选标签 */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  padding: 6px 14px;
  border: 1px solid var(--sz-border);
  border-radius: var(--r-full);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  background: var(--sz-cream);
}

.tag-option:hover {
  border-color: var(--sz-gold);
}

.tag-option.selected {
  background: var(--sz-brown);
  color: white;
  border-color: var(--sz-brown);
}

.form-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--sz-brown) 0%, var(--sz-brown-light) 100%);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: var(--sp-md);
  transition: all 0.2s;
  letter-spacing: 1px;
}

.form-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--sz-shadow-md);
}

/* ── 方案弹窗 ────────────────────────────────────── */
.plan-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.plan-modal {
  width: 90%;
  max-width: 780px;
  max-height: 90vh;
  background: white;
  border-radius: var(--r-md);
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.plan-close {
  position: sticky;
  top: 12px;
  float: right;
  margin-right: 12px;
  width: 36px;
  height: 36px;
  background: var(--sz-warm-white);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  color: var(--sz-text);
}

.plan-content {
  padding: var(--sp-2xl);
}

/* 方案头部 */
.plan-hero {
  text-align: center;
  padding-bottom: var(--sp-xl);
  border-bottom: 2px solid var(--sz-gold-light);
  margin-bottom: var(--sp-xl);
}

.plan-hero .plan-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  color: var(--sz-gold);
  letter-spacing: 4px;
  margin-bottom: var(--sp-md);
}

.plan-hero h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  color: var(--sz-brown-dark);
  margin-bottom: 8px;
  line-height: 1.4;
}

.plan-hero .plan-subtitle {
  font-size: 14px;
  color: var(--sz-text-light);
  line-height: 1.6;
}

.plan-hero img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--r-sm);
  margin-top: var(--sp-lg);
}

/* 方案信息栏 */
.plan-info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-md);
  padding: var(--sp-lg);
  background: var(--sz-cream);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-xl);
}

.plan-info-item {
  text-align: center;
}

.plan-info-item .label {
  font-size: 12px;
  color: var(--sz-text-light);
  margin-bottom: 4px;
}

.plan-info-item .value {
  font-size: 16px;
  font-weight: 600;
  color: var(--sz-brown);
}

.plan-info-item .value.price {
  color: var(--sz-red);
  font-size: 20px;
}

/* 行程天 */
.plan-section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: var(--sz-brown);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.plan-section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--sz-gold);
  border-radius: 2px;
}

.itinerary-day {
  display: flex;
  gap: var(--sp-lg);
  padding: var(--sp-lg) 0;
  border-bottom: 1px solid var(--sz-border);
}

.itinerary-day:last-child { border-bottom: none; }

.day-badge {
  width: 48px;
  height: 48px;
  background: var(--sz-brown);
  color: var(--sz-gold-light);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  line-height: 1.2;
}

.day-badge .day-num {
  font-size: 18px;
  font-weight: 700;
}

.day-info { flex: 1; }
.day-info .route {
  font-size: 13px;
  color: var(--sz-gold);
  font-weight: 500;
  margin-bottom: 6px;
}

.day-info .day-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--sz-text);
}

/* 方案底部 */
.plan-footer {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 2px solid var(--sz-gold-light);
  text-align: center;
}

.plan-footer .total-price {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  color: var(--sz-red);
  font-weight: 700;
}

.plan-footer .price-note {
  font-size: 13px;
  color: var(--sz-text-light);
  margin-top: 4px;
}

/* ── 订单确认卡片 ────────────────────────────────── */
.order-card {
  background: linear-gradient(135deg, #FEF9F3 0%, #FBF3EA 100%);
  border: 2px solid var(--sz-gold-light);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  text-align: center;
  animation: fadeSlideUp 0.4s ease-out;
  max-width: 400px;
}

.order-card .check-icon {
  width: 48px;
  height: 48px;
  background: var(--sz-sage);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto var(--sp-md);
}

.order-card h3 {
  font-family: 'Noto Serif SC', serif;
  color: var(--sz-brown);
  margin-bottom: var(--sp-sm);
}

.order-card .order-id {
  font-size: 13px;
  color: var(--sz-text-light);
  margin-bottom: var(--sp-md);
}

.order-card .order-details {
  text-align: left;
  font-size: 14px;
  line-height: 2;
  color: var(--sz-text);
}

/* ── 方案预览卡片（在聊天中） ───────────────────── */
.plan-preview-card {
  background: white;
  border: 1px solid var(--sz-border);
  border-radius: var(--r-md);
  overflow: hidden;
  max-width: 420px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 12px var(--sz-shadow);
}

.plan-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--sz-shadow-md);
}

.plan-preview-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.plan-preview-card .preview-body {
  padding: var(--sp-md);
}

.plan-preview-card h4 {
  font-family: 'Noto Serif SC', serif;
  color: var(--sz-brown);
  font-size: 15px;
  margin-bottom: 6px;
}

.plan-preview-card .preview-price {
  color: var(--sz-red);
  font-weight: 600;
}

.plan-preview-card .preview-btn {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--sz-cream);
  color: var(--sz-brown);
  font-size: 13px;
  font-weight: 500;
  border-top: 1px solid var(--sz-border);
}

/* ── 动画 ────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-in { animation: fadeSlideUp 0.4s ease-out; }

/* ── 滚动条 ──────────────────────────────────────── */
.chat-area::-webkit-scrollbar { width: 6px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb {
  background: var(--sz-border);
  border-radius: 3px;
}
.chat-area::-webkit-scrollbar-thumb:hover { background: var(--sz-brown-light); }

.plan-modal::-webkit-scrollbar { width: 6px; }
.plan-modal::-webkit-scrollbar-track { background: transparent; }
.plan-modal::-webkit-scrollbar-thumb {
  background: var(--sz-border);
  border-radius: 3px;
}

/* ── 方案H5底部悬浮支付按钮 ───────────────────── */
.plan-sticky-pay {
  position: sticky;
  bottom: 0;
  padding: 12px 24px 16px;
  background: linear-gradient(to top, white 70%, rgba(255,255,255,0));
  border-top: 1px solid var(--sz-border);
}

.plan-pay-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--sz-red) 0%, #B84A40 100%);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.plan-pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(160, 56, 46, 0.3);
}

.plan-pay-price {
  font-size: 18px;
  font-weight: 700;
}

/* ── 模拟支付弹窗 ────────────────────────────────── */
.pay-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.pay-modal {
  width: 380px;
  max-width: 90%;
  background: white;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeSlideUp 0.3s ease-out;
}

/* 支付弹窗头部 */
.pay-header {
  background: linear-gradient(135deg, var(--sz-brown-dark) 0%, var(--sz-brown) 100%);
  color: white;
  padding: 20px 24px;
  text-align: center;
}

.pay-header .pay-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 12px;
  letter-spacing: 3px;
  opacity: 0.7;
  margin-bottom: 8px;
}

.pay-header .pay-amount {
  font-family: 'Noto Serif SC', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--sz-gold-light);
}

.pay-header .pay-desc {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 6px;
}

/* 支付弹窗内容 */
.pay-body {
  padding: 20px 24px;
}

.pay-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--sz-text);
  border-bottom: 1px solid var(--sz-border);
}

.pay-info-row:last-child { border-bottom: none; }

.pay-info-row .pay-label {
  color: var(--sz-text-light);
}

/* 支付方式选择 */
.pay-methods {
  margin-top: 16px;
}

.pay-methods-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--sz-brown);
  margin-bottom: 10px;
}

.pay-method-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--sz-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}

.pay-method:hover { border-color: var(--sz-gold); }

.pay-method.selected {
  border-color: var(--sz-brown);
  background: var(--sz-cream);
}

.pay-method .pay-method-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.pay-method .pay-method-radio {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border: 2px solid var(--sz-border);
  border-radius: 50%;
  position: relative;
}

.pay-method.selected .pay-method-radio {
  border-color: var(--sz-brown);
}

.pay-method.selected .pay-method-radio::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  background: var(--sz-brown);
  border-radius: 50%;
}

/* 支付按钮 */
.pay-footer {
  padding: 0 24px 20px;
}

.pay-confirm-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--sz-red) 0%, #B84A40 100%);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pay-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(160, 56, 46, 0.3);
}

.pay-confirm-btn:disabled {
  background: var(--sz-border);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pay-mock-note {
  text-align: center;
  font-size: 11px;
  color: var(--sz-text-light);
  margin-top: 12px;
  opacity: 0.7;
}

/* 支付处理中 */
.pay-processing {
  text-align: center;
  padding: 40px 24px;
}

.pay-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--sz-border);
  border-top: 3px solid var(--sz-brown);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

.pay-processing-text {
  font-size: 15px;
  color: var(--sz-text);
}

/* 支付成功 */
.pay-success {
  text-align: center;
  padding: 40px 24px;
}

.pay-success-icon {
  width: 56px;
  height: 56px;
  background: var(--sz-sage);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  animation: fadeSlideUp 0.4s ease-out;
}

.pay-success-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: var(--sz-brown);
  margin-bottom: 6px;
}

.pay-success-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--sz-red);
  margin-bottom: 12px;
}

.pay-success-hint {
  font-size: 13px;
  color: var(--sz-text-light);
}

/* 方案预览卡片支付按钮 */
.preview-pay-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px;
  background: linear-gradient(135deg, var(--sz-red) 0%, #B84A40 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.preview-pay-btn:hover {
  background: linear-gradient(135deg, #B84A40 0%, var(--sz-red) 100%);
}

/* ── 响应式 ──────────────────────────────────────── */
@media (max-width: 600px) {
  #app { max-width: 100%; }
  .header { padding: var(--sp-sm) var(--sp-md); }
  .chat-area { padding: var(--sp-md); }
  .message { max-width: 92%; }
  .plan-content { padding: var(--sp-lg); }
  .plan-info-bar { grid-template-columns: repeat(2, 1fr); }
}


/* ═══════════════════════════════════════════════════════
   会话侧栏（顾问模式）
   默认隐藏；#app.advisor 时显示
   ═══════════════════════════════════════════════════════ */

.session-sidebar { display: none; }
.app-main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* 匿名模式下 .app-main 需要占满 #app（保持原始单列体验） */
#app.anonymous .app-main { height: 100%; }

/* 顾问模式：双栏布局 */
#app.advisor {
  flex-direction: row;
  max-width: 1200px;
}

#app.advisor .session-sidebar {
  display: flex;
  flex-direction: column;
  width: 260px;
  flex-shrink: 0;
  background: var(--sz-warm-white);
  border-right: 1px solid var(--sz-border);
  height: 100vh;
  overflow: hidden;
}

.session-sidebar-header {
  padding: var(--sp-md);
  border-bottom: 1px solid var(--sz-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: white;
}

.session-sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--sz-brown);
  font-family: 'Noto Serif SC', serif;
}

.session-new-btn {
  background: var(--sz-brown);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.session-new-btn:hover { background: var(--sz-brown-dark); }

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-sm);
}

.session-empty {
  color: var(--sz-text-light);
  font-size: 13px;
  text-align: center;
  padding: var(--sp-xl) var(--sp-md);
  line-height: 1.6;
}

.session-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s;
}
.session-item:hover { background: rgba(139, 115, 85, 0.08); }
.session-item.active {
  background: rgba(139, 115, 85, 0.15);
  box-shadow: inset 3px 0 0 var(--sz-brown);
}

.session-item-main { flex: 1; min-width: 0; overflow: hidden; }
.session-item-title {
  font-size: 14px;
  color: var(--sz-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-item-title-input {
  width: 100%;
  font-size: 14px;
  color: var(--sz-text);
  font-weight: 500;
  padding: 2px 6px;
  border: 1px solid rgba(139, 115, 85, 0.35);
  border-radius: 4px;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}
.session-item-title-input:focus {
  border-color: rgba(139, 115, 85, 0.7);
  box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.12);
}
.session-item-meta {
  font-size: 11px;
  color: var(--sz-text-light);
  margin-top: 2px;
}

.session-item-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.session-item:hover .session-item-actions { opacity: 1; }

.session-item-actions button {
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--r-sm);
  color: var(--sz-text-light);
}
.session-item-actions button:hover {
  background: rgba(92, 61, 46, 0.1);
  color: var(--sz-brown);
}

/* ── 移动端：侧栏变抽屉 ──────────────────────────── */
@media (max-width: 768px) {
  #app.advisor { flex-direction: column; }
  #app.advisor .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-right: var(--sp-sm);
  }
  #app.advisor .session-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80vw;
    max-width: 300px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  }
  #app.advisor.sidebar-open .session-sidebar { transform: translateX(0); }
  #app.advisor.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99;
  }
}
