/* ================= 基础与变量 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:root {
  --teal-900: #134e4a;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-050: #f0fdfa;
  --amber: #f59e0b;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e7edf2;
  --bg: #f4f6f8;
  --card: #ffffff;
  --danger: #e11d48;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(15, 76, 74, .08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #dfe7ea;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; }

.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(15, 23, 42, .12);
  overflow: hidden;
}

.page { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(104px + var(--safe-b)); }
.content { padding: 14px 16px 8px; }

/* ================= 首页 Hero ================= */
.hero {
  padding: calc(18px + var(--safe-t)) 18px 22px;
  color: #fff;
  background: linear-gradient(140deg, var(--teal-900) 0%, var(--teal-700) 45%, var(--teal-500) 130%);
  border-radius: 0 0 26px 26px;
  box-shadow: 0 10px 30px rgba(13, 148, 136, .3);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  font-size: 30px; width: 48px; height: 48px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); border-radius: 14px;
  backdrop-filter: blur(4px);
}
.brand h1 { font-size: 21px; letter-spacing: .5px; }
.brand p { font-size: 12px; opacity: .82; margin-top: 1px; }

.hero-stats {
  margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .12); border-radius: 16px; padding: 12px 6px;
  backdrop-filter: blur(6px);
}
.hero-stats div { text-align: center; }
.hero-stats b { display: block; font-size: 20px; font-weight: 700; }
.hero-stats span { font-size: 11.5px; opacity: .85; }

/* ================= 通用控件 ================= */
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; font-size: 20px;
  display: grid; place-items: center; color: var(--ink);
  transition: background .15s;
}
.icon-btn:active { background: rgba(15, 23, 42, .08); }
.icon-btn.light { color: #fff; }
.icon-btn.light:active { background: rgba(255, 255, 255, .2); }
.icon-btn.placeholder { visibility: hidden; }

.text-btn { color: var(--teal-600); font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.text-btn:disabled { opacity: .5; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  color: #fff; font-weight: 600; border-radius: 12px;
  padding: 11px 18px; box-shadow: 0 6px 16px rgba(13, 148, 136, .32);
  transition: transform .1s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary.big { padding: 13px 26px; font-size: 16px; margin-top: 6px; }
.btn-ghost {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 12px; padding: 10px 16px; font-weight: 500;
}
.btn-ghost.small { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; text-decoration: none; }
.btn-danger {
  background: var(--danger); color: #fff; border-radius: 12px;
  padding: 10px 18px; font-weight: 600;
}
.link-danger { color: var(--danger); font-size: 12.5px; background: none; margin-left: 8px; }

.fab {
  position: fixed; z-index: 50;
  right: max(20px, calc(50% - 220px));
  bottom: calc(22px + var(--safe-b));
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  color: #fff; font-size: 30px; line-height: 1;
  box-shadow: 0 10px 26px rgba(13, 148, 136, .45);
  transition: transform .12s;
}
.fab:active { transform: scale(.92) rotate(90deg); }

.empty { text-align: center; padding: 56px 28px; color: var(--muted); }
.empty-ic { font-size: 56px; margin-bottom: 12px; }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty p { font-size: 13.5px; margin-bottom: 18px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 2px 12px; }
.section-title h2 { font-size: 16.5px; }
.section-title span { font-size: 12.5px; color: var(--muted); }

.list-end { text-align: center; color: var(--muted-2); font-size: 12px; padding: 26px 0 8px; }

/* ================= 首页条目 ================= */
.all-entry {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); text-align: left;
  transition: transform .1s;
}
.all-entry:active { transform: scale(.985); }
.all-entry-ic {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: var(--teal-050);
}
.all-entry-txt { flex: 1; display: flex; flex-direction: column; }
.all-entry-txt b { font-size: 15px; }
.all-entry-txt small { color: var(--muted); font-size: 12px; }
.chevron { color: var(--muted-2); font-size: 22px; }

.trip-grid { display: grid; gap: 16px; }
.trip-card {
  background: var(--card); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .1s; cursor: pointer;
}
.trip-card:active { transform: scale(.985); }
.trip-cover {
  position: relative; height: 150px;
  background-size: cover; background-position: center;
}
.trip-cover.fallback { display: grid; place-items: center; }
.trip-cover-emoji { font-size: 52px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.trip-cover.has-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.28), transparent 55%);
}
.trip-card-menu {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(15, 23, 42, .42); color: #fff; font-size: 18px;
  display: grid; place-items: center; backdrop-filter: blur(4px);
}
.trip-body { padding: 13px 15px 15px; }
.trip-body h3 { font-size: 16.5px; margin-bottom: 3px; }
.trip-desc { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-meta { display: flex; gap: 14px; margin-top: 9px; color: var(--ink-2); font-size: 12.5px; }

/* ================= 顶栏 ================= */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 10px 8px;
  background: rgba(244, 246, 248, .88);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(231, 237, 242, .7);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= 时间线 ================= */
.day-group { margin-top: 18px; }
.day-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink-2); margin: 0 4px 10px;
}
.day-title span { font-weight: 700; color: var(--teal-700); }
.day-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.day-title i { font-style: normal; font-size: 11.5px; color: var(--muted-2); font-weight: 400; }

.day-list { position: relative; padding-left: 22px; }
.day-list::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(var(--line), rgba(231,237,242,.3));
}
.rec-card {
  position: relative; display: flex; gap: 10px;
  background: var(--card); border-radius: var(--radius);
  padding: 13px 14px; margin-bottom: 12px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .1s;
}
.rec-card:active { transform: scale(.985); }
.rec-rail { position: absolute; left: -22px; top: 18px; }
.rec-rail i {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--teal-500);
  box-shadow: 0 0 0 3px var(--bg);
}
.rec-main { flex: 1; min-width: 0; }
.rec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec-time { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rec-trip-chip {
  font-size: 11px; background: var(--teal-050); color: var(--teal-700);
  border: 1px solid #99f6e4; border-radius: 20px; padding: 1px 9px;
}
.rec-place { font-size: 13px; color: var(--teal-700); margin-top: 4px; font-weight: 500; }
.rec-text {
  margin-top: 5px; font-size: 14px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap; word-break: break-word;
}
.rec-thumbs { display: flex; gap: 6px; margin-top: 9px; }
.rec-thumb {
  position: relative; width: 78px; height: 78px; border-radius: 10px;
  background: #e9eef2 center/cover no-repeat; flex-shrink: 0;
}
.rec-thumb b {
  position: absolute; inset: 0; border-radius: 10px;
  background: rgba(15, 23, 42, .45); color: #fff;
  display: grid; place-items: center; font-size: 17px;
}
.rec-chips { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.chip {
  font-size: 12px; color: var(--ink-2); background: #f1f5f9;
  border-radius: 8px; padding: 3px 10px;
}

/* ================= 记录详情 ================= */
.detail-trip {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 12px; padding: 11px 14px;
  margin-bottom: 14px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.detail-trip b { color: var(--muted); }

.detail-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.detail-gallery.single { grid-template-columns: 1fr; }
.detail-img {
  width: 100%; aspect-ratio: 4/3; border-radius: 14px;
  background: #e9eef2 center/cover no-repeat; cursor: zoom-in;
}
.detail-gallery.single .detail-img { aspect-ratio: 3/2; }

.detail-videos { display: grid; gap: 12px; margin-bottom: 14px; }
.video-wrap { background: #0f172a; border-radius: 14px; overflow: hidden; }
.video-wrap video { width: 100%; max-height: 320px; display: block; background: #000; }
.video-wrap small {
  display: block; background: var(--card); color: var(--muted);
  padding: 7px 12px; font-size: 12px;
}

.detail-audios { display: grid; gap: 10px; margin-bottom: 14px; }
.audio-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow);
}
.audio-ic {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--teal-050); display: grid; place-items: center; font-size: 18px;
}
.audio-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.audio-body b { font-size: 13.5px; font-weight: 600; }
.audio-body audio { width: 100%; height: 36px; }

.detail-block {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.detail-text { font-size: 15px; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.loc-block { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loc-info { display: flex; gap: 11px; align-items: flex-start; min-width: 0; }
.loc-ic { font-size: 20px; }
.loc-info b { display: block; font-size: 14.5px; }
.loc-info small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
.detail-time { text-align: center; color: var(--muted-2); font-size: 12.5px; padding: 8px 0 4px; }

/* ================= 表单 ================= */
.form-content { padding-top: 18px; }
.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 8px;
}
.field input[type=text],
.field input[type=datetime-local],
.field textarea,
.field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 13px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: none; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .14);
}

.loc-row { display: flex; gap: 8px; }
.loc-row input { flex: 1; min-width: 0; }
.locate-btn {
  flex-shrink: 0; display: flex; align-items: center; gap: 5px;
  border-radius: 12px; padding: 0 15px;
  background: var(--teal-050); color: var(--teal-700);
  border: 1.5px solid #99f6e4; font-weight: 600; font-size: 14px;
}
.locate-btn:active { background: #ccfbf1; }
.locate-btn.loading { opacity: .65; pointer-events: none; }
.locate-btn.loading .locate-ic { display: inline-block; animation: pulse 1s infinite; }
.loc-coords { margin-top: 7px; font-size: 12.5px; color: var(--muted); padding-left: 2px; min-height: 16px; }

.form-hint {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  font-size: 12.5px; border-radius: 12px; padding: 10px 13px;
}

/* 媒体网格 */
.media-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px;
}
.mg-item {
  position: relative; aspect-ratio: 1; border-radius: 12px;
  background: #e9eef2 center/cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px; text-align: center; overflow: hidden;
}
.mg-item.vid, .mg-item.aud { background: #fff; border: 1.5px solid var(--line); aspect-ratio: auto; min-height: 92px; }
.mg-ic { font-size: 26px; }
.mg-item small { font-size: 11px; color: var(--muted); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-item small.mg-size { color: var(--muted-2); font-size: 10.5px; }
.mg-del {
  position: absolute; right: 5px; top: 5px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(15, 23, 42, .55); color: #fff; font-size: 11px;
  display: grid; place-items: center;
}
.media-add-row { display: flex; gap: 10px; }
.media-add {
  flex: 1; border: 1.5px dashed #b7c6ce; border-radius: 12px;
  padding: 12px 4px; background: #fff; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 13px; font-weight: 500;
}
.media-add span { font-size: 22px; }
.media-add:active { background: var(--teal-050); border-color: var(--teal-500); }

/* 录音条 */
.recorder-bar {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; background: #fff1f2; border: 1.5px solid #fecdd3;
  border-radius: 12px; padding: 11px 13px;
}
.rec-dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--danger);
  animation: pulse 1.1s infinite;
}
.recorder-bar b { font-variant-numeric: tabular-nums; color: var(--danger); }
.rec-hint { flex: 1; font-size: 12.5px; color: #9f1239; }
.rec-cancel, .rec-stop { border-radius: 9px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.rec-cancel { background: #fff; border: 1px solid #fecdd3; color: #9f1239; }
.rec-stop { background: var(--danger); color: #fff; }

@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.8);} }

/* ================= 弹层 ================= */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .42);
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  animation: fade .18s ease;
}
.dialog {
  width: 100%; max-width: 320px; background: #fff;
  border-radius: 18px; padding: 22px 20px 16px; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
}
.dialog h3 { font-size: 16.5px; margin-bottom: 8px; }
.dialog p { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions button { flex: 1; }

.sheet-mask { align-items: flex-end; padding: 0; }
.sheet {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: #f8fafc; border-radius: 20px 20px 0 0;
  padding: 10px 12px calc(14px + var(--safe-b));
  animation: slideUp .24s ease;
}
.sheet-title { text-align: center; font-size: 13px; color: var(--muted); padding: 10px 0 8px; }
.sheet-item {
  width: 100%; display: block; text-align: center;
  background: #fff; border-radius: 13px; padding: 15px;
  font-size: 15.5px; margin-bottom: 8px; color: var(--ink);
}
.sheet-item:active { background: #f1f5f9; }
.sheet-item.danger { color: var(--danger); }
.sheet-cancel {
  width: 100%; background: #fff; border-radius: 13px;
  padding: 15px; font-size: 15.5px; font-weight: 600; margin-top: 4px;
}

.settings-storage {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
}
.settings-storage div {
  background: #fff; border-radius: 13px; padding: 13px; text-align: center;
}
.settings-storage b { display: block; font-size: 17px; color: var(--teal-700); }
.settings-storage span { font-size: 11.5px; color: var(--muted); }
.settings-about { padding: 12px 8px; }
.settings-about p { font-size: 12px; color: var(--muted); margin-bottom: 5px; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: #000; display: flex; align-items: center; justify-content: center;
  animation: fade .2s ease;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; color: #fff; font-size: 26px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  display: grid; place-items: center;
}
.lightbox-close { top: calc(14px + var(--safe-t)); right: 14px; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-index {
  position: absolute; bottom: calc(20px + var(--safe-b));
  left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(255,255,255,.15);
  padding: 4px 14px; border-radius: 20px;
}

/* Toast */
.toast-root {
  position: fixed; left: 50%; top: calc(70px + var(--safe-t));
  transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: max-content; max-width: 90vw;
}
.toast {
  background: rgba(15, 23, 42, .9); color: #fff;
  padding: 10px 18px; border-radius: 22px; font-size: 13.5px;
  opacity: 0; transform: translateY(-12px);
  transition: opacity .25s, transform .25s;
  max-width: 100%; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--teal-700); }
.toast-error { background: var(--danger); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
@keyframes slideUp { from { transform: translateY(100%); } }

/* 视图切换 */
.view-root .page { animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: .4; transform: translateY(8px); } }

/* 桌面端适配 */
@media (min-width: 520px) {
  body { padding: 24px 0; }
  .app { min-height: calc(100vh - 48px); border-radius: 26px; }
  .page { min-height: calc(100vh - 48px); }
  .fab { right: calc(50% - 240px + 20px); bottom: 46px; }
}

/* ================= AI 科普问答入口 ================= */
.ai-ask-bar {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin: 12px 0 4px; padding: 12px 14px;
  background: linear-gradient(135deg, #f0fdfa, #ecfeff);
  border: 1px solid #99f6e4; border-radius: 14px; text-align: left;
  transition: transform .15s;
}
.ai-ask-bar:active { transform: scale(.985); }
.ai-ask-ic {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(135deg, var(--teal-500), #06b6d4);
  box-shadow: 0 4px 12px rgba(13, 148, 136, .3);
}
.ai-ask-bar span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.ai-ask-bar b { font-size: 14.5px; color: var(--teal-900); }
.ai-ask-bar small { font-size: 12px; color: var(--muted); margin-top: 1px; }
.ai-ask-bar .chevron { color: var(--muted-2); font-size: 20px; }

.lightbox-ai {
  position: fixed !important; bottom: calc(24px + var(--safe-b)); left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, .72); backdrop-filter: blur(10px);
  color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; white-space: nowrap; z-index: 310;
  border: 1px solid rgba(255,255,255,.18);
}
.lightbox-ai:active { transform: translateX(-50%) scale(.96); }

/* 设置中的 AI 配置 */
.settings-ai {
  margin-top: 14px; padding: 14px; border-radius: 14px;
  background: #f8fafc; border: 1px solid var(--line);
}
.settings-ai h4 { font-size: 14px; margin-bottom: 10px; }
.settings-ai input {
  width: 100%; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 13.5px; outline: none;
}
.settings-ai input:focus { border-color: var(--teal-500); }
.settings-ai p { font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* ================= AI 聊天面板 ================= */
.chat-mask { z-index: 250; background: rgba(15, 23, 42, .45); }
.chat-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: 5%;
  max-width: 520px; margin: 0 auto;
  background: #f5f7f9; border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-up .25s ease;
}
@keyframes sheet-up { from { transform: translateY(6%); opacity: .4; } to { transform: none; opacity: 1; } }
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px calc(12px + var(--safe-t)); padding-top: calc(14px + var(--safe-t));
  background: #fff; border-bottom: 1px solid var(--line); flex: none;
}
.chat-head-txt { flex: 1; display: flex; flex-direction: column; }
.chat-head b { font-size: 15.5px; }
.chat-head small { font-size: 11.5px; color: var(--muted); }
.chat-close {
  width: 32px; height: 32px; border-radius: 50%; background: #f1f5f9;
  font-size: 14px; color: var(--muted);
}
.chat-thumb {
  flex: none; height: 104px; overflow: hidden; background: #0f172a;
  border-bottom: 1px solid var(--line);
}
.chat-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .95; }
.chat-list {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-bubble {
  max-width: 86%; padding: 10px 13px; border-radius: 14px;
  font-size: 14px; line-height: 1.65; word-break: break-word;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.chat-bubble.ai {
  align-self: flex-start; background: #fff;
  border-bottom-left-radius: 4px;
}
.chat-bubble.ai b { color: var(--teal-700); }
.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  color: #fff; border-bottom-right-radius: 4px;
}
.chat-err { color: var(--danger); font-size: 13px; }
.chat-config-btn {
  margin-top: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--teal-600); color: #fff; font-size: 13px;
}
.typing { display: inline-flex; gap: 4px; padding: 3px 2px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2);
  animation: typing-blink 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chips {
  flex: none; display: flex; gap: 8px; padding: 8px 14px;
  overflow-x: auto; background: #f5f7f9;
}
.chat-chip {
  flex: none; padding: 7px 13px; border-radius: 999px;
  background: #fff; border: 1px solid #b2e4dd; color: var(--teal-700);
  font-size: 12.5px; white-space: nowrap;
}
.chat-chip:active { background: var(--teal-050); }
.chat-input-bar {
  flex: none; display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b));
  background: #fff; border-top: 1px solid var(--line);
}
.chat-input-bar input {
  flex: 1; padding: 11px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #f5f7f9; outline: none;
  font-size: 14px;
}
.chat-input-bar input:focus { border-color: var(--teal-500); background: #fff; }
.chat-input-bar button {
  padding: 0 18px; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  color: #fff; font-size: 14px;
}
.chat-input-bar button:disabled { opacity: .5; }

/* ================= 旅程 Vlog ================= */
.vlog-page {
  position: fixed; inset: 0; z-index: 400; padding-bottom: 0;
  background: #0a0f14; color: #eef6f5;
  overflow-y: auto; scroll-snap-type: y proximity;
  scrollbar-width: none;
}
.vlog-page::-webkit-scrollbar { display: none; }

.vlog-hud {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 420;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: linear-gradient(rgba(10,15,20,.82), rgba(10,15,20,0));
}
.vlog-exit {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 14px;
  backdrop-filter: blur(6px);
}
.vlog-hud-txt { flex: 1; min-width: 0; }
.vlog-hud-txt b {
  display: block; font-size: 13px; color: #e6fffb;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vlog-progress {
  margin-top: 5px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.18); overflow: hidden;
}
.vlog-progress i {
  display: block; height: 100%; width: 6%;
  background: linear-gradient(90deg, var(--teal-500), #22d3ee);
  border-radius: 2px; transition: width .5s ease;
}
.vlog-hud-count { flex: none; font-size: 11.5px; color: rgba(255,255,255,.72); }

.vlog-stage { min-height: 100%; }
.vlog-cover {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #134e4a center/cover no-repeat;
  background-color: #0f172a;
  scroll-snap-align: start;
}
.vlog-cover-mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,15,20,.55) 0%, rgba(10,15,20,.25) 45%, rgba(10,15,20,.82) 100%);
}
.vlog-cover-inner {
  position: relative; text-align: center; padding: 40px 28px; max-width: 460px;
}
.vlog-cover-inner small {
  letter-spacing: 6px; font-size: 11px; color: #5eead4;
}
.vlog-cover-inner h1 {
  margin: 14px 0 8px; font-size: 34px; line-height: 1.25;
  color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.vlog-cover-date { color: rgba(255,255,255,.82); font-size: 14px; }
.vlog-cover-stats {
  margin: 18px 0 30px; font-size: 13px; color: rgba(255,255,255,.88);
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center;
}
.vlog-cover-stats i { color: rgba(255,255,255,.4); font-style: normal; }
.vlog-play-btn {
  display: inline-block; padding: 13px 34px; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal-500), #06b6d4);
  color: #062925; font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 30px rgba(20, 184, 166, .4);
}
.vlog-play-btn:active { transform: scale(.97); }
.vlog-play-btn.ghost {
  background: rgba(255,255,255,.1); color: #e6fffb; font-weight: 500;
  box-shadow: none; border: 1px solid rgba(255,255,255,.25);
  margin: 6px 8px 0; padding: 11px 26px;
}
.vlog-scroll-hint { margin-top: 18px; font-size: 12px; color: rgba(255,255,255,.55); }

.vlog-scene {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: start; overflow: hidden;
}
.vlog-image {
  background: #0a0f14 center/cover no-repeat;
}
.vlog-image.kb-a { animation: kb-a 5s ease-in-out infinite alternate; }
.vlog-image.kb-b { animation: kb-b 5s ease-in-out infinite alternate; }
@keyframes kb-a {
  from { background-size: 105% auto; background-position: center; }
  to { background-size: 118% auto; background-position: 56% 44%; }
}
@keyframes kb-b {
  from { background-size: 118% auto; background-position: 44% 56%; }
  to { background-size: 105% auto; background-position: center; }
}
.vlog-scene-mask {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(10,15,20,.78) 0%, rgba(10,15,20,0) 34%, rgba(10,15,20,0) 70%, rgba(10,15,20,.3) 100%);
}
.vlog-caption {
  position: absolute; left: 0; right: 0; bottom: calc(70px + var(--safe-b));
  padding: 0 26px; max-width: 520px; margin: 0 auto;
}
.vlog-caption small {
  display: block; font-size: 12px; color: #5eead4; margin-bottom: 6px;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.vlog-caption p {
  font-size: 17px; line-height: 1.7; color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}
.vlog-caption.on-media {
  bottom: 16px;
}
.vlog-video video {
  width: 100%; height: 100vh; object-fit: contain; background: #000;
}

.vlog-audio-scene { background: radial-gradient(circle at 50% 38%, #134e4a 0%, #0a141c 70%); }
.vlog-audio-card {
  text-align: center; padding: 36px 30px; border-radius: 22px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(12px); width: min(82vw, 340px);
}
.vlog-eq {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 6px; height: 56px; margin-bottom: 16px;
}
.vlog-eq i {
  width: 7px; border-radius: 4px; background: linear-gradient(180deg, #2dd4bf, #0891b2);
  animation: eq 1s ease-in-out infinite alternate;
}
.vlog-eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.vlog-eq i:nth-child(2) { height: 80%; animation-delay: .15s; }
.vlog-eq i:nth-child(3) { height: 100%; animation-delay: .3s; }
.vlog-eq i:nth-child(4) { height: 65%; animation-delay: .45s; }
.vlog-eq i:nth-child(5) { height: 45%; animation-delay: .6s; }
@keyframes eq { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.vlog-audio-card b { display: block; font-size: 17px; color: #fff; }
.vlog-audio-card > small { display: block; font-size: 12px; color: rgba(255,255,255,.6); margin: 4px 0 16px; }
.vlog-audio-card audio { width: 100%; }

.vlog-text-scene { background: linear-gradient(160deg, #0f2e2b, #0a141c); }
.vlog-quote {
  position: relative; max-width: 420px; padding: 30px 28px; text-align: center;
}
.vlog-quote-mark {
  font-size: 64px; line-height: 1; color: rgba(94,234,212,.35);
  font-family: Georgia, serif; display: block; margin-bottom: 6px;
}
.vlog-quote p { font-size: 21px; line-height: 1.9; color: #f0fdfa; font-weight: 500; }
.vlog-quote small { display: block; margin-top: 20px; font-size: 12.5px; color: #5eead4; }

.vlog-end {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 40px 28px; scroll-snap-align: start;
}
.vlog-end-ic { font-size: 46px; margin-bottom: 14px; }
.vlog-end h2 { font-size: 26px; color: #fff; margin-bottom: 8px; }
.vlog-end p { color: rgba(255,255,255,.7); font-size: 13.5px; }
.vlog-end-sub { color: rgba(255,255,255,.5) !important; margin: 6px 0 26px; font-size: 12.5px !important; }

.vlog-fab-toggle {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-b));
  transform: translateX(-50%); z-index: 420;
  padding: 11px 26px; border-radius: 999px;
  background: rgba(15, 23, 42, .7); backdrop-filter: blur(10px);
  color: #fff; font-size: 14px; border: 1px solid rgba(255,255,255,.22);
}
.vlog-fab-toggle:active { transform: translateX(-50%) scale(.96); }

@media (min-width: 560px) {
  .vlog-cover-inner h1 { font-size: 42px; }
}
