/* ============================================================
   AI 旅行攻略生成器 · 视觉重设计
   风格参考 markopolo.ai:大字号标题 / 药丸按钮 / 圆角卡片 / 悬浮导航
   叠加全屏风景摄影背景 + 玻璃拟态面板
   ============================================================ */

:root {
  --ink: #101828;
  --ink-2: #344054;
  --ink-3: #667085;
  --action: #eee6d6;
  --action-hover: #f7efe1;
  --accent: #ff7a45;          /* 日出橙,呼应背景 */
  --accent-deep: #f4511e;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow-lg: 0 24px 60px -18px rgba(16, 24, 40, 0.35);
  --shadow-sm: 0 8px 24px -10px rgba(16, 24, 40, 0.25);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-pill: 999px;
}

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

html, body { height: 100%; }

body {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景:全屏风景原图 ---------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url('/static/pcbg6-desktop.jpg') center 38% / cover no-repeat fixed;
  filter: brightness(0.65);
}
.bg-scene.bg-pc-macbook {
  background-image: url('/static/macbook-bg-desktop.jpg');
}

/* ---------- 悬浮药丸导航 ---------- */
.app-header {
  position: sticky;
  top: 16px;
  z-index: 100;
  padding: 0 20px;
}
.header-inner {
  max-width: 880px;
  margin: 0 auto;
  height: 62px;
  padding: 0 10px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: none;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.logo-icon {
  width: auto;
  height: 1.8em;
  object-fit: contain;
  display: block;
  border-radius: 24%;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.18);
}
.app-title {
  font-size: 1.02em;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(16, 24, 40, 0.45);
}
.title-dot { margin: 0 4px; color: var(--accent); }

.header-nav {
  display: flex;
  gap: 4px;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 4px;
}
.nav-tab {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(31, 52, 68, 0.34);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9em;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(16, 24, 40, 0.35);
}
.nav-tab:hover {
  background: rgba(31, 52, 68, 0.48);
  color: #fff;
}
.nav-tab.active {
  background: var(--action);
  border-color: rgba(238, 230, 214, 0.9);
  color: #2f2f2f;
  text-shadow: none;
  box-shadow: 0 8px 18px -10px rgba(16, 24, 40, 0.55);
}

/* ---------- 主内容 ---------- */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

/* ---------- Hero / 输入区 ---------- */
.input-section {
  display: flex;
  justify-content: center;
  padding-top: 7vh;
}
.input-container {
  width: 100%;
  max-width: 760px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #fff;
  background: rgba(16, 24, 40, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  margin-bottom: 20px;
}
.input-header h2 {
  font-size: clamp(2.2rem, 5.4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 4px 28px rgba(16, 24, 40, 0.45);
  margin-bottom: 14px;
}
.input-desc {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 14px rgba(16, 24, 40, 0.5);
  font-size: 1.02em;
  max-width: 560px;
  margin: 0 auto 30px;
}

/* 输入卡片 */
.input-box {
  background: rgba(214, 221, 232, 0.84);
  border: 1px solid rgba(238, 242, 247, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 20px 20px 14px;
  text-align: left;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.input-box:focus-within {
  box-shadow: 0 28px 70px -16px rgba(16, 24, 40, 0.45);
  transform: translateY(-2px);
}
.input-box textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  resize: vertical;
  min-height: 84px;
  font-size: 1.02em;
  font-family: inherit;
  color: var(--ink);
  line-height: 1.7;
}
.input-box textarea::placeholder { color: var(--ink-3); }
.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(16, 24, 40, 0.07);
}
.char-count { font-size: 0.8em; color: var(--ink-3); }

/* ---------- 按钮体系:药丸 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 0.95em;
  padding: 12px 26px;
}
.btn-primary {
  background: var(--action);
  color: #2f2f2f;
  border: 1px solid rgba(238, 230, 214, 0.9);
  box-shadow: 0 10px 24px -10px rgba(16, 24, 40, 0.42);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--action-hover);
  box-shadow: 0 14px 30px -10px rgba(16, 24, 40, 0.48);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-2);
  border: 1px solid rgba(16, 24, 40, 0.12);
}
.btn-ghost:hover {
  background: #fff;
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-sm { padding: 8px 16px; font-size: 0.84em; }
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- 快速标签 ---------- */
.quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.tag-label {
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 8px rgba(16, 24, 40, 0.5);
}
.tag {
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 8px;
  font-size: 0.86em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  box-shadow: none;
  text-shadow: 0 2px 10px rgba(16, 24, 40, 0.58);
}
.tag:hover {
  background: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: none;
}

/* ---------- 状态条 ---------- */
.status-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding: 7px 16px;
  background: rgba(16, 24, 40, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-pill);
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.92);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
  flex-shrink: 0;
}
.status-dot.connected { background: #32d583; box-shadow: 0 0 10px rgba(50, 213, 131, 0.8); }
.status-dot.disconnected { background: var(--accent); box-shadow: 0 0 10px rgba(255, 122, 69, 0.8); }
.status-dot.error { background: #f97066; box-shadow: 0 0 10px rgba(249, 112, 102, 0.8); }

/* ---------- 通用玻璃面板 ---------- */
.panel {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 26px 28px;
}

/* ---------- 生成中 ---------- */
.generating-section { padding-top: 3vh; }
.generating-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.generating-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.generating-header h3 {
  font-size: 1.1em;
  font-weight: 800;
  color: var(--ink);
}
.generating-note {
  color: #d92d20;
  font-size: 0.88em;
  font-weight: 900;
  white-space: nowrap;
}
.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 69, 0.55); }
  50% { box-shadow: 0 0 0 12px rgba(255, 122, 69, 0); }
}
.stream-output {
  background: rgba(238, 244, 251, 0.74);
  color: #233044;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  padding: 20px 22px;
  min-height: 300px;
  max-height: 56vh;
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.82em;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 结果页 ---------- */
.result-section { padding-top: 1vh; }
.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px 10px 20px;
  margin-bottom: 18px;
  position: sticky;
  top: 88px;
  z-index: 50;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-badge {
  font-size: 0.88em;
  font-weight: 700;
  color: var(--ink);
}
.guide-id { font-size: 0.76em; color: var(--ink-3); }
.toolbar-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.guide-preview {
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.guide-preview iframe { display: block; }

/* ---------- 我的行程 ---------- */
.trips-section { padding-top: 3vh; }
.trips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.trips-header h2 {
  font-size: 1.3em;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.trips-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.trip-card {
  background: #fff;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}
.trip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px rgba(16, 24, 40, 0.3);
}
.trip-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.trip-card-header strong {
  font-size: 0.98em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trip-date { font-size: 0.74em; color: var(--ink-3); white-space: nowrap; }
.trip-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.trip-card-meta span {
  font-size: 0.76em;
  font-weight: 600;
  color: var(--accent-deep);
  background: rgba(255, 122, 69, 0.1);
  border: 1px solid rgba(255, 122, 69, 0.22);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}
.trip-card-actions {
  display: flex;
  gap: 8px;
}
.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.9em;
  padding: 36px 0;
}

/* ---------- 信息说明页 ---------- */
.info-page {
  min-height: 100vh;
}
.logo-link {
  color: inherit;
  text-decoration: none;
}
.info-main {
  max-width: 920px;
  padding-top: 54px;
}
.info-hero {
  color: var(--ink);
  text-align: center;
  margin-bottom: 18px;
}
.info-hero .eyebrow {
  margin-bottom: 16px;
}
.info-hero h1 {
  color: var(--ink);
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}
.info-hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--ink-2);
}
.info-anchor-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}
.info-anchor-nav a {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  text-decoration: none;
  font-size: 0.88em;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.info-anchor-nav a:hover {
  background: #fff;
  transform: translateY(-1px);
}
.info-section {
  scroll-margin-top: 96px;
  margin-bottom: 18px;
}
.info-section h2 {
  color: var(--ink);
  font-size: 1.26em;
  font-weight: 900;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.info-section p {
  color: var(--ink-2);
  font-size: 0.98em;
  line-height: 1.9;
  margin: 10px 0;
}
.contact-email {
  color: var(--accent-deep);
  font-size: 1.08em;
  font-weight: 900;
  text-decoration: none;
}
.contact-email:hover {
  text-decoration: underline;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: rgba(16, 24, 40, 0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 0.88em;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid #98a2b3;
  max-width: 340px;
}
.toast.success { border-left-color: #32d583; }
.toast.error { border-left-color: #f97066; }
.toast.info { border-left-color: #7cd4fd; }

/* ---------- Footer ---------- */
.app-footer {
  width: 100%;
  margin-top: auto;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  box-shadow: none;
}
.footer-note {
  max-width: 920px;
  margin: 0 auto;
  padding: 42px 24px 58px;
  text-align: center;
}
.footer-kicker {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.86em;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 18px;
}
.footer-copy {
  max-width: 760px;
  margin: 0 auto;
  font-size: 0.78em;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.64);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  max-width: 1120px;
  min-height: 92px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-brand,
.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.footer-brand {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.86em;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.footer-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 0.8em;
  letter-spacing: 0;
}
.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.footer-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.88em;
  font-weight: 700;
  white-space: nowrap;
}
.footer-links a:hover {
  color: #fff;
}

/* ============================================================
   响应式 · 手机端重设计（≤640px）
   目标：统一按钮宽度、放大点按热区、结构更清晰，桌面端不受影响
   ============================================================ */
@media (max-width: 640px) {
  .bg-scene {
    background: url('/static/mbbg1-mobile.jpg') center center / cover no-repeat scroll;
    filter: none;
  }
  .bg-scene.bg-mobile-alt {
    background-image: url('/static/mbbg2-mobile.jpg');
  }

  /* ---- 悬浮导航：贴合刘海屏，品牌与页签各自呼吸 ---- */
  .app-header {
    padding: 0 12px;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
  }
  .header-inner { height: 54px; padding: 0 6px 0 14px; gap: 8px; }
  .app-title { font-size: 0.82em; }
  .logo-icon { width: auto; height: 1.4em; }
  .header-nav { padding: 3px; gap: 2px; }
  .nav-tab { padding: 8px 13px; font-size: 0.8em; min-height: 38px; }

  .main-content {
    padding: 26px 16px calc(48px + env(safe-area-inset-bottom, 0px));
  }

  /* ---- Hero / 输入区 ---- */
  .input-section { padding-top: 2vh; }
  .input-header h2 { font-size: 2rem; }
  .input-desc { font-size: 0.96em; margin-bottom: 24px; }
  .input-box { padding: 18px 16px 16px; }
  .input-box textarea { min-height: 96px; font-size: 1.05em; }

  /* 生成按钮改为整行大按钮，字数统计移到上方，单手更好点 */
  .input-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .char-count { align-self: flex-start; }
  .input-box .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 15px 24px;
    font-size: 1.02em;
  }

  /* ---- 快速体验：手机端两列文字按钮 ---- */
  .quick-tags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin-top: 22px;
  }
  .tag-label {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 2px;
  }
  .tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 34px;
    padding: 4px 2px;
    font-size: 0.82em;
  }

  .panel { padding: 20px 16px; }

  /* ---- 生成中 ---- */
  .generating-header {
    flex-wrap: wrap;
  }
  .generating-title {
    flex-wrap: wrap;
    gap: 4px 10px;
  }
  .generating-header h3 { font-size: 1.02em; }
  .generating-note {
    font-size: 0.84em;
  }
  .stream-output { padding: 16px 16px; max-height: 60vh; }

  /* ---- 结果页工具栏：徽章一行 + 按钮网格，宽度统一好点按 ---- */
  .result-section { padding-top: 0; }
  .result-toolbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-radius: var(--radius-lg);
    padding: 14px;
  }
  .toolbar-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
  }
  .result-badge { white-space: nowrap; }
  .guide-id {
    display: block;
    width: 100%;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .toolbar-right {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
  }
  /* HTML / PDF / DOCX 三个下载键各占 1/3 */
  .toolbar-right .btn:nth-child(1),
  .toolbar-right .btn:nth-child(2),
  .toolbar-right .btn:nth-child(3) { grid-column: span 2; }
  /* 保存行程 / 重新生成 各占 1/2 */
  .toolbar-right .btn:nth-child(4),
  .toolbar-right .btn:nth-child(5) { grid-column: span 3; }
  .toolbar-right .btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    padding: 10px 8px;
  }
  .guide-preview { border-radius: var(--radius-lg); }

  /* ---- 我的行程：标题整行显示，操作键等宽 ---- */
  .trips-header h2 { font-size: 1.2em; }
  .trip-card { padding: 16px 16px; }
  .trip-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .trip-card-header strong { white-space: normal; }
  .trip-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .trip-card-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* ---- 通用：手机端按钮统一最小热区 ---- */
  .btn-sm { min-height: 44px; }

  /* ---- 信息说明页 ---- */
  .info-main { padding-top: 28px; }
  .info-anchor-nav { justify-content: flex-start; }
  .info-section h2 { font-size: 1.16em; }

  /* ---- Toast：贴两边，整行更醒目 ---- */
  .toast-container {
    right: 12px;
    left: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 74px);
  }
  .toast { max-width: none; }

  /* ---- Footer：手机端整体居中 ---- */
  .footer-note { padding: 34px 18px 42px; }
  .footer-bottom {
    min-height: 124px;
    padding: 22px 18px;
    align-items: center;
    flex-direction: column;
    text-align: center;
  }
  .footer-brand {
    font-size: 0.72em;
    white-space: normal;
    justify-content: center;
  }
  .footer-links {
    justify-content: center;
    gap: 12px 16px;
  }
}
