/* 秋刀鱼旅行助手 - 全局设计规范
   风格：年轻/清新/轻盈/旅行感/治愈柔和
   配色：明亮轻快，深蓝主色 #2E6FB7，薄荷绿点缀
   适配：全机型弹性布局，卡片式，文字不挤压换行 */
:root {
  --primary: #2E7DD1;
  --primary-dark: #1F4E78;
  --primary-light: #E8F2FC;
  --accent: #38C6A6;
  --accent-light: #E3F8F2;
  --warn: #FF8A5B;
  --danger: #E8524F;
  --gold: #FFB23F;
  --ink: #1E2A3A;
  --ink-2: #5B6B7F;
  --ink-3: #93A2B5;
  --line: #E6EDF5;
  --bg: #F4F8FD;
  --card: #FFFFFF;
  --shadow: 0 4px 20px rgba(46, 125, 209, 0.08);
  --shadow-lg: 0 10px 36px rgba(46, 125, 209, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(72px + var(--safe-bottom));
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; color: inherit; }

/* 布局容器：手机全宽，桌面居中限宽 */
.app { width: 100%; max-width: 520px; margin: 0 auto; min-height: 100vh; position: relative; }
.page { padding: 16px 16px 24px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(135deg, var(--primary) 0%, #4A9BE8 100%);
  color: #fff; padding: calc(14px + var(--safe-top)) 16px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 12px rgba(46,125,209,.22);
}
.topbar .back { font-size: 22px; width: 28px; flex: 0 0 28px; line-height: 1; }
.topbar h1 { font-size: 18px; font-weight: 700; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .action { font-size: 14px; flex: 0 0 auto; opacity: .95; }

/* 品牌头（登录/首页） */
.brand-head { text-align: center; padding: 40px 20px 24px; }
.brand-head .logo { font-size: 46px; }
.brand-head h1 { font-size: 24px; margin: 8px 0 4px; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-head p { color: var(--ink-2); margin: 0; font-size: 14px; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 13px; color: var(--primary); font-weight: 500; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.input, .textarea, .select {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: #FBFDFF; color: var(--ink); transition: border .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,125,209,.1); }
.textarea { min-height: 84px; resize: vertical; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: var(--radius-sm); font-weight: 700; font-size: 15px;
  transition: transform .12s, box-shadow .2s, opacity .2s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #4A9BE8); color: #fff; box-shadow: 0 4px 14px rgba(46,125,209,.28); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #5AD9BC); color: #fff; box-shadow: 0 4px 14px rgba(56,198,166,.28); }
.btn-ghost { background: var(--primary-light); color: var(--primary); }
.btn-line { background: #fff; color: var(--ink-2); border: 1.5px solid var(--line); }
.btn-danger { background: #FDECEC; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 标签/徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--accent-light); color: #1FA588; }
.badge-orange { background: #FFF1E6; color: var(--warn); }
.badge-red { background: #FDECEC; color: var(--danger); }
.badge-gray { background: #EEF2F7; color: var(--ink-2); }

/* 行程卡片 */
.trip-card { position: relative; overflow: hidden; }
.trip-card .cover { height: 92px; border-radius: 14px; background: linear-gradient(135deg, #A8D8FF, #7FB8F0); display: flex; align-items: center; justify-content: center; font-size: 38px; margin-bottom: 12px; }
.trip-card h3 { margin: 0 0 6px; font-size: 17px; }
.trip-card .meta { color: var(--ink-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.trip-card .meta span { white-space: nowrap; }

/* 列表行 */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.row .amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-in { color: var(--danger); }
.amount-out { color: var(--accent); }

/* 金额大字 */
.money-big { font-size: 30px; font-weight: 800; color: var(--primary-dark); font-variant-numeric: tabular-nums; }

/* 时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-light); }
.tl-time { font-size: 12px; color: var(--primary); font-weight: 700; }
.tl-loc { font-size: 13px; color: var(--ink-2); }

/* 复选框 */
.check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex: 0 0 22px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.check.on { background: var(--accent); border-color: var(--accent); }
.done .title { text-decoration: line-through; color: var(--ink-3); }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 40;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex; padding: 8px 4px calc(8px + var(--safe-bottom));
}
.tabbar .tab { flex: 1; text-align: center; color: var(--ink-3); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar .tab .ic { font-size: 20px; line-height: 1; }
.tabbar .tab.active { color: var(--primary); font-weight: 700; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(20,35,55,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.modal { width: 100%; max-width: 520px; background: #fff; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + var(--safe-bottom)); max-height: 86vh; overflow-y: auto; }
.modal h3 { margin: 0 0 16px; font-size: 18px; text-align: center; }
.modal .close { position: absolute; right: 16px; top: 16px; font-size: 20px; color: var(--ink-3); }

/* 隐私提示 */
.privacy-tip { background: var(--accent-light); border-radius: 12px; padding: 10px 12px; font-size: 12px; color: #1FA588; display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }

/* 空状态 */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .ic { font-size: 52px; margin-bottom: 12px; opacity: .7; }

/* 图片网格 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid .ph { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); position: relative; }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }

/* 分段控制 */
.segment { display: flex; background: #EEF2F7; border-radius: 12px; padding: 3px; margin-bottom: 16px; }
.segment .seg { flex: 1; text-align: center; padding: 9px 4px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.segment .seg.on { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* toast */
.toast { position: fixed; left: 50%; top: 20%; transform: translateX(-50%); background: rgba(30,42,58,.92); color: #fff; padding: 10px 20px; border-radius: 12px; z-index: 100; font-size: 14px; max-width: 80%; text-align: center; animation: fade .2s; }

/* 桌面端微调 */
@media (min-width: 560px) {
  body { background: #EAF1F8; }
  .app { box-shadow: 0 0 40px rgba(30,50,80,.06); background: var(--bg); }
}
