:root {
  --bg: #f5f5f0;
  --surface: #ffffff;
  --surface-2: #fafaf6;
  --ink: #17211c;
  --ink-2: #46524b;
  --muted: #8b958e;
  --line: #e6e6dd;
  --line-soft: #efefe8;
  --accent: #0f7a5c;
  --accent-soft: #e6f2ec;
  --accent-deep: #0a5a44;
  --company: #0f7a5c;
  --dept: #4356c7;
  --team: #b06a12;
  --personal: #7a4bc9;
  --danger: #b33a2c;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 33, 28, .04), 0 8px 24px -18px rgba(23, 33, 28, .4);
  --nav-h: 68px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(1200px 500px at 50% -260px, rgba(15, 122, 92, .10), transparent 70%),
    radial-gradient(900px 420px at 100% 20%, rgba(67, 86, 199, .06), transparent 70%);
  background-repeat: no-repeat;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px calc(var(--nav-h) + 46px);
  position: relative;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 2px 12px;
  background: linear-gradient(to bottom, var(--bg) 68%, rgba(245, 245, 240, 0));
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 37px; height: 37px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
  display: grid; place-items: center;
  box-shadow: var(--shadow);
  flex: none;
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .4px; margin-top: -1px; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: rgba(15, 122, 92, .25);
  color: var(--accent-deep);
}
.chip-toggle[aria-pressed="false"] { color: var(--muted); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(15, 122, 92, .22);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 14px;
  display: grid; place-items: center;
  flex: none;
}

/* ---------- views ---------- */
.views { min-height: 60vh; }
.view { animation: rise .3s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title { font-size: 19px; margin: 0; letter-spacing: -.2px; }
.section-desc { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.net-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 2px 14px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(150deg, #0e2b23 0%, #113a2e 48%, #0e2b23 100%);
  color: #eef6f1;
  border-radius: 24px;
  padding: 20px 20px 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px -28px rgba(9, 48, 37, .9);
}
.hero::after {
  content: "";
  position: absolute;
  top: -40%; right: -30%; bottom: auto; left: auto;
  inset: -40% -30% auto auto;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(120, 220, 180, .22), transparent 62%);
  pointer-events: none;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.hero-eyebrow { font-size: 11.5px; letter-spacing: 1.4px; color: rgba(232, 246, 238, .62); text-transform: uppercase; }
.hero-name { font-size: 21px; font-weight: 700; margin-top: 3px; letter-spacing: -.2px; }
.hero-meta { font-size: 12.5px; color: rgba(232, 246, 238, .66); margin-top: 4px; }
.hero-ring { flex: none; width: 88px; height: 88px; position: relative; }
.hero-ring svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.hero-ring .ring-val {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  letter-spacing: -.5px;
}
.hero-ring .ring-val small { font-size: 11px; font-weight: 600; margin-left: 1px; color: rgba(232, 246, 238, .65); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  position: relative;
}
.hero-stat {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  padding: 9px 11px;
}
.hero-stat b { display: block; font-size: 17px; letter-spacing: -.3px; }
.hero-stat span { font-size: 10.5px; color: rgba(232, 246, 238, .58); letter-spacing: .4px; }

.hero-signal {
  position: relative;
  margin-top: 14px;
  font-size: 12px;
  color: rgba(232, 246, 238, .75);
  display: flex; align-items: flex-start; gap: 7px;
  line-height: 1.55;
}
.hero-signal svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* ---------- cards / lists ---------- */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 2px 10px;
}
.list-head h3 { margin: 0; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.list-head .link-btn { font-size: 12.5px; }
.list-actions { display: flex; align-items: center; gap: 10px; }
.list-head .quick-import {
  background: #e3f2ea; color: var(--accent-deep);
  border: 1px solid #c9e2d5;
  border-radius: 999px; padding: 4px 10px 4px 11px;
  font-weight: 600;
}
.list-head .quick-import:hover { background: #d5ebe0; border-color: #b8d8c7; }

.okr-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform .16s ease, border-color .16s ease;
}
.okr-card:active { transform: scale(.994); border-color: #d8d8cd; }
.okr-card.is-mine { border-left: 3px solid var(--accent); }

.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.level-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 3px 8px;
  border-radius: 6px;
  flex: none;
}
.level-tag.lv-company { background: rgba(15, 122, 92, .10); color: var(--company); }
.level-tag.lv-dept { background: rgba(67, 86, 199, .10); color: var(--dept); }
.level-tag.lv-team { background: rgba(176, 106, 18, .12); color: var(--team); }
.level-tag.lv-personal { background: rgba(122, 75, 201, .10); color: var(--personal); }
.owner-tag { font-size: 11.5px; color: var(--muted); }
.card-score { margin-left: auto; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

.card-objective {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: -.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-objective .o-flag { color: var(--accent); font-weight: 800; margin-right: 5px; }

.progress-line { height: 5px; border-radius: 4px; background: var(--line-soft); margin: 11px 0 8px; overflow: hidden; }
.progress-line i { display: block; height: 100%; border-radius: 4px; transition: width .4s ease; }
.progress-line i.s-good { background: linear-gradient(90deg, #1a8f6c, #37b98d); }
.progress-line i.s-mid { background: linear-gradient(90deg, #c9821c, #e0a13c); }
.progress-line i.s-low { background: linear-gradient(90deg, #b8473a, #d0665a); }

.card-bottom { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.card-bottom .kr-count { font-variant-numeric: tabular-nums; }
.card-bottom .spacer { flex: 1; }
.related-pill {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
  font-size: 10.5px;
}
.parent-hint {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--ink-2);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  margin-top: 10px;
  line-height: 1.35;
}
.parent-hint svg { width: 13px; height: 13px; flex: none; color: var(--muted); }
.parent-hint .ph-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parent-hint .ph-owner { color: var(--muted); flex: none; }

/* ---------- empty state ---------- */
.empty {
  text-align: center;
  background: var(--surface);
  border: 1px dashed #dcdcd1;
  border-radius: 20px;
  padding: 26px 20px;
}
.empty .em-icon {
  width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
}
.empty .em-icon svg { width: 28px; height: 28px; }
.empty h4 { margin: 0 0 5px; font-size: 16px; }
.empty p { margin: 0 auto 16px; font-size: 12.5px; color: var(--muted); max-width: 300px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .14s ease, background .14s ease;
}
.btn:active { transform: scale(.985); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-deep); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); }
.btn-danger { color: var(--danger); border-color: rgba(179, 58, 44, .25); background: #fdf5f3; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 9px; }
.btn-row .btn { flex: 1; }

.link-btn { background: none; border: 0; color: var(--accent-deep); font-size: 13px; font-weight: 600; padding: 2px 0; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--ink-2);
  flex: none;
}
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- footnote ---------- */
.footnote {
  margin: 22px 4px 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
  display: flex;
  gap: 7px;
}
.footnote svg { width: 14px; height: 14px; flex: none; margin-top: 2px; opacity: .7; }

/* ---------- network ---------- */
.net-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 6px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.net-stat { text-align: center; position: relative; }
.net-stat + .net-stat::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 1px; background: var(--line-soft);
}
.net-stat b { display: block; font-size: 18px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.net-stat span { font-size: 10.5px; color: var(--muted); letter-spacing: .3px; }

.graph-card {
  background: #0f1f1a;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 44px -30px rgba(10, 40, 32, .9);
  position: relative;
}
.graph-tools {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 4px;
  gap: 8px;
}
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10.5px; color: rgba(226, 240, 233, .62); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.lv-company { background: #4ecfa4; }
.dot.lv-dept { background: #8b9bf5; }
.dot.lv-team { background: #ecb264; }
.dot.lv-personal { background: #c3a0f7; }
.graph-actions { display: flex; gap: 6px; flex: none; }
.mini-btn {
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04);
  color: rgba(232, 244, 238, .78);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  flex: none;
}
body.graph-full { overflow: hidden; }
body.graph-full #view-align { animation: none; transform: none; }
.graph-card.graph-full {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  background: #0c1b16;
  box-shadow: none;
}
.graph-card.graph-full .graph-tools {
  justify-content: flex-end;
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 6px calc(14px + env(safe-area-inset-left));
}
.graph-card.graph-full .legend { display: none; }
.graph-card.graph-full .graph-stage {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px calc(8px + env(safe-area-inset-right)) 8px calc(8px + env(safe-area-inset-left));
}
.graph-card.graph-full .graph-hint {
  padding: 4px calc(8px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
}
.graph-stage {
  padding: 6px 4px 10px;
  overflow: hidden;
  position: relative;
  touch-action: none;
}
#graphSvg {
  display: block; max-width: none; margin: 0 auto;
  transform-origin: 0 0;
  background: radial-gradient(120% 100% at 50% 0%, #14271f 0%, #0c1b16 70%);
  border-radius: 14px;
  touch-action: none;
}
.graph-hint {
  text-align: center;
  font-size: 10.5px;
  color: rgba(226, 240, 233, .38);
  padding: 4px 0 12px;
  letter-spacing: .3px;
}

.g-node rect { transition: fill .18s ease, stroke .18s ease, opacity .18s ease; }
.g-node { cursor: pointer; transition: opacity .18s ease; }
.g-node:active rect:first-of-type { fill: rgba(255, 255, 255, .1); }
.g-node.sel rect:first-of-type { fill: rgba(255, 255, 255, .12); stroke: #ffffff; stroke-width: 1.6; }
.g-node.near { opacity: .95; }
.g-node.dim { opacity: .24; }
.g-edge-align { fill: none; stroke: rgba(206, 228, 218, .30); stroke-width: 1.2; transition: opacity .18s ease, stroke .18s ease; }
.g-edge-rel { fill: none; stroke: rgba(120, 210, 178, .55); stroke-width: 1; stroke-dasharray: 3 4; opacity: .8; transition: opacity .18s ease; }
.g-edge-align.active { stroke: rgba(126, 231, 192, .95); stroke-width: 1.8; }
.g-edge-align.dim { opacity: .10; }
.g-edge-rel.active { opacity: 1; stroke-width: 1.4; }
.g-edge-rel.dim { opacity: .08; }
.g-row-label { fill: rgba(220, 238, 230, .34); font-size: 10px; letter-spacing: 1.2px; }

#netInsights .insight {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  box-shadow: var(--shadow);
}
.insight h4 { margin: 0 0 4px; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.insight h4 svg { width: 15px; height: 15px; color: var(--accent); }
.insight p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
.insight .pair { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; }
.insight .pair .bar { flex: 1; height: 4px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.insight .pair .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.insight .pair b { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 34px; text-align: right; }
.insight .pair .pname { max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- search / filters ---------- */
.searchbar {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 13px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.searchbar svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.searchbar input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; }
.searchbar input::placeholder { color: #a8b0aa; }
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; }

.filter-row {
  display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 12px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
  flex: none;
}
.filter-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.group-head {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 3px 8px;
}
.group-head .g-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  color: #fff;
  flex: none;
}
.group-head .g-name { font-size: 13px; font-weight: 700; }
.group-head .g-meta { font-size: 11px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- tabbar / fab ---------- */
.tabbar {
  position: fixed;
  left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  height: var(--nav-h);
  background: #fdfdf9;
  border: 1px solid rgba(220, 220, 210, .9);
  border-radius: 22px;
  box-shadow: 0 14px 36px -18px rgba(23, 33, 28, .5);
  display: flex;
  align-items: stretch;
  z-index: 30;
}
.tab {
  flex: 1;
  border: 0;
  background: none;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .3px;
  border-radius: 22px;
  transition: color .18s ease;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--accent-deep); }
.tab.active svg { color: var(--accent); }

.fab {
  position: fixed;
  right: max(20px, calc(50% - 380px + 20px));
  bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  z-index: 25;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 12px 17px 12px 14px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 14px 28px -12px rgba(15, 122, 92, .7);
  transition: transform .22s cubic-bezier(.22, .61, .36, 1), opacity .18s ease;
  will-change: transform, opacity;
}
.fab svg { width: 18px; height: 18px; }
.fab:active { transform: scale(.96); }
.fab.is-hidden { opacity: 0; transform: translateY(10px) scale(.92); pointer-events: none; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 60; }
.sheet-mask { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(14, 24, 20, .45); animation: fade .2s ease both; }
.sheet {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 100%; max-width: 760px; max-height: 88vh;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.22, .8, .3, 1) both;
  overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translate(-50%, 6%); opacity: .4; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-wrap:not(.hidden) .sheet { will-change: transform, opacity; }
.sheet-wrap.closing { pointer-events: none; }
.sheet-wrap.closing .sheet-mask { animation: fadeOut .18s ease both; }
.sheet-wrap.closing .sheet { animation: slideDown .2s cubic-bezier(.4, 0, .7, .2) both; }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideDown { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, 9%); opacity: 0; } }
.sheet-grab { width: 38px; height: 4px; border-radius: 3px; background: #d5d5ca; margin: 4px auto 14px; }

.detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-objective { font-size: 19px; font-weight: 700; line-height: 1.4; letter-spacing: -.3px; margin: 0 0 4px; }
.detail-owner { font-size: 12.5px; color: var(--muted); }
.detail-score-row {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 6px;
}
.detail-score-row .big { font-size: 26px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.detail-score-row .lbl { font-size: 11.5px; color: var(--muted); }
.detail-score-row .spacer { flex: 1; }
.conf-pill { font-size: 11.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

.block-title {
  font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  margin: 20px 2px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.block-title .cnt { font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 11px; }

.kr-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 8px;
}
.kr-line1 { display: flex; gap: 9px; align-items: flex-start; }
.kr-index {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; flex: none; margin-top: 1px;
}
.kr-text { font-size: 13.5px; line-height: 1.5; font-weight: 500; flex: 1; }
.kr-num { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.kr-progress { margin-top: 9px; display: flex; align-items: center; gap: 9px; }
.kr-progress .bar { flex: 1; height: 4px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.kr-progress .bar i { display: block; height: 100%; border-radius: 3px; }
.kr-progress .pct { font-size: 10.5px; font-weight: 700; color: var(--ink-2); min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.kr-edit { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.kr-edit input[type="range"] { flex: 1; accent-color: var(--accent); height: 22px; }
.kr-edit .cur-val { font-size: 11.5px; color: var(--ink-2); min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }

.chain-item, .related-item {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 7px;
}
.chain-item .ci-main, .related-item .ri-main { flex: 1; min-width: 0; }
.chain-item .ci-o, .related-item .ri-o {
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chain-item .ci-meta, .related-item .ri-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chain-item .ci-score {
  font-size: 11.5px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); padding: 2px 7px; border-radius: 6px;
  font-variant-numeric: tabular-nums; flex: none;
}
.tag-pill { background: #f0f0ea; color: var(--ink-2); border-radius: 5px; padding: 1px 6px; font-size: 10px; }
.related-explain {
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
  padding: 2px 2px 8px;
  display: flex; gap: 6px;
}
.related-explain svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--accent); }

.suggest-card {
  background: linear-gradient(140deg, #eaf5ef, #f7fbf8);
  border: 1px solid rgba(15, 122, 92, .2);
  border-radius: 14px;
  padding: 12px 13px;
  margin: 8px 0 4px;
}
.suggest-card .sc-title { font-size: 11.5px; font-weight: 700; color: var(--accent-deep); display: flex; align-items: center; gap: 5px; }
.suggest-card .sc-title svg { width: 14px; height: 14px; }
.suggest-card .sc-body { font-size: 12.5px; margin: 6px 0 9px; line-height: 1.5; }
.suggest-card .sc-why { font-size: 10.5px; color: var(--ink-2); opacity: .8; margin-top: 4px; }
.suggest-card .btn { background: #fff; border-color: rgba(15, 122, 92, .25); color: var(--accent-deep); }

.detail-actions { display: flex; gap: 9px; margin-top: 20px; }
.detail-actions .btn { flex: 1; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 70; }
.modal-wrap.modal-over-auth { z-index: 90; }
.modal-mask { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(14, 24, 20, .5); animation: fade .2s ease both; }
.modal {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 26px); max-width: 600px;
  max-height: 90vh;
  background: var(--bg);
  border-radius: 22px;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pop .24s cubic-bezier(.2, .8, .3, 1) both;
  box-shadow: 0 30px 70px -30px rgba(10, 30, 24, .6);
}
@keyframes pop { from { transform: translate(-50%, -48%) scale(.97); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal-wrap:not(.hidden) .modal { will-change: transform, opacity; }
.modal-wrap.closing { pointer-events: none; }
.modal-wrap.closing .modal-mask { animation: fadeOut .16s ease both; }
.modal-wrap.closing .modal { animation: popOut .17s cubic-bezier(.4, 0, .7, .2) both; }
@keyframes popOut { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(-50%, -50%) scale(.97); opacity: 0; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.modal-head h3 { margin: 0; font-size: 16.5px; letter-spacing: -.2px; }
.modal-body { padding: 14px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  display: flex; gap: 9px;
  flex: none;
  background: var(--bg);
}
.modal-foot .btn { flex: 1; }

/* ---------- 自定义下拉选择 ---------- */
.cselect { position: relative; }
.cselect select { display: none !important; }
.cselect-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.cselect-btn:hover { border-color: #cfd8d2; }
.cselect-btn:active { background: #f1f5f2; }
.cselect-btn .cs-label {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cselect-btn.is-placeholder .cs-label { color: var(--muted); }
.cselect-btn svg { width: 16px; height: 16px; flex: none; color: var(--muted); }

.picker-wrap {
  position: fixed; inset: 0; z-index: 96;
  display: flex; align-items: flex-end; justify-content: center;
}
.picker-mask {
  position: absolute; inset: 0;
  background: rgba(14, 24, 20, .44);
  animation: fade .18s ease both;
}
.picker {
  position: relative; width: 100%; max-width: 600px; max-height: 70vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -24px 60px -24px rgba(10, 30, 24, .55);
  padding-bottom: env(safe-area-inset-bottom);
  animation: pickerUp .22s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes pickerUp { from { transform: translateY(26px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.picker-head h3 { margin: 0; font-size: 15.5px; letter-spacing: -.2px; }
.picker-list {
  padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
}
.picker-option {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 12px 10px;
  border: 0; border-radius: 12px;
  background: transparent;
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  text-align: left;
}
.picker-option + .picker-option { margin-top: 2px; }
.picker-option:active { background: #eef4f0; }
.picker-option .po-main { flex: 1; min-width: 0; line-height: 1.4; }
.picker-option .po-title { display: block; }
.picker-option .po-desc { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.picker-option .po-check {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center;
  border: 1.6px solid #c9d4cd; border-radius: 50%;
  font-size: 12px; color: transparent;
}
.picker-option.on { background: var(--accent-soft); }
.picker-option.on .po-check {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ---------- forms ---------- */
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; letter-spacing: .2px; }
.field .hint { font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(15, 122, 92, .45);
  box-shadow: 0 0 0 3px rgba(15, 122, 92, .08);
}
.textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%238b958e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.kr-edit-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  margin-bottom: 9px;
  position: relative;
}
.kr-edit-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.kr-edit-head .badge { font-size: 10.5px; font-weight: 700; color: var(--accent-deep); background: var(--accent-soft); padding: 2px 7px; border-radius: 5px; }
.kr-edit-head .rm { margin-left: auto; }
.kr-edit-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-top: 7px; }
.kr-edit-grid .mini-label { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.kr-edit-grid input { width: 100%; border: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; outline: none; }
.kr-edit-card .kr-text-input { width: 100%; border: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 8px; padding: 8px 9px; font-size: 13px; outline: none; }

.settings-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .sr-main { flex: 1; min-width: 0; }
.settings-row .sr-title { font-weight: 600; }
.settings-row .sr-desc { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.settings-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex: none;
}

.export-area {
  width: 100%;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px;
  outline: none;
  color: var(--ink-2);
}
.import-area { min-height: 120px; }
.import-drop {
  border: 1.5px dashed #b9c9c0;
  border-radius: 14px;
  padding: 18px 12px 16px;
  text-align: center;
  background: #fbfdfb;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 10px;
  outline: none;
}
.import-drop:hover, .import-drop:focus-visible, .import-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.import-drop-icon {
  width: 36px; height: 36px; margin: 0 auto 7px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
}
.import-drop-icon svg { width: 19px; height: 19px; }
.import-drop-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.import-drop-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.import-meta { font-size: 11.5px; color: var(--accent-deep); margin-top: 6px; min-height: 14px; }
.import-or {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 11px; margin: 8px 0;
}
.import-or::before, .import-or::after {
  content: ""; height: 1px; background: var(--line); flex: 1;
}
.import-hint { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 6px 2px 0; }
.import-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px; background: #eef3ef; color: var(--ink-2);
  padding: 1px 4px; border-radius: 4px;
}
.seg {
  display: flex;
  background: #ecece5;
  border-radius: 11px;
  padding: 3px;
  margin-bottom: 14px;
}
.seg button {
  flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.welcome {
  text-align: center;
  padding: 6px 4px 2px;
}
.welcome .w-mark {
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin: 0 auto 12px;
}
.welcome .w-mark svg { width: 32px; height: 32px; }
.welcome h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.3px; }
.welcome p { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.welcome .field { text-align: left; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 40px);
  transform: translate(-50%, 10px);
  background: rgba(20, 32, 27, .94);
  color: #f2f7f4;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 100;
  max-width: 84vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 四大动作 ---------- */
.action-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 13px 12px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}
.action-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.action-head .ah-main { display: flex; flex-direction: column; gap: 1px; }
.action-head .ah-main b { font-size: 13px; letter-spacing: .2px; }
.action-head .ah-main span { font-size: 10.5px; color: var(--muted); letter-spacing: .3px; }
.action-count {
  font-size: 12px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); border-radius: 999px; padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}
.action-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.action-step {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 8px 6px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0;
  transition: border-color .15s ease, background .15s ease;
}
.action-step:active { transform: scale(.985); }
.action-step .as-dot {
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  background: #ecece5; color: var(--muted);
  margin-bottom: 2px;
}
.action-step b { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.action-step small {
  font-size: 9.5px; color: var(--muted); line-height: 1.3;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.action-step.doing { border-color: rgba(176, 106, 18, .22); background: #fdf8ef; }
.action-step.doing .as-dot { background: rgba(176, 106, 18, .14); color: #9a5c0d; }
.action-step.done { border-color: rgba(15, 122, 92, .2); background: #f2f9f5; }
.action-step.done .as-dot { background: var(--accent); color: #fff; }
.action-step.done b { color: var(--accent-deep); }

/* ---------- 战略金字塔（我的） ---------- */
.strategy-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}
.strategy-mini.empty { text-align: left; }
.strategy-mini .sm-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.strategy-mini .sm-title { font-size: 12px; font-weight: 700; letter-spacing: .6px; color: var(--ink-2); }
.strategy-mini .sm-row {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 6px 0;
  border-top: 1px dashed var(--line-soft);
}
.strategy-mini .sm-label {
  flex: none; font-size: 10.5px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); border-radius: 5px; padding: 2px 7px;
  margin-top: 1px;
}
.strategy-mini .sm-text {
  font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.strategy-mini .sm-text.none { color: var(--muted); }
.strategy-mini p { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- 战略金字塔（对齐） ---------- */
.pyr-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 14px 10px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.pyr-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.pyr-head .ah-main { display: flex; flex-direction: column; gap: 1px; }
.pyr-head .ah-main b { font-size: 13px; }
.pyr-head .ah-main span { font-size: 10.5px; color: var(--muted); }
.pyr-row {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}
.pyr-label {
  flex: none; width: 62px;
  font-size: 10.5px; font-weight: 700;
  border-radius: 6px; padding: 3px 6px;
  text-align: center;
}
.pyr-row.lv-1 .pyr-label { background: rgba(15, 122, 92, .12); color: var(--company); }
.pyr-row.lv-2 .pyr-label { background: rgba(67, 86, 199, .10); color: var(--dept); }
.pyr-row.lv-3 .pyr-label { background: rgba(176, 106, 18, .12); color: var(--team); }
.pyr-row.lv-4 .pyr-label { background: rgba(122, 75, 201, .10); color: var(--personal); }
.pyr-row.lv-5 .pyr-label { background: #eef0e8; color: var(--ink-2); }
.pyr-main { flex: 1; min-width: 0; }
.pyr-text { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.pyr-text.none { color: var(--muted); }
.pyr-hint { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ---------- 为什么 / 任务 / 标签 ---------- */
.strategy-context {
  display: flex; gap: 8px; align-items: flex-start;
  background: #f3f7f4;
  border: 1px solid #e1ece5;
  border-radius: 12px;
  padding: 9px 11px;
  margin: 12px 0 2px;
}
.strategy-context.edit { margin: 0 0 12px; }
.strategy-context .sc-label {
  flex: none; font-size: 10px; font-weight: 700; color: var(--accent-deep);
  background: #e0efe7; border-radius: 5px; padding: 2px 6px; margin-top: 1px;
}
.strategy-context .sc-text { font-size: 12px; line-height: 1.55; color: var(--ink-2); }
.strategy-context .sc-text.none { color: var(--muted); }

.why-block {
  background: #fbf7ee;
  border: 1px solid #efe4ce;
  border-left: 3px solid #c99436;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 12px;
}
.why-block .why-label {
  font-size: 10px; font-weight: 700; letter-spacing: .6px;
  color: #9a6a12; text-transform: uppercase;
}
.why-block p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.why-block.empty { background: #fbfaf5; border-color: var(--line); border-left-color: #d8c9a8; }
.why-block.empty p { color: var(--muted); }
.why-block .link-btn { margin-top: 5px; font-size: 12px; }

.task-pill, .stale-pill, .risk-pill {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 2px 7px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.task-pill { background: #eef1fb; color: #3d4cae; }
.stale-pill { background: #fdf3e6; color: #a56a14; }
.risk-pill { background: #fdf0ee; color: #b04034; }

.task-list { margin-top: 2px; }
.task-item {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  margin-bottom: 6px;
}
.task-item input[type="checkbox"] {
  width: 17px; height: 17px; flex: none;
  accent-color: var(--accent);
}
.task-item .task-text { flex: 1; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.task-item.done .task-text { color: #a8b0aa; text-decoration: line-through; }
.task-item .task-del {
  flex: none; border: 0; background: none;
  color: #b8beb9; font-size: 17px; line-height: 1;
  padding: 2px 4px;
}
.task-item .task-go {
  flex: none; border: 0; background: none;
  color: var(--accent-deep); font-size: 10.5px; font-weight: 600;
  padding: 2px 0;
}
.task-add { display: flex; gap: 7px; margin-top: 8px; }
.task-add .input { flex: 1; padding: 8px 10px; font-size: 12.5px; }
.task-add .btn { flex: none; }

/* ---------- 跟踪 ---------- */
.track-hero {
  background: linear-gradient(150deg, #0e2b23 0%, #113a2e 48%, #0e2b23 100%);
  color: #eef6f1;
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: 0 18px 40px -30px rgba(9, 48, 37, .9);
}
.track-hero .th-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.track-hero .th-title { font-size: 16px; font-weight: 700; }
.track-hero .th-sub { font-size: 11px; color: rgba(232, 246, 238, .62); margin-top: 2px; }
.track-hero .th-badge {
  flex: none; font-size: 10.5px; font-weight: 600;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px; padding: 3px 9px;
  color: rgba(238, 246, 241, .85);
}
.track-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 14px;
}
.ts-cell {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px; padding: 8px 10px;
}
.ts-cell b { display: block; font-size: 16px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.ts-cell b small { font-size: 10px; font-weight: 600; color: rgba(232, 246, 238, .55); margin-left: 1px; }
.ts-cell span { font-size: 9.5px; color: rgba(232, 246, 238, .6); letter-spacing: .3px; }

.track-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 13px;
  margin-bottom: 7px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.track-row:active { transform: scale(.995); }
.track-row .tr-main { flex: 1; min-width: 0; }
.track-row .tr-o {
  font-size: 12.8px; font-weight: 600; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.track-row .tr-meta { font-size: 10.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.track-row .tr-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.track-row .tr-score { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-deep); }

/* ---------- 复盘 ---------- */
.review-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
}
.review-hero.done { border-color: rgba(15, 122, 92, .22); }
.review-hero .rv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rv-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 999px; padding: 3px 9px;
}
.rv-badge.done { background: var(--accent); color: #fff; }
.rv-period { font-size: 11px; color: var(--muted); }
.review-hero h3 { margin: 10px 0 6px; font-size: 19px; letter-spacing: -.3px; }
.review-hero p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.review-snap {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin: 14px 0;
}
.rs-cell {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 9px 10px;
}
.rs-cell b { display: block; font-size: 18px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.rs-cell b small { font-size: 10px; color: var(--muted); font-weight: 600; margin-left: 1px; }
.rs-cell span { font-size: 9.5px; color: var(--muted); letter-spacing: .2px; }
.review-qa { margin: 4px 0 14px; }
.review-qa .rq-item {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
}
.review-qa .rq-label { font-size: 10px; font-weight: 700; letter-spacing: .4px; color: var(--accent-deep); }
.review-qa .rq-text { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); margin-top: 3px; }
.review-loop {
  text-align: center; font-size: 10.5px; color: var(--muted);
  letter-spacing: .3px; margin-top: 11px;
}

/* ---------- desktop ---------- */
@media (max-width: 480px) {
  .list-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .list-head .list-actions { flex-wrap: wrap; }
}

@media (min-width: 720px) {
  .app { padding-left: 24px; padding-right: 24px; }
  .topbar { padding-top: 20px; }
  .fab { right: max(24px, calc(50% - 356px)); }
  .graph-stage { height: 560px; }
}

/* ---------- 团队与云端 ---------- */
.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 7px 12px; text-align: center;
  background: #b06a12; color: #fff;
  font-size: 11.5px; letter-spacing: .2px;
}
.cloud-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 15px 14px;
  margin-bottom: 12px;
}
.cloud-card-title { font-size: 14px; font-weight: 700; letter-spacing: -.1px; display: flex; align-items: center; gap: 7px; }
.cloud-card-desc { margin: 6px 0 12px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.cloud-count {
  font-size: 10.5px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); border-radius: 999px; padding: 2px 7px;
}
.cloud-note { font-size: 11px; color: var(--muted); line-height: 1.6; padding: 2px 4px 10px; }
.cloud-empty { font-size: 12px; color: var(--muted); padding: 8px 0 2px; }
.cloud-team-card { padding: 16px 15px; }
.cloud-team-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cloud-team-name { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.cloud-team-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.cloud-team-meta b { color: var(--accent-deep); letter-spacing: 1.2px; }
.sync-pill {
  flex: none; font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 4px 9px;
  background: #f0f0ea; color: var(--muted);
}
.sync-pill.on { background: var(--accent-soft); color: var(--accent-deep); }
.sync-pill.busy { background: #fdf2e3; color: #a3610f; }
.sync-pill.warn { background: #fbe9e5; color: var(--danger); }
.sync-pill.off { background: #ececec; color: #6c756e; }
.invite-box { margin-top: 13px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px; }
.invite-link { font-size: 11px; color: var(--ink-2); word-break: break-all; line-height: 1.5; }
.cloud-status-line { margin-top: 9px; font-size: 11px; color: var(--muted); }
.cloud-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.cloud-actions .btn { width: 100%; justify-content: center; }
.cloud-banner {
  border: 1px solid rgba(179, 58, 44, .28);
  background: #fdf5f3;
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 12px;
}
.cloud-banner b { font-size: 13px; color: var(--danger); }
.cloud-banner p { margin: 5px 0 10px; font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.cloud-banner .btn { flex: 1; }
.member-list { margin-top: 10px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.member-row:last-child { border-bottom: 0; }
.member-avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  color: #fff; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
}
.member-main { flex: 1; min-width: 0; }
.member-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.member-tag {
  font-size: 9.5px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); border-radius: 999px; padding: 1.5px 6px;
}
.member-tag.owner { color: #a3610f; background: #fdf2e3; }
.member-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.member-last { flex: none; font-size: 10px; color: var(--muted); text-align: right; }
.cloud-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 11px; }
.cloud-stats > div {
  background: var(--surface-2); border-radius: 11px;
  padding: 9px 4px; text-align: center;
}
.cloud-stats b { display: block; font-size: 14px; letter-spacing: -.2px; }
.cloud-stats span { font-size: 9.5px; color: var(--muted); }
.activity-list { margin-top: 8px; }
.activity-item { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.activity-item:last-child { border-bottom: 0; }
.activity-item b { font-weight: 600; color: var(--ink); }
.activity-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.activity-time { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ---------- 团队 OKR 库 ---------- */
.library-card .searchbar { margin-bottom: 8px; }
.library-list { margin-top: 4px; }
.lib-group { margin-top: 12px; }
.lib-group-head {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 2px 8px;
}
.lib-g-main { flex: 1; min-width: 0; }
.lib-g-name { font-size: 13px; font-weight: 700; }
.lib-g-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.lib-visible {
  flex: none; font-size: 9.5px; font-weight: 700;
  color: var(--accent-deep); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 7px;
}
.library-list .okr-card { margin-bottom: 8px; }

.btn:disabled { opacity: .5; }


/* ---------- 版本更新 ---------- */
.update-ver { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.update-notes { margin: 6px 0 4px; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.update-notes li { margin-bottom: 2px; }

/* ---------- 离线重连条 ---------- */
.offline-bar { display: flex; align-items: center; justify-content: center; gap: 8px; }
.offline-bar button {
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .22); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
}
.offline-bar button:disabled { opacity: .6; }

/* ---------- 开屏动画 ---------- */
#bootSplash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background:
    radial-gradient(420px 320px at 50% 24%, rgba(15, 122, 92, .10), transparent 70%),
    radial-gradient(300px 240px at 74% 76%, rgba(240, 131, 92, .10), transparent 72%),
    var(--bg);
  transition: opacity .42s ease;
}
#bootSplash.boot-done { opacity: 0; pointer-events: none; }
#bootSplash .boot-card {
  width: min(84%, 320px);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  text-align: center;
  font-size: 13.5px;
}
.boot-stage { position: relative; width: 118px; height: 118px; margin: 0 auto 18px; }
.boot-orbit {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(15, 122, 92, .22);
}
.boot-orbit.o2 {
  inset: 15px;
  border-style: dashed;
  border-color: rgba(15, 122, 92, .16);
  animation: bootspin 16s linear infinite;
}
.boot-dot {
  position: absolute;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .5;
}
.boot-dot.d1 { top: 4%; left: 50%; animation: boottwinkle 2.4s ease-in-out infinite; }
.boot-dot.d2 { top: 62%; left: 2%; animation: boottwinkle 2.4s ease-in-out .8s infinite; }
.boot-dot.d3 { top: 86%; left: 72%; animation: boottwinkle 2.4s ease-in-out 1.4s infinite; }
.boot-peach {
  position: absolute; inset: 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 12px 32px -14px rgba(15, 122, 92, .5),
    inset 0 0 0 1px rgba(15, 122, 92, .12);
  animation: bootfloat 2.8s ease-in-out infinite;
}
.boot-peach svg { width: 56px; height: 56px; }
.boot-title {
  display: block;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 2.4px;
  color: var(--ink);
  text-indent: 2.4px;
}
#bootSplash .boot-card p.boot-sub {
  margin: 6px 0 0;
  font-size: 12px;
  letter-spacing: .8px;
  color: var(--muted);
  word-break: normal;
}
.boot-bar {
  width: 132px; height: 3px;
  margin: 20px auto 12px;
  border-radius: 999px;
  background: rgba(15, 122, 92, .12);
  overflow: hidden;
}
.boot-bar i {
  display: block;
  width: 42%; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(15, 122, 92, .55), var(--accent));
  animation: bootbar 1.25s cubic-bezier(.45, 0, .25, 1) infinite;
}
#bootSplash .boot-card p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-all;
}
#bootSplash .boot-card button {
  margin-top: 14px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700; padding: 9px 18px;
}
@keyframes bootspin { to { transform: rotate(360deg); } }
@keyframes bootfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes boottwinkle { 0%, 100% { opacity: .18; transform: scale(.8); } 50% { opacity: .7; transform: scale(1.15); } }
@keyframes bootbar { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
@media (prefers-reduced-motion: reduce) {
  #bootSplash { transition: none; }
  .boot-peach, .boot-orbit.o2, .boot-dot, .boot-bar i { animation: none; }
}

/* 原生悬浮球开启时隐藏网页悬浮球，避免重复 */
body.native-overlay-on .ai-assistant { display: none !important; }

/* ---------- 登录 / 注册 ---------- */
.auth-gate {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.auth-card {
  width: min(100%, 380px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 18px 18px;
}
.auth-brand { font-size: 20px; font-weight: 700; letter-spacing: -.3px; color: var(--accent-deep); }
.auth-sub { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 5px 0 14px; }
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); border-radius: 11px; padding: 4px; margin-bottom: 14px; }
.auth-tabs button {
  flex: 1; border: 0; background: none; border-radius: 8px;
  padding: 8px 0; font-size: 13px; font-weight: 600; color: var(--muted);
}
.auth-tabs button.on { background: #fff; color: var(--accent-deep); box-shadow: 0 1px 4px rgba(23,33,28,.08); }
.auth-msg { font-size: 11.5px; color: var(--danger); min-height: 16px; margin-top: 8px; line-height: 1.5; }
.auth-skip { display: block; margin: 10px auto 0; font-size: 12px; }

/* ---------- 扫码登录 ---------- */
.qr-box {
  width: 200px; height: 200px; margin: 6px auto 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
}
.qr-box img, .qr-box canvas { width: 180px !important; height: 180px !important; }
.qr-loading { font-size: 11.5px; color: var(--muted); }
.qr-status { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.6; margin-bottom: 10px; }

/* ---------- 健康度 / 检查记录 ---------- */
.health-pill {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 700;
  border-radius: 999px; padding: 2px 7px;
  white-space: nowrap;
}
.health-pill.h-on { background: #e6f2ec; color: #0f7a5c; }
.health-pill.h-risk { background: #fdf2e3; color: #a3610f; }
.health-pill.h-off { background: #fbe9e5; color: #b33a2c; }
.health-strip { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.checkin-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px 10px;
  margin: 11px 0 12px;
}
.ck-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ck-t b { font-size: 13px; display: block; }
.ck-t span { font-size: 10.5px; color: var(--muted); }
.checkin-trend { width: 100%; height: 54px; display: block; margin-top: 8px; }
.checkin-empty { font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.ck-latest { font-size: 10.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }

/* ---------- 消息与好友 ---------- */
.msg-btn { position: relative; }
.msg-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #d9534f; color: #fff;
  font-size: 9.5px; font-style: normal; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px #f6f6f2;
}
.msg-badge.hidden { display: none; }
body.chat-open { overflow: hidden; }
.chat-overlay {
  position: fixed; inset: 0; z-index: 55;
  background: var(--bg, #f6f6f2);
  display: flex; flex-direction: column;
}
.chat-overlay.hidden { display: none; }
.chat-panel {
  width: 100%; max-width: 760px; height: 100%; margin: 0 auto;
  display: flex; flex-direction: column; background: var(--bg, #f6f6f2);
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 253, 249, .97);
}
.chat-back {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 20px; line-height: 1;
  display: grid; place-items: center; flex: none;
}
.chat-head-main { flex: 1; min-width: 0; }
.chat-title { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.chat-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.chat-tabs { display: flex; gap: 8px; padding: 10px 14px 4px; }
.chat-tabs button {
  flex: 1; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 7px 0; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.chat-tabs button.on { background: var(--accent-soft); border-color: rgba(15, 122, 92, .25); color: var(--accent-deep); }
.chat-body { flex: 1; overflow-y: auto; padding: 10px 12px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.chat-body.chat-thread { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.chat-item:active { background: var(--accent-soft); }
.chat-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.chat-kind {
  font-size: 9px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 5px;
}
.chat-item-last {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item-side { flex: none; text-align: right; }
.chat-time { display: block; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.unread-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  margin-top: 4px; padding: 0 5px; border-radius: 9px;
  background: #d9534f; color: #fff; font-size: 10px; font-style: normal; font-weight: 700;
}
.chat-empty { padding: 46px 18px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.chat-search { display: flex; gap: 8px; margin: 4px 0 12px; }
.chat-search input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); padding: 9px 11px; font-size: 13px; color: var(--ink);
}
.chat-search button {
  border: 0; border-radius: 11px; padding: 0 13px; background: var(--accent); color: #fff;
  font-size: 12.5px; font-weight: 700; flex: none;
}
.chat-section-title { margin: 16px 4px 7px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.friend-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.friend-row .chat-avatar { width: 36px; height: 36px; font-size: 13px; }
.friend-main { flex: 1; min-width: 0; }
.friend-name { font-size: 13px; font-weight: 700; }
.friend-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.friend-actions { display: flex; gap: 6px; flex: none; }
.mini-act {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 9px; padding: 5px 9px; font-size: 11px; font-weight: 600;
}
.mini-act.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini-act.warn { color: #b0483c; border-color: rgba(176, 72, 60, .25); background: rgba(176, 72, 60, .06); }
.chat-tip { padding: 3px 4px 10px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; }
.msg-line { display: flex; flex-direction: column; max-width: 82%; }
.msg-line.me { align-self: flex-end; align-items: flex-end; }
.msg-line.other { align-self: flex-start; align-items: flex-start; }
.msg-sender { font-size: 10px; color: var(--muted); margin: 0 4px 2px; }
.msg-bubble { padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.msg-line.me .msg-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-line.other .msg-bubble { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-time { font-size: 9.5px; color: var(--muted); margin: 2px 4px 0; }
.chat-compose {
  display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #fdfdf9;
}
.chat-compose input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; background: #fff; color: var(--ink);
}
.chat-compose button {
  border: 0; border-radius: 12px; padding: 0 16px; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700; flex: none;
}
.chat-compose button:disabled { opacity: .55; }
.pick-list { max-height: 46vh; overflow-y: auto; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.pick-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.pick-row .friend-meta { margin-left: auto; }
.member-msg {
  border: 1px solid rgba(15, 122, 92, .25); background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 8px; padding: 4px 8px; font-size: 10.5px; font-weight: 700; flex: none;
}
@media (max-width: 480px) {
  .chat-head { padding-left: 12px; padding-right: 12px; }
  .chat-panel { max-width: none; }
}

.tab-count {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px;
  margin-left: 4px; padding: 0 4px; border-radius: 8px;
  background: #d9534f; color: #fff; font-size: 9px; font-style: normal; font-weight: 700;
}
.tab-count.hidden { display: none; }
.msg-read { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.unread-divider {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 2px; color: #b06a12; font-size: 10px; font-weight: 600;
}
.unread-divider::before,
.unread-divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(176, 106, 18, .28);
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 4px 4px 10px; font-size: 11.5px; color: var(--muted); font-weight: 600;
}
.notif-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
}
.notif-row.unread { border-color: rgba(15, 122, 92, .22); background: #fbfdfb; }
.notif-main { flex: 1; min-width: 0; }
.notif-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-kind {
  flex: none; font-size: 9px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 5px;
}
.notif-body {
  font-size: 12px; color: var(--ink-2); line-height: 1.55; margin-top: 3px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.notif-time { font-size: 10px; color: var(--muted); margin-top: 4px; }
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #d9534f;
  margin-top: 6px; flex: none;
}

/* ---------- 二次验证 ---------- */
.totp-qr { display: flex; justify-content: center; padding: 8px 0 6px; }
.totp-qr img, .totp-qr canvas { border-radius: 10px; background: #fff; padding: 6px; }
.totp-secret {
  margin: 4px 0 12px; padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px; letter-spacing: 1.2px; text-align: center;
  word-break: break-all;
}

/* ---------- AI 助手 ---------- */
.ai-panel {
  margin: 0 0 14px; padding: 12px;
  background: #f3f8f4; border: 1px solid #d9e7df; border-radius: 14px;
}
.ai-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px; font-size: 13px; color: #25332b;
}
.ai-head b { font-size: 13.5px; }
.ai-badge {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px;
  padding: 0 7px; border-radius: 7px;
  background: var(--brand, #0f7a5c); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
}
.ai-engine {
  margin-left: auto; padding: 3px 8px;
  font-size: 11px; color: #66766c; background: #e6f0e9; border-radius: 999px;
}
.ai-row { display: flex; gap: 8px; align-items: center; }
.ai-row .input { flex: 1; min-width: 0; }
.ai-hint { margin-top: 7px; font-size: 11.5px; line-height: 1.6; color: #6f7f76; }
.ai-setup {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed #cfdfd5;
}
.ai-setup .input { flex: 1; min-width: 160px; }
.ai-setup .ai-hint { flex-basis: 100%; margin-top: 2px; }
.ai-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 9px; }
.ai-share {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  font-size: 13px; color: var(--ink);
}
.ai-share input { flex: none; accent-color: var(--accent); }
.ai-task-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ai-task-opt {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px;
  font-size: 13px; line-height: 1.5; color: var(--ink);
}
.ai-task-opt input, .ai-next-head input { margin-top: 3px; flex: none; accent-color: var(--accent); }
.ai-next-card {
  display: block; padding: 12px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
}
.ai-next-head { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
.ai-next-why { margin: 6px 0 0 24px; font-size: 12px; line-height: 1.55; color: var(--ink-2); }
.ai-next-krs { margin: 7px 0 0 24px; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.ai-next-tags { margin: 8px 0 0 24px; display: flex; flex-wrap: wrap; gap: 4px; }
.ai-skill-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.ai-skill {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
}
.ai-skill-stage {
  flex: none; padding: 2px 7px; margin-top: 1px;
  font-size: 10px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px;
}
.ai-skill b { display: block; font-size: 12.5px; }
.ai-skill .ai-hint { margin-top: 2px; }

body.ai-chat-open { overflow: hidden; }
body.ai-capturing .ai-assistant,
body.ai-capturing .ai-chat-wrap,
body.ai-capturing .toast { visibility: hidden !important; }

/* ---------- 桃灼大王 · 悬浮助手 ---------- */
.ai-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ai-assistant {
  position: fixed;
  right: max(18px, calc(50% - 396px));
  bottom: calc(var(--nav-h) + 86px + env(safe-area-inset-bottom));
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.ai-ball {
  position: relative;
  width: 58px; height: 58px;
  padding: 0; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #ffffff 0%, #fbf7ef 40%, #efe8db 100%);
  box-shadow: 0 14px 30px -14px rgba(23, 33, 28, .55), inset 0 0 0 1.5px rgba(15, 122, 92, .32);
  display: grid; place-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ai-ball svg { width: 42px; height: 42px; display: block; pointer-events: none; animation: aiFloat 4.2s ease-in-out infinite; }
.ai-ball:active { transform: scale(.95); }
.ai-ball-halo {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(15, 122, 92, .35);
  animation: aiHalo 2.8s ease-out infinite;
  pointer-events: none;
}
.ai-ball-spark {
  position: absolute; right: 2px; bottom: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #35a06f;
  box-shadow: 0 0 0 2px #fdfcf8;
}
@keyframes aiFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes aiHalo {
  0% { transform: scale(.9); opacity: .8; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

.ai-quick {
  width: 232px;
  padding: 8px;
  background: rgba(253, 253, 249, .98);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 48px -22px rgba(30, 40, 34, .5);
  animation: aiMenuIn .18s cubic-bezier(.2, .8, .3, 1) both;
  transform-origin: bottom right;
}
@keyframes aiMenuIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-quick-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--line-soft, var(--line));
  margin-bottom: 4px;
}
.ai-quick-head b { font-size: 13.5px; letter-spacing: -.2px; color: #8f4429; }
.ai-quick-head span { font-size: 10px; color: var(--muted); }
.ai-quick-item {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 8px;
  border: 0; background: none; border-radius: 12px;
  text-align: left; color: var(--ink);
}
.ai-quick-item:active, .ai-quick-item:hover { background: #fff2e8; }
.ai-quick-ico {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #fff0e4;
  color: #c15a36;
}
.ai-quick-ico svg { width: 17px; height: 17px; }
.ai-quick-item b { display: block; font-size: 13px; line-height: 1.35; letter-spacing: -.1px; }
.ai-quick-item i { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 1px; }

.ai-chat-wrap { position: fixed; inset: 0; z-index: 68; }
.ai-chat-mask {
  position: absolute; inset: 0;
  background: rgba(15, 28, 22, .34);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade .2s ease both;
}
.ai-chat {
  position: absolute;
  right: 24px; bottom: 24px;
  width: min(432px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 48px));
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid rgba(240, 180, 150, .5);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 34px 80px -30px rgba(20, 30, 26, .62);
  animation: aiChatIn .24s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes aiChatIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-chat-head {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  background: linear-gradient(135deg, #fdfdf9 0%, #f8f4eb 62%, #f3eee2 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -2px 0 rgba(15, 122, 92, .05);
}
.ai-avatar {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #ffe7d2, #ffb184 48%, #ef8059);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 8px 16px -10px rgba(226, 96, 63, .8);
}
.ai-avatar svg { width: 34px; height: 34px; }
.ai-chat-id { flex: 1; min-width: 0; }
.ai-chat-id h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.ai-chat-id p {
  margin: 2px 0 0; font-size: 10.5px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.ai-online { width: 6px; height: 6px; border-radius: 50%; background: #35a06f; box-shadow: 0 0 0 2px rgba(53, 160, 111, .16); }
.ai-head-actions { display: flex; gap: 4px; flex: none; }
.ai-icon-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(200, 130, 100, .25);
  background: rgba(255, 255, 255, .62);
  color: #9a4a2e;
  display: grid; place-items: center;
}
.ai-icon-btn svg { width: 15px; height: 15px; }

.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 13px 15px 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background:
    radial-gradient(220px 130px at 100% 0, rgba(15, 122, 92, .06), transparent 72%),
    var(--bg);
}
.ai-persona {
  position: relative;
  margin-bottom: 14px;
  padding: 13px 14px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7ef 0%, #ffe9da 62%, #ffdfc9 100%);
  border: 1px solid rgba(240, 160, 120, .35);
  overflow: hidden;
}
.ai-persona::after {
  content: "";
  position: absolute; right: -28px; top: -34px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 180, 120, .38), transparent 70%);
  pointer-events: none;
}
.ai-persona-head { display: flex; align-items: center; gap: 9px; padding-right: 44px; }
.ai-persona-head .ai-avatar { width: 36px; height: 36px; }
.ai-persona-head .ai-avatar svg { width: 29px; height: 29px; }
.ai-persona-name { font-size: 15px; font-weight: 800; color: #5b2c1b; letter-spacing: -.25px; }
.ai-persona-title { font-size: 10.5px; font-weight: 700; color: #a25a3c; margin-top: 1px; letter-spacing: .1px; }
.ai-persona-tag { margin: 10px 0 8px; font-size: 12.5px; line-height: 1.65; color: #6b3b28; }
.ai-persona-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-chip {
  padding: 3px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(226, 96, 63, .16);
  color: #9a4a2e; font-size: 10.5px; font-weight: 700;
}
.ai-persona-more { margin-top: 8px; font-size: 11px; line-height: 1.6; color: #a5705a; }
.ai-persona-toggle {
  position: absolute; right: 10px; top: 10px;
  border: 0; border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, .66);
  color: #9a4a2e; font-size: 10px; font-weight: 700;
}
.ai-persona.collapsed .ai-persona-tag,
.ai-persona.collapsed .ai-persona-chips,
.ai-persona.collapsed .ai-persona-more { display: none; }

.ai-messages { display: flex; flex-direction: column; gap: 14px; padding-bottom: 4px; }
.ai-msg { display: flex; align-items: flex-end; gap: 7px; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-mini {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #fff7ef;
  box-shadow: inset 0 0 0 1px rgba(15, 122, 92, .12);
}
.ai-mini svg { width: 22px; height: 22px; }
.ai-msg-main { max-width: 84%; min-width: 0; }
.ai-bubble {
  padding: 11px 13px;
  border-radius: 15px 15px 15px 5px;
  background: #fff8f2;
  border: 1px solid rgba(240, 170, 135, .36);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.72;
  word-break: break-word;
  text-wrap: pretty;
}
.ai-bubble b { color: #9c4127; }
.ai-msg.user .ai-bubble {
  border-radius: 15px 15px 5px 15px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ai-msg.user .ai-bubble b { color: #fff; }
.ai-meta { margin: 4px 2px 0; font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-msg.user .ai-meta { text-align: right; }
.ai-suggest, .ai-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-suggest button {
  border: 1px solid rgba(15, 122, 92, .2);
  background: #fff;
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
}
.ai-action {
  border: 0;
  background: #ffe9da;
  color: #b05233;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}
.ai-action::after { content: "›"; font-size: 13px; line-height: 1; }
.ai-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.ai-typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #d98564;
  animation: aiDot 1.2s ease-in-out infinite;
}
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.ai-setup-card {
  margin-top: 8px;
  padding: 11px 12px;
  border-radius: 13px;
  background: #fff;
  border: 1px dashed rgba(226, 96, 63, .38);
  font-size: 12px;
  line-height: 1.6;
  color: #7a4330;
}
.ai-setup-card button {
  margin-top: 7px;
  border: 0; border-radius: 999px;
  padding: 5px 11px;
  background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700;
}

.ai-foot {
  flex: none;
  padding: 9px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(253, 253, 249, .98);
  border-top: 1px solid var(--line);
}
.ai-attach { padding-bottom: 8px; }
.ai-attach-card {
  display: flex; align-items: center; gap: 9px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ai-attach-card img {
  width: 58px; height: 42px;
  object-fit: cover; object-position: top center;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex: none;
}
.ai-attach-main { flex: 1; min-width: 0; font-size: 11px; color: var(--ink-2); }
.ai-attach-main b { display: block; font-size: 11.5px; color: var(--ink); }
.ai-attach-remove {
  border: 0; background: none;
  color: var(--muted); font-size: 10.5px; font-weight: 600;
  padding: 4px;
}
.ai-compose {
  padding: 8px 10px 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 20px -18px rgba(0, 0, 0, .4);
}
.ai-compose textarea {
  display: block;
  width: 100%;
  max-height: 110px;
  padding: 2px 2px 4px;
  border: 0; outline: 0; resize: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
}
.ai-compose-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-tools { display: flex; gap: 6px; min-width: 0; }
.ai-tool {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ai-tool svg { width: 13px; height: 13px; }
.ai-tool.on {
  background: var(--accent-soft);
  border-color: rgba(15, 122, 92, .25);
  color: var(--accent-deep);
}
.ai-send {
  width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -8px rgba(15, 122, 92, .8);
}
.ai-send svg { width: 17px; height: 17px; }
.ai-send:disabled { opacity: .45; }
.ai-disclaimer { margin: 6px 2px 0; text-align: center; font-size: 9.5px; color: var(--muted); letter-spacing: .1px; }

@media (max-width: 640px) {
  .ai-assistant {
    right: 16px;
    bottom: calc(var(--nav-h) + 84px + env(safe-area-inset-bottom));
  }
  .ai-chat {
    right: 0; bottom: 0;
    width: 100%; height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .ai-chat-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .ai-chat-body { padding-left: 13px; padding-right: 13px; }
  .ai-foot { padding-left: 12px; padding-right: 12px; }
}

