/* ============================================================
   自驾游助手 (Travel) — 主题样式
   主题: 清新自然出行风 (天空蓝 + 青绿 + 暖阳橙)
   ============================================================ */
:root {
    /* 主色 */
    --sky-1: #0ea5e9;          /* 天空蓝 */
    --sky-2: #38bdf8;
    --teal: #14b8a6;           /* 青绿 */
    --sun: #f59e0b;            /* 暖阳橙 */
    --sun-light: #fbbf24;
    /* 底色 */
    --bg: #f0f7fb;             /* 浅蓝白背景 */
    --bg-grad-1: #e0f2fe;
    --bg-grad-2: #f0fdfa;
    --card: #ffffff;
    --card-2: #f8fafc;
    /* 文字 */
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    /* 边框/阴影 */
    --border: #e2e8f0;
    --shadow: 0 6px 20px rgba(14, 165, 233, 0.08);
    --shadow-lg: 0 12px 32px rgba(14, 165, 233, 0.15);
    /* 状态色 */
    --ok: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    /* 费用类型色 */
    --type-fuel: #f59e0b;
    --type-highway: #3b82f6;
    --type-park: #8b5cf6;
    --type-stay: #ec4899;
    --type-food: #22c55e;
    --type-ticket: #14b8a6;
    --type-other: #64748b;
    /* 圆角 */
    --r: 16px;
    --r-sm: 10px;
    font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(160deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%) fixed;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 74px; /* 底部导航留白 */
}

/* ============ 顶部导航 ============ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(14,165,233,0.05);
}
.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.72rem;
    cursor: pointer;
    transition: color .2s;
    position: relative;
}
.nav-btn i { font-size: 1.15rem; }
.nav-btn.active { color: var(--sky-1); }
.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30%; right: 30%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--sky-1);
}

/* ============ 内容区 ============ */
#main { padding: 76px 16px 20px; max-width: 640px; margin: 0 auto; }

/* ============ 通用组件 ============ */
.card {
    background: var(--card);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i { color: var(--sky-1); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--sky-1), var(--sky-2));
    color: #fff;
    border: none;
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 12px rgba(14,165,233,0.25);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-teal { background: linear-gradient(135deg, var(--teal), #2dd4bf); box-shadow: 0 4px 12px rgba(20,184,166,0.25); }
.btn-sun { background: linear-gradient(135deg, var(--sun), var(--sun-light)); box-shadow: 0 4px 12px rgba(245,158,11,0.25); }
.btn-ghost { background: var(--card-2); color: var(--text-2); box-shadow: none; border: 1px solid var(--border); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 4px 12px rgba(239,68,68,0.2); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 9px; }

.input, .select, textarea.input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--card-2);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.input:focus, .select:focus, textarea.input:focus {
    border-color: var(--sky-1);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
    background: #fff;
}
textarea.input { resize: vertical; min-height: 60px; }

.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-2);
    margin-bottom: 6px;
    font-weight: 600;
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* 空状态 */
.empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-3);
}
.empty i { font-size: 2.4rem; display: block; margin-bottom: 12px; color: var(--sky-2); }
.empty p { font-size: 0.9rem; }

/* ============ 首页 ============ */
.hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    padding: 26px 20px;
    color: #fff;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 55%, #f59e0b 130%);
    box-shadow: var(--shadow-lg);
}
.hero .hero-bg {
    position: absolute;
    right: -20px; top: -10px;
    font-size: 6rem;
    opacity: 0.25;
    transform: rotate(-12deg);
}
.hero h1 { font-size: 1.6rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.hero p { font-size: 0.9rem; opacity: 0.92; }
.hero .hero-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.hero .stat b { font-size: 1.3rem; display: block; }
.hero .stat span { font-size: 0.75rem; opacity: 0.85; }

.current-travel {
    border-left: 4px solid var(--teal);
}

/* 旅途状态徽章 */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}
.badge-prep { background: #fef3c7; color: #b45309; }
.badge-ongoing { background: #dcfce7; color: #15803d; }
.badge-done { background: #e2e8f0; color: #475569; }

/* ============ 旅途列表 ============ */
.travel-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}
.travel-item .t-icon {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--sky-1), var(--teal));
}
.travel-item .t-info { flex: 1; min-width: 0; }
.travel-item .t-name { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.travel-item .t-meta { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }
.travel-item .t-arrow { color: var(--text-3); }

/* ============ 旅途详情 - Tab ============ */
.tabs {
    display: flex;
    background: var(--card);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow-x: auto;
}
.tab-btn {
    flex: 1;
    padding: 10px 4px;
    background: none;
    border: none;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}
.tab-btn.active {
    background: linear-gradient(135deg, var(--sky-1), var(--sky-2));
    color: #fff;
    box-shadow: 0 3px 10px rgba(14,165,233,0.25);
}

/* 详情头部 */
.detail-head {
    background: linear-gradient(135deg, var(--sky-1), var(--teal));
    border-radius: 20px;
    padding: 22px 20px;
    color: #fff;
    margin-bottom: 18px;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.detail-head h2 { font-size: 1.5rem; margin-bottom: 8px; }
.detail-head .d-meta { font-size: 0.85rem; opacity: 0.92; display: flex; flex-wrap: wrap; gap: 14px; }
.detail-head .d-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 信息行 */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-3); }
.info-row .v { font-weight: 600; text-align: right; color: var(--text); }

/* 成员 */
.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px;
    margin: 3px 4px 3px 0;
    font-size: 0.82rem;
}
.member-chip i { color: var(--sky-1); }

/* 携带物品 */
.item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.item-row:last-child { border-bottom: none; }
.item-chk {
    width: 22px; height: 22px;
    border-radius: 7px;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.7rem;
}
.item-chk.checked { background: var(--ok); border-color: var(--ok); }
.item-row.packed .item-name { text-decoration: line-through; color: var(--text-3); }
.item-info { flex: 1; }
.item-name { font-weight: 600; font-size: 0.92rem; }
.item-sub { font-size: 0.78rem; color: var(--text-3); }
.item-actions { display: flex; gap: 8px; }
.icon-btn {
    width: 32px; height: 32px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--card-2);
    color: var(--text-2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* 计划行程/行程/消费 列表行 */
.plan-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.plan-row:last-child { border-bottom: none; }
.plan-icon {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: #eff6ff;
    color: var(--sky-1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.plan-info { flex: 1; min-width: 0; }
.plan-title { font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-sub { font-size: 0.8rem; color: var(--text-3); margin-top: 3px; }

/* 金额 */
.amount { font-weight: 700; color: var(--sun); }
.type-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
}
.type-fuel { background: var(--type-fuel); }
.type-highway { background: var(--type-highway); }
.type-park { background: var(--type-park); }
.type-stay { background: var(--type-stay); }
.type-food { background: var(--type-food); }
.type-ticket { background: var(--type-ticket); }
.type-other { background: var(--type-other); }

/* ============ 统计 ============ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--card);
    border-radius: var(--r);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
}
.stat-card .num {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--sky-1), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-card .lbl { font-size: 0.8rem; color: var(--text-3); margin-top: 4px; }
.chart-wrap {
    position: relative;
    height: 260px;
    margin: 6px 0 14px;
}
.chart-legend { font-size: 0.8rem; color: var(--text-2); text-align: center; margin-bottom: 6px; }

/* ============ 管理 ============ */
.manage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.manage-item:last-child { border-bottom: none; }
.manage-info { flex: 1; }
.manage-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.manage-name { font-weight: 600; font-size: 0.92rem; }
.manage-sub { font-size: 0.78rem; color: var(--text-3); }

/* ============ 模态框 ============ */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    animation: fadeIn .2s ease;
}
.modal {
    background: #fff;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    animation: slideUp .25s ease;
}
.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-title i { color: var(--sky-1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 勾选列表 */
.check-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}
.check-item:hover { background: var(--card-2); }
.check-item .ck {
    width: 20px; height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.65rem;
    transition: all .15s;
}
.check-item.sel .ck { background: var(--sky-1); border-color: var(--sky-1); }

/* ============ 浮动大圆按钮 ============ */
.fab {
    position: fixed;
    right: 22px;
    bottom: 92px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sun), var(--sun-light));
    color: #fff;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(245,158,11,0.4);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 80;
    transition: transform .15s;
}
.fab:active { transform: scale(0.9); }
.fab.hidden { display: none; }

/* ============ 语音提示 ============ */
#voice-tip {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    background: rgba(15,23,42,0.9);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    z-index: 300;
    display: none;
    max-width: 88%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Toast */
#toast {
    position: fixed;
    left: 50%;
    top: 72px;
    transform: translateX(-50%);
    background: rgba(15,23,42,0.9);
    color: #fff;
    padding: 9px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    z-index: 400;
    display: none;
}

/* 确认弹窗按钮行 */
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* 返回按钮 */
.back-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.back-bar .back-btn {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
}

/* 小工具 */
.muted { color: var(--text-3); font-size: 0.8rem; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.center { text-align: center; }
.loading { text-align: center; padding: 50px 0; color: var(--text-3); }
.loading i { font-size: 1.8rem; margin-bottom: 10px; color: var(--sky-2); }

/* 迷你统计条 */
.mini-stats {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.mini-stat {
    flex: 1;
    background: var(--card-2);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border);
}
.mini-stat b { display: block; font-size: 1.05rem; color: var(--sky-1); }
.mini-stat span { font-size: 0.72rem; color: var(--text-3); }

@media (min-width: 600px) {
    .modal { border-radius: 20px; margin-bottom: 20px; }
}

/* 打印/大屏适配 */
@media (min-width: 700px) {
    body { padding-bottom: 30px; }
    .topbar { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: 0 0 16px 16px; }
}

/* ============ 百度地图选点弹窗 ============ */
.map-search { display: flex; gap: 8px; margin-bottom: 10px; }
.map-search .input { flex: 1; min-width: 0; }
.map-canvas { width: 100%; height: 320px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; background: #eef4fa; }
.map-hint { margin-top: 8px; font-size: 0.78rem; color: var(--text-2, #475569); background: #eff6ff; padding: 8px 10px; border-radius: 8px; word-break: break-all; }
.map-poi { margin-top: 10px; max-height: 160px; overflow-y: auto; border-top: 1px solid var(--border); }
.poi-item { display: block; width: 100%; text-align: left; padding: 8px 6px; border-bottom: 1px solid #eef2f7; cursor: pointer; font-size: 0.9rem; border-radius: 6px; }
.poi-item:hover, .poi-item:active { background: #f0f9ff; }
.poi-item small { display: block; margin-left: 20px; }
.map-canvas + .modal-actions { margin-top: 12px; }

/* ============ 携带物品 折叠 ============ */
.items-toggle { cursor: pointer; user-select: none; }
.items-toggle .items-summary { margin-left: 8px; font-size: 0.75rem; color: var(--text-2); background: rgba(14,165,233,0.12); padding: 2px 8px; border-radius: 20px; }
.items-toggle .items-caret { margin-left: 6px; color: var(--text-3); transition: transform .2s; }
.items-body { margin-top: 4px; }
.items-body.collapsed { display: none; }
.items-collapsed-hint { display: flex; align-items: center; gap: 8px; padding: 8px 4px; color: var(--text-2); font-size: 0.85rem; }
.link-btn { color: var(--sky-1); font-weight: 600; cursor: pointer; text-decoration: underline; background: none; border: none; padding: 0; }
