/* ============================================================
   我的行程 · My Plan — 苹果极简白 / Apple-minimal white
   与主站共享 tokens：纯白画布、#f5f5f7 交替面板、#1d1d1f 墨色、
   hairline #d2d2d7、单一强调色 #0066cc
   ============================================================ */

:root {
  --canvas: #ffffff;
  --canvas-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-muted: #6e6e73;
  --ink-subtle: #86868b;
  --hairline: #d2d2d7;
  --hairline-soft: #e8e8ed;
  --accent: #0066cc;
  --accent-hover: #0071e3;
  --danger: #c7362b;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-lg: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI Variable", "Segoe UI", Inter, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --max: 1180px;
  --topbar-h: 60px;
  --sumbar-h: 78px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  padding-bottom: calc(var(--sumbar-h) + 24px);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

::selection { background: rgba(0, 102, 204, 0.16); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─────────── 顶部导航 ─────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline-soft);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-gap { flex: 1 1 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--ink); color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.brand-text { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }

.back-link {
  font-size: 13px;
  color: var(--ink-muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.back-link:hover { color: var(--ink); border-bottom-color: var(--ink); text-decoration: none; }

.lang-btn {
  min-width: 46px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 980px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.2s var(--ease);
}
.lang-btn:hover { border-color: var(--ink); }

/* ─────────── 横幅 ─────────── */
/* topbar 是 fixed 的，横幅在 <main> 开头会被它盖住。
   所以默认不占位，只有真的有横幅时（JS 给 body 加 .has-banner）才让出 topbar 的高度。 */
.banner-wrap { display: none; }
body.has-banner .banner-wrap {
  display: block;
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 16px) 24px 0;
}
body.has-banner .hero { padding-top: 40px; }
.banner {
  margin-top: 0;
  padding: 16px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--canvas-alt);
  font-size: 14.5px;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.banner + .banner { margin-top: 10px; }
.banner b { color: var(--ink); font-weight: 600; }
.banner[hidden] { display: none; }
.banner .banner-cta { margin-left: auto; flex: 0 0 auto; }
@media (max-width: 620px) { .banner .banner-cta { margin-left: 0; width: 100%; } }

/* ─────────── HERO ─────────── */
.hero { padding: calc(var(--topbar-h) + 88px) 0 24px; }
.eyebrow {
  margin: 0 0 20px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--ink-subtle);
  text-transform: uppercase;
}
.hero-title {
  margin: 0;
  font-size: clamp(38px, 5.6vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero-sub {
  margin: 22px 0 0;
  max-width: 720px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.hero-meta {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--ink-subtle);
  letter-spacing: 0.01em;
}

/* ─────────── 分区 ─────────── */
.section { padding: 76px 0; }
.section-alt { background: var(--canvas-alt); }
.section-head { max-width: 780px; margin-bottom: 40px; }
.kicker {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.lede {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ─────────── 通用卡片 ─────────── */
.card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover { box-shadow: var(--card-shadow); }
.section-alt .card { background: #fff; }
.card-head { margin-bottom: 18px; }
.card-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hint {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-subtle);
}
.hint b { color: var(--ink-muted); font-weight: 500; }

/* ─────────── 表单 ─────────── */
.field { display: block; min-width: 0; }
.lab {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
}
.in {
  display: block;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
textarea.in {
  height: auto;
  min-height: 72px;
  padding: 11px 13px;
  resize: vertical;
  line-height: 1.5;
}
select.in {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-subtle) 50%),
    linear-gradient(135deg, var(--ink-subtle) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.in::placeholder { color: var(--ink-subtle); }
.in:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}
.in:disabled {
  background: var(--canvas-alt);
  color: var(--ink-subtle);
  cursor: not-allowed;
  box-shadow: none;
}
.in.mono { font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
input[type="date"].in { min-height: 42px; }
input[type="number"].in { -moz-appearance: textfield; }
input[type="number"].in::-webkit-outer-spin-button,
input[type="number"].in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ─────────── 按钮 ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 980px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { color: var(--accent); border-color: var(--hairline); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--hairline); background: #fff; }
.btn-danger:hover { border-color: var(--danger); }
.btn-small { height: 38px; padding: 0 18px; font-size: 14px; }
.btn:disabled,
.btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn:disabled:hover { background: var(--ink); }
.btn-ghost:disabled:hover { border-color: var(--hairline); }

/* 情侣模式一旦开启就锁死：按钮要看起来像「已锁定的状态徽章」，
   而不是一个被灰化的可点按钮，否则用户会以为还能再点一下关掉。 */
.btn.is-locked,
.btn.is-locked:disabled {
  position: relative;
  height: 38px;
  padding: 0 16px 0 30px;
  border-radius: 980px;
  border: 1px solid var(--hairline-soft);
  background: var(--canvas-alt);
  color: var(--ink-subtle);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 1;
  cursor: default;
}
/* 小锁：一个圆角方体 + 上方半圆提手，纯 CSS，不依赖字体或 emoji */
.btn.is-locked::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 8px;
  margin-top: 0;
  transform: translateY(-1px);
  border-radius: 2px;
  background: var(--ink-subtle);
}
.btn.is-locked::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-8px);
  border: 1.5px solid var(--ink-subtle);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.btn.is-locked:hover { background: var(--canvas-alt); opacity: 1; }

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--hairline);
  border-radius: 980px;
  background: #fff;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-mini:hover { border-color: var(--ink); color: var(--ink); }
.btn-mini.is-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-mini:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-mini:disabled:hover { border-color: var(--hairline); color: var(--ink-muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.row-center { margin-top: 20px; display: flex; justify-content: center; }

/* ─────────── 模板卡片 ─────────── */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.tpl-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px 26px 24px;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.tpl-card:hover { box-shadow: var(--card-shadow); }
.tpl-card.is-current { border-color: var(--ink); }
.tpl-name {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.tpl-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tpl-fact {
  padding: 5px 11px;
  border: 1px solid var(--hairline-soft);
  border-radius: 980px;
  background: var(--canvas-alt);
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.tpl-fact b { color: var(--ink); font-weight: 600; }
.tpl-note {
  margin: 16px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  flex: 1 1 auto;
}
.tpl-path {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-subtle);
  word-break: break-word;
}
.tpl-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.tpl-actions .btn { flex: 1 1 auto; }

/* ─────────── 空状态 ─────────── */
.empty-card {
  background: #fff;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-lg);
  padding: 44px 26px;
  text-align: center;
}
.empty-title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.empty-text { margin: 10px auto 0; max-width: 420px; font-size: 15px; color: var(--ink-muted); }
.empty-card .btn { margin-top: 22px; }
.empty-note {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--ink-subtle);
  text-align: center;
}
.empty-note[hidden] { display: none; }

/* ─────────── 计划 meta ─────────── */
.meta-card { margin-bottom: 22px; }
.grid-meta {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.meta-hint { margin-top: 14px; }

/* ─────────── 站点卡片 ─────────── */
.stops { display: flex; flex-direction: column; gap: 20px; }
.stop-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease);
}
.stop-card:hover { box-shadow: var(--card-shadow); }
.stop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas-alt);
}
.stop-index {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 600;
  display: grid; place-items: center;
}
.stop-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  min-width: 0;
}
.stop-thead { min-width: 0; flex: 1 1 220px; }
.stop-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-subtle);
}
.stop-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.stop-body { padding: 22px 24px 24px; }
.grid-stop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.grid-stop .field-wide { grid-column: 1 / -1; }
.sub-h {
  margin: 26px 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sub-h::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--hairline-soft);
}
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: #fff;
}
.row .in { flex: 1 1 160px; height: 38px; font-size: 14px; }
.row .in.narrow { flex: 0 1 116px; }
.row .in.mid { flex: 0 1 150px; }
.row .row-num {
  flex: 0 0 auto;
  min-width: 26px;
  font-size: 12px;
  color: var(--ink-subtle);
  font-variant-numeric: tabular-nums;
}
.row-empty {
  margin: 0;
  padding: 10px 2px;
  font-size: 13.5px;
  color: var(--ink-subtle);
}
.add-inline { margin-top: 12px; }

/* ─────────── 额外条目 ─────────── */
.extras-card { margin-top: 26px; }
.budget-card { margin-top: 26px; }

/* ─────────── 预算 ─────────── */
.budget-rows { display: flex; flex-direction: column; }
.brow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 14.5px;
}
.brow:last-child { border-bottom: 0; }
.brow-name { color: var(--ink-muted); min-width: 0; }
.brow-val {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.brow-total {
  border-top: 1px solid var(--hairline);
  border-bottom: 0;
  margin-top: 6px;
  padding-top: 16px;
  font-size: 17px;
  font-weight: 600;
}
.brow-total .brow-name { color: var(--ink); font-weight: 600; }
.brow-total .brow-val small {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-subtle);
  text-align: right;
  margin-top: 2px;
}

/* ─────────── 情侣模式 ─────────── */
.couple-card { margin-bottom: 18px; }
.couple-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
}
.couple-copy { flex: 1 1 320px; min-width: 0; }
.couple-copy h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.couple-action { flex: 0 0 auto; }
.couple-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.pill-locked {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--hairline);
  border-radius: 980px;
  background: var(--canvas-alt);
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.pill-locked b { color: var(--ink); font-weight: 600; }

.invite-card { margin-bottom: 22px; }
.link-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.link-box .in { flex: 1 1 260px; }
.link-box[hidden] { display: none; }

/* ─────────── 同游人卡片 ─────────── */
.comps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.comp-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
  transition: box-shadow 0.25s var(--ease);
}
.comp-card:hover { box-shadow: var(--card-shadow); }
.comp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.comp-avatar {
  width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--canvas-alt);
  border: 1px solid var(--hairline-soft);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.comp-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow-wrap: anywhere;
}
.comp-tools { margin-left: auto; display: flex; gap: 8px; }
.grid-comp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.comp-vis {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-soft);
}
.vis-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.vis-row .lab { margin: 0; }
.vis-row select.in { flex: 1 1 150px; height: 38px; font-size: 14px; }
.vis-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-subtle);
}
.vis-note.is-warn { color: var(--ink-muted); }
.comp-pending {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 980px;
  background: var(--canvas-alt);
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ─────────── 标注 ─────────── */
.ann-form { margin-bottom: 26px; }
.grid-ann {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}
.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}
.ann-main { flex: 1 1 260px; min-width: 0; }
.ann-target {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.ann-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.ann-side { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.tag-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 980px;
  background: #fff;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  white-space: nowrap;
}
.tag-pill.is-public { color: var(--accent); border-color: rgba(0, 102, 204, 0.32); }
.tag-pill.is-private { color: var(--ink-subtle); background: var(--canvas-alt); }
.tag-pill.is-role { color: var(--ink-muted); }

/* ─────────── 数据操作 ─────────── */
.data-card .btn-row { margin-bottom: 4px; }

/* ─────────── 底部汇总条 ─────────── */
.sumbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hairline-soft);
  min-height: var(--sumbar-h);
}
.sumbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px 36px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-budget { margin-right: auto; }
.stat-lab {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.stat-val {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.stat-sub {
  font-size: 12px;
  color: var(--ink-subtle);
  font-variant-numeric: tabular-nums;
}

/* ─────────── 返回顶部 ─────────── */
.to-top {
  position: fixed;
  right: 24px;
  bottom: calc(var(--sumbar-h) + 20px);
  z-index: 56;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.to-top:hover { box-shadow: var(--card-shadow); }
.to-top[hidden] { display: none; }

/* ─────────── toast ─────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sumbar-h) + 20px);
  transform: translate(-50%, 8px);
  z-index: 70;
  max-width: calc(100% - 48px);
  padding: 11px 20px;
  border-radius: 980px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ─────────── footer ─────────── */
.footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--hairline-soft);
}
.footer-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.footer-note {
  margin: 10px 0 0;
  max-width: 640px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-subtle);
}
.footer-links { margin: 16px 0 0; font-size: 13px; }

/* ─────────── 只读模式 ─────────── */
body.is-readonly .card:hover,
body.is-readonly .stop-card:hover,
body.is-readonly .tpl-card:hover,
body.is-readonly .comp-card:hover { box-shadow: none; }
body.is-readonly .tpl-actions,
body.is-readonly #stopAddBtn,
body.is-readonly .add-inline,
body.is-readonly .comp-tools,
body.is-readonly #compAddBtn,
body.is-readonly .invite-card,
body.is-readonly .couple-action,
body.is-readonly #annAddBtn,
body.is-readonly .ann-side .btn-mini { display: none !important; }
body.is-readonly .row-center { display: none; }

/* ─────────── 响应式 ─────────── */
@media (max-width: 980px) {
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .comps { grid-template-columns: minmax(0, 1fr); }
  .grid-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-meta .field:first-child { grid-column: 1 / -1; }
  .grid-stop { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-stop .field-wide { grid-column: 1 / -1; }
  .grid-ann { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-ann .field:nth-child(2) { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap, .nav-inner, .sumbar-inner { padding-left: 18px; padding-right: 18px; }
  .banner-wrap { padding-left: 18px; padding-right: 18px; }

  .hero { padding-top: calc(var(--topbar-h) + 56px); }
  .hero-title { font-size: clamp(32px, 9vw, 44px); }
  .hero-sub { font-size: 16.5px; margin-top: 16px; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }
  .lede { font-size: 15.5px; }

  .card, .stop-body { padding: 20px 18px; }
  .stop-head { padding: 16px 18px; }
  .comp-card { padding: 18px 18px 20px; }
  .tpl-card { padding: 22px 20px 20px; }

  .grid-meta,
  .grid-stop,
  .grid-comp,
  .grid-ann { grid-template-columns: minmax(0, 1fr); }
  .grid-meta .field:first-child,
  .grid-stop .field-wide,
  .grid-ann .field:nth-child(2) { grid-column: auto; order: 0; }

  .comps { gap: 14px; }
  .row { padding: 10px; }
  .row .in, .row .in.narrow, .row .in.mid { flex: 1 1 100%; height: 40px; }
  .row .in.narrow { flex: 0 1 120px; }
  .row .btn-mini { flex: 0 0 auto; }

  .ann-item { padding: 14px 16px; }
  .ann-side { margin-left: 0; width: 100%; justify-content: space-between; }

  .couple-row { gap: 14px; }
  .couple-action { flex: 1 1 100%; }
  .couple-action .btn { width: 100%; }

  .btn { height: 44px; padding: 0 20px; font-size: 14.5px; }
  .btn-small { height: 38px; }
  .btn-row { gap: 10px; }
  .btn-row .btn { flex: 1 1 calc(50% - 5px); }

  .sumbar-inner { gap: 8px 22px; padding-top: 10px; padding-bottom: 10px; }
  .stat-val { font-size: 17px; }
  .stat-budget { margin-right: 0; flex: 1 1 100%; flex-direction: row; align-items: baseline; gap: 10px; }
  .stat-budget .stat-lab { flex: 0 0 auto; }
  .stat-budget .stat-sub { margin-left: auto; }
  :root { --sumbar-h: 96px; }
  .to-top { right: 16px; bottom: calc(var(--sumbar-h) + 14px); width: 40px; height: 40px; }
  .toast { bottom: calc(var(--sumbar-h) + 16px); font-size: 13px; }
  .back-link { display: none; }
  .brand-text { font-size: 14px; }
}

@media (max-width: 420px) {
  .tpl-actions .btn { flex: 1 1 100%; }
  .btn-row .btn { flex: 1 1 100%; }
  .stop-tools { margin-left: 0; width: 100%; }
}


/* ---------- 云端同步条（plan-cloud.js） ---------- */
.cloud-bar {
  /* 页面顶部有 fixed topbar（--topbar-h），云端条贴它下沿，避免被遮住 */
  position: sticky;
  top: var(--topbar-h);
  z-index: 55;
  margin-top: var(--topbar-h);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid #e8e8ed;
}
.cloud-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #6e6e73;
}
.cloud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7c7cc;
  flex: 0 0 auto;
}
.cloud-bar[data-tone="ok"] .cloud-dot { background: #34a853; }
.cloud-bar[data-tone="warn"] .cloud-dot { background: #f2a33c; }
.cloud-bar[data-tone="err"] .cloud-dot { background: #d8543f; }
.cloud-bar[data-tone="busy"] .cloud-dot { background: #0066cc; }
.cloud-status { flex: 1 1 220px; min-width: 0; }
.cloud-vis {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.cloud-vis select {
  font: inherit;
  color: #1d1d1f;
  background: #f5f5f7;
  border: 1px solid #e8e8ed;
  border-radius: 8px;
  padding: 4px 8px;
}
.cloud-btn {
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: #1d1d1f;
  border: 1px solid #1d1d1f;
  border-radius: 980px;
  padding: 5px 14px;
  cursor: pointer;
  flex: 0 0 auto;
}
.cloud-btn:hover { background: #000; }
.cloud-btn:disabled { opacity: 0.5; cursor: default; }
.cloud-btn-ghost {
  color: #0066cc;
  background: transparent;
  border-color: rgba(0, 102, 204, 0.35);
}
.cloud-btn-ghost:hover { background: rgba(0, 102, 204, 0.06); }
.cloud-btn[hidden] { display: none; }
@media (max-width: 640px) {
  .cloud-inner { padding: 10px 16px; gap: 8px; }
  .cloud-status { flex: 1 1 100%; }
}
