/* 361GO 网站基础样式：全站统一的设计变量与通用组件 */
:root {
  --brand: #f0d78c;
  --brand-strong: #e8b84b;
  --accent: #ed9f64;
  --text: #e0e6f0;
  --muted: #8895b5;
  --surface: linear-gradient(155deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  --border: rgba(255,255,255,.1);
  --page-bg: linear-gradient(160deg, #0a0f1e 0%, #141b30 30%, #1a2744 60%, #0f1625 100%);
  --nav-bg: rgba(10, 15, 30, .92);
  --panel-bg: rgba(255, 255, 255, .04);
  --panel-line: rgba(255, 255, 255, .07);
  --body-link: #8ab4f8;
  --shadow: 0 12px 34px rgba(0, 0, 0, .22);
  --radius: 16px;
  --gap: 20px;
  --page-max: 1120px;
  --page-gutter: 48px;
}

html, body { min-height: 100%; }
body { background: var(--page-bg); color: var(--text); }

.ui-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ui-btn {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #1a2744;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter .18s, transform .18s;
}
.ui-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ui-btn.ghost {
  background: rgba(240,215,140,.08);
  border-color: rgba(240,215,140,.35);
  color: var(--brand);
}

/* 二级页面主按钮统一为同一套金色渐变（base.css 由 site-nav.js 在页面样式之后注入） */
.btn.primary, button.primary, .ui-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #1a2744;
  border-color: rgba(240,215,140,.5);
  font-weight: 700;
}

.ui-field {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 14px;
}

/* 统一扫码登录弹层（复用各页已有的 #loginMask，缺失时由 web-login.js 创建） */
.login-mask {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.72); align-items: center; justify-content: center;
}
.login-mask.show { display: flex; }
.login-dialog {
  position: relative; width: 380px; max-width: calc(100vw - 32px);
  padding: 32px 28px 26px; text-align: center; border-radius: 18px;
  background: #fff; color: #303133;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-dialog h3 { font-size: 20px; margin-bottom: 8px; }
.login-dialog p { font-size: 13px; color: #909399; margin-bottom: 12px; line-height: 1.6; }
.login-close {
  position: absolute; right: 12px; top: 8px; border: none; background: none;
  font-size: 26px; color: #909399; cursor: pointer; line-height: 1;
}
.login-close:hover { color: #303133; }
.login-qr { min-height: 280px; display: flex; align-items: center; justify-content: center; }
.login-qr iframe { width: 300px; height: 300px; border: 0; }

/* 统一页脚，由 site-nav.js 注入；首页原 .footer 不再重复输出 */
.site-footer {
  width: min(var(--page-max), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  padding: 22px 0 36px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between; align-items: center;
  font-size: 13px; color: #4a5670;
}
.site-footer a { color: #4a5670; text-decoration: none; transition: color .18s; }
.site-footer a:hover { color: var(--muted); }

/* 窄屏与底部关注模块保持同一左右留白 */
@media (max-width: 760px) {
  :root { --page-gutter: 32px; }
}
@media (max-width: 600px) {
  .site-footer { flex-direction: column; text-align: center; }
}

/* ===== 浅色主题：site-nav.js 的切换按钮写 html[data-theme="light"] ===== */
html[data-theme="light"] {
  --brand: #9a6b12;
  --brand-strong: #c8912c;
  --accent: #d97736;
  --text: #243049;
  --muted: #66738d;
  --surface: linear-gradient(155deg, #ffffff, #f4f6fb);
  --border: rgba(30, 45, 75, .12);
  --page-bg: #f5f7fb;
  --nav-bg: rgba(255, 255, 255, .94);
  --panel-bg: #ffffff;
  --panel-line: rgba(30, 45, 75, .08);
  --body-link: #2f6fc5;
  --shadow: 0 10px 28px rgba(28, 45, 80, .1);
  color-scheme: light;
}
html[data-theme="light"] body { background: var(--page-bg); color: var(--text); }
html[data-theme="light"] .ui-card,
html[data-theme="light"] .hub-card,
html[data-theme="light"] .content-panel,
html[data-theme="light"] .sn-connect,
html[data-theme="light"] .sn-connect-card,
html[data-theme="light"] .hs-bar,
html[data-theme="light"] .hs-panel {
  background: var(--panel-bg);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
html[data-theme="light"] .site-nav {
  background: var(--nav-bg);
  border-bottom-color: var(--border);
}
html[data-theme="light"] .sn-links a,
html[data-theme="light"] .sn-back,
html[data-theme="light"] .sn-user {
  color: #40506d;
}
html[data-theme="light"] .sn-links a:hover,
html[data-theme="light"] .sn-back:hover,
html[data-theme="light"] .sn-user:hover,
html[data-theme="light"] .sn-user-menu a:hover,
html[data-theme="light"] .sn-user-menu button:hover {
  background: rgba(30, 45, 75, .06);
  color: #1d2a44;
}
html[data-theme="light"] .sn-links a.on { color: #9a6b12; background: rgba(200, 145, 44, .14); }
html[data-theme="light"] .sn-back,
html[data-theme="light"] .sn-user,
html[data-theme="light"] .sn-console,
html[data-theme="light"] .sn-theme,
html[data-theme="light"] .sn-user-menu {
  background: #ffffff;
  border-color: rgba(30, 45, 75, .14);
  box-shadow: none;
  color: #40506d;
}
html[data-theme="light"] .sn-console,
html[data-theme="light"] .sn-login-txt,
html[data-theme="light"] .sn-connect-card h3,
html[data-theme="light"] .hs-group h3,
html[data-theme="light"] .hs-status b,
html[data-theme="light"] .panel-head h3 {
  color: #9a6b12 !important;
}
html[data-theme="light"] .sn-user-menu a,
html[data-theme="light"] .sn-user-menu button { color: #40506d; }
html[data-theme="light"] .sn-user-menu button { color: #b95645; border-top-color: var(--border); }
html[data-theme="light"] .sn-logo span {
  background: none; color: #111827;
  -webkit-text-fill-color: #111827;
}
html[data-theme="light"] .section-heading h1,
html[data-theme="light"] .section-heading h2,
html[data-theme="light"] .sn-connect h2,
html[data-theme="light"] .sp-head h1 { color: #8a6418; }
html[data-theme="light"] .hub-card h3,
html[data-theme="light"] .hub-card p,
html[data-theme="light"] .hub-list li { color: #1f2b3d; }
html[data-theme="light"] .panel-more,
html[data-theme="light"] .hs-more a { color: var(--body-link); }
html[data-theme="light"] .hub-list a { color: #1a4f96; font-weight: 600; }
html[data-theme="light"] .hs-form input { color: var(--text); border-bottom-color: var(--border); }
html[data-theme="light"] .hs-form input::placeholder { color: #8a95aa; }
html[data-theme="light"] .hs-quick button,
html[data-theme="light"] .hs-quick a { color: #40506d; background: #f2f5fa; border-color: var(--border); }
html[data-theme="light"] .hs-row a,
html[data-theme="light"] .hs-row span.hs-plain,
html[data-theme="light"] .panel-list a { color: #243049; }
html[data-theme="light"] .hs-row small,
html[data-theme="light"] .hs-status,
html[data-theme="light"] .panel-sub,
html[data-theme="light"] .panel-meta,
html[data-theme="light"] .panel-empty,
html[data-theme="light"] .panel-loading,
html[data-theme="light"] .hs-more,
html[data-theme="light"] .sn-connect > p,
html[data-theme="light"] .sn-connect-card p,
html[data-theme="light"] .sn-connect-note { color: #66738d; }
html[data-theme="light"] .panel-list li,
html[data-theme="light"] .hs-row { border-bottom-color: var(--panel-line); }
html[data-theme="light"] .panel-tag { background: rgba(200, 145, 44, .14); color: #8a6418; }
html[data-theme="light"] .site-footer { border-top-color: var(--border); color: #66738d; }
html[data-theme="light"] .site-footer a { color: #66738d; }
html[data-theme="light"] .ui-btn { color: #ffffff; }
html[data-theme="light"] .ui-btn.ghost {
  background: #fffaf0; border-color: #c8912c; color: #7a520d;
}
html[data-theme="light"] .ui-btn.ghost:hover { background: #fff2d9; color: #6b4608; }

/* 二级页面（数据中心 / 对弈大厅 / 比赛 / 人机）共用组件的浅色适配 */
html[data-theme="light"] .page-head h1,
html[data-theme="light"] .wrap h1,
html[data-theme="light"] .wrap h2 {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: #1f2b3d !important;
  color: #1f2b3d !important;
}
html[data-theme="light"] .page-head p { color: #40506d; }
html[data-theme="light"] .page-head p,
html[data-theme="light"] .muted,
html[data-theme="light"] .empty,
html[data-theme="light"] .item .meta,
html[data-theme="light"] .row-rank .tag,
html[data-theme="light"] .detail-card p,
html[data-theme="light"] .detail-card .kv,
html[data-theme="light"] .log div { color: #66738d; }
html[data-theme="light"] .tabs { border-bottom-color: var(--border); }
html[data-theme="light"] .tabs a { color: #40506d; }
html[data-theme="light"] .tabs a.on { color: #9a6b12; border-bottom-color: #c8912c; }
html[data-theme="light"] .filters input,
html[data-theme="light"] .filters select,
html[data-theme="light"] .form-row input,
html[data-theme="light"] .chat-input input,
html[data-theme="light"] .dialog input,
html[data-theme="light"] .mask-card input {
  background: #ffffff; border-color: var(--border); color: #243049;
}
html[data-theme="light"] .btn,
html[data-theme="light"] .item,
html[data-theme="light"] .dialog,
html[data-theme="light"] .mask-card,
html[data-theme="light"] .player,
html[data-theme="light"] .side-box,
html[data-theme="light"] .clock > div {
  background: #ffffff; border-color: var(--border); color: #243049;
}
html[data-theme="light"] .item .title,
html[data-theme="light"] .detail-card h2,
html[data-theme="light"] .detail-card h3,
html[data-theme="light"] .row-rank .no { color: #9a6b12; }
html[data-theme="light"] .item .meta b,
html[data-theme="light"] .detail-card .kv b { color: #243049; }
html[data-theme="light"] .sgf-box { background: #f7f9fc; color: #40506d; border-color: var(--border); }
html[data-theme="light"] .toast { background: #ffffff; color: #243049; border-color: var(--border); }
html[data-theme="light"] .btn.primary { background: linear-gradient(135deg, #9a6b12, #c8912c); color: #ffffff; }

/* 人机对弈设置页（ai-game-setup.html）浅色适配 */
html[data-theme="light"] .form-card {
  background: linear-gradient(155deg, #ffffff, #f7f9fd);
  border-color: rgba(30, 45, 75, .18);
  box-shadow: 0 14px 36px rgba(28, 45, 80, .14);
}
html[data-theme="light"] .form-card h2 { color: #9a5a12 !important; }
html[data-theme="light"] .form-card .muted,
html[data-theme="light"] .form-card .group-title,
html[data-theme="light"] .form-card .note { color: #33415a !important; }
html[data-theme="light"] .form-card button,
html[data-theme="light"] .form-card select {
  background: #ffffff; border-color: rgba(30, 45, 75, .18); color: #243049;
}
html[data-theme="light"] .form-card button.on {
  background: #fff6e6; border-color: #c8912c; color: #8a5a12;
}
html[data-theme="light"] .form-card button.on .sub { color: #8a5a12; opacity: .85; }
html[data-theme="light"] .form-card button.primary { background: #c8912c; color: #ffffff; border-color: #c8912c; }
html[data-theme="light"] .form-card .price,
html[data-theme="light"] .form-card .resume-card {
  background: #fff8ea; border-color: rgba(200, 145, 44, .35); color: #6b4a12;
}
html[data-theme="light"] .form-card .price b,
html[data-theme="light"] .form-card .resume-title { color: #7a4f08; }
html[data-theme="light"] .form-card .mask-card { background: #ffffff; border-color: var(--border); color: #243049; }
html[data-theme="light"] .form-card .mask-card h3 { color: #8a5a12; }
html[data-theme="light"] .form-card .mask-card p { color: #40506d; }
html[data-theme="light"] .form-card .toast { background: #ffffff; color: #243049; border-color: var(--border); }

/* 围棋日报 / 历史上的今天（SSR 页面）浅色适配 */
html[data-theme="light"] a { color: #2f6fc5; }
html[data-theme="light"] .wrap .sub,
html[data-theme="light"] .wrap .meta { color: #40506d !important; }
html[data-theme="light"] .wrap .card,
html[data-theme="light"] .wrap .list-item {
  background: #ffffff; border-color: var(--border); border-bottom-color: var(--border);
}
html[data-theme="light"] .wrap .card h2,
html[data-theme="light"] .wrap .card h3,
html[data-theme="light"] .wrap .card h4 { color: #8a5a12; }
html[data-theme="light"] .wrap .card a,
html[data-theme="light"] .wrap .list-item a { color: #1a4f96; font-weight: 600; }
html[data-theme="light"] .wrap .card .yr { color: #8a5a12; }
html[data-theme="light"] .wrap .tag { background: #eaf1ff; color: #2f6fc5; }
html[data-theme="light"] .wrap .hist-nav a { color: #2f6fc5; }

/* 对弈大厅（lobby.css）浅色适配 */
html[data-theme="light"] .tabs button { background: #ffffff; border-color: var(--border); color: #40506d; }
html[data-theme="light"] .tabs button.active { background: #fff4e2; border-color: #c8912c; color: #8a5a12; }
html[data-theme="light"] .section h2 { color: #1f2b3d; }
html[data-theme="light"] .section h2 .count { color: #40506d; background: #eef2f8; }
html[data-theme="light"] .card .row,
html[data-theme="light"] .card .players .vs,
html[data-theme="light"] .card .tag.waiting,
html[data-theme="light"] .empty,
html[data-theme="light"] .field label,
html[data-theme="light"] .byoyomi-row span,
html[data-theme="light"] .qr-line,
html[data-theme="light"] .login-hint { color: #40506d; }
html[data-theme="light"] .card .players { color: #1f2b3d; }
html[data-theme="light"] .card .tag { background: #fff4e2; color: #8a5a12; }
html[data-theme="light"] .card .tag.finished { background: #eaf1ff; color: #2f6fc5; }
html[data-theme="light"] .notice { background: #fff8ea; border-color: rgba(200, 145, 44, .35); }
html[data-theme="light"] .notice .txt { color: #40506d; }
html[data-theme="light"] .notice .txt b { color: #8a5a12; }
html[data-theme="light"] .follow-hint { color: #8a5a12; }
html[data-theme="light"] .room-title b,
html[data-theme="light"] .side-box h3,
html[data-theme="light"] .mask-card h3 { color: #8a5a12; }
html[data-theme="light"] .side-box .member { border-bottom-color: var(--panel-line); }

/* 线上比赛（tournament.css）浅色适配 */
html[data-theme="light"] .nav-logo span { color: #1f2b3d; }
html[data-theme="light"] .card h2,
html[data-theme="light"] .stat .v,
html[data-theme="light"] .table-actions button,
html[data-theme="light"] .dialog h3 { color: #8a5a12; }
html[data-theme="light"] .hint,
html[data-theme="light"] .empty,
html[data-theme="light"] .loading,
html[data-theme="light"] .list-meta,
html[data-theme="light"] .field > label,
html[data-theme="light"] .inline .unit,
html[data-theme="light"] th,
html[data-theme="light"] .stat .k,
html[data-theme="light"] .info-grid div span,
html[data-theme="light"] .dialog-close { color: #40506d; }
html[data-theme="light"] .status { background: #eaf1ff; color: #2f6fc5; }
html[data-theme="light"] .status.running { background: #e8f7ee; color: #218341; }
html[data-theme="light"] .status.finished { background: #eef2f8; color: #40506d; }
html[data-theme="light"] .status.cancelled,
html[data-theme="light"] .status.void { background: #fdecec; color: #b95645; }
html[data-theme="light"] .tabs button,
html[data-theme="light"] .seg button,
html[data-theme="light"] .check-chip,
html[data-theme="light"] .list-row,
html[data-theme="light"] .stat { background: #ffffff; border-color: var(--border); color: #243049; }
html[data-theme="light"] .tabs button.on,
html[data-theme="light"] .seg button.on,
html[data-theme="light"] .check-chip.on { background: #fff4e2; border-color: #c8912c; color: #8a5a12; }
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea { background: #ffffff; border-color: var(--border); color: #243049; }
html[data-theme="light"] .field input:focus,
html[data-theme="light"] .field select:focus,
html[data-theme="light"] .field textarea:focus { border-color: #c8912c; }
html[data-theme="light"] th,
html[data-theme="light"] td { border-bottom-color: var(--panel-line); }
html[data-theme="light"] tr:hover td { background: #f7f9fc; }
html[data-theme="light"] .mine-tip { background: #fff8ea; color: #6b4a12; }
