/* =========================================================
   极云aibox · G 设计系统（二级页面公共样式）
   ========================================================= */
:root {
  --bg: #f4f1ea; --card: #ffffff; --soft: #ece8df; --ink: #141414; --muted: #4d4d4d; --line: #141414; --hair: #d9d3c6;
  --blue: #2340ff; --blue-ink: #1a33d6; --tomato: #ff4a2b; --sun: #ffc531; --green: #12704a; --red: #b4232e;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --num: "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --r-card: 24px; --r-ctl: 14px;
  --field: #fffdf8; --link: #1a33d6; --overlay: rgba(244,241,234,.92); --pastel-blue: #dfe4ff; --pastel-red: #ffd9d1; --ink-hover: #2b2b2b;
  color-scheme: light;
}
/* ---------- 深色 ---------- */
html[data-theme="dark"] {
  --bg: #121212; --card: #1c1c1c; --soft: #262626; --ink: #f4f1ea; --muted: #bdb8ae; --line: #f4f1ea; --hair: #3a3a3a;
  --blue: #4d66ff; --blue-ink: #3a52f0; --green: #3fbf7f; --red: #ff7a7a;
  --field: #181818; --link: #9aa8ff; --overlay: rgba(18,18,18,.92); --pastel-blue: #232b52; --pastel-red: #4a2620; --ink-hover: #d9d4ca;
  color-scheme: dark;
}
/* 黄色底上的字永远是深色，深浅模式都清楚 */
.g-badge, .tab b, .tips, .retention, .guide-callout, .companion-badge, .image-guide-body section > strong, .panel.sun,
.software-card:nth-child(3n+1) .software-cover.placeholder, .news-feed-takeaway, .price-tag, .registration-policy, .registration-referral,
.drama-kicker, .drama-download.is-soon, .drama-feature:nth-child(1), .link-wrap .code, .link-wrap .badge.warn, .launch-local, .merchant-hand-note {
  --ink: #141414; --muted: #3d3d3d; --line: #141414; --link: #1a33d6; --bg: #f4f1ea; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 999px; z-index: 100; }
.skip:focus { top: 12px; color: var(--bg); }

/* ---------- header ---------- */
.g-top { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 2px solid var(--line); }
.g-top-inner { max-width: 1440px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 12px 32px; }
.g-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 900; font-size: 20px; white-space: nowrap; }
.g-brand-mark { display: flex; align-items: flex-end; gap: 3px; }
.g-brand-mark i:nth-child(1) { width: 14px; height: 14px; border-radius: 999px; background: var(--tomato); }
.g-brand-mark i:nth-child(2) { width: 14px; height: 20px; background: var(--blue); }
.g-brand-mark i:nth-child(3) { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 16px solid var(--sun); }
.g-brand small { font-family: var(--num); font-weight: 700; font-size: 20px; margin-left: 2px; }
.g-nav { flex: 1 1 auto; display: flex; flex-wrap: nowrap; gap: 0; min-width: 0; }
.g-nav a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; white-space: nowrap; font-size: 15px; font-weight: 500; border-radius: 999px; }
.g-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.g-badge { font-size: 11px; font-weight: 700; background: var(--sun); color: var(--ink); border-radius: 4px; padding: 1px 6px; }
.g-acct { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.g-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; }
.g-btn:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.g-btn.ink { background: var(--ink); color: var(--bg); }
.g-btn.ink:hover:not(:disabled) { background: var(--ink-hover); color: var(--bg); }
.g-btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.g-btn.blue:hover:not(:disabled) { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; }
.g-btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; font-weight: 500; }
.g-btn.big { min-height: 56px; padding: 0 28px; font-size: 17px; }
.g-btn.icon { width: 44px; padding: 0; }
.g-btn:disabled { color: #7a7a7a; border-color: #bdb7ab; background: var(--soft); cursor: not-allowed; }
.g-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- account pill ---------- */
.g-balance { min-height: 44px; display: inline-flex; align-items: center; gap: 2px; padding: 0 4px 0 16px; border-radius: 999px; border: 2px solid var(--line); font-size: 14px; background: transparent; }
.g-balance strong { font-weight: 700; }
.g-balance small { display: block; font-size: 11px; color: var(--muted); }
.g-balance .g-mini { width: 36px; height: 36px; border: none; background: transparent; border-radius: 999px; display: grid; place-items: center; cursor: pointer; font-size: 16px; }
.g-balance .g-mini:hover { background: var(--soft); }

/* ---------- surfaces ---------- */
.g-card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-card); }
.g-soft { background: var(--soft); border-radius: var(--r-card); }
.g-kicker { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.g-kicker::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--tomato); }
.g-h1 { margin: 0; font-size: clamp(40px, 5vw, 64px); line-height: 1.05; font-weight: 900; letter-spacing: -0.03em; }
.g-h2 { margin: 0; font-size: 24px; font-weight: 900; }
.g-lead { margin: 0; font-size: 17px; line-height: 1.7; color: var(--muted); }

/* ---------- form controls ---------- */
.g-input, .g-select, .g-textarea { width: 100%; border: 2px solid var(--line); border-radius: var(--r-ctl); background: var(--card); color: var(--ink); padding: 12px 14px; font-size: 16px; }
.g-input:focus, .g-select:focus, .g-textarea:focus { outline: 3px solid rgba(35,64,255,.28); outline-offset: 1px; border-color: var(--blue); }
::placeholder { color: #767676; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--blue); }

/* ---------- status messages ---------- */
.message:empty, .composer-message:empty { display: none; }
.message, .composer-message { font-size: 14px; line-height: 1.6; }
.message.error, .composer-message.error { color: var(--red); font-weight: 700; }
.message.success, .composer-message.success { color: var(--green); font-weight: 700; }

/* ---------- footer ---------- */
.g-foot { border-top: 2px solid var(--line); margin-top: auto; }
.g-foot-inner { max-width: 1440px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 22px 32px; font-size: 14px; }
.g-foot nav { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------- mobile tab bar ---------- */
.g-tabbar { display: none; }
@media (max-width: 760px) {
  .g-top-inner { padding: 10px 16px; }
  .g-nav { display: none; }
  .g-balance small { display: none; }
  .g-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--bg); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .g-tabbar a, .g-tabbar button { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; border: none; background: transparent; cursor: pointer; }
  .g-tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .g-tabbar [aria-current="page"] { color: var(--link); font-weight: 700; }
  body.g-menu-open .g-nav { display: flex; position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 46; flex-direction: column; padding: 12px; background: var(--card); border: 2px solid var(--line); border-radius: 22px; }
  body { padding-bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.g-top-inner > .g-acct { margin-left: auto; }
.guide-backdrop { backdrop-filter: blur(2px); }

/* ---------- 手机优化 ---------- */
.g-nav .g-nav-logout { display: none; }
@media (max-width: 760px) {
  .g-top-inner { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
  .g-brand { font-size: 18px; gap: 8px; flex: none; }
  .g-brand small { font-size: 18px; }
  .g-brand-mark i:nth-child(1) { width: 12px; height: 12px; } .g-brand-mark i:nth-child(2) { width: 12px; height: 17px; }
  .g-brand-mark i:nth-child(3) { border-left-width: 7px; border-right-width: 7px; border-bottom-width: 14px; }
  .g-top-inner > .g-acct { flex-wrap: nowrap; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .g-top-inner > .g-acct::-webkit-scrollbar { display: none; }
  .g-acct .g-acct { flex-wrap: nowrap; gap: 6px; }
  .g-acct .g-btn.ghost, .g-acct [data-g-logout], #logout-button, #logout { display: none !important; }
  .g-acct .g-btn { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .g-balance { min-height: 40px; padding: 0 2px 0 12px; font-size: 13px; white-space: nowrap; }
  .g-balance strong { font-size: 13px; }
  .g-balance .g-mini { width: 32px; height: 32px; }
  .g-nav .g-nav-logout { display: inline-flex; color: var(--red); }
  body.g-menu-open .g-nav { max-height: calc(100vh - 120px); overflow-y: auto; }
  body.g-menu-open::after { content: ""; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.4); }
  .g-tabbar a, .g-tabbar button { font-size: 12px !important; font-family: var(--font) !important; color: var(--ink); }
  .companion-fab { bottom: calc(76px + env(safe-area-inset-bottom)) !important; right: 12px !important; }
  .g-h1 { font-size: 38px; }
  .g-lead { font-size: 15px; }
  .g-btn.big { min-height: 50px; padding: 0 20px; font-size: 15px; }
  .g-foot-inner { padding: 18px 16px; flex-direction: column; }
}

.g-nav .g-nav-extra { display: none; }
@media (max-width: 760px) {
  .g-top .top-actions > button.g-btn[id] { display: none !important; }
  .g-nav .g-nav-extra { display: inline-flex; }
  .g-balance small { display: none; }
  .companion-fab-greeting { display: none !important; }
}

/* ===== 电脑紧凑尺寸（自动生成，只对鼠标设备、宽屏生效）===== */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
.skip { padding: 10px 14px; }
.g-top-inner { max-width: 1280px; gap: 8px 18px; padding: 12px 26px; }
.g-brand { min-height: 35px; font-size: 18px; }
.g-brand small { font-size: 18px; }
.g-nav a { min-height: 35px; font-size: 14px; }
.g-btn { min-height: 35px; padding: 0 15px; }
.g-btn.big { min-height: 45px; padding: 0 22px; font-size: 16px; }
.g-balance { min-height: 35px; padding: 0 4px 0 14px; }
.g-balance .g-mini { font-size: 15px; }
.g-h1 { font-size: clamp(32.8px,  4.0vw,  49.92px); }
.g-h2 { font-size: 20px; }
.g-lead { font-size: 16px; }
.g-input, .g-select, .g-textarea { font-size: 15px; }
.g-foot-inner { max-width: 1280px; padding: 19px 26px; }
.g-foot nav { gap: 14px; }
html body .g-top-inner, html body .top-inner.prio-bar { max-width: 1360px !important; }
}
