/* ============ Trip Agent · 设计令牌 + 布局 ============ */
:root {
  --tp-accent: #3372ff;
  --tp-accent-soft: rgba(51, 114, 255, 0.14);
  --tp-danger: #e5484d;
  --tp-ok: #1a7f5a;
  --tp-violet: #7c5cff;
  --tp-cyan: #0aa5a5;
  --tp-radius: 12px;
  --tp-radius-sm: 8px;
  --tp-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  --tp-topbar-h: 52px;
  --tp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
[data-theme="dark"] {
  --tp-bg: #0f1219;
  --tp-panel: #171b26;
  --tp-card: #1d2230;
  --tp-card-2: #232a3b;
  --tp-border: rgba(255, 255, 255, 0.09);
  --tp-border-soft: rgba(255, 255, 255, 0.05);
  --tp-text: #e8ecf4;
  --tp-text-2: rgba(232, 236, 244, 0.68);
  --tp-text-3: rgba(232, 236, 244, 0.42);
  --tp-hover: rgba(255, 255, 255, 0.06);
  --tp-msg-user: linear-gradient(135deg, #2c5ce6, #3372ff);
  --tp-scroll: rgba(255, 255, 255, 0.16);
}
[data-theme="light"] {
  --tp-bg: #eef1f6;
  --tp-panel: #ffffff;
  --tp-card: #ffffff;
  --tp-card-2: #f4f6fa;
  --tp-border: rgba(15, 23, 42, 0.10);
  --tp-border-soft: rgba(15, 23, 42, 0.05);
  --tp-text: #1f2733;
  --tp-text-2: rgba(31, 39, 51, 0.72);
  --tp-text-3: rgba(31, 39, 51, 0.45);
  --tp-hover: rgba(31, 45, 72, 0.06);
  --tp-msg-user: linear-gradient(135deg, #3372ff, #5b8cff);
  --tp-scroll: rgba(15, 23, 42, 0.22);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--tp-font);
  background: var(--tp-bg);
  color: var(--tp-text);
  overflow: hidden;
  transition: background 0.25s, color 0.25s;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--tp-scroll); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 顶栏 ============ */
.topbar {
  height: var(--tp-topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: var(--tp-panel);
  border-bottom: 1px solid var(--tp-border-soft);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.brand-icon { font-size: 20px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--tp-text-3); margin-top: 2px; }
.topbar-center { display: flex; align-items: center; }
.topbar-actions { display: flex; align-items: center; gap: 8px; min-width: 220px; justify-content: flex-end; }
.mode-switch {
  display: flex; background: var(--tp-card-2); border-radius: 10px; padding: 3px;
  border: 1px solid var(--tp-border-soft);
}
.mode-btn {
  padding: 5px 16px; border-radius: 8px; font-size: 13px; color: var(--tp-text-2);
  transition: all 0.18s;
}
.mode-btn.active {
  background: var(--tp-accent); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(51, 114, 255, 0.35);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; font-size: 15px;
  display: grid; place-items: center; color: var(--tp-text-2);
  border: 1px solid var(--tp-border-soft); background: var(--tp-card);
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--tp-hover); color: var(--tp-text); }
.quota-chip {
  font-size: 11px; color: var(--tp-text-3); border: 1px solid var(--tp-border-soft);
  padding: 4px 9px; border-radius: 20px; white-space: nowrap;
}
.quota-chip.warn { color: #e5484d; border-color: rgba(229, 72, 77, 0.4); }

/* ============ 三栏 ============ */
.workspace {
  display: grid;
  grid-template-columns: 360px 1fr 320px;
  height: calc(100vh - var(--tp-topbar-h));
}
.chat-col, .panel-col {
  display: flex; flex-direction: column; background: var(--tp-panel); min-height: 0;
}
.chat-col { border-right: 1px solid var(--tp-border-soft); }
.panel-col { border-left: 1px solid var(--tp-border-soft); }
.map-col { position: relative; min-width: 0; }
#mapBox { position: absolute; inset: 0; }
.map-col.amap-loading #mapBox::after {
  content: "地图加载中…"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--tp-text-3); font-size: 13px;
}

/* ============ 聊天列 ============ */
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 8px; min-height: 0; }
.chat-empty { position: absolute; inset: 0 0 76px 0; display: grid; place-items: center; pointer-events: none; }
.chat-col { position: relative; }
.hero { text-align: center; pointer-events: auto; padding: 0 24px; }
.hero-emoji { font-size: 44px; margin-bottom: 10px; }
.hero h2 { font-size: 20px; margin-bottom: 8px; }
.hero p { font-size: 13px; color: var(--tp-text-2); line-height: 1.7; }
.quick-asks { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.quick-btn {
  font-size: 13px; padding: 9px 14px; border-radius: 10px; text-align: left;
  background: var(--tp-card); border: 1px solid var(--tp-border-soft); color: var(--tp-text-2);
  transition: all 0.15s;
}
.quick-btn:hover { border-color: var(--tp-accent); color: var(--tp-accent); background: var(--tp-accent-soft); }

.msg { margin-bottom: 12px; animation: rise 0.22s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-role { font-size: 11px; color: var(--tp-text-3); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.msg-bubble {
  font-size: 13.5px; line-height: 1.75; padding: 10px 13px; border-radius: var(--tp-radius);
  background: var(--tp-card); border: 1px solid var(--tp-border-soft);
  word-break: break-word; white-space: pre-wrap;
}
.msg-user .msg-bubble {
  background: var(--tp-msg-user); color: #fff; border: none;
  border-bottom-right-radius: 4px;
}
.msg-agent .msg-bubble { border-bottom-left-radius: 4px; }
.msg-agent .msg-bubble p { margin: 0 0 6px; white-space: normal; }
.msg-agent .msg-bubble p:last-child { margin-bottom: 0; }
.msg-agent .msg-bubble strong { color: var(--tp-accent); }
.msg-agent .msg-bubble code {
  background: var(--tp-card-2); padding: 1px 5px; border-radius: 4px; font-size: 12px;
}
.msg-agent .msg-bubble ul { padding-left: 18px; margin: 4px 0; }
.msg-bubble .change-badge {
  display: inline-block; margin-top: 8px; font-size: 11px; color: var(--tp-accent);
  background: var(--tp-accent-soft); border-radius: 6px; padding: 2px 8px;
}

/* 工具 chips */
.tool-chip {
  display: flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%;
  font-size: 12px; color: var(--tp-text-2); background: var(--tp-card-2);
  border: 1px solid var(--tp-border-soft); border-radius: 9px;
  padding: 6px 10px; margin: 0 0 6px 18px; cursor: pointer;
  transition: all 0.15s; position: relative;
}
.tool-chip:hover { border-color: var(--tp-accent); }
.tool-chip .t-icon { font-size: 13px; }
.tool-chip .t-name { font-weight: 600; color: var(--tp-text); }
.tool-chip .t-state { margin-left: auto; }
.tool-chip.running .t-state { animation: pulse 1.1s infinite; color: var(--tp-accent); }
.tool-chip.ok .t-state { color: var(--tp-ok); }
.tool-chip.fail .t-state { color: var(--tp-danger); }
@keyframes pulse { 50% { opacity: 0.35; } }
.tool-detail {
  display: none; margin: -2px 0 8px 18px; padding: 8px 10px; font-size: 12px;
  background: var(--tp-card-2); border-radius: 8px; color: var(--tp-text-2);
  border: 1px dashed var(--tp-border); line-height: 1.6; word-break: break-all;
}
.tool-chip.open + .tool-detail { display: block; }

/* 输入区 */
.history-sep {
  text-align: center; font-size: 11px; color: var(--tp-text-3);
  margin: 6px 0 12px;
}
.composer {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px;
  border-top: 1px solid var(--tp-border-soft); background: var(--tp-panel);
}
.composer-row { display: flex; gap: 8px; align-items: flex-end; width: 100%; min-width: 0; }
.attach-strip { display: flex; gap: 8px; width: 100%; padding: 0 2px; flex-wrap: wrap; }
.att-item { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.att-item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--tp-border); display: block;
}
.att-del {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--tp-danger); color: #fff; font-size: 10px;
  line-height: 18px; text-align: center; border: none; cursor: pointer; padding: 0;
}
#chatInput {
  flex: 1; resize: none; min-height: 78px; max-height: 200px; font-size: 13.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--tp-border);
  background: var(--tp-card); outline: none; transition: border 0.15s;
}
#chatInput:focus { border-color: var(--tp-accent); }
.send-btn {
  width: 40px; height: 40px; border-radius: 12px; font-size: 16px; color: #fff;
  background: var(--tp-accent); box-shadow: 0 3px 10px rgba(51, 114, 255, 0.35);
  transition: all 0.15s; flex-shrink: 0;
}
.send-btn:hover { filter: brightness(1.12); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 聊天图片（气泡缩略图 + 大图查看） */
.msg-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; }
.msg-imgs:last-child { margin-bottom: 2px; }
.msg-img {
  width: 108px; height: 108px; object-fit: cover; border-radius: 8px;
  cursor: zoom-in; display: block; background: var(--tp-card-2);
}
.msg-user .msg-img { border: 1px solid rgba(255, 255, 255, 0.35); }
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center;
  background: rgba(0, 0, 0, 0.82); cursor: zoom-out; padding: 24px;
}
.lightbox.open { display: grid; }
.lightbox img {
  max-width: 100%; max-height: 100%; border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.chat-col.dragover::after {
  content: "松开以添加图片"; position: absolute; inset: 8px; z-index: 6;
  display: grid; place-items: center; pointer-events: none;
  background: rgba(51, 114, 255, 0.12); border: 2px dashed var(--tp-accent);
  border-radius: 12px; color: var(--tp-accent); font-size: 14px; font-weight: 600;
}
.typing-dots { display: inline-flex; gap: 3px; padding: 4px 2px; }
.typing-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--tp-text-3);
  animation: blink 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 50% { opacity: 0.2; transform: translateY(-2px); } }

/* ============ 地图浮层 ============ */
.map-toolbar {
  position: absolute; top: 12px; right: 12px; z-index: 30;
  display: flex; flex-direction: column; gap: 6px;
  background: color-mix(in srgb, var(--tp-panel) 82%, transparent);
  backdrop-filter: blur(10px); border: 1px solid var(--tp-border-soft);
  border-radius: 12px; padding: 6px;
}
.tool-btn {
  width: 34px; height: 34px; border-radius: 9px; font-size: 15px;
  display: grid; place-items: center; color: var(--tp-text-2); transition: all 0.15s;
}
.tool-btn:hover { background: var(--tp-hover); color: var(--tp-text); }
.tool-btn.active { background: var(--tp-accent-soft); color: var(--tp-accent); }
.node-chain {
  position: absolute; left: 12px; right: 60px; bottom: 12px; z-index: 30;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: color-mix(in srgb, var(--tp-panel) 86%, transparent);
  backdrop-filter: blur(10px); border: 1px solid var(--tp-border-soft);
  border-radius: 12px; padding: 8px 10px; font-size: 12px;
}
.node-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 14px;
  background: var(--tp-card); border: 1px solid var(--tp-border-soft); color: var(--tp-text-2);
}
.node-pill.origin, .node-pill.dest { color: var(--tp-accent); font-weight: 600; }
.node-arrow { color: var(--tp-text-3); }
.node-x {
  width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; color: var(--tp-danger); background: transparent;
}
.node-x:hover { background: rgba(229, 72, 77, 0.15); }

/* ============ 行程面板 ============ */
.panel-scroll { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
.plan-head { margin-bottom: 10px; }
.plan-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.plan-title-row h3 {
  font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.ver-badge {
  font-size: 10.5px; font-weight: 700; color: var(--tp-accent);
  background: var(--tp-accent-soft); border-radius: 6px; padding: 2px 7px; flex-shrink: 0;
}
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat-cell {
  background: var(--tp-card); border: 1px solid var(--tp-border-soft);
  border-radius: 10px; padding: 8px 4px; text-align: center;
}
.stat-cell b { display: block; font-size: 14px; }
.stat-cell span { font-size: 10.5px; color: var(--tp-text-3); }
.card {
  background: var(--tp-card); border: 1px solid var(--tp-border-soft);
  border-radius: var(--tp-radius); padding: 11px 12px; margin-bottom: 10px;
}
.card-head {
  font-size: 12px; font-weight: 700; color: var(--tp-text-2); margin-bottom: 9px;
  display: flex; align-items: center; justify-content: space-between;
}
.mini-btn { font-size: 12px; color: var(--tp-text-3); padding: 1px 6px; border-radius: 5px; }
.mini-btn:hover { background: var(--tp-hover); color: var(--tp-text); }

/* 方案列表 */
.route-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--tp-border-soft); margin-bottom: 6px; cursor: pointer;
  transition: all 0.15s; font-size: 12.5px;
}
.route-item:hover { border-color: var(--tp-accent); }
.route-item.active { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.route-item .r-label { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-item .r-meta { color: var(--tp-text-3); font-size: 11px; white-space: nowrap; }
.rec-tag {
  font-size: 10px; color: #fff; background: var(--tp-accent); border-radius: 5px;
  padding: 1px 5px; flex-shrink: 0;
}

/* 分天卡 */
.day-item {
  border: 1px solid var(--tp-border-soft); border-radius: 10px; padding: 8px 10px;
  margin-bottom: 7px; font-size: 12.5px; cursor: pointer; transition: all 0.15s;
}
.day-item:hover { border-color: var(--tp-accent); }
.day-item.active { border-color: #ff2e88; background: rgba(255, 46, 136, 0.10); }
.day-item.active .d-head b, .day-item.active .d-km { color: #ff2e88; }
.day-item .d-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.day-item .d-head b { color: var(--tp-text); }
.day-item .d-head .d-km { color: var(--tp-accent); font-weight: 700; margin-left: auto; margin-right: 8px; }
.day-item .d-bar {
  height: 5px; border-radius: 3px; background: var(--tp-card-2); overflow: hidden; margin-bottom: 4px;
}
.day-item .d-bar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--tp-cyan), #3ddad0);
  transition: width 0.6s ease;
}
.day-item .d-stop { color: var(--tp-text-3); font-size: 11.5px; }
.day-item .d-top { position: relative; }
.day-item .d-chev {
  color: var(--tp-text-3); font-size: 10px; align-self: center;
  transition: transform 0.18s ease;
}
.day-item.open { border-color: var(--tp-accent); background: rgba(91, 140, 255, 0.06); }
.day-item.open .d-chev { transform: rotate(180deg); }
.day-item .d-body {
  display: none; margin-top: 8px; padding-top: 7px;
  border-top: 1px dashed var(--tp-border-soft);
  max-height: 240px; overflow-y: auto;
}
.day-item.open .d-body { display: block; }
.day-item .d-sec {
  font-size: 11px; color: var(--tp-text-3); margin: 4px 0 3px;
  letter-spacing: 0.4px;
}
.day-item .poi-item {
  display: flex; align-items: flex-start; gap: 6px; padding: 4px 5px;
  border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--tp-text-2);
}
.day-item .poi-item:hover { background: var(--tp-hover); color: var(--tp-text); }
.day-item .poi-item .p-ico { flex-shrink: 0; font-size: 12px; line-height: 1.5; }
.day-item .poi-item .p-txt { min-width: 0; display: flex; flex-direction: column; }
.day-item .poi-item .p-txt b { color: var(--tp-text); font-weight: 600; line-height: 1.5; }
.day-item .poi-item .p-rate {
  font-style: normal; color: #f5a623; font-size: 10.5px;
  margin-right: 5px; font-weight: 700;
}
.day-item .poi-item .p-txt span {
  color: var(--tp-text-3); font-size: 10.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-item .d-note { font-size: 11px; color: var(--tp-text-3); padding: 2px 4px 4px; }
.day-item .d-note.warn { color: #e5a13d; }
.day-item .d-loading {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px;
  color: var(--tp-text-3); padding: 4px 2px;
}
.day-item .d-loading i {
  width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--tp-border-soft); border-top-color: var(--tp-accent);
  animation: tp-spin 0.8s linear infinite;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }
.day-item .d-retry { margin: 2px 0 4px; }

/* 分天海拔曲线 */
.day-item .d-elev { display: none; margin-top: 8px; }
.day-item.open .d-elev { display: block; }
.day-item .elev-chart svg {
  display: block; width: 100%; height: auto; border-radius: 8px;
  background: var(--tp-card-2);
}
.day-item .elev-stats { font-size: 11px; color: var(--tp-text-3); padding: 4px 2px 0; }
.day-item .elev-stats b { font-weight: 700; }
.day-item .elev-stats .e-up { color: #f0554f; }    /* 爬升红 */
.day-item .elev-stats .e-down { color: #2fbf71; }  /* 下降绿 */

/* 海拔大图弹框 */
.day-item .elev-chart { position: relative; cursor: zoom-in; }
.day-item .elev-chart::after {
  content: '⤢'; position: absolute; right: 5px; bottom: 5px; font-size: 10px;
  color: #9fb3d8; background: rgba(15,25,45,0.6); border-radius: 5px; padding: 1px 5px;
  pointer-events: none;
}
/* 海拔大图弹框：无遮罩（地图可继续操作），卡片自身可交互 */
.elev-modal {
  position: fixed; inset: 0; z-index: 1200; pointer-events: none;
  display: flex; align-items: center; justify-content: center; animation: tp-fade 0.15s ease;
}
.elev-modal-card {
  pointer-events: auto;
  background: var(--tp-card); border: 1px solid var(--tp-border-soft); border-radius: 14px;
  padding: 12px 14px 10px; width: min(780px, 94vw); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.elev-modal-card .elev-chart { cursor: default; position: relative; }
.elev-modal-card .elev-chart::after { content: none; }
.elev-modal-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px;
  cursor: grab; touch-action: none; user-select: none;
}
.elev-modal-head.dragging { cursor: grabbing; }
.elev-modal-head b { color: var(--tp-text); }
.elev-modal-head .elev-modal-km { color: var(--tp-accent); font-size: 12px; }
.elev-modal-head .elev-modal-x {
  margin-left: auto; font-size: 13px; color: var(--tp-text-3);
  padding: 2px 8px; border-radius: 6px; line-height: 1.4;
}
.elev-modal-head .elev-modal-x:hover { background: rgba(229, 72, 77, 0.16); color: #e5484d; }
.elev-modal-card .elev-stats { font-size: 12.5px; padding: 8px 2px 2px; }
@keyframes tp-fade { from { opacity: 0; } }

/* 天卡片「▶ 导航」→ 高德深链菜单（手机直接跳 App，PC 出网页版链接） */
.day-item .d-nav {
  font-size: 11px; color: var(--tp-accent); background: var(--tp-accent-soft);
  border-radius: 6px; padding: 1px 7px; margin-left: 8px;
}
.day-item .d-nav:hover { background: rgba(51, 114, 255, 0.28); }
.nav-menu { position: fixed; inset: 0; pointer-events: none; z-index: 1300; }
.nav-menu-card {
  pointer-events: auto; position: absolute; right: 12px; width: 268px;
  background: var(--tp-card); border: 1px solid var(--tp-border-soft); border-radius: 12px;
  padding: 10px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45); animation: tp-fade 0.15s ease;
}
.nav-menu-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.nav-menu-head b { color: var(--tp-text); }
.nav-menu-head .nav-menu-x {
  margin-left: auto; font-size: 13px; color: var(--tp-text-3); padding: 2px 8px; border-radius: 6px;
}
.nav-menu-head .nav-menu-x:hover { background: rgba(229, 72, 77, 0.16); color: #e5484d; }
.nav-menu .nav-menu-tgl {
  display: block; width: 100%; text-align: left; font-size: 11.5px; color: var(--tp-text-3);
  border: 1px solid var(--tp-border-soft); border-radius: 7px; padding: 4px 9px; margin-bottom: 7px;
}
.nav-menu .nav-menu-tgl.on { color: #fff; background: var(--tp-accent); border-color: var(--tp-accent); }
/* PC 对话框：App 扫码 + 电脑打开（固定屏幕居中，不随按钮位置变化） */
.nav-menu-pc { left: 50%; right: auto; top: 50%; transform: translate(-50%, -50%); width: 460px; max-width: 94vw; }
.nav-pc-body { display: flex; gap: 16px; align-items: flex-start; }
.nav-pc-sec { flex: 1; min-width: 0; }
.nav-pc-qr { text-align: center; }
.nav-sec-t { font-size: 12.5px; color: var(--tp-text); font-weight: 700; margin-bottom: 8px; }
.nav-pc-qr .nav-sec-t { text-align: center; }
.nav-qr { width: 190px; max-width: 100%; background: #fff; border-radius: 8px; padding: 6px; display: block; margin: 0 auto; }
.nav-qr-fallback { font-size: 10.5px; color: var(--tp-text-3); word-break: break-all; }
.nav-sec-sub { font-size: 10.5px; color: var(--tp-text-3); margin-top: 7px; line-height: 1.5; }
.nav-link-input {
  width: 100%; font-size: 11px; color: var(--tp-text-2); background: var(--tp-card-2);
  border: 1px solid var(--tp-border-soft); border-radius: 7px; padding: 6px 7px;
}
.nav-link-ops { display: flex; gap: 8px; margin-top: 8px; }
.nav-link-ops .nav-copy, .nav-link-ops .nav-open {
  font-size: 12px; padding: 3px 12px; border-radius: 6px; color: var(--tp-accent); background: var(--tp-accent-soft);
}
.nav-link-ops .nav-copy:hover, .nav-link-ops .nav-open:hover { background: rgba(51, 114, 255, 0.28); }
.nav-menu .nav-row { display: block; padding: 7px 9px; border-radius: 8px; }
.nav-menu .nav-row:hover { background: var(--tp-hover); }
.nav-menu .nav-row b { display: block; font-size: 12.5px; color: var(--tp-text); font-weight: 600; }
.nav-menu .nav-row span { display: block; font-size: 10.5px; color: var(--tp-text-3); margin-top: 1px; }
.nav-menu .nav-row.main { background: var(--tp-accent-soft); }
.nav-menu-foot { font-size: 10px; color: var(--tp-text-3); margin-top: 7px; line-height: 1.5; }

/* 曲线探测十字准星（悬停显示；2s 后联动地图预览） */
.elev-chart .elev-xhair { position: absolute; top: 0; bottom: 0; left: 0; width: 0; display: none; pointer-events: none; }
.elev-chart .elev-xhair.on { display: block; }
.elev-chart .elev-xhair i {
  position: absolute; top: 0; bottom: 0; left: -0.5px; width: 1px;
  background: rgba(255, 46, 136, 0.55);
}
.elev-chart .elev-xhair span {
  position: absolute; top: 2px; left: 4px; white-space: nowrap; font-size: 10px;
  color: #ffd7e5; background: rgba(15, 25, 45, 0.82);
  padding: 1px 5px; border-radius: 6px; border: 1px solid rgba(255, 46, 136, 0.4);
}
.card-head .head-hint { font-size: 10.5px; font-weight: 400; color: var(--tp-text-3); }

/* 标注/划线 */
.mark-item {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 5px 4px;
  color: var(--tp-text-2); cursor: pointer; border-radius: 7px;
}
.mark-item:hover { background: var(--tp-hover); }
.mark-item .m-dot { width: 8px; height: 8px; border-radius: 2px; background: #e5484d; flex-shrink: 0; transform: rotate(45deg); }
/* 标注序号徽标：与地图旗标编号一一对应 */
.mark-item .m-dot.m-num {
  width: auto; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  transform: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; line-height: 1;
}
.mark-item.ln .m-dot { background: var(--tp-cyan); border-radius: 50%; }
.mark-item .m-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-item .mark-x {
  flex-shrink: 0; font-size: 11px; color: var(--tp-text-3); padding: 1px 6px;
  border-radius: 5px; line-height: 1.4;
}
.mark-item .mark-x:hover { background: rgba(229, 72, 77, 0.16); color: #e5484d; }

/* 档案 */
.archive-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 10px;
  border: 1px solid var(--tp-border-soft); margin-bottom: 6px; cursor: pointer;
  transition: all 0.15s; font-size: 12.5px;
}
.archive-item:hover { border-color: var(--tp-accent); }
.archive-item.current { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.archive-item .a-body { flex: 1; min-width: 0; }
.archive-item .a-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-item .a-meta { font-size: 11px; color: var(--tp-text-3); margin-top: 2px; }
.archive-item .a-del {
  color: var(--tp-text-3); font-size: 13px; padding: 4px; border-radius: 6px; flex-shrink: 0;
}
.archive-item .a-del:hover { color: var(--tp-danger); background: rgba(229, 72, 77, 0.12); }
.archive-empty { font-size: 12px; color: var(--tp-text-3); text-align: center; padding: 14px 0; }

.panel-actions {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--tp-border-soft);
}
.panel-btn {
  flex: 1; padding: 9px 0; border-radius: 10px; font-size: 13px;
  border: 1px solid var(--tp-border); background: var(--tp-card); color: var(--tp-text-2);
  transition: all 0.15s;
}
.panel-btn:hover { border-color: var(--tp-accent); color: var(--tp-accent); }

/* ============ 弹框 / toast ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 16, 0.55);
  backdrop-filter: blur(3px); display: grid; place-items: center;
}
.modal {
  width: min(480px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto;
  background: var(--tp-panel); border: 1px solid var(--tp-border);
  border-radius: 16px; box-shadow: var(--tp-shadow);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--tp-border-soft);
}
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 14px 18px; }
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 12.5px; color: var(--tp-text-2); margin-bottom: 5px; }
.form-group .hint { font-size: 11px; color: var(--tp-text-3); font-weight: 400; }
.form-group input, .form-group textarea {
  width: 100%; font-size: 13px; padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--tp-border); background: var(--tp-card); outline: none;
  transition: border 0.15s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--tp-accent); }
.field-state { font-size: 11px; color: var(--tp-ok); margin-top: 3px; min-height: 14px; }
/* 设置页开关行 */
.switch-row {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--tp-text);
  padding: 7px 10px; margin-bottom: 6px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--tp-border-soft); transition: all 0.15s;
}
.switch-row:hover { border-color: var(--tp-accent); }
.switch-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--tp-accent); cursor: pointer; flex-shrink: 0;
}
.switch-row:has(input[type="checkbox"]:checked) { border-color: var(--tp-accent); background: var(--tp-accent-soft); }
.modal-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--tp-border-soft);
}
.save-msg { font-size: 12px; color: var(--tp-ok); margin-right: auto; }
.primary-btn {
  padding: 8px 22px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--tp-accent); box-shadow: 0 2px 8px rgba(51, 114, 255, 0.3);
}
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 120;
  background: var(--tp-card); color: var(--tp-text); border: 1px solid var(--tp-border);
  padding: 10px 18px; border-radius: 12px; font-size: 13px; box-shadow: var(--tp-shadow);
  animation: rise 0.2s ease;
}
.toast.err { border-color: rgba(229, 72, 77, 0.5); color: var(--tp-danger); }

/* ============ 行程管理 / 设置 独立页 ============ */
.manage-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  max-width: 860px;
  margin: 0 auto;
  height: calc(100vh - var(--tp-topbar-h));
  overflow: hidden;
}
.manage-col { overflow-y: auto; min-height: 0; }
.manage-col .card { padding: 14px 16px; }
.manage-head-card .card-head { margin-bottom: 10px; }
.m-count { font-weight: 400; color: var(--tp-text-3); font-size: 11px; }
.manage-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.manage-toolbar input {
  flex: 1; font-size: 13px; padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--tp-border); background: var(--tp-card-2); outline: none;
}
.manage-toolbar input:focus { border-color: var(--tp-accent); }
.manage-toolbar .mini-btn {
  border: 1px solid var(--tp-border); border-radius: 9px; padding: 0 12px; font-size: 12.5px;
  color: var(--tp-text-2);
}
.trip-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--tp-border-soft); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; transition: border 0.15s;
}
.trip-item:hover { border-color: var(--tp-accent); }
.trip-item .t-main { flex: 1; min-width: 0; }
.trip-item .a-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-item .a-meta { font-size: 11.5px; color: var(--tp-text-3); margin-top: 3px; }
.trip-item .t-actions { display: flex; gap: 6px; flex-shrink: 0; }
.t-btn {
  font-size: 12px; padding: 5px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--tp-border-soft); color: var(--tp-text-2); background: var(--tp-card-2);
  text-decoration: none; transition: all 0.15s;
}
.t-btn:hover { border-color: var(--tp-accent); color: var(--tp-accent); }
.t-btn.open { color: var(--tp-accent); border-color: var(--tp-accent-soft); background: var(--tp-accent-soft); }
.t-btn.del:hover { border-color: var(--tp-danger); color: var(--tp-danger); }
.save-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.save-row .save-msg { margin-right: auto; }
.nav-back:hover { border-color: var(--tp-accent) !important; color: var(--tp-accent) !important; }
@media (max-width: 900px) {
  .manage-wrap { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .manage-col { overflow: visible; }
  body { overflow: auto; }
}

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 300px 1fr 280px; }
}
@media (max-width: 980px) {
  body { overflow: auto; }
  .workspace { grid-template-columns: 1fr; height: auto; }
  .map-col { height: 52vh; order: -1; }
  .chat-col, .panel-col { border: none; }
  .chat-scroll { max-height: 46vh; }
  .chat-empty { inset: 0 0 60px 0; }
}
