/* ═══════════ Iris · 瞳 原型 — 设计令牌（设计规范.md 第 3 节） ═══════════ */
:root {
  --bg: #FFFFFF;
  --surface: #FBF6F9;
  --surface-2: #F8EFF4;
  --border: #F0E4EA;
  --border-strong: #E3D2DC;
  --rose: #CB0E75;
  --rose-soft: #E63692;
  --rose-light: #EC549E;
  --rose-deep: #B40166;
  --ink: #2B2B33;
  --text-2: #6E6A75;
  /* 原 #9A93A0（设计规范）白底对比度仅 2.7:1，为满足 WCAG 4.5:1 调深 */
  --text-3: #75717C;
  --success: #4E8A6E;
  --warning: #C08A2D;
  --danger: #D3355E;
  --brand: linear-gradient(135deg, #CB0E75 0%, #E63692 60%, #EC549E 100%);
  --shadow: 0 8px 24px rgba(203, 14, 117, .08);
  --shadow-hover: 0 12px 32px rgba(203, 14, 117, .12);
  --font-sans: 'Noto Sans SC', 'Noto Sans CJK SC', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: clip; /* hidden 会让 overflow-y 计算为 auto，body 变滚动容器致 sticky 失效 */
}
.mono { font-family: var(--font-mono); }
.grad-text { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
[hidden] { display: none !important; }
.skip-link {
  position: fixed; left: 16px; top: -64px; z-index: 1000;
  padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* 粉雾光晕（设计规范：纯白 + 角落玫红雾 5–12% 透明） */
.rose-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 560px 380px at 12% -6%, rgba(230, 54, 146, .10), transparent 62%),
    radial-gradient(ellipse 500px 360px at 90% 6%, rgba(203, 14, 117, .08), transparent 62%),
    radial-gradient(ellipse 560px 400px at 50% 110%, rgba(236, 84, 158, .07), transparent 65%);
}

/* ═══════════ 组件 ═══════════ */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 700; }
.card-head__hint { font-size: 12px; color: var(--text-3); }
.card-head--wrap { align-items: center; }

.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  border: none;
  border-radius: 99px;
  padding: 9px 22px;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--rose); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--rose-deep); }
.btn-brand { background: var(--brand); color: #fff; font-weight: 900; box-shadow: var(--shadow); }
.btn-brand:hover { filter: brightness(1.08); box-shadow: var(--shadow-hover); }
.btn-ghost { background: var(--bg); border: 1px solid var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose); }
.btn-text { background: none; color: var(--rose); padding: 6px 10px; }
.btn-text:hover { background: rgba(203, 14, 117, .08); }
.btn-text.danger-text { color: #B92B50; }
.btn-text.danger-text:hover { background: rgba(185, 43, 80, .08); }
.btn-danger { background: #fff; border: 1px solid var(--danger); color: #B92B50; font-weight: 700; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px 22px; font-size: 15px; letter-spacing: .3em; }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn:focus-visible,
.settings-nav__item:focus-visible {
  outline: 3px solid rgba(203, 14, 117, .32);
  outline-offset: 2px;
}

.input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  outline: none;
  transition: all .2s ease;
}
.input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(203, 14, 117, .12); }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; font-family: var(--font-sans); }
.input-copy { display: flex; gap: 8px; }
.input-copy .input { flex: 1; color: var(--text-2); background: var(--surface); }

/* 列表过滤搜索框 */
.filter-box { position: relative; max-width: 360px; margin: 0 0 16px; }
.filter-box .filter-input { padding-right: 34px; }
.filter-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; line-height: 20px; border: none; border-radius: 50%;
  background: var(--text-3); color: #fff; font-size: 13px; cursor: pointer;
  text-align: center; padding: 0;
}
.filter-clear:hover { background: var(--ink); }
.filter-clear[hidden] { display: none; }
.filter-row { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.filter-row .filter-box { flex: 1; max-width: 360px; margin: 0; }
.attribution-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.filter-label, .inline-filter-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.attribution-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.attribution-card-head .card-title { margin-bottom: 0; }
.attribution-hint { margin: 10px 0 12px; font-size: 12px; color: var(--text-3); }

/* 事件字典：label 主显 + 原始名小字 */
.event-raw { font-size: 11px; color: var(--text-3); font-weight: 400; }
.events-dict-table th.dict-ev { width: 40%; }
.events-dict-table th.dict-w { width: 24%; }
.events-dict-table th.dict-w2 { width: 36%; }
.events-dict-table td input { min-width: 0; }

.badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 500;
  padding: 2px 10px; border-radius: 99px;
  background: #EDE9EE; color: #5A5560; /* WCAG ≥4.5:1 */
  white-space: nowrap;
}
.badge-rose { background: rgba(203, 14, 117, .1); color: var(--rose-deep); }
.badge-ok { background: rgba(78, 138, 110, .12); color: #3A6B54; }
.badge-off { background: #EDE9EE; color: #5A5560; }
.badge-owner { background: var(--brand); color: #fff; font-weight: 700; }
.badge-admin { background: rgba(203, 14, 117, .12); color: var(--rose-deep); }
.badge-member { background: #EDE9EE; color: #5A5560; }
.badge-viewer { background: #fff; border: 1px solid var(--border-strong); color: var(--text-2); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.alt { background: linear-gradient(135deg, #4E8A6E, #6FA98C); }
.avatar.alt2 { background: linear-gradient(135deg, #C08A2D, #D9A94E); }
.avatar.alt3 { background: linear-gradient(135deg, #5C6BC0, #7E8BD9); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; gap: 2px; }
.seg__item {
  font-family: var(--font-sans); font-size: 13px;
  border: none; background: none; cursor: pointer;
  padding: 5px 14px; border-radius: 99px; color: #5A5560;
  transition: all .2s ease; white-space: nowrap;
}
.seg__item:hover { color: var(--rose); }
.seg__item.active { background: #fff; color: var(--rose); font-weight: 700; box-shadow: 0 2px 8px rgba(203, 14, 117, .12); }

.date-range {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; font-family: var(--font-sans); font-size: 13px; color: #5A5560;
  border: 1px solid var(--border-strong); border-radius: 99px;
  padding: 6px 13px; cursor: pointer; transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
  background: var(--bg); white-space: nowrap;
}
.date-range:hover { border-color: var(--rose); color: var(--rose); }
.date-range:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.date-range.is-custom { border-color: var(--rose); color: var(--rose-deep); background: rgba(203, 14, 117, .04); }
.date-range svg { width: 17px; height: 17px; flex: none; }
.date-range__chevron { color: var(--text-3); font-size: 12px; transition: transform .2s ease; }
.date-range[aria-expanded="true"] .date-range__chevron { transform: rotate(180deg); }

.table { width: 100%; border-collapse: collapse; }
.table th {
  font-size: 12px; font-weight: 500; color: var(--text-3);
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table tbody tr { transition: background .2s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num, .table th.num { text-align: right; }
.table td.num { font-size: 13px; }
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-2); background: var(--surface);
}
.badge-rank-top { background: var(--brand); color: #fff; font-weight: 700; }


/* ═══════════ 0. 公开首页（调性：玫红光雾） ═══════════ */
.public-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.public-page > main { flex: 1; }
#page-home { position: relative; overflow: clip; } /* hidden 会让 page 成滚动容器致 sticky 失效 */
.home-bokeh { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.bokeh {
  position: absolute; border-radius: 50%;
  filter: blur(100px);
  will-change: transform;
}
.bokeh--1 {
  width: 460px; height: 460px; right: -120px; top: 30px;
  background: radial-gradient(circle, rgba(230, 54, 146, .13), rgba(230, 54, 146, .05) 55%, transparent 72%);
  animation: bokehDrift1 80s ease-in-out infinite alternate;
}
.bokeh--2 {
  width: 380px; height: 380px; left: -110px; top: 46%;
  background: radial-gradient(circle, rgba(203, 14, 117, .11), rgba(203, 14, 117, .04) 55%, transparent 72%);
  animation: bokehDrift2 90s ease-in-out infinite alternate;
}
.bokeh--3 {
  width: 420px; height: 420px; right: 8%; bottom: -160px;
  background: radial-gradient(circle, rgba(236, 84, 158, .1), rgba(236, 84, 158, .04) 55%, transparent 72%);
  animation: bokehDrift3 70s ease-in-out infinite alternate;
}
.bokeh--s1 { width: 130px; height: 130px; left: 14%; top: 130px; filter: blur(48px); background: radial-gradient(circle, rgba(230, 54, 146, .12), transparent 70%); animation: bokehDrift2 85s ease-in-out infinite alternate; }
.bokeh--s2 { width: 90px; height: 90px; left: 30%; top: 560px; filter: blur(40px); background: radial-gradient(circle, rgba(180, 1, 102, .1), transparent 70%); animation: bokehDrift1 75s ease-in-out infinite alternate; }
.bokeh--s3 { width: 110px; height: 110px; right: 12%; top: 380px; filter: blur(44px); background: radial-gradient(circle, rgba(236, 84, 158, .11), transparent 70%); animation: bokehDrift3 95s ease-in-out infinite alternate; }
.bokeh--s4 { width: 70px; height: 70px; right: 26%; top: 760px; filter: blur(34px); background: radial-gradient(circle, rgba(230, 54, 146, .09), transparent 70%); animation: bokehDrift1 65s ease-in-out infinite alternate; }
.bokeh--s5 { width: 100px; height: 100px; left: 8%; bottom: 120px; filter: blur(42px); background: radial-gradient(circle, rgba(203, 14, 117, .09), transparent 70%); animation: bokehDrift3 88s ease-in-out infinite alternate; }
@keyframes bokehDrift1 {
  from { transform: translate(0, 0); }
  to { transform: translate(34px, -26px); }
}
@keyframes bokehDrift2 {
  from { transform: translate(0, 0); }
  to { transform: translate(-30px, 22px); }
}
@keyframes bokehDrift3 {
  from { transform: translate(0, 0); }
  to { transform: translate(26px, 30px); }
}
@media (prefers-reduced-motion: reduce) {
  .bokeh { animation: none; }
}
.home-nav {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 40px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.home-nav__links { display: flex; align-items: center; gap: 18px; }
.home-nav__links a { color: var(--text-2); text-decoration: none; font-size: 14px; transition: color .2s ease; }
.home-nav__links a:hover { color: var(--rose); }

.home-hero {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(460px, 1.08fr);
  align-items: center; gap: 64px;
  min-height: 620px; padding: 56px 64px 74px;
  max-width: 1280px; margin: 0 auto;
}
.home-hero__copy { max-width: 570px; }
.home-hero__title { font-size: clamp(42px, 3.9vw, 56px); font-weight: 900; letter-spacing: .025em; line-height: 1.16; }
.home-hero__keyword { white-space: nowrap; }
.home-hero__sub { color: var(--text-2); font-size: 16px; line-height: 1.85; margin: 22px 0 0; max-width: 31em; }
.home-hero__cta { display: flex; gap: 12px; margin-top: 30px; }
.home-hero__cta .btn { min-height: 46px; padding: 0 22px; font-size: 14px; }
.home-hero__media { min-width: 0; }
.home-demo-preview {
  aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: 0 24px 70px rgba(78, 26, 54, .18);
}
.home-demo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-demo-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--text-2); font-size: 13px; }
.home-demo-caption strong { color: var(--ink); }
.home-proofline {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  max-width: 1152px; margin: 0 auto; padding: 18px 0;
  border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px;
}
.home-proofline__flow { display: flex; align-items: center; justify-content: center; gap: 12px; white-space: nowrap; }
.home-proofline strong { color: var(--rose-deep); }
.home-proofline i { color: var(--border-strong); font-style: normal; }

#home-demo-modal.home-demo-overlay { background: rgba(43, 43, 51, .58); backdrop-filter: blur(5px); }
#home-demo-modal .home-demo-dialog { width: min(900px, 100%); overflow: hidden; border-radius: 18px; }
.home-demo-dialog__head {
  min-height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 24px; border-bottom: 1px solid var(--border);
}
.home-demo-dialog__head h2 { margin: 0; font-size: 17px; }
.home-demo-dialog__close {
  width: 44px; height: 44px; border: 0; border-radius: 99px;
  color: var(--text-2); background: transparent; font-size: 26px; line-height: 1; cursor: pointer;
}
.home-demo-dialog__close:hover { color: var(--rose-deep); background: var(--surface-2); }
.home-demo-dialog__close:focus-visible { outline: 3px solid rgba(203, 14, 117, .26); outline-offset: 2px; }
.home-demo-video-wrap { padding: 18px; background: #232329; }
.home-demo-video-wrap video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #18181c; }
.home-demo-dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
.home-demo-dialog__foot p { margin: 0; color: var(--text-2); font-size: 13px; }
.home-demo-complete { min-height: 500px; display: grid; place-items: center; padding: 44px 24px; text-align: center; }
.home-demo-complete__mark {
  width: 68px; height: 68px; display: grid; place-items: center;
  margin: 0 auto 18px; border-radius: 50%; color: #fff; background: var(--brand);
  font-size: 30px; font-weight: 900;
}
.home-demo-complete h2 { margin: 0; font-size: 26px; }
.home-demo-complete p { max-width: 31em; margin: 12px auto 24px; color: var(--text-2); line-height: 1.8; }
.home-demo-complete__actions { display: flex; justify-content: center; gap: 12px; }


#features, #steps { scroll-margin-top: 76px; } /* 锚点滚动补偿 sticky 顶栏高度 */
.home-features { position: relative; z-index: 1; padding: 60px 40px; max-width: 1120px; margin: 0 auto; }
.home-sec-title { text-align: center; font-size: 28px; font-weight: 900; margin-bottom: 36px; }
.home-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.home-feature {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 26px 22px;
  transition: all .2s ease;
}
.home-feature:hover { border-color: var(--rose); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.home-feature__icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(203, 14, 117, .1); color: var(--rose); font-size: 16px; margin-bottom: 12px; }
.home-feature h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.home-feature p { font-size: 13px; color: var(--text-2); line-height: 1.8; }

.home-mcp {
  position: relative; z-index: 1; max-width: 1040px; margin: 0 auto;
  padding: 30px 40px 34px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.home-mcp__eyebrow { color: var(--rose); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.home-mcp__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; margin-top: 12px; }
.home-mcp h2 { font-size: 24px; line-height: 1.35; margin: 0; }
.home-mcp p { max-width: 650px; margin: 9px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.home-mcp__action { display: flex; align-items: flex-end; flex-direction: column; gap: 12px; }
.home-mcp__badge { color: var(--text-2); font-size: 10px; letter-spacing: .05em; white-space: nowrap; }
.home-mcp__action .btn { white-space: nowrap; }

.home-steps { position: relative; z-index: 1; padding: 40px 40px 60px; max-width: 1120px; margin: 0 auto; }
.home-step-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.home-step {
  background: var(--surface); border-radius: 14px; padding: 24px 22px;
  border: 1px solid var(--border);
}
.home-step__no { color: var(--rose); font-size: 13px; font-weight: 700; }
.home-step h3 { font-size: 15px; font-weight: 700; margin: 8px 0 6px; }
.home-step p { font-size: 13px; color: var(--text-2); line-height: 1.8; }

.home-guides {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto; padding: 40px 40px 68px;
}
.home-guides__head { margin-bottom: 24px; }
.home-guides__head .home-sec-title { margin-bottom: 8px; text-align: left; }
.home-guides__head p { max-width: 620px; color: var(--text-2); font-size: 14px; }
.home-guide-list { border-top: 1px solid var(--border-strong); }
.home-guide-link {
  display: grid; grid-template-columns: 96px minmax(210px, .9fr) 1.4fr;
  align-items: baseline; gap: 24px; padding: 20px 4px;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--border);
  transition: color .2s ease, padding .2s ease, background .2s ease;
}
.home-guide-link:hover { color: var(--rose); padding-left: 12px; background: var(--surface); }
.home-guide-link:focus-visible { outline: 3px solid rgba(203, 14, 117, .32); outline-offset: 3px; }
.home-guide-link__type { color: var(--rose); font-size: 12px; font-weight: 700; }
.home-guide-link strong { font-size: 15px; }
.home-guide-link > span:last-child { color: var(--text-2); font-size: 13px; line-height: 1.7; }
.home-guides__all {
  display: inline-flex; gap: 8px; align-items: center; margin-top: 20px;
  color: var(--rose); font-size: 14px; font-weight: 700; text-decoration: none;
}
.home-guides__all span { transition: transform .2s ease; }
.home-guides__all:hover span { transform: translateX(3px); }

.home-cta {
  position: relative; z-index: 1;
  margin: 0 40px 60px; max-width: 1120px;
  margin-left: auto; margin-right: auto;
  background: var(--brand);
  border-radius: 20px; padding: 44px 30px;
  text-align: center; color: #fff;
  box-shadow: 0 16px 48px rgba(203, 14, 117, .3);
}
.home-cta h2 { font-size: 24px; font-weight: 900; margin-bottom: 18px; }
.home-cta .btn-brand { background: #fff; color: var(--rose); box-shadow: none; }
.home-cta .btn-brand:hover { filter: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }

.home-footer {
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3);
  position: relative;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
}
.home-footer__left, .home-footer__right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer-icp { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.footer-icp:hover { color: var(--rose); }
.footer-icp--record { display: inline-flex; align-items: center; }
.footer-icp--record::before {
  content: '·'; margin-right: 14px; color: var(--text-3); text-decoration: none;
}

/* ═══════════ 注册页 ═══════════ */
.register-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px;
}
.register-title { font-size: 26px; font-weight: 900; margin-top: 14px; }
.register-card {
  width: 560px; max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-top: 22px;
}
.register-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.code-row .btn { flex-shrink: 0; }
.link { color: var(--rose); text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
.auth-back-home {
  position: absolute; top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left));
  min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 99px; background: rgba(255, 255, 255, .9);
  color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none;
  box-shadow: 0 4px 16px rgba(43, 43, 51, .06); backdrop-filter: blur(8px);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.auth-back-home svg { width: 18px; height: 18px; flex: 0 0 auto; }
.auth-back-home:hover, .auth-back-home:focus-visible { border-color: var(--rose); color: var(--rose-deep); }
.auth-back-home:focus-visible { outline: 3px solid rgba(203, 14, 117, .32); outline-offset: 2px; }

/* 项目列表空态 */
.projects-empty { display: flex; align-items: center; justify-content: center; min-height: 320px; }
.projects-empty__card {
  text-align: center; max-width: 480px;
  background: var(--bg); border: 1px dashed var(--border-strong); border-radius: 16px;
  padding: 44px 36px;
}
.projects-empty__card h3 { font-size: 17px; font-weight: 700; }
.projects-empty__card p { font-size: 13px; color: var(--text-2); margin: 10px 0 20px; line-height: 1.8; }
.projects-empty__steps {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  font-size: 12px; color: var(--text-3); margin-top: 22px;
}
.projects-empty__steps .arr { color: var(--rose); }

/* ═══════════ 1. 登录页 ═══════════ */
.login-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.login-logo { width: 96px; height: 96px; filter: drop-shadow(0 10px 24px rgba(203, 14, 117, .18)); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.login-title { font-size: 34px; font-weight: 900; letter-spacing: .06em; margin-top: 18px; }
.login-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .5em; color: var(--text-3); margin-top: 4px; }
.login-card {
  width: 380px; max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  margin-top: 30px;
}
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 14px; }
.auth-alternative { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--text-3); font-size: 12px; }
.auth-alternative::before, .auth-alternative::after { content: ''; height: 1px; flex: 1; background: var(--border); }
.btn-wechat-login {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--ink); font-weight: 700; letter-spacing: 0;
}
.btn.btn-wechat-login svg { width: 18px; height: 18px; color: #07C160; flex: 0 0 18px; margin-right: 0; }
.btn-wechat-login:hover { border-color: #2F8A57; color: #1D6740; background: #F5FBF7; }
.btn-wechat-login:active { transform: scale(.985); }
.btn-wechat-login:disabled { color: var(--text-3); border-color: var(--border); background: var(--surface); }
.btn-wechat-login:disabled svg { color: var(--text-3); }
.btn-wechat-login.is-bound { border-color: rgba(47, 138, 87, .48); color: #2F6F4D; background: #F3FAF6; }
.btn-wechat-login.is-bound:hover { border-color: #2F8A57; background: #EAF6EF; }
.register-wechat-bind { margin-bottom: 12px; }
.wechat-login-dialog {
  position: fixed; inset: 0; width: min(408px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; overflow: auto;
  padding: 24px; border: 1px solid var(--border); border-radius: 18px;
  color: var(--ink); background: var(--bg); box-shadow: 0 24px 72px rgba(43, 43, 51, .22);
}
.wechat-login-dialog::backdrop { background: rgba(43, 43, 51, .38); backdrop-filter: blur(5px); }
.wechat-login-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.wechat-login-dialog__eyebrow { margin: 0 0 4px; color: var(--rose); font: 700 10px/1.3 var(--font-mono); letter-spacing: .16em; }
.wechat-login-dialog h2 { font-size: 20px; font-weight: 900; line-height: 1.25; }
.wechat-login-dialog__close {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -6px -6px 0 0;
  border: 0; border-radius: 50%; color: var(--text-2); background: transparent; cursor: pointer; transition: background .2s ease, color .2s ease;
}
.wechat-login-dialog__close svg { width: 20px; height: 20px; }
.wechat-login-dialog__close:hover { color: var(--rose-deep); background: rgba(203, 14, 117, .08); }
.wechat-login-dialog__close:focus-visible { outline: 3px solid rgba(203, 14, 117, .32); outline-offset: 2px; }
.wechat-qr-frame {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 210px; margin: 22px 0 16px;
  border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text-3); font-size: 12px;
}
.wechat-qr-frame svg { width: 94px; height: 94px; color: var(--rose); }
.wechat-login-dialog__status { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-2); font-size: 13px; }
.wechat-login-dialog__status i { width: 8px; height: 8px; border-radius: 50%; background: #2F8A57; box-shadow: 0 0 0 4px rgba(47, 138, 87, .12); }
.wechat-login-dialog__help { margin: 10px auto 18px; max-width: 310px; color: var(--text-3); text-align: center; font-size: 12px; line-height: 1.7; }
.wechat-login-choice { margin: 18px 0; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.wechat-login-choice h3 { margin: 2px 0 6px; font-size: 16px; font-weight: 800; line-height: 1.45; }
.wechat-login-choice > p:not(.wechat-login-dialog__eyebrow) { margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.65; }
.wechat-login-choice__actions { display: grid; gap: 10px; margin-top: 16px; }

/* ═══════════ 2. 项目列表页 ═══════════ */
.projects-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark.sm { width: 26px; height: 26px; }
.brand-name { font-size: 17px; font-weight: 900; letter-spacing: .04em; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-username { font-size: 14px; font-weight: 500; }

.container { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 34px 40px 60px; }
.projects-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 900; }
.page-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.project-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: -6px 0 20px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.project-search { position: relative; flex: 0 1 360px; min-width: 240px; }
.project-search > svg {
  position: absolute; left: 12px; top: 50%; width: 18px; height: 18px;
  color: var(--text-2); transform: translateY(-50%); pointer-events: none;
}
.project-search .input { min-height: 42px; padding: 9px 58px 9px 38px; background: var(--bg); }
.project-search__clear {
  position: absolute; right: 6px; top: 50%; min-width: 48px; min-height: 32px;
  padding: 0 8px; border: 0; border-radius: 99px; transform: translateY(-50%);
  background: transparent; color: var(--rose-deep); font: 600 12px/1 var(--font-sans); cursor: pointer;
}
.project-search__clear:hover { background: rgba(203, 14, 117, .08); }
.project-search__clear:focus-visible, .project-card__drag:focus-visible {
  outline: 3px solid rgba(203, 14, 117, .28); outline-offset: 2px;
}
.project-tools__meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px 14px; flex-wrap: wrap;
  color: var(--text-2); font-size: 12px; text-align: right;
}
#project-result-count { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.project-sort-hint { max-width: 330px; }
.project-sort-hint.is-filtering { color: var(--rose-deep); font-weight: 600; }
.projects-no-results {
  min-height: 260px; padding: 56px 20px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--bg);
}
.projects-no-results h3 { margin-bottom: 8px; font-size: 16px; }
.projects-no-results p { margin-bottom: 18px; color: var(--text-2); font-size: 13px; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 22px;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.project-card:hover { border-color: var(--rose); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.project-sorting, .project-sorting * { cursor: grabbing !important; user-select: none !important; }
.project-grid.is-sorting .project-card { transition: none; }
.project-grid.is-sorting .project-card:hover { transform: none; }
.project-card.project-card--placeholder {
  border: 1px dashed var(--rose); background: var(--surface); box-shadow: none;
  transform: none; cursor: grabbing;
}
.project-card--placeholder > * { visibility: hidden; }
.project-card.project-card--floating {
  position: fixed; top: 0; left: 0; z-index: 1000; margin: 0;
  pointer-events: none; transition: none; will-change: transform;
  border-color: var(--rose); box-shadow: 0 12px 32px rgba(203, 14, 117, .12);
}
.project-sort-menu {
  position: absolute; right: 12px; bottom: 60px; z-index: 5; min-width: 144px;
  padding: 4px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); box-shadow: var(--shadow);
}
.project-sort-menu button {
  display: block; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  text-align: left; font: 500 14px/1.5 var(--font-sans); cursor: pointer;
}
.project-sort-menu button:hover, .project-sort-menu button:focus-visible { background: var(--surface-2); color: var(--rose-deep); }
.project-sort-menu button:focus-visible { outline: 2px solid var(--rose); outline-offset: -2px; }
.project-sort-menu button:disabled { color: var(--text-3); cursor: not-allowed; opacity: .55; }
.project-card__open { display: flex; flex: 1; min-width: 0; flex-direction: column; color: inherit; text-decoration: none; }
.project-card__open:focus-visible { outline: 3px solid rgba(203, 14, 117, .28); outline-offset: 5px; border-radius: 8px; }
.project-card__top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.project-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
}
.project-avatar--img { object-fit: cover; background: #fff; }
.project-avatar.alt { background: linear-gradient(135deg, #4E8A6E, #6FA98C); }
.project-avatar.alt2 { background: linear-gradient(135deg, #C08A2D, #D9A94E); }
.project-avatar.alt3 { background: linear-gradient(135deg, #5C6BC0, #7E8BD9); }
.project-avatar.mini { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.project-card__meta {
  flex: 1; min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title type" "appid role";
  column-gap: 8px; row-gap: 4px; align-items: start;
}
.project-card__title {
  grid-area: title; min-width: 0;
  font-size: 16px; font-weight: 700; line-height: 1.5;
  white-space: normal; overflow-wrap: anywhere;
}
.project-card__meta p {
  grid-area: appid; min-width: 0;
  font-size: 12px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-card__type-badge { grid-area: type; justify-self: end; }
.project-card__role-badge { grid-area: role; justify-self: end; }
.project-card__type-badge, .project-card__role-badge { flex-shrink: 0; }
.project-card__stats { display: flex; gap: 26px; margin: auto 0 12px; padding: 14px 16px; background: var(--surface); border-radius: 10px; }
.pstat { display: flex; flex-direction: column; }
.pstat-num { font-size: 18px; font-weight: 700; color: var(--ink); }
.pstat-label { font-size: 11px; color: var(--text-2); }
.project-card__foot { min-width: 0; min-height: 24px; padding-right: 44px; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.project-card__drag {
  position: absolute; right: 12px; bottom: 12px;
  display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--text-2); cursor: grab; touch-action: none;
}
.project-card__drag:hover { color: var(--rose-deep); background: rgba(203, 14, 117, .08); }
.project-card__drag:active { cursor: grabbing; background: rgba(203, 14, 117, .12); }
.project-card__drag svg { width: 18px; height: 18px; pointer-events: none; }
.project-card__drag[aria-disabled="true"] { color: var(--text-3); cursor: not-allowed; opacity: .55; }

@media (prefers-reduced-motion: reduce) {
  .project-card { transition: border-color .01ms, box-shadow .01ms; }
  .project-card:hover { transform: none; }
}

/* ═══════════ 角色权限表 ═══════════ */
.role-table-wrap { margin-top: 6px; }
.role-table { width: 100%; border-collapse: collapse; }
.role-table th, .role-table td {
  text-align: center; padding: 7px 8px;
  font-size: 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.role-table td:first-child {
  text-align: left; font-weight: 500;
  white-space: normal; line-height: 1.6;
  vertical-align: top; padding-top: 9px;
}
.role-table thead th { font-size: 12.5px; }
.role-table tbody tr:last-child td { border-bottom: none; }
.role-table .role-col { transition: background .2s ease; }
.role-table .role-col.active,
.role-table td[data-role-col].active { background: rgba(203, 14, 117, .07); }
#modal-role-table thead .role-col.active { background: var(--rose); color: #fff; border-radius: 8px 8px 0 0; font-weight: 700; }
#modal-role-table td[data-role-col].active:last-child { border-radius: 0 0 8px 0; }
.role-table .ok { color: var(--rose); font-weight: 700; }
.role-table .no { color: #75717C; }
.role-matrix { margin-top: 20px; border-top: 1px dashed var(--border-strong); padding-top: 16px; }
.role-matrix__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.role-matrix__head h4 { font-size: 14px; font-weight: 700; }
.role-matrix .role-table th { padding: 8px; }
.role-matrix .role-table .badge { padding: 3px 12px; }

/* 用户搜索选择器 */
.user-picker { position: relative; }
.user-picker__panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(43, 43, 51, .16);
  max-height: 264px; overflow-y: auto;
  padding: 6px;
  animation: modalIn .2s ease both;
}
.user-picker__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; transition: background .15s ease;
}
.user-picker__item:hover { background: rgba(203, 14, 117, .07); }
.user-picker__item-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-picker__item-meta span:first-child { font-size: 13px; font-weight: 500; }
.user-picker__item-meta .mono { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-picker__item-uid { font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }
.user-picker__empty { text-align: center; font-size: 13px; color: var(--text-3); padding: 22px 10px; }
.user-picker__foot { border-top: 1px solid var(--border); margin-top: 4px; padding: 8px 10px 4px; font-size: 11px; color: var(--text-3); text-align: center; }
.user-picker__remove {
  border: none; background: none; cursor: pointer;
  color: var(--text-3); font-size: 16px; line-height: 1;
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  transition: all .2s ease;
}
.user-picker__remove:hover { color: var(--danger); background: rgba(211, 53, 94, .08); }
.user-picker__notfound { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.user-picker__input-wrap { position: relative; }
.user-picker__input-wrap .input { padding-right: 36px; }
.user-picker__spinner {
  position: absolute; right: 12px; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
  border: 2px solid rgba(203, 14, 117, .2);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.user-picker__searching { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.user-picker__found { margin-top: 8px; animation: modalIn .2s ease both; }
.user-picker__found-tip {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: #3A6B54; margin-bottom: 6px;
}
.user-picker__found-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #3A6B54; color: #fff; font-size: 10px; flex-shrink: 0;
}
.user-picker__found-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border: 1px solid rgba(203, 14, 117, .45);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.user-picker__found-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-picker__found-name { font-size: 14px; font-weight: 700; }
.user-picker__found-meta .mono { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 退出登录按钮 */
.logout-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border: none; background: none; cursor: pointer;
  color: var(--text-3); border-radius: 50%;
  transition: all .2s ease;
}
.logout-btn svg { width: 16px; height: 16px; }
.logout-btn:hover { color: var(--rose); background: rgba(203, 14, 117, .08); }

/* 人机校验滑块（示意） */

.main { margin-left: 232px; min-height: 100vh; min-height: 100dvh; position: relative; z-index: 1; }

.content { padding: 28px 32px 48px; max-width: 1280px; }

.view { animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { transform: translateY(8px); } to { transform: translateY(0); } }


/* 指标卡 */


/* 事件分析 */
#event-total { margin-top: 2px; }

/* 设置页 */
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.panel-title.danger-text, .danger-text { color: var(--danger); }
.panel-desc { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.panel-actions { display: flex; gap: 12px; margin-top: 20px; }
.panel-hint { font-size: 12px; color: var(--text-3); margin-top: 14px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-title-row .panel-title { margin-bottom: 0; }
.panel-desc code, .sdk-step code, .modal__hint code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--rose-deep);
}

.code-block { border-radius: 10px; overflow: hidden; border: 1px solid #3a3a44; }
.code-block__head {
  display: flex; align-items: center; justify-content: space-between;
  background: #23232b; padding: 8px 14px; color: #C4BEC8; font-size: 12px;
}
.code-block pre {
  background: #2B2B33; color: #F5E9EF;
  padding: 16px; font-size: 12.5px; line-height: 1.8;
  overflow-x: auto;
}
.code-tabs { display: flex; gap: 4px; padding: 6px 8px 0; background: #23232b; }
.code-tab {
  border: 1px solid transparent; background: none; color: #B8B1BB; font-family: var(--font-sans);
  font-size: 12px; padding: 5px 12px; border-radius: 7px 7px 0 0; cursor: pointer;
}
.code-tab:hover { color: #F5E9EF; }
.code-tab:focus-visible { outline: 2px solid var(--rose-light); outline-offset: -2px; }
.code-tab.is-active { background: #2B2B33; color: #F5E9EF; border-color: #3a3a44; border-bottom-color: #2B2B33; }
.sdk-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sdk-step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.sdk-step__no { color: var(--rose); font-size: 12px; }
.sdk-debug-option {
  margin: 14px 0; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.sdk-debug-toggle {
  display: flex; align-items: flex-start; gap: 12px; min-height: 44px;
  color: var(--ink); cursor: pointer;
}
.sdk-debug-toggle__control {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: 0 0 auto; width: 40px; height: 24px; margin: 2px 0 0;
  border: 1px solid var(--text-2); border-radius: 99px; background: var(--bg); cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.sdk-debug-toggle__control::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border: 1px solid var(--border-strong); border-radius: 50%; background: var(--bg);
  box-shadow: 0 1px 3px rgba(43, 43, 51, .16); transition: transform .2s ease;
}
.sdk-debug-toggle__control:checked { border-color: var(--rose); background: var(--rose); }
.sdk-debug-toggle__control:checked::after { transform: translateX(16px); }
.sdk-debug-toggle__control:focus-visible { outline: 3px solid rgba(203, 14, 117, .32); outline-offset: 3px; }
.sdk-debug-toggle__body { display: block; min-width: 0; }
.sdk-debug-toggle__title { display: block; font-size: 13px; font-weight: 700; line-height: 1.5; }
.sdk-debug-toggle__help { display: block; margin-top: 3px; color: var(--text-2); font-size: 12px; line-height: 1.55; }
.sdk-debug-status { min-height: 20px; margin: 7px 0 0 52px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) {
  .sdk-debug-toggle__control, .sdk-debug-toggle__control::after { transition: none; }
}

.member-cell { display: flex; align-items: center; gap: 10px; }
.member-mail { font-size: 12px; color: var(--text-3); display: block; overflow-wrap: anywhere; }

.logo-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#setting-logo-preview { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: #fff; }
.op-cell { white-space: nowrap; text-align: right; }
.op-cell .btn { margin-left: 2px; }
.role-select {
  font-family: var(--font-sans); font-size: 12px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); color: var(--ink);
  padding: 4px 8px; cursor: pointer; transition: all .2s ease;
}
.role-select:hover { border-color: var(--rose); }

/* ═══════════ 设置页布局（桌面壳） ═══════════ */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-title { font-size: 22px; font-weight: 900; letter-spacing: .02em; }
.view-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.settings-layout { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.settings-nav__item {
  font-family: var(--font-sans); font-size: 14px; text-align: left;
  background: none; border: none; cursor: pointer;
  padding: 10px 14px; border-radius: 10px; color: var(--text-2);
  transition: all .2s ease;
}
.settings-nav__item:hover { background: var(--surface-2); color: var(--rose); }
.settings-nav__item.active { background: rgba(203, 14, 117, .1); color: var(--rose); font-weight: 700; }
.settings-nav__item.danger { color: var(--danger); }
.settings-nav__item.danger:hover { background: rgba(211, 53, 94, .08); }
.settings-nav__item.danger.active { background: rgba(211, 53, 94, .1); color: var(--danger); font-weight: 700; }
.settings-panels { min-width: 0; }
.settings-panel { max-width: 680px; }
.setting-type-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setting-type-row .modal__hint { margin: 0; }
.server-access-note,
.server-key-error {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.server-key-error .btn { margin-left: 8px; }
.server-key-limit { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.server-key-limit.is-full { color: var(--danger); font-weight: 600; }
.server-key-create {
  margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
}
.server-key-create > label { display: block; color: var(--ink); font-size: 13px; font-weight: 700; }
.server-field-help { margin: 4px 0 10px; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.server-key-create__row { display: flex; align-items: center; gap: 8px; }
.server-key-create__row .input { flex: 1; min-width: 0; }
.server-key-create__error { min-height: 18px; margin: 7px 0 0; color: #B92B50; font-size: 12px; }
.server-key-secret {
  margin-top: 14px; padding: 15px; border: 1px solid rgba(211, 53, 94, .3); border-radius: 12px;
  background: rgba(211, 53, 94, .055);
}
.server-key-secret__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.server-key-secret h4 { margin: 6px 0 0; color: var(--ink); font-size: 15px; }
.server-key-secret p { margin: 9px 0 11px; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.server-secret-badge {
  display: inline-flex; padding: 2px 8px; border-radius: 999px; background: #B92B50; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.server-connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.server-connect-item { min-width: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.server-connect-item > span { display: block; margin-bottom: 7px; color: var(--text-2); font-size: 11px; font-weight: 700; }
.server-copy-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.server-copy-row code { flex: 1; min-width: 0; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; word-break: break-word; }
.server-copy-row .btn { flex-shrink: 0; }
.server-code-block { margin-top: 12px; }
.server-code-block .code-tabs { overflow-x: auto; }
.server-code-block .code-tab { flex-shrink: 0; }
.server-code-block .code-tab:not(.is-active) { color: #B8B1BB; }
.ingest-key-management { margin-top: 20px; min-height: 58px; }
.ingest-key-prefix { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.ingest-key-status { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ingest-key-date { color: var(--text-3); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.ingest-key-management .empty-cell { color: var(--text-2); }
.ingest-revoke-confirm { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; }
.ingest-revoke-confirm__note { width: 100%; color: #B92B50; font-size: 11px; line-height: 1.4; }

@media (max-width: 640px) {
  .sdk-debug-option { padding: 12px; }
  .sdk-debug-status { margin-left: 0; }
  .server-key-create__row { align-items: stretch; flex-wrap: wrap; }
  .server-key-create__row .input { flex-basis: 100%; }
  .server-key-secret__head { flex-direction: column; }
  .server-connect-grid { grid-template-columns: 1fr; }
  .server-copy-row { align-items: flex-start; flex-wrap: wrap; }
  .server-copy-row code { flex-basis: 100%; }
  .server-code-block pre { max-width: 100%; }
  .ingest-revoke-confirm { justify-content: flex-start; gap: 8px; }
  .ingest-revoke-confirm .btn { min-height: 44px; }
}

/* ═══════════ 弹窗（桌面壳） ═══════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43, 43, 51, .45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 440px; max-width: 100%;
  background: var(--bg);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(43, 43, 51, .18);
  animation: modalIn .2s ease both;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal--wide { width: 560px; }
.mcp-modal { width: 620px; }
.mcp-create-grid { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; align-items: end; }
.mcp-create-grid .form-field { margin: 0 0 14px; }
.mcp-write-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin: 2px 0 14px; cursor: pointer; }
.mcp-write-option input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--rose); flex: 0 0 auto; }
.mcp-write-option b, .mcp-write-option small { display: block; }
.mcp-write-option small { color: var(--text-3); font-size: 12px; line-height: 1.55; margin-top: 3px; }
.mcp-once { margin-top: 16px; padding: 14px; border: 1px solid #efc4d8; background: #fff8fb; border-radius: 10px; color: var(--text-2); }
.mcp-once b { font-size: 13px; }
.mcp-token-value { min-width: 0; flex: 1; overflow-wrap: anywhere; color: var(--text); font-size: 12px; padding: 8px 0; }
.mcp-config { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; padding: 10px; border-radius: 8px; background: var(--surface-2); font-size: 11px; line-height: 1.5; }
.mcp-list-title { margin: 22px 0 8px; font-size: 14px; }
.mcp-token-list { display: grid; gap: 8px; }
.mcp-token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.mcp-token-row .btn { min-height: 44px; }
.mcp-token-row__name { font-size: 13px; font-weight: 700; }
.mcp-token-row__meta { margin-top: 3px; color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; }
.mcp-token-status { font-size: 12px; color: var(--text-3); }
.modal--date-range { width: 480px; }
.modal--doc { width: 680px; max-height: 82vh; display: flex; flex-direction: column; }
.modal--doc .modal__head { flex-shrink: 0; }
.doc-modal-meta { padding: 4px 24px 0; margin: 0; font-size: 12px; color: var(--text-3); }
.doc-modal-body { padding: 14px 24px 24px; overflow-y: auto; min-height: 0; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal__head h3 { font-size: 16px; font-weight: 700; }
.modal__close {
  border: none; background: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-3);
  width: 30px; height: 30px; border-radius: 50%;
  transition: all .2s ease;
}
.modal__close:hover { background: var(--surface-2); color: var(--rose); }
.modal__body { padding: 18px 24px 4px; }
.modal__hint { font-size: 12px; color: var(--text-3); margin: 2px 0 8px; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 24px 20px;
}
.required { color: var(--rose); }

/* 看板日期范围 */
.date-preset-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.date-preset {
  min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--bg); color: var(--text-2); font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.date-preset:hover, .date-preset:focus-visible { border-color: var(--rose); color: var(--rose); }
.date-preset:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.date-preset.active { border-color: var(--rose); background: rgba(203, 14, 117, .08); color: var(--rose-deep); font-weight: 700; }
.date-range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-range-fields .form-field { margin-bottom: 8px; }
.date-range-fields .input { min-height: 44px; font-size: 16px; }
.date-range-error { min-height: 20px; margin: 4px 0 0; color: #A12424; font-size: 12px; line-height: 1.6; }
.date-range-error[hidden] { display: block !important; visibility: hidden; }

/* ═══════════ 项目类型选择卡片 / 类型徽章 ═══════════ */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--bg); padding: 14px 10px; cursor: pointer;
  text-align: center; transition: all .2s ease;
}
.type-card svg { width: 24px; height: 24px; color: var(--text-3); }
.type-card__name { font-size: 14px; font-weight: 700; color: var(--ink); }
.type-card__desc { font-size: 11px; color: var(--text-3); line-height: 1.6; }
.type-card:hover { border-color: var(--rose); }
.type-card.active { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(203, 14, 117, .12); }
.type-card.active svg { color: var(--rose); }
.type-card.active .type-card__name { color: var(--rose); }

.badge-type-web { background: #fff; border: 1px solid var(--border-strong); color: var(--text-2); }
.badge-type-weapp { background: rgba(203, 14, 117, .12); color: var(--rose-deep); font-weight: 700; }

/* ═══════════ Toast ═══════════ */
.toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 200;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 500;
  padding: 10px 22px; border-radius: 99px;
  box-shadow: 0 12px 32px rgba(43, 43, 51, .25);
  animation: toastIn .2s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.out { opacity: 0; transform: translate(-50%, 8px); transition: all .3s ease; }

/* ═══════════ 导出按钮 ═══════════ */
.btn-export { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.btn-export svg { width: 14px; height: 14px; }
.card-head__side { display: inline-flex; align-items: center; gap: 10px; }
.btn svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.btn.btn-sm svg { margin-right: 3px; }

/* ═══════════ 分析看板 ═══════════ */
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.dash-tabs { display: flex; gap: 2px; background: var(--surface-2); border-radius: 99px; padding: 3px; min-width: 0; max-width: 100%; } /* flex 子项 min-width:auto 按内容撑破视口；max-width 兜底防横向溢出 */
.dash-tab {
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  border: none; background: none; color: var(--text-2);
  padding: 7px 18px; border-radius: 99px; cursor: pointer;
  transition: all .2s ease; white-space: nowrap;
}
.dash-tab:hover { color: var(--rose); }
.dash-tab.active {
  background: #fff; color: var(--rose); font-weight: 700;
  box-shadow: 0 2px 8px rgba(203, 14, 117, .12);
}
.dash-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 100%; }
.dash-global-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 100%; }
.dash-source-trigger { display: inline-flex; gap: 8px; align-items: center; max-width: 300px; min-height: 44px; }
.dash-source-trigger.is-active { border-color: var(--rose); color: var(--rose-deep); background: var(--surface); }
.dash-source-trigger span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-source-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.dash-source-context p { color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; margin: 0; }
.dash-source-context strong { color: var(--rose-deep); }
.dash-source-context button { flex: none; min-height: 44px; }
.source-dialog { width: min(480px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: hidden; background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.source-dialog::backdrop { background: rgba(29,21,29,.35); }
.source-dialog[open] { display: flex; flex-direction: column; }
.source-dialog-top { padding: 24px 24px 16px; flex-shrink: 0; }
.source-dialog-top h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.source-dialog-top p { color: var(--text-3); font-size: 12px; margin: 0 0 18px; line-height: 1.6; }
.source-dialog-top .input { min-height: 44px; width: 100%; }
.source-options { overflow-y: auto; min-height: 0; max-height: 390px; padding: 0 16px 16px; }
.source-option { display: flex; align-items: center; gap: 12px; min-height: 62px; border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.source-option:has(input:checked) { background: var(--surface); border-color: var(--border-strong); }
.source-option:hover { background: var(--surface); }
.source-option input { width: 17px; height: 17px; accent-color: var(--rose); flex: none; }
.source-option-copy { min-width: 0; }
.source-option b { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.source-option small { display: block; color: var(--text-3); font-size: 12px; }
.source-options-status { color: var(--text-2); padding: 20px 12px; font-size: 13px; text-align: center; }
.source-dialog-bottom { padding: 16px 24px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }
.source-dialog-bottom p { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; margin: 0; }
.source-actions { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }
.source-actions .btn { min-width: 110px; min-height: 44px; }
.source-attribution-summary { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; color: var(--text-2); font-size: 12px; }
@media(max-width:360px) { #page-project #btn-mcp-access-p { width: 34px; min-width: 34px; padding: 0; font-size: 0; } #page-project #btn-mcp-access-p::after { content: 'MCP'; font-size: 10px; } }
@media(max-width:600px) { .dash-global-filters { width: 100%; flex-wrap: nowrap; } .dash-global-filters > button { min-width: 0; flex: 1 1 0; max-width: 100%; justify-content: center; } #dash-date-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .source-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); } .source-actions .btn { width: 100%; min-width: 0; } }
.dash-segment-filter { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.dash-segment-filter label { flex: 0 0 auto; color: var(--text-2); font-size: 12px; font-weight: 700; }
.dash-segment-filter .input { width: 196px; min-width: 0; min-height: 34px; padding: 6px 30px 6px 10px; font-size: 12px; }
.dash-segment-context {
  display: flex; align-items: center; gap: 8px; margin: -6px 0 14px; padding: 9px 12px;
  border-left: 3px solid var(--rose); border-radius: 0 9px 9px 0;
  background: rgba(203,14,117,.055); color: var(--text-2); font-size: 12px; line-height: 1.6;
}
.dash-segment-context__copy { min-width: 0; }
.dash-segment-context strong { color: var(--rose-deep); }
.dash-segment-context button { flex: 0 0 auto; min-width: 44px; min-height: 44px; margin: -7px -7px -7px auto; border: 0; background: transparent; color: var(--rose-deep); font: 700 12px var(--font-sans); white-space: nowrap; cursor: pointer; }
.dash-segment-context button:hover,.dash-segment-context button:focus-visible { text-decoration: underline; outline: 2px solid rgba(203,14,117,.28); outline-offset: -2px; }
.seg__item:disabled { opacity: .45; cursor: not-allowed; }

.platform-readonly-banner {
  display: flex; align-items: center; gap: 11px; margin: -4px 0 18px; padding: 11px 13px;
  border: 1px solid #E8D29F; border-radius: 10px; background: #FFF9EC; color: #6F5014;
}
.platform-readonly-banner > svg { width: 20px; height: 20px; flex: 0 0 auto; }
.platform-readonly-banner > span { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.platform-readonly-banner b { font-size: 13px; white-space: nowrap; }
.platform-readonly-banner small { color: #80672F; font-size: 12px; line-height: 1.6; }
.platform-readonly-banner .btn { min-height: 36px; flex: 0 0 auto; border-color: #DCC17E; color: #6F5014; }

.health-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 9px 14px; border-radius: 10px; margin-bottom: 14px; line-height: 1.6; }
.health-bar b { font-weight: 700; }
.health-bar a { color: inherit; font-weight: 600; text-decoration: underline; }
.health-bar--ok { background: #EFF7F1; border: 1px solid #CFE3D5; color: #3C7A55; }
.health-bar--warn { background: #FCF6E8; border: 1px solid #F0DFB4; color: #8A6410; }
.metric-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.metric-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 16px 18px;
}
.metric-label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.metric-help { width: 17px; height: 17px; margin-left: 4px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--bg); color: var(--text-2); font-size: 11px; font-weight: 700; line-height: 15px; cursor: pointer; vertical-align: 1px; }
.metric-help:hover, .metric-help:focus { border-color: var(--rose); color: var(--rose); outline: none; }
.metric-help-detail { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text-2); line-height: 1.65; }
.metric-help-detail b { flex: none; color: var(--ink); }.metric-help-detail button { margin-left: auto; border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; }
.metric-num { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.metric-unit { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 3px; }

.chart-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px;
}
.chart-card:last-child { margin-bottom: 0; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.card-title .card-head__hint { font-weight: 400; font-size: 11.5px; }
.chart { width: 100%; height: 280px; }
.chart-lg .chart { height: 320px; }
.chart-fallback {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--text-3); font-size: 13px;
}

/* 用户分析：趋势 / 地域 / 设备 */
.user-subtabs {
  display: flex; align-items: center; gap: 24px;
  min-height: 45px; margin: 0 0 18px; border-bottom: 1px solid var(--border);
}
.user-subtab {
  position: relative; align-self: stretch; min-width: 52px; min-height: 44px;
  border: 0; background: none; color: var(--text-2); cursor: pointer;
  font: 600 14px var(--font-sans); transition: color .18s ease;
}
.user-subtab::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--rose); transform: scaleX(0); transition: transform .18s ease;
}
.user-subtab:hover { color: var(--ink); }
.user-subtab.active { color: var(--rose); }
.user-subtab.active::after { transform: scaleX(1); }
.user-subtab:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 4px; }
.user-view-panel { min-height: 390px; }
.user-view-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin: 4px 0 14px;
}
.user-view-head h3 { display: flex; align-items: center; gap: 4px; font-size: 16px; }
.user-view-head p { margin-top: 4px; color: var(--text-3); font-size: 12px; }
.user-dimension-seg .seg__item { min-height: 44px; padding: 7px 16px; }
.user-coverage-row { grid-template-columns: repeat(4, 1fr); }
.user-geo-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.user-geo-layout .chart-card, .user-device-grid .chart-card { margin-bottom: 0; min-width: 0; }
.user-dimension-chart { height: 360px; }
.user-device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.user-device-chart { height: 250px; }
.user-device-card { padding: 18px; }
.user-device-card .table { font-size: 11.5px; }
.user-device-card .table th, .user-device-card .table td { padding: 8px 6px; }
.user-dimension-note { margin-top: 12px; color: var(--text-3); font-size: 12px; line-height: 1.65; }
.user-view-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 300px; color: var(--text-2); font-size: 13px;
}
.user-view-loading { min-height: 390px; }
.user-skeleton {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 45%, var(--surface) 65%);
  background-size: 240% 100%; animation: userSkeleton 1.4s ease-in-out infinite;
}
.user-skeleton--metrics { height: 92px; margin-bottom: 16px; }
.user-skeleton--chart { height: 280px; }
@keyframes userSkeleton { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .user-subtab, .user-subtab::after, .user-skeleton { transition: none; animation: none; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 1100px) {
  .user-device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.event-row { cursor: pointer; }
.event-row--sel td { background: rgba(203, 14, 117, .06); }
.event-row--sel td:first-child { color: var(--rose); font-weight: 700; }
.row-empty td { text-align: center; color: var(--text-3); padding: 18px 12px; }
.table-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 26px 12px; }
.url-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prop-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.prop-chip {
  font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--ink);
  border-radius: 99px; padding: 4px 12px; cursor: pointer; transition: all .2s ease;
}
.prop-chip:hover { border-color: var(--rose); color: var(--rose); }
.prop-chip.active {
  background: rgba(203, 14, 117, .1); border-color: var(--rose);
  color: var(--rose); font-weight: 700;
}
.props-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.props-title { font-size: 13px; color: var(--text-2); }
.dict-props-editor { margin-top: 18px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface); }
.dict-prop-row { display: grid; grid-template-columns: 1.1fr 1fr .9fr auto 1.4fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.dict-prop-row .input { min-width: 0; padding: 7px 9px; font-size: 12px; }.dict-required { font-size: 12px; white-space: nowrap; color: var(--text-2); }

/* 接入引导 */
.onboard-steps { display: flex; gap: 6px; margin: 0 0 18px; }.onboard-step { flex: 1; border: 0; border-bottom: 2px solid var(--border); background: none; padding: 8px 4px; color: var(--text-3); cursor: pointer; font-weight: 700; }.onboard-step.active { color: var(--rose); border-color: var(--rose); }.onboard-step span { font-size: 12px; margin-left: 3px; }
.onboard-template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }.onboard-template { text-align: left; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); padding: 10px; cursor: pointer; color: var(--ink); }.onboard-template:hover,.onboard-template.active { border-color: var(--rose); background: rgba(203,14,117,.05); }.onboard-template b,.onboard-template span { display:block; }.onboard-template span { margin-top: 2px; font: 11px var(--font-mono); color: var(--text-3); }
.onboard-check { padding: 16px; background: var(--surface); border-radius: 10px; color: var(--text-2); }.onboard-check b { color: var(--ink); }.onboard-check p { margin-top: 8px; font-size: 13px; }.onboard-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.prop-bars { display: flex; flex-direction: column; gap: 10px; }
.prop-bar { display: grid; grid-template-columns: 160px 1fr 64px; align-items: center; gap: 12px; }
.prop-bar__label {
  font-size: 12px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: right; color: var(--text-2);
}
.prop-bar__track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.prop-bar__fill { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.prop-bar__count { font-size: 12px; color: var(--text-3); text-align: right; }

.settings-nav__back { text-align: left; margin-bottom: 6px; font-weight: 500; }
.settings-nav__back:hover { color: var(--rose); }

/* ═══════════ 手机端（≤900px） ═══════════ */

@media (max-width: 900px) {
  .dict-prop-row { grid-template-columns: 1fr 1fr; }.dict-prop-row .dict-required { padding: 6px 0; }.onboard-template-grid { grid-template-columns: 1fr; }

  /* 公开首页 */
  .home-nav { padding: 12px 16px; }
  .home-nav__links a { display: none; }
  .home-nav__links .home-nav__help, .home-nav__register { display: none; }
  .home-nav__links { gap: 8px; }
  .home-nav__links .btn { padding: 10px 16px; font-size: 14px; min-height: 40px; }
  .home-hero { display: flex; flex-direction: column; align-items: stretch; gap: 24px; min-height: 0; padding: 36px 18px 28px; }
  .home-hero__copy { max-width: none; }
  .home-hero__title { max-width: 9em; font-size: 37px; line-height: 1.18; }
  .home-hero__sub { margin-top: 16px; font-size: 15px; line-height: 1.75; }
  .home-hero__cta { display: grid; gap: 10px; margin-top: 22px; }
  .home-hero__cta .btn { width: 100%; min-height: 48px; }
  .home-hero__demo { grid-row: 1; color: #fff; border-color: transparent; background: var(--brand); box-shadow: 0 10px 24px rgba(203, 14, 117, .2); }
  .home-hero__demo:hover { color: #fff; border-color: transparent; }
  .home-hero__register { grid-row: 2; color: var(--ink); border: 1px solid var(--border-strong); background: #fff; box-shadow: none; }
  .home-hero__register:hover { color: var(--rose-deep); border-color: var(--rose); filter: none; box-shadow: none; }
  .home-demo-preview { border-radius: 14px; box-shadow: 0 16px 42px rgba(78, 26, 54, .16); }
  .home-demo-caption { margin-top: 10px; font-size: 12px; }
  .home-proofline { margin: 0 18px; padding: 16px 0 22px; font-size: 12px; }
  .home-proofline__flow { gap: 5px; }
  .home-demo-overlay { align-items: center; padding: 16px; }
  .home-demo-dialog { width: 100%; max-height: calc(100dvh - 32px); border-radius: 16px; }
  .home-demo-dialog__head { min-height: 56px; padding-left: 16px; }
  .home-demo-dialog__head h2 { font-size: 15px; }
  .home-demo-video-wrap { padding: 8px; }
  .home-demo-dialog__foot { align-items: stretch; flex-direction: column; padding: 14px 16px; }
  .home-demo-dialog__foot .btn { width: 100%; min-height: 46px; }
  .home-demo-complete { min-height: min(540px, calc(100dvh - 88px)); padding: 34px 18px; }
  .home-demo-complete > div { width: 100%; }
  .home-demo-complete__actions { display: grid; grid-template-columns: 1fr; justify-content: stretch; width: 100%; }
  .home-demo-complete__actions .btn { width: 100%; min-height: 46px; }
  .home-features { padding: 40px 16px; }
  .home-feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-mcp { margin: 0 16px; padding: 26px 0 28px; }
  .home-mcp__body { grid-template-columns: 1fr; gap: 20px; }
  .home-mcp h2 { font-size: 21px; }
  .home-mcp__action { align-items: flex-start; }
  .home-mcp__badge { white-space: normal; }
  .home-steps { padding: 24px 16px 40px; }
  .home-step-row { grid-template-columns: 1fr; gap: 12px; }
  .home-guides { padding: 28px 16px 48px; }
  .home-guides__head .home-sec-title { font-size: 24px; }
  .home-guide-link { grid-template-columns: 1fr; gap: 4px; padding: 18px 2px; }
  .home-guide-link:hover { padding-left: 8px; }
  .home-cta { margin: 0 16px 44px; padding: 34px 20px; }
  .home-footer { flex-direction: column; align-items: center; gap: 8px; padding: 16px; text-align: center; line-height: 1.8; }
  .home-footer__left { flex-direction: column; align-items: center; gap: 6px; }
  .home-footer__right { width: 100%; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .footer-icp--record { flex: 1 0 100%; justify-content: center; margin-top: 2px; }
  .footer-icp--record::before { display: none; }

  /* 注册页 */
  .register-grid { grid-template-columns: 1fr; }
  .register-card { padding: 18px 16px; margin-top: 16px; }

  /* 登录页 */
  .login-card { padding: 18px 16px; margin-top: 16px; }

  /* 登录/注册/找回：内容压缩适配视口，垂直居中无纵向滚动条；
     .page .auth-wrap 提高优先级，覆盖全局 auth-wrap(100dvh) */
  .page .auth-wrap { padding: 24px 16px calc(88px + env(safe-area-inset-bottom)); min-height: 100dvh; }
  .auth-back-home {
    top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left));
    padding: 7px 10px; background: rgba(255, 255, 255, .94);
  }
  .login-logo { width: 68px; height: 68px; }
  .login-title { font-size: 26px; margin-top: 12px; }
  .login-sub { letter-spacing: .4em; margin-top: 3px; }
  .login-hint { margin-top: 10px; line-height: 1.6; }
  .auth-alternative { margin: 14px 0 10px; }
  .wechat-login-dialog { width: min(408px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 20px 18px; }
  .wechat-qr-frame { min-height: 184px; margin: 18px 0 14px; }
  .register-title { font-size: 22px; margin-top: 10px; }
  .auth-wrap .form-field { margin-bottom: 12px; }
  .auth-wrap .form-field label { margin-bottom: 5px; }
  .auth-wrap .btn-block { padding: 10px 22px; }
  #page-register #register-submit,
  #page-login #login-submit {
    position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
    width: calc(100% - 32px); min-height: 44px; transform: translateX(-50%);
    box-shadow: 0 10px 28px rgba(203, 14, 117, .24);
  }
  #page-register .auth-wrap::after,
  #page-login .auth-wrap::after {
    content: ''; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    height: calc(68px + env(safe-area-inset-bottom)); pointer-events: none;
    border-top: 1px solid rgba(229, 220, 227, .8); background: rgba(255, 252, 254, .9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  #page-register #register-submit { max-width: 528px; }
  #page-login #login-submit { max-width: 348px; }

  /* 项目列表 */
  .projects-topbar { padding: 12px 16px; }
  .topbar-username { display: none; }
  .container { padding: 22px 16px 40px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .projects-head .btn-brand { width: 100%; }
  .project-tools { align-items: stretch; flex-direction: column; gap: 10px; margin-top: -6px; padding: 12px; }
  .project-search { flex-basis: auto; min-width: 0; width: 100%; }
  .project-search .input { min-height: 44px; font-size: 16px; }
  .project-search__clear { min-height: 44px; }
  .project-tools__meta { justify-content: space-between; text-align: left; }
  .project-sort-hint { max-width: none; }
  .project-card { display: block; }
  .project-card__open { display: block; }
  .project-card__top { align-items: center; margin-bottom: 0; }
  .project-card__meta {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "title type role" "appid appid appid";
    row-gap: 0;
  }
  .project-card__title {
    font-size: 15px; line-height: normal;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .project-card__stats { margin: 16px 0 12px; }

  /* 后台布局：侧边栏 → 顶部栏 + 底部标签 */
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .mobile-topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
  }
  .mobile-topbar__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .mobile-topbar__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-topbar__id { font-size: 10px; color: var(--text-3); }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 6px; font-size: 10px; color: var(--text-3);
    cursor: pointer; text-decoration: none; transition: color .2s ease;
  }
  .bottom-nav__item svg { width: 20px; height: 20px; }
  .bottom-nav__item.active { color: var(--rose); font-weight: 700; }

  .content { padding: 18px 16px 32px; }
  .chart-card { margin-bottom: 14px; }
  .event-detail { gap: 14px; }
  .event-layout { gap: 14px; }
  .view-head { align-items: center; margin-bottom: 16px; }
  .view-title { font-size: 19px; }
  .date-range { font-size: 12px; padding: 5px 12px; }
  .dash-date-trigger { min-height: 44px; max-width: 100%; justify-content: center; }
  .date-range-fields { grid-template-columns: 1fr; gap: 0; }
  .date-preset-group { gap: 8px; }

  /* 指标卡：5 → 2 列 */
  .metric-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 12px 14px; }
  .metric-num { font-size: 22px; }
  .metric-card:last-child { grid-column: span 2; }
  .user-coverage-row .metric-card:last-child { grid-column: auto; }

  .user-subtabs { gap: 18px; overflow-x: auto; }
  .user-view-head { align-items: flex-start; flex-direction: column; }
  .user-geo-layout, .user-device-grid { grid-template-columns: minmax(0, 1fr); }
  .user-dimension-seg { width: 100%; }
  .user-dimension-seg .seg__item { flex: 1; }
  .user-dimension-chart { height: 300px; }
  .user-device-chart { height: 230px; }

  /* 分析看板 */
  .dash-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .dash-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dash-tab { padding: 7px 13px; font-size: 13px; }
  .dash-controls { justify-content: space-between; }
  .dash-segment-filter { order: -1; width: 100%; align-items: stretch; flex-direction: column; gap: 5px; }
  .dash-segment-filter .input { width: 100%; min-height: 44px; font-size: 16px; }
  .dash-segment-context { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; margin-top: 0; }
  .platform-readonly-banner { align-items: flex-start; flex-wrap: wrap; }
  .platform-readonly-banner > span { align-items: flex-start; flex-direction: column; gap: 2px; }
  .platform-readonly-banner .btn { width: 100%; }
  .chart { height: 220px; }
  .chart-lg .chart { height: 240px; }
  .prop-bar { grid-template-columns: 96px 1fr 52px; gap: 8px; }
  .card { padding: 16px; border-radius: 12px; }

  /* 表格 → 卡片化 */
  .table-wrap { overflow-x: auto; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--surface); border-radius: 10px; padding: 10px 12px;
    margin-bottom: 10px;
  }
  .table tbody tr:hover { background: var(--surface-2); }
  .table td { border: none; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .table td::before {
    content: attr(data-label);
    font-size: 11px; color: var(--text-3); flex-shrink: 0;
  }
  .table td:first-child { font-weight: 500; }
  .table .num, .table td.num { text-align: right; }
  .op-cell { justify-content: flex-end; }
  .op-cell::before { content: none !important; }

  /* 留存/分群矩阵表：保持横向滚动表格（单元格无 data-label，不做卡片化） */
  .retention-table { display: table; width: auto; }
  .retention-table thead { display: table-header-group; }
  .retention-table tbody { display: table-row-group; }
  .retention-table tr { display: table-row; width: auto; padding: 0; margin: 0; background: none; }
  .retention-table th, .retention-table td { display: table-cell; padding: 10px 8px; }
  .retention-table td::before { content: none; }

  /* 事件分析：两栏 → 上下堆叠（列表纵向，过滤框可用） */
  .event-layout { grid-template-columns: 1fr; }
  .event-list { padding: 12px; }
  .event-desc { display: none; }
  .page-search { width: 100%; flex: 1; min-width: 0; }
  .pv-test__row { flex-wrap: wrap; }

  /* 用户分析：地域/设备堆叠 */
  .user-geo-layout { grid-template-columns: 1fr; }
  .device-grid { grid-template-columns: 1fr; }
  .retention-config { gap: 12px; }
  .retention-config__item { flex: 1; min-width: 0; }
  .retention-config .input { min-width: 0; width: 100%; }

  /* 热力图：商品网格 2 列 */
  .hm-grid { grid-template-columns: repeat(2, 1fr); }
  .hm-nav { gap: 8px; font-size: 11px; }

  /* 大屏：手机布局 */
  .screen-bg { padding: 14px 12px 18px; }
  .screen-metrics { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .screen-metric { padding: 12px 14px; }
  .screen-metric__num { font-size: 26px; }
  .screen-main { grid-template-columns: 1fr; grid-template-rows: auto; }
  .screen-panel--chart { grid-row: auto; }
  .screen-chart { min-height: 200px; }
  .screen-clock { font-size: 15px; }
  .seg-select { width: 130px; }

  /* 漏斗：连接标注堆叠 */
  .funnel-picker { padding: 12px 14px; }
  .funnel-picker .btn { width: 100%; }
  .funnel-connector { flex-direction: column; align-items: flex-start; gap: 2px; }
  .funnel-bar { height: 24px; }
  .funnel-step-row { flex-wrap: wrap; }

  /* 分群：列表改选择器，规则行适配触控 */
  .cohort-v2-head { align-items: center; }
  .cohort-v2-head p { display: none; }
  .cohort-v2-layout { display: block; min-height: 0; border: 0; box-shadow: none; overflow: visible; }
  .cohort-v2-sidebar { padding: 0 0 12px; border: 0; background: transparent; }
  .cohort-v2-search,.cohort-v2-list { display: none; }
  .cohort-v2-mobile-select { display: block; min-height: 44px; font-size: 16px; }
  .cohort-v2-detail { padding: 0; }
  .cohort-detail-head { flex-direction: column; gap: 12px; }
  .cohort-detail-head h3 { font-size: 18px; }
  .cohort-detail-actions { width: 100%; flex-wrap: wrap; }
  .cohort-detail-actions .btn { flex: 1; min-height: 44px; }
  .cohort-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cohort-metric:last-child { grid-column: 1/-1; }
  .cohort-analysis-tabs { gap: 18px; }
  .cohort-analysis-tabs button { min-height: 44px; }
  .cohort-builder__settings { grid-template-columns: 1fr; gap: 0; }
  .cohort-match-seg { display: flex; width: 100%; }.cohort-match-seg .seg__item { flex: 1; min-height: 44px; }
  .cohort-rule-row { grid-template-columns: minmax(0,1fr) 92px 44px; }
  .cohort-rule-event { grid-column: 1/-1; font-size: 16px; }
  .cohort-rule-count { grid-column: 1/3; font-size: 16px; }
  .cohort-rule-remove { grid-column: 3; width: 44px; height: 44px; }
  .cohort-preview { align-items: stretch; flex-direction: column; }
  .cohort-preview .btn { min-height: 44px; }
  .cohort-builder .modal__body { max-height: calc(88vh - 148px); }

  /* 设置页：左导航 → 顶部横滑 */
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .settings-nav__item { flex-shrink: 0; border: 1px solid var(--border); border-radius: 99px; padding: 6px 14px; font-size: 13px; }
  .settings-nav__item.active { border-color: var(--rose); }
  #sdk-code-tabs .code-tab, #sdk-code-copy { min-height: 44px; }
  .code-block pre { font-size: 11.5px; }

  /* 弹窗 → 底部抽屉 */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal--wide { width: 100%; }
  .mcp-modal { width: 100%; }
  .mcp-create-grid { grid-template-columns: 1fr; gap: 0; }
  .mcp-token-row { grid-template-columns: minmax(0, 1fr); }
  .role-table th, .role-table td { font-size: 11px; padding: 6px 5px; }
  .modal {
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    animation: sheetIn .2s ease both;
  }
  @keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .modal__head { padding: 18px 20px 0; }
  .modal__body { padding: 16px 20px 4px; }
  .modal__foot { padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); }
  .modal__foot .btn { min-height: 44px; flex: 1; }
  /* 首页视频是短内容的聚焦弹窗，不沿用业务表单的底部抽屉形态。 */
  #home-demo-modal { align-items: center; padding: 16px; }
  #home-demo-modal .home-demo-dialog {
    width: 100%; max-height: calc(100dvh - 32px);
    border-radius: 16px; animation: modalIn .2s ease both;
  }
  #modal-project .modal { display: flex; flex-direction: column; overflow: hidden; }
  #modal-project .modal__head, #modal-project .modal__foot { flex: 0 0 auto; }
  #modal-project .modal__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #modal-project .modal__foot { border-top: 1px solid var(--border); background: var(--bg); }

  /* 日期面板全宽居中 */
  .date-panel { position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); width: auto; }

  /* ── 汉堡按钮 + 右侧抽屉 ── */
  .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--bg); color: var(--ink); cursor: pointer;
    transition: all .2s ease;
  }
  .hamburger svg { width: 18px; height: 18px; }
  .hamburger:hover { border-color: var(--rose); color: var(--rose); }

  .drawer-overlay {
    display: block;
    position: fixed; inset: 0; z-index: 60;
    background: rgba(43, 43, 51, .45);
    animation: fadeIn .2s ease both;
  }
  .drawer {
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
    width: 280px; max-width: 82vw;
    background: var(--bg);
    box-shadow: -12px 0 40px rgba(43, 43, 51, .16);
    border-radius: 16px 0 0 16px;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    animation: drawerIn .2s ease both;
    overflow-y: auto;
  }
  @keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
  .drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 14px; }
  .drawer__project {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
  }
  .drawer__project-meta { display: flex; flex-direction: column; min-width: 0; }
  .drawer__project-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .drawer__project-id { font-size: 11px; color: var(--text-3); }
  .drawer__switch {
    align-self: flex-start;
    margin: 10px 2px 4px;
    font-family: var(--font-sans); font-size: 13px;
    border: none; background: none; cursor: pointer;
    color: var(--rose); padding: 4px 6px; border-radius: 8px;
    transition: background .2s ease;
  }
  .drawer__switch:hover { background: rgba(203, 14, 117, .08); }
  .drawer-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
  .drawer-nav__item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 99px;
    font-size: 14px; color: var(--text-2);
    cursor: pointer; text-decoration: none;
    transition: all .2s ease;
  }
  .drawer-nav__item svg { width: 17px; height: 17px; flex-shrink: 0; }
  .drawer-nav__item.active { background: rgba(203, 14, 117, .1); color: var(--rose); font-weight: 700; }
  .drawer__user {
    display: flex; align-items: center; gap: 10px;
    border-top: 1px solid var(--border);
    margin-top: 14px; padding: 14px 8px 0;
  }
  .drawer__user-meta { display: flex; flex-direction: column; }
  .drawer__user-meta span:first-child { font-size: 14px; font-weight: 500; }
  .drawer__user-meta .mono { font-size: 11px; color: var(--text-3); }
}

/* ═══════════ 公开站补充（auth 容器 + select 箭头） ═══════════ */
.auth-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px;
}
.select-input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%239A93A0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

/* ═══════════ 系统管理页（#/admin） ═══════════ */
.admin-container { max-width: 1440px; }
.admin-shell { display: block; }
.admin-nav {
  display: flex; gap: 6px; overflow-x: auto; overscroll-behavior: contain;
  margin: 0 -16px 20px; padding: 2px 16px 8px; scrollbar-width: thin;
}
.admin-nav__item {
  min-height: 44px; flex: 0 0 auto; padding: 8px 16px; border: 1px solid var(--border);
  border-radius: 99px; background: var(--bg); color: var(--text-2); font: 600 14px/1.4 var(--font-sans);
  cursor: pointer; transition: all .2s ease;
}
.admin-nav__item:hover { border-color: var(--rose); color: var(--rose-deep); }
.admin-nav__item.active { border-color: transparent; background: rgba(203, 14, 117, .1); color: var(--rose-deep); font-weight: 700; }
.admin-nav__item:focus-visible,
.admin-recent-row:focus-visible,
.admin-drawer .modal__close:focus-visible {
  outline: 3px solid rgba(203, 14, 117, .32); outline-offset: 2px;
}
.admin-content { min-width: 0; }
.admin-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.admin-section-head h3 { margin: 0; font-size: 19px; line-height: 1.4; }
.admin-section-head p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
.admin-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.admin-metric {
  min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg); box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.admin-metric > span { color: var(--text-2); font-size: 12px; font-weight: 600; }
.admin-metric strong { margin: 6px 0 2px; color: var(--rose-deep); font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.admin-metric small { color: var(--text-3); font-size: 11px; }
.admin-recent-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.admin-recent-card { padding: 16px; min-width: 0; }
.admin-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.admin-card-head h4 { margin: 0; font-size: 15px; }
.admin-recent-row {
  width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 2px; border: 0; border-bottom: 1px solid var(--border); background: transparent;
  color: var(--ink); text-align: left; font: inherit; cursor: pointer;
}
.admin-recent-row:last-child { border-bottom: 0; }
.admin-recent-row:hover b { color: var(--rose-deep); }
.admin-recent-row > span:first-child { min-width: 0; }
.admin-recent-row b, .admin-recent-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-recent-row b { font-size: 13px; }
.admin-recent-row small, .admin-recent-row time { color: var(--text-3); font-size: 11px; }
.admin-recent-row time { flex: none; }
.admin-recent-order { display: flex; align-items: flex-end; flex-direction: column; gap: 4px; }
.admin-recent-empty { padding: 18px 0; color: var(--text-3); font-size: 13px; text-align: center; }
.admin-filters {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .45fr); gap: 10px;
  align-items: end; margin-bottom: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}
.admin-filters label { min-width: 0; }
.admin-filters label > span { display: block; margin: 0 0 4px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.admin-filters .admin-search { grid-column: 1 / -1; }
.admin-filters .btn { min-height: 40px; }
.admin-filters input[type="date"] { min-width: 0; padding-inline: 10px 6px; font-size: 12px; }
.admin-list { min-height: 180px; }
.admin-list__desktop { display: none; }
.admin-list__mobile { display: grid; gap: 10px; }
.admin-mobile-card { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow); }
.admin-mobile-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.admin-mobile-card__head > span { min-width: 0; }
.admin-mobile-card__head b, .admin-mobile-card__head small { display: block; overflow-wrap: anywhere; }
.admin-mobile-card__head b { font-size: 14px; }
.admin-mobile-card__head small { margin-top: 2px; color: var(--text-3); font-size: 11px; }
.admin-mobile-card dl { display: grid; gap: 7px; margin: 12px 0; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.admin-mobile-card dl > div { display: flex; justify-content: space-between; gap: 12px; }
.admin-mobile-card dt { color: var(--text-3); font-size: 12px; }
.admin-mobile-card dd { margin: 0; text-align: right; font-size: 12px; overflow-wrap: anywhere; }
.admin-mobile-card > .btn { width: 100%; min-height: 40px; }
.admin-table { min-width: 980px; font-size: 12px; }
.admin-users-table { min-width: 1180px; }
.admin-table th { white-space: nowrap; }
.admin-table td { vertical-align: middle; }
.admin-table td > b, .admin-table td > small { display: block; }
.admin-table td > small { max-width: 210px; color: var(--text-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-person { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.admin-person > span:last-child { min-width: 0; }
.admin-person b, .admin-person small { display: block; }
.admin-person b em { color: var(--rose-deep); font-size: 10px; font-style: normal; }
.admin-status { display: inline-flex; align-items: center; border-radius: 99px; padding: 3px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.admin-status.is-ok { color: #3A6B54; background: #E3F6EC; }
.admin-status.is-warn { color: #8A5B10; background: #FFF2D8; }
.admin-status.is-danger { color: #B92B50; background: #FCE7ED; }
.admin-status.is-off { color: #5A5560; background: #EDE9EE; }
.admin-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--text-3); font-size: 12px; }
.admin-pagination > div { display: flex; gap: 8px; }
.admin-loading, .admin-empty { min-height: 180px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--text-3); text-align: center; }
.admin-loading__bar { width: 120px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--border), var(--rose-light), var(--border)); background-size: 200% 100%; animation: admin-loading 1.2s ease infinite; }
.admin-empty strong { color: var(--ink); font-size: 15px; }
.admin-empty span { font-size: 12px; }
@keyframes admin-loading { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .admin-loading__bar { animation: none; background: var(--border-strong); } }
.admin-settings > .card + .card { margin-top: 16px; }
.admin-drawer-backdrop { position: fixed; inset: 0; z-index: 980; background: rgba(43, 43, 51, .32); opacity: 0; transition: opacity .2s ease; }
.admin-drawer-backdrop.is-open { opacity: 1; }
.admin-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 990; width: min(100%, 520px);
  background: var(--bg); box-shadow: -16px 0 48px rgba(43, 43, 51, .14); overflow-y: auto;
  transform: translateX(100%); transition: transform .2s ease;
}
.admin-drawer.is-open { transform: translateX(0); }
.admin-drawer__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.admin-drawer__eyebrow { display: block; color: var(--rose-deep); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.admin-drawer__head h3 { margin: 3px 0 0; font-size: 19px; overflow-wrap: anywhere; }
.admin-drawer__body { padding: 20px; }
body.drawer-open { overflow: hidden; }
.admin-detail-list { margin: 0; }
.admin-detail-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.admin-detail-row dt { color: var(--text-3); font-size: 12px; }
.admin-detail-row dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.admin-detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.admin-detail-summary--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-detail-summary > span { padding: 10px; border-radius: 10px; background: var(--surface); text-align: center; }
.admin-detail-summary small, .admin-detail-summary b { display: block; }
.admin-detail-summary small { color: var(--text-3); font-size: 11px; }
.admin-detail-summary b { margin-top: 3px; color: var(--rose-deep); font-size: 15px; }
.admin-detail-section { margin-top: 22px; }
.admin-detail-section h4 { margin: 0 0 10px; font-size: 14px; }
.admin-detail-items { list-style: none; border-top: 1px solid var(--border); }
.admin-detail-items li { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.admin-detail-items b, .admin-detail-items small { display: block; }
.admin-detail-items small { color: var(--text-3); font-size: 11px; }
.admin-lifecycle-items li > span:last-child { flex: none; text-align: right; }
.account-lifecycle-toggle { min-width: 84px; min-height: 44px; }
.admin-detail-empty { color: var(--text-3); justify-content: center !important; }
.admin-readonly-note { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #F0D9B0; border-radius: 10px; background: #FFF8EC; color: #805716; font-size: 12px; }
.admin-operation-section { margin: 18px 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.admin-operation-section h4 { margin: 0; font-size: 14px; }
.admin-operation-section p { margin: 5px 0 12px; color: var(--text-3); font-size: 12px; line-height: 1.6; }
.admin-operation-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.admin-operation-buttons .btn { min-height: 40px; }
.admin-operation-note { color: var(--text-3); font-size: 12px; }
.admin-audit-table { min-width: 1040px; }
.admin-audit-reason { min-width: 180px; max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
.admin-action-overlay { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 16px; background: rgba(43, 43, 51, .42); }
.admin-action-overlay[hidden] { display: none; }
.admin-action-dialog { width: min(100%, 480px); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 14px; background: var(--bg); box-shadow: 0 24px 70px rgba(43, 43, 51, .2); }
.admin-action-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.admin-action-dialog__head span { color: var(--rose-deep); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.admin-action-dialog__head h3 { margin: 3px 0 0; font-size: 19px; }
.admin-action-dialog form { padding: 20px; }
.admin-action-desc { margin: 0 0 12px; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.admin-action-current { margin-bottom: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.admin-action-dialog .form-field { display: block; margin: 0 0 16px; }
.admin-action-dialog .form-field > span { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.admin-action-dialog .form-field > span b { color: var(--danger); }
.admin-action-dialog textarea { min-height: 92px; resize: vertical; }
.admin-action-dialog .form-field small { display: block; margin-top: 5px; color: var(--text-3); font-size: 11px; line-height: 1.5; }
.admin-field-error { display: block; min-height: 18px; margin-top: 3px; color: var(--danger); font-size: 11px; font-style: normal; }
.admin-action-error { margin-bottom: 14px; padding: 10px 12px; border: 1px solid #F3C6D2; border-radius: 10px; background: #FFF2F5; color: #9D2444; font-size: 12px; }
.admin-action-error:focus { outline: 3px solid rgba(203, 14, 117, .26); outline-offset: 2px; }
.admin-action-buttons { display: flex; justify-content: flex-end; gap: 9px; }
.admin-action-buttons .btn { min-height: 42px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.setting-meta { flex: 1; min-width: 260px; }
.setting-name { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.setting-desc { font-size: 13px; color: var(--text-3); margin: 0; line-height: 1.6; }
.setting-action { display: flex; align-items: center; gap: 12px; }
.captcha-state { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.captcha-state.on { color: #0d8a4f; background: #e3f6ec; }
.captcha-state.off { color: var(--text-3); background: var(--bg-2, #f4f1f6); }
.terms-editor { width: 100%; min-height: 240px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.7; resize: vertical; margin-bottom: 10px; }

@media (min-width: 700px) {
  .admin-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .admin-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-filters .admin-search { grid-column: 1 / -1; }
  .admin-detail-summary--wide { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 901px) {
  .admin-shell { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 28px; align-items: start; }
  .admin-nav { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; overflow: visible; }
  .admin-nav__item { width: 100%; justify-content: flex-start; border-color: transparent; border-radius: 8px; text-align: left; }
  .admin-list__desktop { display: block; overflow-x: auto; }
  .admin-list__mobile { display: none; }
}
@media (min-width: 1180px) {
  .admin-recent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-filters { grid-template-columns: minmax(230px, 1fr) repeat(3, minmax(126px, .42fr)) auto auto; }
  .admin-filters .admin-search { grid-column: auto; }
  #admin-users-filters { grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(116px, .38fr)) auto auto; }
  #admin-projects-filters { grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(116px, .38fr)) auto auto; }
  #admin-audit-filters { grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(116px, .38fr)) auto auto; }
}

/* ═══════════ 协议页（#/terms #/privacy）与注册同意行 ═══════════ */
.agree-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-3); margin: 14px 0 16px; line-height: 1.6; cursor: pointer; }
.agree-row input { margin-top: 3px; accent-color: #CB0E75; flex-shrink: 0; }
.agree-row .link { text-decoration: underline; }
/* 协议正文排版（独立页 .doc-body 与弹窗 .doc-modal-body 共用） */
.doc-meta { font-size: 12px; color: var(--text-3); margin: 0 0 14px; }
.doc-body h2, .doc-modal-body h2 { font-size: 15px; color: var(--rose-deep); margin: 20px 0 8px; }
.doc-body h2:first-child, .doc-modal-body h2:first-child { margin-top: 0; }
.doc-body p, .doc-modal-body p { margin: 0 0 14px; line-height: 1.9; font-size: 14px; color: var(--text-1); }
.doc-body p:last-child, .doc-modal-body p:last-child { margin-bottom: 0; }
.doc-body ul, .doc-modal-body ul { margin: 0 0 14px 20px; padding: 0; }
.doc-body li, .doc-modal-body li { margin: 4px 0; font-size: 14px; line-height: 1.9; color: var(--text-1); }
.doc-body b, .doc-modal-body b { color: var(--rose-deep); }
.doc-edit-meta { display: flex; gap: 10px; margin-bottom: 10px; }
.doc-edit-meta .input { flex: 1; }

/* ═══════════ 开放 API Key（admin） ═══════════ */
.apikey-reveal { border: 1px solid #f0d9b0; background: #fff8ec; border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; }
.apikey-reveal-tip { font-size: 12px; color: #9a6b1f; margin: 0 0 8px; font-weight: 600; }
.apikey-reveal-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.apikey-reveal-code { flex: 1; min-width: 220px; font-size: 13px; color: var(--rose-deep); word-break: break-all; background: #fff; border: 1px solid #f0e4ea; border-radius: 6px; padding: 8px 10px; }
.apikey-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.apikey-empty { font-size: 13px; color: var(--text-3); margin: 0; }
.apikey-item { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px solid var(--border, #f0e4ea); border-radius: 10px; padding: 10px 14px; }
.apikey-item-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; flex-wrap: wrap; }
.apikey-item-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.apikey-item-prefix { font-size: 12px; color: var(--text-3); background: var(--bg-2, #f4f1f6); border-radius: 6px; padding: 2px 8px; }
.apikey-item-meta { display: flex; align-items: center; gap: 12px; }
.apikey-status { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.apikey-status.on { color: #0d8a4f; background: #e3f6ec; }
.apikey-status.off { color: var(--text-3); background: var(--bg-2, #f4f1f6); }
.apikey-item-time { font-size: 12px; color: var(--text-3); }

/* ═══════════ 留存矩阵（dash-retention） ═══════════ */
.retention-wrap { overflow-x: auto; }
.retention-table { min-width: 720px; }
.retention-table th, .retention-table td { white-space: nowrap; }
.retention-table th.retention-day-head,
.retention-table td.retention-cell,
.retention-table td.retention-na { min-width: 72px; text-align: center; }
.retention-rate { display: block; font-weight: 700; font-size: 13px; color: #CB0E75; }
.retention-count { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.retention-na { background: repeating-linear-gradient(45deg, var(--bg-2, #f4f1f6), var(--bg-2, #f4f1f6) 6px, transparent 6px, transparent 12px); }
.retention-hint { margin-top: 12px; font-size: 12px; }

/* ═══════════ 漏斗分析（dash-funnel） ═══════════ */
.funnel-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.funnel-select { flex: 1; min-width: 200px; max-width: 360px; }
.funnel-attribution-select { width: 150px; min-width: 150px; }
#funnel-chart { height: 320px; }
#funnel-table { margin-top: 16px; }
.attribution-funnel { margin-top: 24px; }

/* ═══════════ 用户分群 V2 ═══════════ */
.cohort-v2-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.cohort-v2-head h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.35; }
.cohort-v2-head p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.cohort-v2-empty { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--border-strong); border-radius: 16px; background: var(--surface); padding: 36px 20px; }
.cohort-v2-empty__mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 16px; border-radius: 50%; background: rgba(203,14,117,.08); color: var(--rose); font: 700 28px/1 Georgia,serif; }
.cohort-v2-empty h3 { margin: 0 0 8px; font-size: 17px; }
.cohort-v2-empty p { max-width: 420px; margin: 0 0 20px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.cohort-v2-layout { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 520px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.cohort-v2-sidebar { min-width: 0; padding: 14px; border-right: 1px solid var(--border); background: var(--surface); }
.cohort-v2-search { min-height: 40px; margin-bottom: 10px; font-size: 13px; }
.cohort-v2-mobile-select { display: none; }
.cohort-v2-list { display: grid; gap: 6px; }
.cohort-v2-list__item { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; text-align: left; transition: background .15s ease,border-color .15s ease,color .15s ease; }
.cohort-v2-list__item:hover { background: var(--bg); border-color: var(--border); color: var(--ink); }
.cohort-v2-list__item.is-active { background: var(--bg); border-color: rgba(203,14,117,.3); color: var(--ink); box-shadow: inset 3px 0 0 var(--rose); }
.cohort-v2-list__item strong,.cohort-v2-list__item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cohort-v2-list__item strong { margin-bottom: 3px; font-size: 13px; }
.cohort-v2-list__item span { color: var(--text-3); font-size: 11px; }
.cohort-v2-detail { min-width: 0; padding: 22px; }
.cohort-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.cohort-detail-head h3 { margin: 0 0 7px; font-size: 20px; line-height: 1.35; }
.cohort-detail-head p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.cohort-detail-meta { margin-top: 7px; color: var(--text-3); font-size: 11px; }
.cohort-detail-actions { display: flex; gap: 7px; flex: none; }
.cohort-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.cohort-metric { padding: 15px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cohort-metric span { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 11px; }
.cohort-metric strong { color: var(--ink); font-size: 23px; line-height: 1.2; }
.cohort-analysis-tabs { display: flex; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.cohort-analysis-tabs button { min-height: 42px; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.cohort-analysis-tabs button.is-active { border-color: var(--rose); color: var(--rose-deep); font-weight: 700; }
.cohort-analysis-body { padding-top: 18px; }
.cohort-analysis-chart { height: 260px; }
.cohort-rule-readonly { display: grid; gap: 8px; margin-top: 18px; }
.cohort-rule-chip { width: fit-content; max-width: 100%; padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.cohort-loading { display: grid; gap: 12px; }
.cohort-loading span { display: block; height: 18px; border-radius: 6px; background: linear-gradient(90deg,var(--surface),var(--bg),var(--surface)); background-size: 200% 100%; animation: cohortShimmer 1.2s linear infinite; }
.cohort-loading span:first-child { width: 42%; height: 26px; }.cohort-loading span:nth-child(2){width:82%;}.cohort-loading span:nth-child(3){height:88px;}
@keyframes cohortShimmer { to { background-position: -200% 0; } }
.cohort-builder { width: min(720px,calc(100vw - 32px)); }
.cohort-builder .modal__body { max-height: calc(82vh - 136px); overflow-y: auto; }
.cohort-builder__settings { display: grid; grid-template-columns: 1fr 180px; gap: 16px; }
.cohort-match-seg { width: fit-content; }
.cohort-rule-group { margin: 0 0 16px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.cohort-rule-group--exclude { background: var(--surface); }
.cohort-rule-group legend { padding: 0 5px; color: var(--ink); font-size: 13px; font-weight: 700; }
.cohort-rule-group > p { margin: -2px 0 11px; color: var(--text-3); font-size: 11px; }
.cohort-rule-row { display: grid; grid-template-columns: minmax(0,1fr) 104px 38px; gap: 8px; align-items: start; margin-bottom: 8px; }
.cohort-rule-row .input { min-width: 0; min-height: 40px; }
.cohort-rule-count { text-align: center; }
.cohort-rule-remove { display: inline-grid; place-items: center; width: 38px; height: 40px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text-3); cursor: pointer; }
.cohort-rule-remove:hover { border-color: var(--danger); color: var(--danger); }
.cohort-rule-error { grid-column: 1/-1; margin: -4px 0 2px; color: var(--danger); font-size: 11px; }
.cohort-property-area { grid-column: 1/-1; margin: 0 0 5px 14px; padding: 10px 11px; border-left: 2px solid rgba(203,14,117,.2); border-radius: 0 9px 9px 0; background: rgba(203,14,117,.035); }
.cohort-property-list { display: grid; gap: 8px; }
.cohort-property-row { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(92px,.7fr) minmax(0,1fr) 34px; gap: 7px; align-items: start; }
.cohort-property-row .input { min-height: 36px; font-size: 12px; }
.cohort-property-remove { display: inline-grid; place-items: center; width: 34px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text-3); cursor: pointer; }
.cohort-property-remove:hover { border-color: var(--danger); color: var(--danger); }
.cohort-property-add { min-height: 32px; margin-top: 7px; padding: 0; border: 0; background: transparent; color: var(--rose-deep); font-size: 12px; font-weight: 600; cursor: pointer; }
.cohort-property-add:disabled { color: var(--text-3); cursor: not-allowed; }
.cohort-property-hint { margin: 3px 0 0; color: var(--text-3); font-size: 11px; line-height: 1.55; }
.cohort-property-row .cohort-rule-error { margin: 0; }
.cohort-summary { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--rose); border-radius: 0 8px 8px 0; background: rgba(203,14,117,.06); color: var(--text-2); font-size: 12px; line-height: 1.6; }
.cohort-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; color: var(--text-2); }
.cohort-preview.is-success { border-color: #CFE3D5; background: #EFF7F1; color: #3C7A55; }.cohort-preview.is-error { border-color: #E8C9D4; background: #FFF4F7; color: var(--danger); }
.field-error,.form-error-summary { color: var(--danger); font-size: 12px; line-height: 1.6; }
.field-error { margin: 5px 0 0; }.form-error-summary { margin-top: 12px; padding: 9px 11px; border: 1px solid #E8C9D4; border-radius: 8px; background: #FFF4F7; }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(182,35,72,.08); }
@media (max-width: 640px) {
  /* 此段必须位于分群桌面样式之后，确保移动端规则不会被后声明的默认值覆盖。 */
  .cohort-v2-head { align-items: center; }
  .cohort-v2-head p { display: none; }
  .cohort-v2-layout { display: block; min-height: 0; border: 0; box-shadow: none; overflow: visible; }
  .cohort-v2-sidebar { padding: 0 0 12px; border: 0; background: transparent; }
  .cohort-v2-search,.cohort-v2-list { display: none; }
  .cohort-v2-mobile-select { display: block; min-height: 44px; font-size: 16px; }
  .cohort-v2-detail { padding: 0; }
  .cohort-detail-head { flex-direction: column; gap: 12px; }
  .cohort-detail-head h3 { font-size: 18px; }
  .cohort-detail-actions { width: 100%; flex-wrap: wrap; }
  .cohort-detail-actions .btn { flex: 1; min-height: 44px; }
  .cohort-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cohort-metric:last-child { grid-column: 1/-1; }
  .cohort-analysis-tabs { gap: 18px; }
  .cohort-analysis-tabs button { min-height: 44px; }
  .cohort-builder__settings { grid-template-columns: 1fr; gap: 0; }
  .cohort-match-seg { display: flex; width: 100%; }
  .cohort-match-seg .seg__item { flex: 1; min-height: 44px; }
  .cohort-rule-row { grid-template-columns: minmax(0,1fr) 92px 44px; }
  .cohort-rule-row .input { min-height: 44px; }
  .cohort-rule-event { grid-column: 1/-1; font-size: 16px; }
  .cohort-rule-count { grid-column: 1/3; font-size: 16px; }
  .cohort-rule-remove { grid-column: 3; width: 44px; height: 44px; }
  .cohort-property-area { margin-left: 0; padding: 10px; }
  .cohort-property-row { grid-template-columns: minmax(0,1fr) minmax(104px,.55fr) 44px; }
  .cohort-property-row .input { min-height: 44px; font-size: 16px; }
  .cohort-property-key { grid-column: 1/3; }
  .cohort-property-operator { grid-column: 1; }
  .cohort-property-value { grid-column: 2; }
  .cohort-property-remove { grid-column: 3; grid-row: 1/3; width: 44px; height: 44px; align-self: end; }
  .cohort-property-add { min-height: 44px; }
  .cohort-preview { align-items: stretch; flex-direction: column; }
  .cohort-preview .btn { min-height: 44px; }
  .cohort-builder .modal__body { max-height: calc(88vh - 148px); }
}
.heatmap-wrap { overflow: auto; margin-bottom: 8px; }
.heatmap-wrap canvas { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.heatmap-hint { font-size: 12px; color: var(--text-3); }

/* ═══════════ 用户回放 ═══════════ */
.replay-toolbar { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.replay-input { flex: 1; min-width: 220px; max-width: 380px; }
.replay-hint { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.replay-recent { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.replay-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
}
.replay-chip:hover { border-color: var(--rose); color: var(--rose); }
.replay-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.replay-select { max-width: 220px; }
.replay-count { font-size: 12px; color: var(--text-3); }
.replay-timeline { min-width: 640px; }
.replay-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.replay-item.is-active { background: rgba(203, 14, 117, .08); border-radius: 8px; box-shadow: inset 3px 0 0 var(--rose); }
.replay-time { color: var(--text-3); font-size: 12px; white-space: nowrap; width: 150px; flex: none; }
.replay-event { color: var(--rose); font-weight: 600; white-space: nowrap; flex: none; }
.replay-page { color: var(--text-2); white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; flex: none; }
.replay-props { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-platform { color: var(--text-3); font-size: 11px; flex: none; }
.replay-attribution { color: var(--text-3); font-size: 11px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════ 实时大屏（#/project/{id}/realtime · 深色投屏风） ═══════════ */
body.screen-mode .projects-topbar { display: none; } /* 大屏全屏隐藏顶栏 */
body.screen-mode .container { max-width: none; }
#project-realtime { position: relative; z-index: 1; background: #120c16; border-radius: 20px; padding: 24px; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.screen-title { font-size: 26px; font-weight: 900; color: #fff; }
.screen-sub { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 2px; }
.screen-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.screen-card { background: linear-gradient(160deg, #2b1c30, #1c1420); border: 1px solid rgba(203,14,117,.25); border-radius: 16px; padding: 20px 22px; }
.screen-card__label { font-size: 12.5px; color: rgba(255,255,255,.55); letter-spacing: .06em; }
.screen-card__num { font-size: 40px; font-weight: 700; color: #EC549E; margin-top: 4px; }
.screen-stream-wrap { background: rgba(255,255,255,.04); border: 1px solid rgba(203,14,117,.25); border-radius: 16px; overflow: hidden; }
.screen-stream-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; font-weight: 700; color: rgba(255,255,255,.9); }
.screen-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #EC549E; animation: livePulse 1.2s ease infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.screen-stream { height: 360px; overflow-y: auto; padding: 6px 0; font-family: var(--font-mono); font-size: 12.5px; }
.screen-stream-item { display: flex; align-items: center; gap: 12px; padding: 7px 18px; border-bottom: 1px solid rgba(255,255,255,.05); }
.screen-stream-time { color: rgba(255,255,255,.45); flex-shrink: 0; }
.screen-stream-event { color: #EC549E; font-weight: 700; flex-shrink: 0; }
.screen-stream-user { color: rgba(255,255,255,.75); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-stream-url { color: rgba(255,255,255,.72); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  #project-realtime { min-width: 0; padding: 16px; border-radius: 16px; }
  .screen-head { align-items: flex-start; flex-direction: column; }
  .screen-head__actions { width: 100%; flex-wrap: wrap; }
  .screen-sub { max-width: 100%; overflow-wrap: anywhere; }
  .screen-grid { grid-template-columns: repeat(2, 1fr); }
  .screen-card { min-width: 0; padding: 16px; }
  .screen-stream-url { display: none; }
}

/* 漏斗配置弹窗：步骤行 */
.funnel-step { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.funnel-step-num { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: #CB0E75; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.funnel-step-event { flex: 1; min-width: 160px; }
.funnel-step-url { flex: 1.2; min-width: 140px; }
.funnel-step-remove { flex-shrink: 0; width: 28px; height: 28px; border: 1px solid var(--line, #e4dde4); border-radius: 6px; background: transparent; color: var(--text-3); font-size: 15px; line-height: 1; cursor: pointer; }
.funnel-step-remove:hover:not(:disabled) { color: #CB0E75; border-color: #CB0E75; }
.funnel-step-remove:disabled { opacity: 0.35; cursor: not-allowed; }

/* ═══════════ 帮助中心（#/help） ═══════════ */
.help-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--bg); color: var(--rose);
  font-size: 15px; font-weight: 900; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s ease; font-family: var(--font-sans);
}
.help-btn:hover { border-color: var(--rose); background: var(--rose); color: #fff; box-shadow: 0 4px 14px rgba(203, 14, 117, .25); }
.help-btn--text { width: auto; height: auto; padding: 5px 13px; border-radius: 99px; font-size: 13px; font-weight: 700; gap: 4px; }
.help-btn--sm { width: 32px; height: 32px; flex-shrink: 0; font-size: 13px; }
.help-badge {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; color: var(--rose);
  background: rgba(203, 14, 117, .08); border: 1px solid rgba(203, 14, 117, .18);
}

/* 帮助中心目录抽屉（移动端）：按钮桌面隐藏，遮罩默认隐藏 */
.help-menu-btn { display: none; }
.help-drawer-mask { display: none; }
.screen-head__actions { display: flex; align-items: center; gap: 10px; }

.help-wrap { display: flex; gap: 36px; padding-top: 8px; align-items: flex-start; }
.help-nav {
  position: sticky; top: 84px; width: 216px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px; padding: 8px 0;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.help-nav__group {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--rose);
  margin: 18px 10px 6px; text-transform: uppercase;
}
.help-nav__group:first-child { margin-top: 6px; }
.help-nav__link {
  display: block; padding: 6px 10px; border-radius: 8px;
  color: var(--text-2); font-size: 13px; text-decoration: none;
  border-left: 3px solid transparent; transition: all .15s ease;
}
.help-nav__link:hover { color: var(--rose); background: rgba(203, 14, 117, .05); }
.help-nav__link.is-active { color: var(--rose); background: rgba(203, 14, 117, .08); border-left-color: var(--rose); font-weight: 600; }

.help-content { flex: 1; min-width: 0; max-width: 820px; padding-bottom: 60px; }
.help-sec {
  width: 100%; min-width: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 28px 30px; margin-bottom: 20px;
  scroll-margin-top: 92px; position: relative; overflow: hidden;
}
.help-sec::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--brand); opacity: 0;
}
.help-sec.is-focused::before { opacity: 1; }
.help-sec__no {
  position: absolute; right: 26px; top: 14px;
  font-family: var(--font-mono); font-size: 44px; font-weight: 800; line-height: 1;
  background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .14;
}
.help-sec h1, .help-sec h2 { font-size: 20px; font-weight: 800; margin-bottom: 12px; letter-spacing: .01em; }
.help-sec p { color: var(--text-2); margin: 0 0 10px; line-height: 1.8; }
.help-sec p:last-child { margin-bottom: 0; }
.help-sec b { color: var(--ink); }
.help-sec .mono { font-size: 12.5px; background: rgba(203, 14, 117, .06); padding: 1px 5px; border-radius: 5px; color: var(--rose-deep); }

.help-code {
  background: #2A2233; color: #F3E6EE; border-radius: 12px; padding: 16px 18px;
  margin: 12px 0 14px; overflow-x: auto; border-left: 3px solid var(--rose-light);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75;
  box-shadow: 0 6px 18px rgba(42, 34, 51, .18);
}
.help-code code { font-family: inherit; }

.help-callout {
  background: rgba(203, 14, 117, .05); border: 1px solid rgba(203, 14, 117, .14);
  border-radius: 10px; padding: 10px 14px; margin-top: 12px;
  font-size: 13px; color: var(--text-2); line-height: 1.7;
}
.help-callout .mono { font-size: 12px; }
.help-table { margin: 12px 0; }
.help-table .table td.mono { color: var(--rose-deep); background: none; padding: 0; }

@media (max-width: 900px) {
  .help-wrap { flex-direction: column; gap: 16px; }
  /* 解除 help-wrap(container) z-index:1 层叠上下文：否则抽屉 z-index:121 被困内部，整体低于遮罩 z-index:120，点击落在遮罩上 */
  .help-wrap { z-index: auto; }
  /* 目录 → 底部抽屉：顶栏「☰ 目录」按钮打开，毛玻璃 + 圆角 + 章节分组 + 当前项高亮 */
  .help-nav {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; max-width: none; max-height: 74vh;
    flex-direction: column; align-items: stretch; overflow-y: auto;
    gap: 2px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0; border: none; border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(16px);
    box-shadow: 0 -10px 44px rgba(43, 42, 51, .18);
    transform: translateY(102%); transition: transform .32s cubic-bezier(.32, .72, 0, 1);
    z-index: 121;
  }
  .help-nav.open { transform: translateY(0); }
  .help-nav::before {
    content: ''; width: 40px; height: 4px; border-radius: 99px;
    background: var(--border-strong); margin: 2px auto 8px; flex-shrink: 0;
  }
  .help-nav__group { display: block; margin: 18px 10px 6px; }
  .help-nav__group:first-child { margin-top: 6px; }
  .help-nav__link { white-space: normal; border-left: 3px solid transparent; padding: 9px 12px; font-size: 14px; }
  .help-nav__link.is-active { border-left-color: var(--rose); background: rgba(203, 14, 117, .08); }
  .help-menu-btn {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--border-strong); background: var(--bg); color: var(--rose);
    font-size: 13px; font-weight: 700; padding: 6px 13px; border-radius: 99px; cursor: pointer;
  }
  .help-drawer-mask { display: block; position: fixed; inset: 0; background: rgba(43, 42, 51, .42); z-index: 120; }
  .help-drawer-mask[hidden] { display: none; }
  /* 内容紧凑 */
  .help-sec { padding: 18px 16px; }
  /* 代码示例长行换行（真机 390px 下防撑破视口，内容完整显示） */
  .help-code { max-width: 100%; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; }
  .help-sec__no { right: 14px; top: 12px; font-size: 30px; opacity: .1; }
  .help-sec h1, .help-sec h2 { font-size: 18px; }
  /* 帮助中心表格（自动采集事件等）：移动端保持表格布局，不做卡片化（单元格无 data-label） */
  .help-table .table { display: table; width: 100%; }
  .help-table .table thead { display: table-header-group; }
  .help-table .table tbody { display: table-row-group; }
  .help-table .table tr { display: table-row; width: auto; padding: 0; margin: 0; background: none; border-radius: 0; }
  .help-table .table th, .help-table .table td { display: table-cell; padding: 10px 12px; }
  .help-table .table td::before { content: none; }
  .help-table .table td:first-child { font-weight: normal; }
}

/* 帮助中心：顶栏保持可见，页脚沿用首页的正常文档流 */
.help-topbar { position: sticky; top: 0; }



/* 帮助中心搜索 */
.help-search-box { position: relative; width: 100%; margin: 0 0 22px; }
.help-search__input { padding-right: 44px; }
.help-search__clear { right: 5px; width: 32px; height: 32px; line-height: 30px; }
.help-results { margin-bottom: 20px; }
.help-result {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  box-shadow: var(--shadow); transition: all .2s ease;
}
.help-result:hover { border-color: var(--rose); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.help-result__no {
  font-size: 20px; font-weight: 800; line-height: 1;
  background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  flex-shrink: 0; margin-top: 2px; opacity: .8;
}
.help-result__title { font-size: 15px; font-weight: 700; color: var(--ink); }
.help-result__snippet { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }

/* 帮助搜索无结果：邮件联系链接 */
.help-search__mail { color: var(--rose); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.help-search__mail:hover { color: var(--rose-deep); }

/* 点击 logo 回根路径 */
.brand-row, .login-logo { cursor: pointer; }

/* teown 生态快速链接 */
.home-ecos { position: relative; z-index: 1; padding: 40px 40px 60px; max-width: 1120px; margin: 0 auto; }
.home-eco-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.home-eco-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 22px 22px; text-decoration: none;
  transition: all .2s ease;
}
.home-eco-card:hover { border-color: var(--rose); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.home-eco-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.home-eco-card__logo {
  width: 40px; height: 40px; object-fit: contain; object-position: left;
  display: block; flex-shrink: 0;
}
.home-eco-card__name { font-size: 16px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.home-eco-card__domain { font-size: 12px; color: var(--text-3); }
.home-eco-card__desc { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.home-eco-card__go { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 700; color: var(--rose); }
.home-eco-card__go span { display: inline-block; transition: transform .2s ease; }
.home-eco-card:hover .home-eco-card__go span { transform: translateX(3px); }
@media (max-width: 900px) { .home-eco-grid { grid-template-columns: 1fr; } }

/* 联系我们页 */
.contact-wrap { padding-top: 8px; }
.contact-card {
  max-width: 640px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 36px 40px;
}
.contact-card__title { font-size: 24px; font-weight: 900; letter-spacing: .02em; margin-bottom: 8px; }
.contact-card__sub { color: var(--text-2); font-size: 14px; margin-bottom: 28px; line-height: 1.7; }
.contact-field { margin-bottom: 20px; }
.contact-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.contact-hint { font-size: 12px; font-weight: 400; color: var(--text-3); }
.contact-card .input { width: 100%; }
.contact-actions { margin-top: 28px; text-align: center; }
.contact-note { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 14px; line-height: 1.6; }

@media (max-width: 640px) {
  .projects-topbar { min-width: 0; gap: 8px; }
  .projects-topbar .brand-row { flex-shrink: 0; }
  .topbar-user { min-width: 0; gap: 6px; }
  #btn-back-projects,
  #btn-back-projects-admin,
  #btn-admin,
  #btn-admin-p,
  #btn-help-projects,
  #btn-help-project { width: 34px; height: 34px; padding: 0; font-size: 0; }
  #btn-back-projects::after,
  #btn-back-projects-admin::after { content: '←'; font-size: 15px; }
  #btn-admin::after,
  #btn-admin-p::after { content: '管'; font-size: 13px; }
  #btn-help-projects::after,
  #btn-help-project::after { content: '?'; font-size: 14px; font-weight: 800; }
  .contact-card { padding: 26px 18px; }
  .contact-card__title { font-size: 20px; }
  /* 四枚类型 seg 窄屏换行，避免溢出 */
  #contact-type-seg { flex-wrap: wrap; border-radius: 16px; }
  #contact-type-seg .seg__item { padding: 6px 12px; font-size: 12.5px; }
  .contact-card .input { font-size: 15px; }
}

/* ═══════════ 邀请链接 ═══════════ */
.invite-loading { font-size: 14px; color: var(--text-2); text-align: center; padding: 10px 0; }
.invite-body { text-align: center; }
.invite-sub { font-size: 14px; color: var(--text-2); margin: 0 0 6px; }
.invite-sub b { color: var(--ink); }
.invite-project { font-size: 24px; font-weight: 900; color: var(--ink); margin: 4px 0 10px; }
.invite-role { font-size: 13px; color: var(--text-2); margin: 0 0 22px; }
.invite-role .badge { padding: 3px 12px; vertical-align: middle; }
.invite-actions { display: flex; flex-direction: column; gap: 10px; }
.invite-error { font-size: 14px; color: var(--text-2); text-align: center; padding: 14px 0; }
.invite-section { margin-top: 20px; border-top: 1px dashed var(--border-strong); padding-top: 16px; }
.invite-link { font-size: 12px; color: var(--rose-deep); word-break: break-all; background: var(--bg-2); border-radius: 6px; padding: 2px 8px; }
.empty-cell { text-align: center; color: var(--text-3); font-size: 13px; padding: 18px 10px; }

/* ═══════════ 公告（管理端发送 + 用户站内信） ═══════════ */
/* 顶栏铃铛（复用 .btn-ghost 圆角按钮，内联图标 + 右上角徽标） */
.bell-btn {
  position: relative;
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.bell-icon { width: 16px; height: 16px; }
.bell-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger, #D3355E); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.bell-count { display: inline-block; }

/* 未读动效：JS 在有未读时给铃铛按钮加 .has-unread，全部动画仅在该状态下生效 */
.bell-btn.has-unread .bell-icon {
  transform-origin: 50% 0;
  transform-box: fill-box;
  animation: bell-ring 3s ease-in-out infinite;
}
@keyframes bell-ring {
  0%, 72%, 100% { transform: rotate(0); }
  78% { transform: rotate(9deg); }
  84% { transform: rotate(-7deg); }
  90% { transform: rotate(5deg); }
  96% { transform: rotate(-2deg); }
}
.bell-btn.has-unread .bell-badge {
  animation: badge-breathe 1.6s ease-in-out infinite;
}
@keyframes badge-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
.bell-btn.has-unread .bell-count {
  animation: badge-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badge-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .bell-btn.has-unread .bell-icon,
  .bell-btn.has-unread .bell-badge,
  .bell-btn.has-unread .bell-count { animation: none; }
}

/* 管理端公告表单 */
.ann-body { min-height: 140px; }
.ann-emails { min-height: 90px; }
.ann-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.ann-preview-result {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); line-height: 1.6;
}
.ann-preview-result b { color: var(--rose-deep); }

/* 管理端发送历史 */
.ann-list-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.ann-list-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ann-list { display: flex; flex-direction: column; gap: 8px; }
.ann-item {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
}
.ann-item.is-sending { background: var(--surface); }
.ann-item-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.ann-item-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.ann-item-meta { font-size: 12px; color: var(--text-3); }
.ann-item-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.ann-status { font-weight: 700; }
.ann-status.sending { color: var(--warning, #C08A2D); }
.ann-status.done { color: #0d8a4f; }

/* 用户站内信列表 */
.ann-mine-list { display: flex; flex-direction: column; gap: 14px; }
.ann-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 18px 22px; cursor: pointer;
  transition: all .2s ease;
}
.ann-card:hover { border-color: var(--rose); }
.ann-card.is-unread {
  border-left: 3px solid var(--rose);
  background: linear-gradient(90deg, rgba(203, 14, 117, .05), transparent 62%);
}
.ann-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ann-card-title { font-size: 15px; font-weight: 700; color: var(--ink); flex: 1; min-width: 0; }
.ann-card.is-unread .ann-card-title { font-weight: 800; }
.ann-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); flex-shrink: 0; }
.ann-card-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.ann-card-body { font-size: 14px; color: var(--text-2); line-height: 1.8; word-break: break-word; }
.ann-mine-empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 60px 0; }

@media (max-width: 640px) {
  .ann-card { padding: 15px 16px; }
  .ann-item-time { width: 100%; }
}

/* 导出报告剩余次数徽标 */
.credit-tag {
  align-self: center;
  font-size: 12px; font-weight: 600; color: var(--rose-deep);
  background: rgba(203, 14, 117, .08); border: 1px solid rgba(203, 14, 117, .18);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.credit-tag--free { color: #0d8a4f; background: rgba(13, 138, 79, .08); border-color: rgba(13, 138, 79, .18); }
.credit-tag--empty { color: #c0392b; background: rgba(192, 57, 43, .08); border-color: rgba(192, 57, 43, .2); }

/* 导出报告付费弹窗 */
.pay-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pay-price-row { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 4px; }
.pay-price { font-size: 40px; font-weight: 800; color: var(--rose); letter-spacing: -.02em; }
.pay-price-label { font-size: 14px; color: var(--text-3); }
.pay-left-hint { font-size: 13px; color: var(--text-3); margin: 0 0 10px; }
.pay-left-hint b { color: var(--rose-deep); }
.pay-qr-wrap { padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 12px; display: flex; justify-content: center; }
.pay-qr { width: 180px; height: 180px; }
.pay-qr img, .pay-qr canvas { display: block; }
.pay-loading { font-size: 13px; color: var(--text-3); padding: 60px 0; }
.report-progress-body { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 4px; }
#modal-report-progress .modal__head { justify-content: center; }
.report-progress-body .modal__hint { margin: 0; }
.report-spinner {
  width: 22px; height: 22px; flex: 0 0 22px;
  border: 2px solid rgba(203, 14, 117, .2); border-top-color: var(--rose);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.report-theme-field { border: 0; min-width: 0; }
.report-language-field { border: 0; min-width: 0; }
.report-language-field legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
#report-language-seg { display: flex; width: 100%; }
#report-language-seg .seg__item { flex: 1; min-height: 44px; }
.report-theme-field legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.report-theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-theme-card { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px; text-align: left; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; }
.report-theme-card:hover { border-color: var(--rose); }
.report-theme-card.active { border-color: var(--rose); box-shadow: 0 0 0 2px rgba(203,14,117,.12); }
.report-theme-card > span:nth-child(2) { min-width: 0; display: grid; line-height: 1.25; }
.report-theme-card b { font-size: 12px; }
.report-theme-card small { color: var(--text-3); font-size: 10px; margin-top: 3px; }
.report-theme-card em { display: none; margin-left: auto; color: var(--rose-deep); font-size: 10px; font-style: normal; font-weight: 700; white-space: nowrap; }
.report-theme-card.active em { display: block; }
.report-theme-card:focus-visible { outline: 3px solid rgba(203,14,117,.32); outline-offset: 2px; }
.report-theme-swatch { flex: 0 0 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--theme-a) 0 52%, var(--theme-b) 52%); border: 1px solid rgba(0,0,0,.12); }
.report-theme-swatch--iris { --theme-a:#B31570; --theme-b:#374151; }.report-theme-swatch--ocean { --theme-a:#1976B9; --theme-b:#12324A; }.report-theme-swatch--forest { --theme-a:#18735B; --theme-b:#17352E; }.report-theme-swatch--amber { --theme-a:#B76A14; --theme-b:#3B3025; }.report-theme-swatch--violet { --theme-a:#7446A6; --theme-b:#2D2340; }.report-theme-swatch--midnight { --theme-a:#A16207; --theme-b:#1C1917; }.report-theme-swatch--slate { --theme-a:#5C6E82; --theme-b:#202936; }
@media (max-width: 420px) { .report-theme-grid { grid-template-columns: 1fr; } }

/* ═══════════ 账户与微信登录 ═══════════ */
.account-trigger {
  border: 0; padding: 0; overflow: hidden; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .8), 0 0 0 2px var(--border);
}
.account-trigger:hover { box-shadow: 0 0 0 2px rgba(203, 14, 117, .32); }
.account-trigger:focus-visible { outline: 3px solid rgba(203, 14, 117, .34); outline-offset: 3px; }
.avatar img, .account-avatar-preview img, .account-popover__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wechat-login-dialog__close { width: 44px; height: 44px; }
.wechat-qr-frame { overflow: hidden; }
.wechat-qr-frame img { width: min(176px, calc(100% - 28px)); height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 8px; }
.wechat-qr-loading { width: 42px; height: 42px; border: 3px solid var(--border); border-top-color: var(--rose); border-radius: 50%; animation: wxSpin .8s linear infinite; }
@keyframes wxSpin { to { transform: rotate(360deg); } }
.wechat-login-success { min-height: 210px; margin: 22px 0 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #2F8A57; }
.wechat-login-success svg { width: 76px; height: 76px; }
.wechat-login-success strong { color: var(--ink); font-size: 18px; }
.wechat-login-dialog__status.is-error i { background: var(--danger); box-shadow: 0 0 0 4px rgba(211, 53, 94, .12); }
.wechat-login-error { margin: 14px 0 18px; padding: 14px; border: 1px solid rgba(211, 53, 94, .22); border-radius: 12px; background: #FFF7F9; }
.wechat-login-error p { margin-bottom: 12px; color: #8A2945; font-size: 13px; text-align: center; }

.account-container { max-width: 980px; }
.account-kicker { margin-bottom: 2px; color: var(--rose); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.account-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 28px; align-items: start; }
.account-nav { position: sticky; top: 94px; display: grid; gap: 5px; }
.account-nav__item { min-height: 44px; padding: 0 15px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: 700 13px/1 var(--font-sans); text-align: left; cursor: pointer; }
.account-nav__item:hover { color: var(--rose); background: var(--surface); }
.account-nav__item.active { color: var(--rose-deep); background: rgba(203, 14, 117, .09); }
.account-nav__item:focus-visible { outline: 3px solid rgba(203, 14, 117, .28); outline-offset: 2px; }
.account-content { min-width: 0; }
.account-section__head { margin-bottom: 14px; }
.account-section__head p { color: var(--rose); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.account-section__head h2 { margin-top: 2px; font-size: 20px; line-height: 1.35; }
.account-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); }
.account-card--danger { border-color: rgba(211, 53, 94, .24); box-shadow: 0 8px 24px rgba(211, 53, 94, .05); }
.account-row { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.account-row:last-child { border-bottom: 0; }
.account-row > div:first-child { min-width: 0; }
.account-row b { display: block; font-size: 14px; }
.account-row small { display: block; margin-top: 3px; color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; }
.account-row__action { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.account-avatar-preview, .account-popover__avatar {
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800;
}
.account-avatar-preview { width: 58px; height: 58px; font-size: 20px; }
#account-wechat-bind.is-bound { display: inline-flex; align-items: center; gap: 8px; border-color: rgba(47, 138, 87, .42); color: #2F6F4D; background: #F3FAF6; white-space: nowrap; }
#account-wechat-bind.is-bound::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #2F8A57; box-shadow: 0 0 0 4px rgba(47, 138, 87, .12); }
#account-wechat-bind.is-bound:hover { border-color: #2F8A57; background: #EAF6EF; }

.account-popover {
  position: fixed; z-index: 170; width: min(292px, calc(100vw - 24px)); padding: 10px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg); box-shadow: 0 18px 48px rgba(43, 43, 51, .16);
}
.account-popover__profile { display: flex; align-items: center; gap: 11px; padding: 8px 8px 13px; border-bottom: 1px solid var(--border); }
.account-popover__avatar { width: 42px; height: 42px; flex: 0 0 auto; }
.account-popover__profile div { min-width: 0; }
.account-popover__profile b, .account-popover__profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover__profile small { max-width: 205px; margin-top: 1px; color: var(--text-3); font-size: 11px; }
.account-popover > button { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: 700 13px/1 var(--font-sans); text-align: left; cursor: pointer; }
.account-popover > button:hover, .account-popover > button:focus-visible { color: var(--rose); background: var(--surface); outline: none; }
.account-popover > button:last-child { color: #B92B50; }

.account-edit-modal { width: 460px; }
.account-edit-eyebrow { margin-bottom: 2px; color: var(--rose); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.account-edit-modal .modal__close { width: 44px; height: 44px; margin: -8px -8px 0 0; }
.account-edit-modal .modal__body { padding: 18px 24px 4px; }
.account-edit-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px 24px; }
.account-edit-actions .btn { min-height: 44px; min-width: 104px; }
.account-edit-actions.is-avatar { justify-content: center; }
.account-edit-field { margin-bottom: 15px; }
.account-edit-field label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 13px; }
.account-edit-field .input { height: 44px; }
.account-edit-hint { margin-top: 7px; color: var(--text-3); font-size: 12px; line-height: 1.6; }
.account-edit-warning { padding: 12px 13px; border-left: 3px solid var(--danger); background: #FFF7F9; color: #7D4D55; font-size: 12px; }
.account-avatar-picker { display: flex; flex-direction: column; align-items: center; gap: 11px; padding: 12px 0 4px; text-align: center; }
.account-avatar-picker__preview { width: 84px; height: 84px; display: grid; place-items: center; overflow: hidden; padding: 0; border: 4px solid #fff; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(43, 43, 51, .12); font-size: 27px; font-weight: 900; cursor: pointer; }
.account-avatar-picker__preview img { width: 100%; height: 100%; object-fit: cover; }
.account-avatar-crop { text-align: center; }
.account-crop-viewport { position: relative; width: min(280px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 16px; background: #2B2B33; touch-action: none; cursor: grab; }
.account-crop-viewport:active { cursor: grabbing; }
.account-crop-viewport canvas { width: 100%; height: 100%; display: block; }
.account-crop-viewport::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at center, transparent 0 41.5%, rgba(27, 24, 29, .58) 42.2% 100%); pointer-events: none; }
.account-crop-ring { position: absolute; z-index: 1; left: 8%; top: 8%; width: 84%; aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, .95); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); pointer-events: none; }
.account-crop-help { margin: 10px 0 16px; color: var(--text-3); font-size: 12px; }
.account-crop-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.account-crop-controls label { font-size: 12px; font-weight: 700; }
.account-crop-controls input { width: 100%; accent-color: var(--rose); }
.account-avatar-final { display: grid; place-items: center; gap: 12px; padding: 10px 0 4px; }
.account-avatar-final img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(43, 43, 51, .12); }

@media (max-width: 900px) {
  .account-layout { grid-template-columns: 1fr; gap: 18px; }
  .account-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .account-nav::-webkit-scrollbar { display: none; }
  .account-nav__item { flex: 0 0 auto; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; text-align: center; }
  .account-nav__item.active { border-color: rgba(203, 14, 117, .42); }
  .account-edit-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .account-edit-actions .btn { width: 100%; min-height: 48px; min-width: 0; }
  .account-edit-actions .btn:only-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .account-container { padding-top: 24px; }
  .account-row { min-height: 74px; padding: 15px 16px; gap: 12px; }
  .account-row--avatar { align-items: flex-start; }
  .account-row__action { gap: 10px; }
  .account-avatar-preview { width: 48px; height: 48px; }
  .account-crop-viewport { width: min(248px, 100%); }
  .account-crop-controls { gap: 8px; }
  .account-popover { right: 12px !important; left: auto !important; }
}

/* 访客入口与中文事件名：docs/ui/funnel-visitors-review.html */
.event-friendly { font-family: 'Noto Sans SC', sans-serif; overflow-wrap: anywhere; }
.event-code { display: block; font: 12px/1.6 'JetBrains Mono', monospace; color: var(--text-3); overflow-wrap: anywhere; }
.funnel-event-cell { min-width: 130px; max-width: 300px; }
.visitor-panel { padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.visitor-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.visitor-head h3, #replay-detail h3 { margin: 0 0 6px; font-size: 16px; }
.visitor-head .badge { width: auto; height: auto; min-width: 0; align-self: flex-start; flex: 0 0 auto; padding: 3px 10px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--rose-deep); font: 12px/1.6 var(--font-sans); }
.visitor-search { display: flex; align-items: end; gap: 8px; margin: 16px 0; max-width: 460px; }
.visitor-search label, .visitor-manual-label { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); }
.visitor-search input, .visitor-manual-label input { display: block; margin-top: 6px; width: 100%; }
.visitor-table { width: 100%; table-layout: fixed; }
.visitor-table th:first-child { width: 34%; }
.visitor-table th:nth-child(2) { width: 23%; }
.visitor-table th:last-child { width: 120px; }
.visitor-table td { overflow-wrap: anywhere; }
.visitor-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.visitor-identity > span { min-width: 0; overflow-wrap: anywhere; }
.visitor-copy { flex: 0 0 auto; }
.visitor-panel .btn, #replay-detail .btn, .visitor-manual .btn, .visitor-search input { min-height: 44px; }
.visitor-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.visitor-pagination > div { display: flex; gap: 8px; align-items: center; }
.visitor-manual { margin-top: 20px; }
.visitor-manual summary { min-height: 44px; cursor: pointer; color: var(--text-2); }
.visitor-manual .replay-toolbar { align-items: end; }
#replay-detail { border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
#replay-back { margin-bottom: 16px; }
#replay-status { color: var(--text-2); }
#replay-detail .replay-timeline { min-width: 0; }
#replay-detail .replay-item { flex-wrap: wrap; padding: 16px 12px; }
#replay-detail .replay-event { white-space: normal; overflow-wrap: anywhere; max-width: 100%; color: var(--ink); }
.user-subtabs { flex-wrap: wrap; }
@media (max-width: 640px) {
  .visitor-panel, #replay-detail { padding: 16px; }
  .visitor-search input, .visitor-manual input { font-size: 16px; }
  .visitor-table, .visitor-table tbody { display: block; }
  .visitor-table thead { display: none; }
  .visitor-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 0; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
  .visitor-table td { display: block; border: 0; padding: 0; text-align: left !important; }
  .visitor-table td:first-child, .visitor-table td:nth-child(2), .visitor-table td:last-child { grid-column: 1 / -1; }
  .visitor-table td[data-label]::before { content: attr(data-label); margin-right: 12px; color: var(--text-3); font: 12px 'Noto Sans SC', sans-serif; }
  .visitor-table td:last-child .btn { width: 100%; }
  .visitor-pagination > div { width: 100%; justify-content: space-between; }
  .visitor-pagination .btn { padding: 8px 12px; }
  .visitor-manual .replay-toolbar { flex-direction: column; align-items: stretch; }
  #replay-detail .replay-controls { display: flex; flex-wrap: wrap; }
  #replay-detail .replay-select { width: 100%; max-width: 100%; }
  #replay-detail .replay-item { flex-direction: column; align-items: stretch; gap: 6px; }
  #replay-detail .replay-time { width: auto; }
  #replay-detail .replay-page, #replay-detail .replay-props, #replay-detail .replay-attribution { white-space: normal; overflow-wrap: anywhere; max-width: none; }
}
