:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #eef0f7;
  --text: #1a1f36; --muted: #6b7280; --border: #e3e6ef;
  --primary: #4f46e5; --primary-ink: #fff;
  --info: #2563eb; --warning: #d97706; --high: #dc2626; --critical: #7c1d1d;
  --ok: #16a34a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a; --surface: #1a2238; --surface-2: #131a2c;
    --text: #e6e9f2; --muted: #93a0b8; --border: #2a3454;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
}
.b-name { font-weight: 700; font-size: 16px; }
.b-tag { font-size: 12px; color: var(--muted); }
.top-actions { display: flex; gap: 8px; }
.ghost {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.ghost:hover { background: var(--surface-2); }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.login-card { margin-top: 8vh; }
.login-card h1, .inbox-head h1, .sub-box h2 { margin: 0 0 6px; font-size: 20px; }
.hint, .api-docs { color: var(--muted); font-size: 13px; }
.api-docs { margin-top: 14px; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
input, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 15px;
}
.primary {
  background: var(--primary); color: var(--primary-ink); border: none; padding: 11px 14px;
  border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.primary:hover { filter: brightness(1.05); }
.inbox-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 12px; }
.muted { color: var(--muted); font-size: 14px; font-weight: 400; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 语言切换器（原生 select，零 JS 依赖） ---------- */
.qt-langsel { display: inline-flex; align-items: center; gap: 5px; line-height: 1; flex: none; }
.qt-langsel::before { content: "🌐"; font-size: 14px; opacity: .85; }
.qt-langsel-in {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--border, var(--line, #e7e9eb));
  background: transparent; color: var(--text, var(--ink, var(--txt, #0f172a)));
  border-radius: 9px; padding: 5px 8px; font-size: 13px; font-family: inherit;
  cursor: pointer; max-width: 138px;
}
.qt-langsel-in:focus { outline: 2px solid rgba(79, 70, 229, .35); outline-offset: 1px; }
.qt-langsel[data-style="ghost"] .qt-langsel-in { padding: 6px 10px; }
.qt-langsel[data-style="tab"] .qt-langsel-in { padding: 6px 9px; font-size: 12.5px; }
.qt-langsel[data-style="c-icon"] { gap: 3px; }
.qt-langsel[data-style="c-icon"] .qt-langsel-in { padding: 4px 6px; font-size: 12px; max-width: 120px; }
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px;
  position: relative; cursor: pointer;
}
.event.unread { border-left: 3px solid var(--primary); }
.ev-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-project { font-weight: 600; font-size: 14px; }
.ev-topic { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; color: #fff; }
.badge.info { background: var(--info); }
.badge.warning { background: var(--warning); }
.badge.high { background: var(--high); }
.badge.critical { background: var(--critical); }
.ev-title { font-size: 15px; margin: 6px 0 2px; }
.ev-body { font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.ev-time { font-size: 11px; color: var(--muted); margin-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.sub-box { margin-top: 22px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }
.foot a { color: var(--muted); }
a.ghost { text-decoration: none; display: inline-flex; align-items: center; }
.docs-link { display: block; margin-top: 8px; color: var(--primary); font-weight: 600; text-decoration: none; }
.docs-link:hover { text-decoration: underline; }
.deep-hint {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: rgba(79,70,229,.08); border: 1px solid rgba(79,70,229,.25); color: var(--primary);
}

/* 落地欢迎卡片（从合作站点深链跳来并自动订阅后） */
.welcome-slot { margin-bottom: 16px; }
.welcome-card {
  position: relative; background: var(--surface); border: 1px solid var(--primary);
  border-radius: 14px; padding: 20px 20px 18px;
  box-shadow: 0 6px 22px rgba(79,70,229,.14);
  animation: welcome-in .45s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes welcome-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.welcome-x {
  position: absolute; top: 10px; right: 12px; border: none; background: transparent;
  color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.welcome-x:hover { color: var(--text); }
.welcome-badge {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--primary);
  background: rgba(79,70,229,.1); padding: 3px 12px; border-radius: 999px;
}
.welcome-card h2 { margin: 12px 0 8px; font-size: 20px; }
.welcome-card p { margin: 0; font-size: 14px; color: var(--text); line-height: 1.7; }
.welcome-tip {
  margin-top: 14px; font-size: 12.5px; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--border); padding: 9px 12px; border-radius: 9px;
}
.welcome-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.welcome-back {
  font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none;
}
.welcome-back:hover { text-decoration: underline; }
.welcome-ok {
  margin-left: auto; background: var(--primary); color: #fff; border: none;
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.welcome-ok:hover { filter: brightness(1.06); }
[hidden] { display: none !important; }
