/*
 * 心游品牌门户样式（与 Tailwind 2.2.19 预构建 CSS 一起本地托管；CSP 禁止内联样式）。
 * 设计 token 从参考截图提炼：柔和粉→淡紫全屏渐变 + 悬浮白色大圆角卡片 + 暖珊瑚主色 + 超大黑体标题。
 */
:root {
  /* 主色（珊瑚红） */
  --brand:        #F15A38;
  --brand-strong: #E8491F;
  --brand-weak:   #FDECE6;
  --brand-grad:   linear-gradient(135deg, #FB7A5C 0%, #F0502E 100%);

  /* 文字 */
  --ink:   #1D2430;
  --text:  #374151;
  --muted: #8A93A3;

  /* 背景与表面 */
  --bg:        linear-gradient(120deg, #FBE7E0 0%, #EEF0F7 45%, #DDE3F4 100%);
  --surface:   #FFFFFF;
  --surface-2: #F6F7F9;
  --border:    #ECEEF2;

  /* 语义色 */
  --ok:     #16A34A; --ok-bg:     #DCFCE7;
  --danger: #EF4444; --danger-bg: #FEE2E2;
  --warn:   #D97706; --warn-bg:   #FEF3C7;
  --info:   #2563EB; --info-bg:   #DBEAFE;

  /* 形状与阴影 */
  --radius-card: 20px;
  --radius-ctrl: 10px;
  --shadow:     0 10px 30px -12px rgba(30, 40, 60, .18);
  --shadow-bar: 0 8px 24px -14px rgba(30, 40, 60, .20);

  /* 字体 */
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[x-cloak] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 104px; background: var(--bg); min-height: 100%; }
body.portal {
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* 截图里的柔光晕：左下暖粉、右上冷蓝 */
body.portal::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40rem 30rem at 0% 85%, rgba(251, 207, 196, .55), transparent 70%),
    radial-gradient(36rem 28rem at 92% 12%, rgba(196, 210, 248, .55), transparent 70%);
}

/* ------------------------------------------------------------------ 文字 */
.text-ink   { color: var(--ink); }
.text-body  { color: var(--text); }
.text-muted { color: var(--muted); }
.text-brand { color: var(--brand); }
.font-mono-portal { font-family: var(--mono); }

.hero-title {
  color: var(--ink);
  font-weight: 900;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  word-break: keep-all;
}
@media (min-width: 768px)  { .hero-title { font-size: 56px; } }
@media (min-width: 1280px) { .hero-title { font-size: 62px; } }

.page-title {
  color: var(--ink);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) { .page-title { font-size: 44px; } }

/* section 眉标：短珊瑚横线 + 珊瑚小字（如「— 加入心游」） */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--brand); font-size: 13px; font-weight: 600; letter-spacing: .04em;
}
.eyebrow::before {
  content: ""; display: inline-block; width: 22px; height: 2px; border-radius: 2px; background: var(--brand);
}

/* 英文副标：小字、字间距放大、灰色 */
.brand-sub {
  color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .28em; line-height: 1;
}

/* ------------------------------------------------------------------ 顶栏（悬浮胶囊） */
.topbar {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-bar);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
}
.logo-mark { height: 36px; width: auto; display: block; }

/* 控制台 Tab 导航（参考图3：选中项为白底浅阴影的小圆角胶囊） */
.tabbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.tab {
  color: var(--text); font-size: 14px; padding: 7px 14px; border-radius: 12px;
  transition: background-color .15s, color .15s, box-shadow .15s; white-space: nowrap;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab:focus { outline: none; }
.tab:focus-visible { box-shadow: 0 0 0 3px rgba(241, 90, 56, .25); }
.tab-active, .tab-active:hover {
  color: var(--ink); font-weight: 700; background: var(--surface);
  box-shadow: 0 2px 10px -4px rgba(30, 40, 60, .22), 0 0 0 1px var(--border);
}
.tab-exit { color: var(--muted); }
.tab-exit:hover { color: var(--brand); background: var(--brand-weak); }

/* 顶栏卡密掩码 / 未登录 chip */
/* 掩码固定为「前4…后4」，不截断：不设 max-width / overflow:hidden，且不参与 flex 收缩 */
.key-chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  max-width: none; overflow: visible; text-overflow: clip;
  padding: 5px 12px; border-radius: 9999px; background: var(--surface-2);
  color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.key-chip .font-mono-portal { letter-spacing: .02em; }

/* 「在线 N」chip（默认关闭，见 LS_PORTAL_SHOW_ONLINE） */
.online-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-ctrl); background: var(--surface);
}
.online-chip .label { color: var(--muted); font-size: 10px; line-height: 1; }
.online-chip .value { color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.1; }
.sparkline { width: 60px; height: 20px; }
.sparkline polyline { fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-ctrl); font-weight: 700; font-size: 14px;
  padding: 10px 18px; transition: filter .15s, background-color .15s, box-shadow .15s, transform .05s;
  cursor: pointer; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; font-weight: 600; }
.btn-xl { padding: 16px 28px; font-size: 17px; border-radius: 14px; }
.btn-primary {
  color: #fff; background: var(--brand-grad);
  box-shadow: 0 8px 18px -10px rgba(240, 80, 46, .75);
}
.btn-primary:hover { filter: brightness(.95) saturate(1.05); }
.btn-secondary { color: var(--ink); background: var(--surface); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-soft { color: var(--brand); background: var(--brand-weak); }
.btn-soft:hover { background: #FBDDD3; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn .arrow { font-weight: 400; }

/* ------------------------------------------------------------------ 卡片与行 */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .9);
}
.kv {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface-2); border-radius: var(--radius-ctrl); padding: 12px 14px;
}
.kv .k { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.kv .v { color: var(--ink); font-size: 14px; font-weight: 600; text-align: right; min-width: 0; }
.hash {
  font-family: var(--mono); font-size: 12px; color: var(--ink); word-break: break-all; line-height: 1.5;
}

.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 8px 16px -10px rgba(240, 80, 46, .8);
}

/* 绿勾优势清单 */
.check {
  width: 18px; height: 18px; border-radius: 9999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ok-bg); color: var(--ok); font-size: 11px; font-weight: 800;
}

/* ------------------------------------------------------------------ 状态 pill / 点 / 徽标 */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; line-height: 1.5;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }
.pill-ok     { color: var(--ok);     background: var(--ok-bg); }
.pill-danger { color: var(--danger); background: var(--danger-bg); }
.pill-warn   { color: var(--warn);   background: var(--warn-bg); }
.pill-muted  { color: var(--muted);  background: var(--surface-2); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 9999px; }
.dot-ok { background: var(--ok); }
.dot-danger { background: var(--danger); }
.dot-muted { background: #C3C8D2; }

.tag {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap;
}
.tag-version { color: #fff; background: var(--brand); }
.tag-latest  { color: var(--brand); background: var(--brand-weak); }
.tag-count   { color: var(--warn); background: var(--warn-bg); }
.tag-fix     { color: var(--warn); background: var(--warn-bg); }
.tag-update  { color: var(--info); background: var(--info-bg); }
.tag-add     { color: var(--ok);   background: var(--ok-bg); }

/* ------------------------------------------------------------------ 表单 */
.input {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-ctrl);
  padding: 12px 14px; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #B4BAC5; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(241, 90, 56, .18); }
.input-mono { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.input-mono::placeholder { text-transform: none; letter-spacing: normal; font-family: var(--font); }

/* ------------------------------------------------------------------ FAQ 手风琴 */
.faq-item + .faq-item { border-top: 1px solid var(--border); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 4px; text-align: left; color: var(--ink); font-weight: 600; font-size: 15px;
}
.faq-q:focus { outline: none; }
.faq-q:focus-visible { box-shadow: 0 0 0 3px rgba(241, 90, 56, .25); border-radius: var(--radius-ctrl); }
.faq-sign {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 9999px; display: inline-flex;
  align-items: center; justify-content: center; background: var(--brand-weak); color: var(--brand); font-weight: 700;
  transition: transform .2s;
}
.faq-sign.open { transform: rotate(45deg); }
.faq-a { padding: 0 4px 18px; color: var(--text); font-size: 14px; line-height: 1.75; }

/* ------------------------------------------------------------------ 提示 toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.toast-error { color: #991B1B; background: #FFF1F1; border: 1px solid var(--danger-bg); }
.toast-info  { color: var(--ink); background: var(--surface); border: 1px solid var(--border); }
.toast-ok    { color: #166534; background: #F0FDF4; border: 1px solid var(--ok-bg); }
.toast button { color: inherit; opacity: .6; font-weight: 700; }

/* ------------------------------------------------------------------ 品牌展示卡 */
.brand-card { position: relative; overflow: hidden; }
.brand-card::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 220px; height: 220px; border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(241, 90, 56, .12), transparent);
  pointer-events: none;
}
.brand-logo { width: 100%; max-width: 380px; height: auto; margin: 0 auto; display: block; }
/* ------------------------------------------------------------------ 登录屏（参考图1） */
.login-card { padding-top: 2rem; }
.input-soft { background: #EEF3FD; border-color: #DDE5F5; }
.input-soft:focus { background: var(--surface); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, .14); }
.login-error { color: var(--danger); font-size: 13px; font-weight: 600; }

.quote-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255, 255, 255, .78); border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
  padding: 18px 22px; color: var(--text); font-size: 14px; line-height: 1.7;
}
.quote-mark { color: var(--brand); font-size: 28px; font-weight: 900; line-height: 1; font-style: italic; }

/* ------------------------------------------------------------------ 控制台（参考图2） */
.hero-title-sm { font-size: 40px; }
@media (min-width: 768px)  { .hero-title-sm { font-size: 52px; } }
@media (min-width: 1280px) { .hero-title-sm { font-size: 56px; } }

.tile { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.tile-k { color: var(--muted); font-size: 12px; }
.tile-v { color: var(--ink); font-size: 15px; font-weight: 700; margin-top: 6px; word-break: break-word; }

/* 购卡入口（登录卡底部居中淡色小字） */
.buy-entry { text-align: center; color: var(--muted); font-size: 12px; }
.buy-link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; transition: color .15s; }
.buy-link:hover { color: var(--brand); }

/* 版本下载：单一客户端主卡 */
.client-card { position: relative; overflow: hidden; border: 1px solid var(--brand-weak); }
.client-card::after {
  content: ""; position: absolute; right: -90px; top: -90px; width: 240px; height: 240px; border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(241, 90, 56, .12), transparent); pointer-events: none;
}
.client-icon { height: 44px; width: auto; flex-shrink: 0; }
.copy-btn { min-width: 104px; }
.copy-ok, .copy-ok:hover { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bg); }

/* 弱化小提示卡（运行库） */
.tip-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255, 255, 255, .6); border: 1px dashed #D5DAE3; border-radius: 14px;
  padding: 12px 16px; color: var(--muted); font-size: 13px; line-height: 1.7;
}
.tip-icon {
  width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--info-bg); color: var(--info); font-size: 11px; font-weight: 800; font-style: italic;
}
.tip-link { color: var(--info); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* 登录屏 / 各标签页切换时的淡入（x-show 切 display 时重新触发） */
.screen { animation: screen-in .28s ease-out both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.divider { height: 1px; background: var(--border); }
.footer { color: var(--muted); font-size: 12px; }
