:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-size: 16px;
  --page: #edf7ee;
  --page-deep: #e3f2e8;
  --surface: #ffffff;
  --surface-soft: #f7fcf8;
  --surface-hover: #f1faf3;
  --ink: #18372d;
  --ink-strong: #102c22;
  --muted: #617b6b;
  --soft: #819589;
  --line: #cfe5d5;
  --line-strong: #a8d2b6;
  --green: #227756;
  --green-deep: #155d42;
  --green-glow: #6fb891;
  --green-soft: #dff2e4;
  --accent: #6679df;
  --accent-bright: #7e8fee;
  --accent-pale: #eef0ff;
  --accent-line: #9eacef;
  --amber: #b7742e;
  --blue: #3e78a6;
  --red: #b65059;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(34, 71, 52, .075), 0 2px 6px rgba(34, 71, 52, .025);
  --hover-shadow: 0 22px 44px rgba(61, 92, 78, .14), 0 7px 16px rgba(74, 95, 160, .075);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 88% 13%, rgba(146, 219, 174, .36), transparent 34%),
    radial-gradient(ellipse at 8% 72%, rgba(159, 204, 228, .18), transparent 36%),
    linear-gradient(rgba(75, 127, 94, .023) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 127, 94, .023) 1px, transparent 1px),
    linear-gradient(180deg, #f5fcf6 0%, #edf7ef 50%, #e8f4ec 100%);
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
  background-attachment: fixed;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .54; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #96a6f1;
  outline-offset: 3px;
}
::selection { background: #dce2ff; color: #213b79; }
.boot-loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.spacer { flex: 1; }
.grow { min-width: 0; flex: 1; }
.top-gap { margin-top: 18px; }
.bottom-gap { margin-bottom: 15px; }
.hidden { display: none !important; }
.danger-text { color: var(--red); }
.good-text { color: var(--green); }
.eyebrow { color: var(--muted); font-size: .82rem; }
.site-footer { min-height: 64px; display: flex; justify-content: center; align-items: center; padding: 18px 20px; color: var(--muted); font-size: .75rem; text-align: center; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.boot-loading, .auth-screen, .app-shell { min-height: calc(100vh - 64px); }

.auth-screen {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 26px;
  background:
    radial-gradient(circle at 48% 18%, rgba(100, 187, 131, .24), transparent 30%),
    radial-gradient(circle at 88% 88%, rgba(166, 221, 175, .3), transparent 28%),
    var(--page);
}
.auth-card {
  width: min(100%, 430px);
  padding: 40px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #bfdcc8;
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(27, 89, 49, .14);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.auth-brand-mark, .brand-mark {
  display: grid; place-items: center;
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #778aee, #5368cb);
  color: white; font-weight: 900; font-size: 1.2rem;
  box-shadow: 0 8px 18px rgba(75, 93, 190, .18);
}
.auth-title { margin: 0; color: var(--ink-strong); font-size: 1.35rem; letter-spacing: -.02em; }
.auth-subtitle { margin: 0 0 32px; color: var(--muted); text-align: center; font-size: .9rem; }
.auth-card .field + .field { margin-top: 20px; }
.auth-submit { width: 100%; margin-top: 27px; min-height: 48px; }
.auth-foot { margin-top: 27px; padding-top: 19px; border-top: 1px solid var(--line); color: var(--soft); text-align: center; font-size: .78rem; }

.app-shell { min-height: calc(100vh - 64px); }
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(248, 254, 250, .88);
  border-bottom: 1px solid rgba(167, 208, 179, .6);
  box-shadow: 0 9px 28px rgba(36, 83, 58, .065);
  backdrop-filter: blur(22px) saturate(1.2);
}
.site-header::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(107, 132, 220, .45), rgba(111, 191, 142, .45), transparent); pointer-events: none; }
.header-inner {
  max-width: 1500px;
  min-height: 82px;
  margin: 0 auto;
  padding: 12px clamp(20px, 3.2vw, 45px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
}
.header-links { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 11px; color: #143d2c; font-size: .98rem; font-weight: 700; white-space: nowrap; line-height: 1.2; }
.brand strong { font-weight: 900; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .13em; }
.brand-mark { width: 37px; height: 37px; border-radius: 13px; }
.brand-mark { box-shadow: 0 9px 20px rgba(77, 93, 191, .23), inset 0 1px 0 rgba(255,255,255,.23); transition: transform .32s cubic-bezier(.2,.75,.25,1), box-shadow .32s ease; }
.brand:hover .brand-mark { transform: rotate(-4deg) translateY(-2px); box-shadow: 0 13px 25px rgba(77, 93, 191, .3); }
.nav { display: flex; flex: 1; justify-content: center; align-items: center; gap: 5px; min-width: 0; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #4d6d5a;
  font-size: .86rem; font-weight: 700; white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-link:hover {
  color: #4c60b9; background: #f0f2ff;
  border-color: #c4cbf7; box-shadow: 0 7px 17px rgba(86, 103, 188, .12);
  transform: translateY(-1px);
}
.nav-link.active { color: white; background: linear-gradient(115deg, #6275dd, #8491ee); border-color: #6f7fe2; box-shadow: 0 7px 17px rgba(82, 96, 190, .18); }
.nav-link.active:hover { background: linear-gradient(115deg, #7486ed, #97a2f4); color: white; }
.nav-icon { width: 18px; text-align: center; font-size: 1rem; }
.header-account { display: flex; align-items: center; gap: 13px; }
.current-user { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.user-avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; color: white; background: #6ba67b; font-weight: 800; }
.user-name { color: var(--ink-strong); font-size: .8rem; font-weight: 800; }
.user-role { color: var(--muted); font-size: .7rem; }
.sidebar-actions { display: flex; align-items: center; gap: 6px; }
.sidebar-actions .btn { padding: 8px 10px; font-size: .76rem; }
.menu-toggle { display: none !important; }
.mobile-overlay, .mobile-bar { display: none; }

.main { width: min(100%, 1500px); margin: 0 auto; padding: 39px clamp(20px, 3.2vw, 45px) 78px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.page-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #6074bf; font-size: .65rem; font-weight: 850; letter-spacing: .16em; }
.page-kicker::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #81cfa6; box-shadow: 0 0 0 4px rgba(129,207,166,.18); }
.page-title { margin: 0; color: var(--ink-strong); font-size: clamp(1.7rem, 2vw, 2.35rem); font-weight: 900; line-height: 1.15; letter-spacing: -.035em; }
.page-subtitle { margin: 8px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.date-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 13px; border: 1px solid rgba(183, 215, 192, .88); border-radius: 11px; background: rgba(255,255,255,.86); color: var(--muted); font-size: .8rem; white-space: nowrap; box-shadow: 0 7px 18px rgba(40, 91, 51, .065); backdrop-filter: blur(8px); }
.panel, .stat-card, .game-card, .summary-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color .28s ease, outline-color .28s ease, box-shadow .32s cubic-bezier(.2,.75,.25,1), transform .32s cubic-bezier(.2,.75,.25,1);
}
.panel:hover, .stat-card:hover, .game-card:hover, .summary-card:hover {
  border-color: var(--accent-line);
  outline: 1px solid rgba(114, 132, 226, .48);
  outline-offset: 0;
  box-shadow: var(--hover-shadow);
}
.panel:hover { transform: translateY(-2px); }
.panel { background: linear-gradient(160deg, rgba(255,255,255,.99), rgba(252,255,253,.95)); border-radius: var(--radius); }
.panel + .panel { margin-top: 17px; }
.panel-pad { padding: 22px; }
.section-title { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; color: var(--ink-strong); font-size: 1.02rem; font-weight: 850; }
.section-title::before { content: ""; width: 5px; height: 18px; border-radius: 9px; background: linear-gradient(180deg, #8dbde2, #8bd0ac); flex: 0 0 auto; }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 33px 0 16px; }
.section-bar .section-title { margin: 0; }
.section-bar-tight { margin: 0 0 15px; }
.section-bar a { color: #5268bd; font-size: .84rem; font-weight: 800; }
.section-bar a:hover { color: #7387e7; text-decoration: underline; }

.stats-grid { display: grid; grid-template-columns: minmax(300px, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 15px; }
.dashboard-stats-grid { grid-template-columns: minmax(300px,1.35fr) repeat(3,minmax(0,1fr)); gap: 15px; }
.dashboard-stats-grid .stat-card { min-height: 169px; padding: 21px; }
.dashboard-stats-grid .stat-card.featured { grid-column: auto; }
.dashboard-stats-grid .stat-card:last-child { grid-column: auto; }
.dashboard-stats-grid .stat-card.featured .stat-value { font-size: clamp(2rem, 2.45vw, 3rem); }
.dashboard-stats-grid .stat-card.publisher-before { background: linear-gradient(140deg, #fff8ec, #fffdf7); border-color: #f1dfc3; }
.dashboard-stats-grid .stat-card.publisher-before .stat-icon { color: #aa762b; background: #fff0d5; }
.dashboard-stats-grid .stat-card.publisher-before .stat-value { color: #9b6621; }
.dashboard-stats-grid .stat-card.publisher-after { background: linear-gradient(140deg, #ecf8f0, #fbfffc); border-color: #c7e5d0; }
.dashboard-stats-grid .stat-card.publisher-after .stat-icon { color: #24845e; background: #dcf2e5; }
.dashboard-stats-grid .stat-card.publisher-after .stat-value { color: #20734e; }
.dashboard-income-note { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: -7px 0 16px; padding: 11px 15px; border: 1px solid #d6e3f5; border-radius: 12px; background: #f5f8ff; color: #52699e; font-size: .8rem; line-height: 1.5; }
.dashboard-income-note.error { border-color: #edc8ca; background: #fff7f7; color: #a44f55; }
.dashboard-income-note > span:not(.loading-dot) { flex-basis: 100%; font-size: .73rem; overflow-wrap: anywhere; }
.dashboard-income-note a { margin-left: auto; color: #5268bd; font-weight: 800; white-space: nowrap; }
.dashboard-income-note a:hover { color: #8292e8; text-decoration: underline; }
.dashboard-stats-grid .stat-card,
.game-grid .game-card,
.summary-grid .summary-card { transform-style: preserve-3d; backface-visibility: hidden; }
.stat-card { position: relative; min-width: 0; min-height: 155px; padding: 22px; overflow: hidden; background: #fff; border-radius: 20px; }
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #82cfa1, #93a2ee); opacity: .32; transition: opacity .3s ease, height .3s ease; }
.stat-card:hover::before { height: 4px; opacity: .85; }
.stat-card.featured { background: linear-gradient(125deg, #def5e4, #eaf7ec 62%, #edf0ff); color: var(--ink); border-color: #b8dec7; }
.stat-card.featured::after { content: ""; position: absolute; width: 200px; height: 200px; right: -66px; top: -86px; border: 38px solid rgba(124,143,225,.1); border-radius: 50%; pointer-events: none; }
.stat-card.featured:hover { border-color: var(--accent-line); outline-color: var(--accent-line); box-shadow: 0 15px 35px rgba(77, 118, 93, .17); }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 18px; border-radius: 12px; background: #e3f3e9; color: var(--green); font-weight: 900; transition: transform .32s cubic-bezier(.2,.75,.25,1), box-shadow .32s ease; }
.stat-card:hover .stat-icon { transform: translateY(-2px) rotate(-4deg); box-shadow: 0 7px 17px rgba(87, 104, 154, .1); }
.stat-card.featured .stat-icon { color: #5066bc; background: rgba(255,255,255,.78); }
.stat-card.amber .stat-icon { color: #ae6d25; background: #fff1db; }
.stat-card.blue .stat-icon { color: #3d77a5; background: #e5f1fb; }
.stat-value { color: var(--ink-strong); font-size: clamp(1.4rem, 1.6vw, 2rem); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-card.featured .stat-value { color: #205b43; font-size: clamp(2rem, 2.4vw, 3rem); }
.stat-label { margin-top: 8px; color: var(--muted); font-size: .78rem; }
.stat-card.featured .stat-label { color: #597a66; }
.rank-panel { margin-top: 19px; background: linear-gradient(145deg, #ffffff, #fbfffd 58%, #f8fbff); }
.rank-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.rank-heading .section-title { margin: 0; }
.rank-list { display: grid; gap: 11px; }
.rank-row { display: grid; grid-template-columns: 30px minmax(120px, 1.2fr) minmax(120px, 2fr) auto; gap: 12px; align-items: center; padding: 5px 8px; margin: -5px -8px; border-radius: 9px; transition: background .24s ease, transform .24s ease; }
.rank-row:hover { background: rgba(232, 245, 237, .55); transform: translateX(3px); }
.rank-position { color: #8b9aef; font-size: .76rem; font-weight: 900; }
.rank-name { color: var(--ink-strong); font-size: .84rem; font-weight: 760; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { color: #2d6951; font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-progress { width: 100%; height: 9px; border: 0; border-radius: 999px; overflow: hidden; background: #edf2ef; }
.rank-progress::-webkit-progress-bar { background: #edf2ef; border-radius: 999px; }
.rank-progress::-webkit-progress-value { background: linear-gradient(90deg, #87cfa8, #899aea); border-radius: 999px; }
.rank-progress::-moz-progress-bar { background: linear-gradient(90deg, #87cfa8, #899aea); border-radius: 999px; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.game-card { position: relative; min-width: 0; padding: 20px; overflow: hidden; background: linear-gradient(150deg, #fff, #fcfffd); border-radius: 20px; }
.game-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #7ecfa0, #7fb9cf, #8b97eb); opacity: 0; transition: opacity .28s ease; }
.game-card:hover::before { opacity: 1; }
.game-card:hover .game-glyph { background: #e8ecff; color: #5e72ce; }
.game-card-title-row { display: flex; align-items: flex-start; gap: 12px; }
.game-glyph { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; background: #e0f3e7; color: var(--green); font-weight: 900; }
.game-card-title { margin: 1px 0 4px; color: var(--ink-strong); font-size: .97rem; font-weight: 850; overflow-wrap: anywhere; }
.game-id { color: var(--soft); font-size: .73rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 999px; font-size: .72rem; line-height: 1.1; font-weight: 750; white-space: nowrap; }
.badge.active { color: #166542; background: #dcf4e4; }
.badge.inactive { color: #a45055; background: #fbe9eb; }
.badge.role { color: #3b7056; background: #e6f4e9; }
.game-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 20px; padding: 15px 0; border-top: 1px solid #edf3ee; border-bottom: 1px solid #edf3ee; }
.game-publisher-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 12px 0 1px; }
.publisher-mini-stat { display: grid; gap: 5px; min-width: 0; padding: 10px 11px; border: 1px solid #f1e6d3; border-radius: 11px; background: linear-gradient(150deg, #fffaf2, #fffdf9); }
.publisher-mini-stat:last-child { border-color: #d6e9dd; background: linear-gradient(150deg, #f1faf4, #fbfffc); }
.publisher-mini-stat span { color: #8a785b; font-size: .68rem; font-weight: 700; }
.publisher-mini-stat:last-child span { color: #638774; }
.publisher-mini-stat strong { color: #9b6621; font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.publisher-mini-stat:last-child strong { color: #20734e; }
.game-publisher-state { margin-top: 8px; color: #687ab6; font-size: .7rem; }
.metric-number { color: var(--ink-strong); font-size: .94rem; font-weight: 850; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-label { margin-top: 5px; color: var(--soft); font-size: .72rem; }
.game-sync { margin-top: 13px; color: #4f8b68; font-size: .76rem; line-height: 1.45; overflow-wrap: anywhere; }
.game-sync.error { padding: 9px 11px; border: 1px solid #f0d7d8; border-radius: 10px; background: #fff8f8; color: var(--red); }
.game-sync summary { cursor: pointer; font-weight: 750; }
.game-sync.error > div { margin-top: 7px; color: #9c555a; font-size: .71rem; font-weight: 500; line-height: 1.45; }
.game-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.game-card-actions .btn { padding: 7px 10px; font-size: .78rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 39px; padding: 9px 13px;
  border: 1px solid #c7cfee; border-radius: 10px;
  background: #fff; color: #5165b4;
  font-size: .85rem; font-weight: 750; line-height: 1.2;
  box-shadow: 0 2px 7px rgba(76, 91, 168, .05);
  transition: background .24s ease, color .24s ease, border-color .24s ease, outline-color .24s ease, box-shadow .28s cubic-bezier(.2,.75,.25,1), transform .28s cubic-bezier(.2,.75,.25,1);
}
.btn:hover {
  border-color: #8c9bf0;
  outline: 1px solid #9ca9ef;
  outline-offset: 0;
  background: #f0f2ff;
  box-shadow: 0 8px 19px rgba(87, 101, 192, .16);
}
.btn:active { box-shadow: 0 2px 7px rgba(76, 91, 168, .1); }
.btn:focus-visible, .nav-link:focus-visible { outline: 3px solid rgba(113, 129, 221, .38); outline-offset: 2px; }
.btn:disabled { cursor: wait; opacity: .62; transform: none; box-shadow: none; outline: 0; }
.btn.primary { position: relative; overflow: hidden; border-color: #6375da; background: linear-gradient(115deg, #6175df, #7989e9); color: white; }
.btn.primary::after { content: ""; position: absolute; inset: -35% auto -35% -70%; width: 45%; transform: skewX(-24deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent); transition: left .52s ease; pointer-events: none; }
.btn.primary:hover::after { left: 135%; }
.btn.primary:hover { background: linear-gradient(115deg, #7286ee, #91a0f4); border-color: #8090ee; color: white; }
.btn.success { border-color: #c1caf5; background: #e9edff; color: #4b62b8; }
.btn.success:hover { background: #dce4ff; }
.btn.danger { border-color: #efc8c9; background: #fff5f5; color: var(--red); }
.btn.danger:hover { border-color: #d58289; background: #ffebed; outline-color: #e5a2a8; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 33px; padding: 6px 10px; font-size: .78rem; }
.btn.selected { border-color: #697ce0; background: linear-gradient(115deg, #6679df, #8190ed); color: white; }
.btn.selected:hover { background: linear-gradient(115deg, #7588ed, #96a2f4); color: white; }
.field label, .field-label { display: block; margin-bottom: 8px; color: #355844; font-size: .84rem; font-weight: 750; }
.input, .select {
  display: block; width: 100%; min-height: 44px;
  border: 1px solid #c2dcc9; border-radius: 10px;
  background: #fbfefb; color: var(--ink);
  padding: 10px 12px; font-size: .87rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .22s cubic-bezier(.2,.75,.25,1);
}
.input::placeholder { color: #92a698; }
.input:hover, .select:hover { border-color: #76ba91; background: white; }
.input:focus, .select:focus { outline: 2px solid #c1c9f8; border-color: #8796e5; box-shadow: 0 6px 15px rgba(88, 109, 194, .1); background: white; }
.auth-card .input:focus { transform: translateY(-2px); box-shadow: 0 9px 19px rgba(88, 109, 194, .14); }
.help { margin-top: 7px; color: var(--soft); font-size: .76rem; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .83rem; }
.checkbox-line input, .permission-item input { accent-color: var(--accent); width: 16px; height: 16px; }

.table-wrap { overflow: auto; border: 1px solid #d8e9db; border-radius: 13px; }
table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .82rem; }
th { padding: 13px 14px; text-align: left; color: #315a43; background: #e9f5ec; font-weight: 800; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #e7efe8; color: #365447; vertical-align: middle; }
tbody tr { transition: background .17s ease; }
tbody tr:hover { background: #f1faf3; }
.table-user { color: var(--ink-strong); font-weight: 850; }
.table-sub { margin-top: 3px; color: var(--soft); font-size: .72rem; }
.table-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.table-actions .btn { min-width: 36px; padding: 6px 8px; }
.game-tags { display: flex; gap: 5px; flex-wrap: wrap; max-width: 400px; }
.game-tag { padding: 5px 8px; border-radius: 6px; color: #2e7650; background: #e9f6ed; font-size: .73rem; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 17px; color: var(--muted); font-size: .82rem; }

.realtime-workspace { display: grid; grid-template-columns: minmax(280px, 310px) minmax(0, 1fr); gap: 17px; align-items: start; }
.query-panel { position: sticky; top: 101px; }
.realtime-form { display: grid; grid-template-columns: 1fr; gap: 23px; }
.select-stack { display: grid; gap: 9px; }
.date-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.date-pills .btn { min-width: 0; padding: 8px 4px; font-size: .76rem; }
.custom-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; margin-top: 12px; }
.custom-dates .input { min-width: 0; padding-inline: 7px; font-size: .76rem; }
.realtime-footer { display: grid; gap: 15px; margin-top: 22px; padding-top: 17px; border-top: 1px solid #e9f1e9; }
.realtime-footer .btn-row { display: grid; grid-template-columns: 1fr 1fr; }
.realtime-footer .btn { min-width: 0; }
.filters { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(170px, 1fr) auto; gap: 13px; align-items: end; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.summary-card { min-width: 0; padding: 17px 13px; border-radius: 13px; background: #f2faf4; text-align: left; }
.summary-card.green { background: #e9f7ed; }
.summary-card.amber { background: #fff7e9; border-color: #f0dfc0; }
.summary-card.blue { background: #edf6fb; border-color: #cbe3ef; }
.summary-card.cyan { background: #eaf9f5; border-color: #c7e7dc; }
.summary-card .number { color: var(--green-deep); font-size: clamp(1.08rem, 1.2vw, 1.55rem); font-weight: 900; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-card.amber .number { color: #a66723; }
.summary-card.blue .number { color: #3977a2; }
.summary-card .caption { margin-top: 6px; color: #667b6e; font-size: .75rem; }
.record-id { color: #42795a; font-weight: 750; }
.record-cost { color: #1a8054; font-weight: 850; }
.record-type { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #e0f2e6; color: #267954; font-size: .73rem; font-weight: 800; }
.filter-tip { color: var(--muted); font-size: .76rem; line-height: 1.5; }
.publisher-query-grid { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(340px, 1.6fr); gap: 22px; align-items: start; }
.publisher-date-pills { grid-template-columns: repeat(5, minmax(0,1fr)); }
.publisher-custom-dates { max-width: 620px; margin-left: auto; }
.publisher-query-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 21px; padding-top: 16px; border-top: 1px solid #e9f1e9; }
.publisher-query-footer .btn-row { display: flex; gap: 8px; flex: 0 0 auto; }
.publisher-permission-note { margin-top: 12px; color: var(--soft); font-size: .74rem; line-height: 1.5; }
.publisher-progress, .publisher-complete { margin-top: 14px; padding: 12px 15px; border: 1px solid #d5e3f1; border-radius: 12px; background: #f3f8ff; color: #4965a9; font-size: .82rem; line-height: 1.5; }
.publisher-complete { border-color: #c7e5d0; background: #f1faf3; color: #397555; }
.loading-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #7889e5; animation: publisher-pulse 1s ease-in-out infinite alternate; }
@keyframes publisher-pulse { from { opacity: .35; transform: scale(.78); } to { opacity: 1; transform: scale(1.08); } }
.publisher-summary-panel, .publisher-table-panel { margin-top: 17px; }
.publisher-summary-grid { margin-top: 14px; }
.publisher-secondary-metrics { display: flex; flex-wrap: wrap; gap: 9px 25px; margin-top: 14px; color: var(--muted); font-size: .77rem; }
.publisher-secondary-metrics strong { margin-left: 4px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.publisher-table-wrap table { min-width: 1220px; }
.publisher-income { color: #a66723; font-weight: 850; white-space: nowrap; }
.publisher-income-after { color: #168458; font-weight: 850; white-space: nowrap; }
.publisher-source { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #eaf3ff; color: #4e6fb5; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.loading { padding: 35px; color: var(--muted); text-align: center; }
.inline-error { color: var(--red); font-size: .82rem; line-height: 1.4; }
.error-box { padding: 13px; border: 1px solid #edbfc1; border-radius: 11px; background: #fff1f1; color: #aa3f49; font-size: .82rem; line-height: 1.5; }
.empty-state { padding: 48px 24px; border: 1px dashed #abd5b5; border-radius: 17px; background: #f8fdf9; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink-strong); font-size: 1rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(14, 40, 23, .42); backdrop-filter: blur(4px); }
.modal { width: min(100%, 660px); max-height: min(90vh, 850px); overflow: auto; background: white; border: 1px solid #a9d0b5; border-radius: 19px; box-shadow: 0 30px 90px rgba(15, 58, 30, .22); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: #e7f6eb; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; color: var(--ink-strong); font-size: 1.05rem; }
.modal-close { border: 0; background: transparent; color: #5669b8; font-size: 1.45rem; line-height: 1; }
.modal-close:hover { color: #8293e9; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--line); }
.permission-list { max-height: 220px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f7fcf8; }
.permission-item { display: flex; align-items: center; gap: 9px; padding: 7px 4px; color: var(--ink); font-size: .84rem; }
.permission-item:hover { background: #edf8ef; border-radius: 6px; }

#toast { position: fixed; z-index: 80; right: 23px; bottom: 22px; display: grid; gap: 8px; max-width: min(390px, calc(100vw - 40px)); }
.toast-item { padding: 13px 16px; border: 1px solid #a2d3ae; border-radius: 11px; background: #ecf9ef; color: #1e6745; box-shadow: var(--hover-shadow); font-size: .85rem; }
.toast-item.error { border-color: #e2afb4; background: #fff0f1; color: #a9434d; }

@media (max-width: 1240px) {
  .header-inner { grid-template-columns: 1fr; row-gap: 10px; }
  .header-links { grid-row: 2; grid-column: 1; width: 100%; }
  .nav { justify-content: flex-start; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-card.featured { grid-column: span 2; }
  .stat-card:last-child { grid-column: span 2; }
  .realtime-workspace { grid-template-columns: minmax(250px, 285px) minmax(0,1fr); }
  .query-panel { top: 142px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .btn-row { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .realtime-workspace { grid-template-columns: 1fr; }
  .query-panel { position: static; }
  .realtime-form { grid-template-columns: minmax(220px,1fr) minmax(0,1.4fr); }
  .realtime-footer { display: flex; justify-content: space-between; align-items: center; }
  .date-pills { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .publisher-query-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr auto; min-height: 70px; }
  .menu-toggle { display: inline-flex !important; grid-column: 2; grid-row: 1; }
  .header-links { display: none; }
  .header-account { display: flex; justify-content: space-between; gap: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
  .header-account .current-user { display: flex; }
  .sidebar-actions .btn { padding: 9px 11px; font-size: .82rem; }
  .nav { display: grid; gap: 4px; }
  body.nav-open { overflow: hidden; }
  body.nav-open .mobile-overlay { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(15, 39, 22, .22); }
  body.nav-open .header-links {
    display: grid;
    position: fixed; top: 76px; left: 14px; right: 14px; z-index: 40;
    width: auto; max-height: calc(100vh - 92px); overflow-y: auto;
    padding: 14px; background: #fff;
    border: 1px solid #c5d1f5; border-radius: 17px;
    box-shadow: 0 20px 48px rgba(62, 82, 135, .2);
  }
  body.nav-open .nav { display: grid; }
  .nav-link { width: 100%; }
  .main { padding: 27px 17px calc(55px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; align-items: stretch; gap: 13px; }
  .head-actions { justify-content: flex-start; }
  .realtime-form { grid-template-columns: 1fr; }
  .realtime-footer { display: grid; }
  .publisher-query-footer { display: grid; }
  .publisher-query-footer .btn-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .publisher-date-pills { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .dashboard-stats-grid .stat-card.featured,
  .dashboard-stats-grid .stat-card:last-child { grid-column: 1 / -1; }
  .rank-row { grid-template-columns: 27px minmax(0,1fr) auto; row-gap: 6px; }
  .rank-progress { grid-column: 2 / -1; grid-row: 2; }
  .stat-card.featured { grid-column: span 2; }
  .stat-card:last-child { grid-column: span 1; }
  .filters { grid-template-columns: 1fr; }
  .filters .btn-row { grid-column: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .btn.small { min-height: 42px; font-size: .88rem; }
  .date-pills .btn { min-height: 44px; font-size: .88rem; }
  .game-card-actions .btn { flex: 1 1 40%; }
  .pagination { justify-content: center; flex-wrap: wrap; }
  .mobile-cards { overflow: visible; border: 0; border-radius: 0; }
  .mobile-cards table { display: block; min-width: 0; font-size: .9rem; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody { display: grid; gap: 12px; }
  .mobile-cards tbody tr {
    display: grid; padding: 13px 15px;
    border: 1px solid var(--line); border-radius: 15px;
    background: #fff; box-shadow: 0 6px 18px rgba(38, 85, 58, .06);
  }
  .mobile-cards tbody tr:hover { background: #f9fcff; border-color: var(--accent-line); }
  .mobile-cards td {
    display: grid; grid-template-columns: minmax(100px, 35%) minmax(0,1fr);
    gap: 8px; align-items: start;
    padding: 7px 0; border: 0;
    overflow-wrap: anywhere; white-space: normal;
  }
  .mobile-cards td::before { content: attr(data-label); color: var(--soft); font-size: .76rem; font-weight: 750; }
  .mobile-cards td:first-child { display: block; padding-bottom: 11px; margin-bottom: 5px; border-bottom: 1px solid #edf2ee; }
  .mobile-cards td:first-child::before { display: block; margin-bottom: 4px; }
  .mobile-cards td:last-child { padding-top: 12px; margin-top: 6px; border-top: 1px solid #edf2ee; }
  .mobile-cards td[data-label="操作"] { display: block; }
  .mobile-cards td[data-label="操作"]::before { display: block; margin-bottom: 9px; }
  .mobile-cards .table-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .mobile-cards .table-actions .btn { min-height: 40px; }
  .mobile-cards .game-tags { max-width: none; }
  .mobile-cards .record-id { color: #5167c1; font-size: .92rem; }
}
@media (max-width: 480px) {
  .brand { font-size: .88rem; }
  .brand small { font-size: .62rem; }
  .brand-mark { width: 33px; height: 33px; }
  .menu-toggle { min-height: 34px; padding: 6px 8px; font-size: .72rem; }
  .page-title { font-size: 1.55rem; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 135px; padding: 16px; }
  .stat-card.featured { min-height: 150px; }
  .dashboard-stats-grid .stat-card { min-height: 124px; padding: 14px; }
  .dashboard-stats-grid .stat-card.featured { min-height: 150px; }
  .dashboard-stats-grid .stat-card.featured .stat-value { font-size: 1.75rem; }
  .summary-grid { gap: 8px; }
  .summary-card { padding: 14px 10px; }
  .game-grid { grid-template-columns: 1fr; }
  .panel-pad { padding: 17px; }
  .date-pills { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .custom-dates { grid-template-columns: 1fr; }
  .custom-dates span { display: none; }
  .modal-body { padding: 17px; }
  .mobile-cards td { grid-template-columns: minmax(88px, 34%) minmax(0,1fr); }
}
@media (hover: none) {
  .btn:hover, .panel:hover, .stat-card:hover, .game-card:hover, .summary-card:hover {
    transform: none;
  }
  .btn:active { transform: scale(.985); }
  .stat-card:active, .game-card:active, .summary-card:active {
    transform: translateY(-2px) scale(.998);
    border-color: var(--accent-line);
    box-shadow: var(--hover-shadow);
    transition-duration: .14s;
  }
  .rank-row:hover, .stat-card:hover .stat-icon { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .panel:hover, .btn:active, .stat-card:active, .game-card:active, .summary-card:active,
  .auth-card .input:focus { transform: none !important; }
}
