/* Mahoro Portal — shared chrome
 * Base reset + dots-bg background + topbar/wordmark/tabs.
 *
 * Loaded after _tokens.css so it can use var(--*).
 * Loaded before per-page <style> blocks so inline overrides can win.
 *
 * Note: .canvas is intentionally NOT here — each page sets its own
 * max-width / padding (main 880, feeds 820, ask 820 + tight bottom,
 * dashboard 1280 for chart density).
 */

/* ── Base reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  background-image: var(--bg-tint);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
::-webkit-scrollbar { width: 0; height: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ── Dotted brand-tinted background ── */
.dots-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 85% 4%, rgba(232,55,154,0.14) 0%, transparent 28%),
    radial-gradient(circle at 8% 88%, rgba(124,92,255,0.08) 0%, transparent 26%),
    radial-gradient(circle at 5% 5%, rgba(232,55,154,0.05) 0%, transparent 20%);
}
.dots-bg svg { position: absolute; inset: 0; opacity: 0.55; width: 100%; height: 100%; }

/* ── Sticky top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center;
  background: rgba(253,247,250,0.72);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 0.5px solid var(--line);
  padding: 0 18px 0 0;
}
.wordmark {
  padding: 14px 20px;
  font-family: var(--font-serif); font-size: 20px; font-weight: 500;
  /* editorial 微调：serif 沿用，字号 19→20、字距 -0.2→-0.4 克制收紧（mahoro.cn 同源） */
  letter-spacing: -0.4px; color: var(--ink); white-space: nowrap;
}
.wordmark em { font-style: italic; color: var(--brand); font-weight: 500; }
.tabs { display: flex; flex-wrap: nowrap; }
.tab {
  padding: 18px 20px; font-family: var(--font-sans);
  font-size: 14px; font-weight: 550;
  color: var(--ink3); letter-spacing: -0.1px;
  position: relative; transition: color .18s;
  white-space: nowrap;
}
.tab:hover { color: var(--ink2); }
.tab.active { color: var(--brand); }
.tab.active::after {
  content: ''; position: absolute;
  bottom: 0; left: 50%;
  width: 60%; height: 2.5px;
  background: linear-gradient(100deg, var(--violet) 0%, var(--brand) 60%, var(--brand-light) 100%);
  border-radius: 2px;
  transform: translateX(-50%);
}
.topbar-spacer { flex: 1; }
.topbar-user {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink3);
  padding: 0 6px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-logout {
  font-size: 12px; color: var(--ink3); padding: 6px 10px;
  border-radius: 999px; letter-spacing: -0.1px;
  transition: all .18s; display: none;
}
.topbar-logout.on { display: inline-block; }
/* hover 底色原写死 light 深墨色 4%，dark 下几乎不可见 —— 改走 token（light 同值，dark 白 8%） */
.topbar-logout:hover { background: var(--surface-hover); color: var(--ink); }

/* ── 深空终端 HUD：topbar 底部青色发丝线（仅 dark 可见，light 结构不动） ── */
[data-theme="dark"] .topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -0.5px;
  height: 1px;
  pointer-events: none;
  /* 青发丝线：两端渐隐，中央 0.28 透明度（拍板值 rgba(127,220,255,0.28)） */
  background: linear-gradient(90deg,
    transparent 0%, rgba(127,220,255,0.28) 28%,
    rgba(127,220,255,0.28) 72%, transparent 100%);
}

/* 深空终端 HUD：active tab 下划线加青色光晕（dark-only 追加，light 不动） */
[data-theme="dark"] .tab.active::after {
  box-shadow: 0 0 8px rgba(127,220,255,0.5); /* 青光晕（拍板值） */
}
