/* 后台独立样式；在共用业务样式后加载，不改变玩家站点。 */
:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 14px; line-height: 1.6;
  color: #263445; background: #f3f5f8;
  --bg: #f3f5f8; --surface: #ffffff; --panel: #ffffff;
  --border: #e4e8ef; --line: #e4e8ef; --muted: #66758a;
  --accent: #2563b9; --ink: #263445; --text: #263445; --sidebar: 208px; --header-height: 52px; --primary: #2864ad; --red: #b42332; --blue: #2864ad; --panel2: #f5f7fa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { min-height: 34px; border: 1px solid transparent; background: #2864ad; color: #fff; border-radius: 4px; padding: 6px 14px; cursor: pointer; line-height: 1.5; }
button:hover { background: #20538f; }
button:disabled { opacity: .45; cursor: default; }
:where(button,a,input,select,textarea,summary):focus-visible { outline: 2px solid #2463ad; outline-offset: 3px; }
a { color: #2463ad; }
.secondary { background: #f5f7fa; border-color: #d9e0e9; color: #43536a; }
.secondary:hover { background: #eaf0f8; }
.danger { background: #fff1f0; color: #b42332; border-color: #f0bdc2; }
.muted, small, .subtle { color: var(--muted); }
.error, .bad { color: #b42332; }
.good { color: #147d55; }
h1 { font-size: 22px; line-height: 1.3; margin: 4px 0; }
h2 { font-size: 19px; line-height: 1.4; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 12px; }
p { margin: 0 0 18px; }
label { display: flex; flex-direction: column; gap: 7px; color: #475569; font-size: 14px; }
input, select, textarea { min-width: 0; width: 100%; min-height: 36px; border: 1px solid #d5dde7; border-radius: 4px; background: #fff; color: #263445; padding: 6px 10px; }
input::placeholder, textarea::placeholder { color: #8a96a6; }
input[type=checkbox] { width: 18px; min-height: 18px; accent-color: #2864ad; }
textarea { resize: vertical; }
/* 混合导航：固定蓝色顶栏、分组侧栏、可横向滚动的工作标签。 */
.topbar { height:var(--header-height); position:sticky; top:0; z-index:40; display:flex; align-items:center; background:#2860a2; color:#fff; gap:8px; padding:0 16px 0 20px; }
.topbar-start, .topbar-end { display:flex; align-items:center; gap:10px; flex-shrink:0; min-width:0; }
.topbar-start { width:180px; }
.console-brand { font-weight:750; color:#fff; text-decoration:none; white-space:nowrap; letter-spacing:.3px; }
.topbar button { white-space:nowrap; }
.topbar .secondary, .header-button { background:transparent; border-color:#ffffff40; color:#fff; padding:4px 8px; font-size:12px; }
.topbar .secondary:hover, .header-button:hover { background:#ffffff20; }
#toggle-nav { display:flex; align-items:center; justify-content:center; padding:6px; border:0; }
#toggle-nav svg { width:18px; height:18px; }
#primary-nav { display:flex; align-items:stretch; align-self:stretch; flex:1; min-width:0; overflow:auto; scrollbar-width:thin; scrollbar-color:#ffffff60 transparent; }
#primary-nav button { display:flex; align-items:center; gap:6px; background:transparent; color:#e4edfa; border-radius:0; border:0; border-bottom:3px solid transparent; padding:0 12px; font-size:13px; flex-shrink:0; }
#primary-nav button:hover { background:#ffffff12; }
#primary-nav button.active { background:#ffffff16; color:#fff; border-bottom-color:#b8d9ff; }
#primary-nav svg { width:16px; height:16px; }
#identity { color:#fff; font-size:12px; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* 全局数据范围与账户相邻但保持分组间距。 */
.topbar-end { gap:24px; }
.account-menu { position:relative; min-width:0; }
.account-menu summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:4px 8px; border-radius:4px; color:#fff; cursor:pointer; list-style:none; }
.account-menu summary::-webkit-details-marker { display:none; }
.account-menu summary:hover, .account-menu[open] summary { background:#ffffff18; }
.account-menu summary:focus-visible { outline:2px solid #fff; outline-offset:-2px; }
.account-menu summary svg { width:16px; height:16px; flex-shrink:0; }
.account-menu[open] summary > svg { transform:rotate(180deg); }
.account-avatar { display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#ffffff20; }
.account-panel { position:absolute; top:calc(100% + 4px); right:0; width:248px; max-width:calc(100vw - 24px); padding:6px; border:1px solid var(--border); border-radius:6px; background:#fff; color:#263445; box-shadow:0 8px 24px #152b4826; }
.account-info { display:flex; flex-direction:column; gap:6px; padding:10px 12px 14px; overflow-wrap:anywhere; }
.account-info strong { font-size:14px; }
.account-info > span { font-size:12px; color:var(--muted); }
.account-actions { display:flex; flex-direction:column; gap:2px; padding-top:6px; border-top:1px solid var(--border); }
.topbar .account-actions .secondary { display:flex; align-items:center; gap:10px; width:100%; min-height:40px; text-align:left; padding:8px 12px; color:#43536a; background:transparent; border:0; font-size:13px; }
.topbar .account-actions .secondary:hover { background:#edf3fa; }
.account-actions svg { width:16px; height:16px; }
#sidebar { position:fixed; inset:var(--header-height) auto 0 0; width:var(--sidebar); background:#2e4055; color:#d7e0eb; z-index:30; display:flex; flex-direction:column; }
.sidebar-heading { display:flex; flex-direction:column; padding:20px 20px 16px; border-bottom:1px solid #ffffff12; }
.sidebar-heading span { font-size:15px; font-weight:600; color:#fff; }
.sidebar-heading small { color:#aab9cb; font-size:11px; margin-top:3px; }
#nav { flex:1; min-height:0; overflow-y:auto; padding:12px 0; scrollbar-width:thin; scrollbar-color:#64788e #2e4055; }
.nav-items { display:grid; gap:2px; }
.nav-items button { display:flex; align-items:center; gap:12px; text-align:left; padding:10px 20px; min-height:42px; border:0; border-radius:0; background:transparent; color:#d7e0eb; font-size:14px; }
.nav-items button:hover { background:#ffffff0c; }
.nav-items button.active { color:#fff; background:#ffffff12; box-shadow:inset 3px 0 #6eb4ff; }
.nav-items svg { width:17px; height:17px; flex-shrink:0; opacity:.8; }
.aside-bottom { border-top:1px solid #ffffff16; padding:16px 20px; text-decoration:none; color:#c6d6e9; font-size:12px; white-space:nowrap; overflow:hidden; }
.workspace-tabs { margin-left:var(--sidebar); display:flex; align-items:center; gap:8px; background:#fff; border-bottom:1px solid var(--border); height:40px; padding:0 12px; position:sticky; top:var(--header-height); z-index:20; }
#page-tabs { display:flex; gap:4px; overflow:auto; flex:1; min-width:0; scrollbar-width:thin; }
.page-tab { display:flex; flex-shrink:0; align-items:center; border:1px solid var(--border); border-radius:3px; height:28px; }
.page-tab button { background:transparent; color:var(--muted); border:0; border-radius:0; min-height:26px; padding:2px 10px; font-size:12px; white-space:nowrap; }
.page-tab button[data-close-page] { padding:2px 7px; font-size:16px; }
.page-tab.active { background:#edf4ff; border-color:#b7d2f3; }
.page-tab.active button { color:#2463ad; }
.page-tab button:hover { background:#e7eef8; }
#close-other-tabs { min-height:26px; padding:2px 8px; font-size:12px; white-space:nowrap; }
.workspace-heading { margin-left:var(--sidebar); padding:16px 20px 12px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.workspace-heading > div { display:flex; flex-direction:column; gap:2px; }
#breadcrumb { font-size:12px; color:var(--muted); }
#title { font-size:20px; margin:0; font-weight:600; }
#scope-badge { color:var(--muted); font-size:12px; padding:4px 10px; border:1px solid var(--border); border-radius:4px; background:#fff; overflow-wrap:anywhere; }
main { margin-left:var(--sidebar); padding:0 20px 32px; min-width:0; }
.brand { display:flex; gap:10px; font-weight:700; }
/* 页面直接承载内容；指标、表格和弹窗保留各自必要的视觉分区。 */
.page-section { min-width:0; margin-bottom:20px; padding:20px; background:#fff; border:1px solid var(--border); border-radius:5px; }
.table-wrap:has(> .empty) { border: 0; border-radius: 0; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 20px; min-width: 0; }
.stat strong { display: block; font-size: clamp(24px,2.3vw,34px); font-weight: 600; line-height: 1.4; margin-top: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; }
.stats > p { grid-column: 1/-1; font-size: 13px; }
.filters, .center-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px 12px; padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--border); }
.filters label, .center-filters label { flex: 1 1 150px; margin: 0; font-size: 14px; }
.filters label:first-child, .center-filters label:first-child { flex-grow: 2; }
.filters input, .center-filters input, .center-filters select { margin: 0; }
.filters .checkbox { flex: 0 0 auto; flex-direction: row; align-items: center; min-height: 36px; }
#record-note { font-size: 13px; margin-bottom: 16px; }
.table-wrap { overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 5px; scrollbar-width: thin; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; font-size: 14px; }
td, th { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
th { color: #536176; background: #f5f7fa; font-size: 13px; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f5f9ff; }
.link, .row-link { background: transparent; padding: 6px 0; color: #2463ad; min-height: 32px; }
.link:hover, .row-link:hover { background: transparent; text-decoration: underline; }
.pagination, .center-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin: 20px 0 0; font-size: 13px; }
.pill, .badge { display: inline-block; padding: 3px 9px; background: #edf4ff; border-radius: 5px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 64px 20px; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top,#dce9f9 0,transparent 65%); }
.login-card { width: min(440px,100%); padding: 36px; background: var(--surface); border: 1px solid #d9e0e9; border-radius: 16px; box-shadow: 0 24px 80px #0004; }
.login-card h1 { margin: 28px 0 10px; }
.login-card p { font-size: 14px; }
.login-card label { margin: 22px 0; }
.login-card > button { width: 100%; }
.login-card > a { display: block; text-align: center; margin-top: 22px; font-size: 14px; }
#notice { position: fixed; z-index: 100; top: 18px; left: 50%; transform: translateX(-50%); max-width: 90vw; background: #fff; border: 1px solid #2864ad; padding: 14px 22px; border-radius: 9px; white-space: pre-wrap; box-shadow: 0 8px 24px #0005; }
/* 表单与确认居中；详情统一右侧抽屉，共用标题、遮罩和控件。 */
dialog, dialog.admin-dialog { background:var(--surface); color:var(--ink); border:1px solid var(--border); border-radius:8px; width:min(600px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 48px); height:fit-content; margin:auto; padding:0 24px 24px; box-shadow:0 18px 64px #14263d38; overflow:auto; overscroll-behavior:contain; }
dialog::backdrop, dialog.admin-dialog::backdrop { background:#13243d80; }
body:has(dialog[open]) { overflow:hidden; }
dialog.center-dialog, dialog.access-dialog { width:min(840px,calc(100vw - 32px)); }
dialog.admin-confirm { width:min(440px,calc(100vw - 32px)); }
.dialog-header, .center-dialog .dialog-header { position:sticky; top:0; display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:64px; background:var(--surface); border-bottom:1px solid var(--border); padding:12px 0; margin:0 0 20px; z-index:2; }
.dialog-header h2 { margin:0; font-size:17px; font-weight:600; overflow-wrap:anywhere; }
.dialog-header button.admin-dialog-close { display:flex; align-items:center; justify-content:center; flex-shrink:0; width:36px; height:36px; min-height:36px; padding:0; border:0; background:transparent; color:var(--muted); font-size:26px; font-weight:400; }
.dialog-header button.admin-dialog-close:hover { background:#edf2f8; color:#263445; }
dialog .dialog-actions { display:flex; justify-content:flex-end; gap:10px; border-top:1px solid var(--border); padding-top:16px; margin-top:24px; }
dialog form > button[type=submit] { display:block; margin:20px 0 0 auto; }
dialog .confirm-message { line-height:1.7; white-space:pre-wrap; overflow-wrap:anywhere; margin:0; }
dialog[open] { animation:admin-dialog-in 140ms ease-out; }
/* 详情保留列表上下文；手机占满可用宽度，避免窄字段再被双侧边距挤压。 */
dialog.admin-dialog.admin-drawer { inset:0 0 0 auto; width:min(760px,100%); max-width:100%; height:100dvh; max-height:100dvh; margin:0 0 0 auto; border-radius:0; border-width:0 0 0 1px; padding:0 24px 24px; }
dialog.admin-drawer[open] { animation:admin-drawer-in 160ms ease-out; }
.admin-drawer > h3 { margin:24px 0 12px; font-size:14px; }
.admin-drawer .management-details { grid-template-columns:150px minmax(0,1fr); gap:0 20px; margin:0 0 24px; }
.admin-drawer .management-details > * { padding:10px 0; border-bottom:1px solid var(--border); font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; }
dialog.admin-drawer .detail-grid > div, dialog.admin-drawer .detail-list > div { gap:20px; padding:10px 0; font-size:13px; }
.admin-drawer .detail-section { margin-top:24px; padding-top:20px; }
.admin-drawer form { border-top:1px solid var(--border); padding-top:20px; margin-top:20px; }
.admin-drawer form > .actions, .admin-drawer form > .management-actions { justify-content:flex-end; position:sticky; bottom:-24px; padding:16px 0; background:var(--surface); border-top:1px solid var(--border); }
.admin-drawer .message-body, .admin-drawer .ticket-meta { overflow-wrap:anywhere; }
.permission-detail-list { padding:0; list-style:none; }
.permission-detail-list li { padding:10px 0; border-bottom:1px solid var(--border); }
@keyframes admin-dialog-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@keyframes admin-drawer-in { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:translateX(0); } }
@media(prefers-reduced-motion:reduce) { dialog[open], dialog.admin-drawer[open] { animation:none; } }
.detail-grid { display: grid; grid-template-columns: 1fr; margin: 0 0 24px; }
.detail-grid > div, .detail-list > div, .center-dialog .detail-list > div { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.detail-grid strong { font-weight: 500; overflow-wrap: anywhere; }
.detail-list { margin: 0 0 24px; }
.detail-list dt { color: var(--muted); }
.detail-list dd, .center-dialog .detail-list dd { margin: 0; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-section { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 28px; }
dialog label, .center-dialog label { font-size: 14px; margin-bottom: 18px; }
dialog p, .center-dialog p { font-size: 14px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 4px; max-height: 55vh; overflow: auto; font-size: 13px; }
.raw-record { border-top: 1px solid var(--border); padding: 16px 0; }
.raw-record summary { cursor: pointer; color: #2463ad; font-size: 14px; }
#backdrop { position: fixed; inset: 0; background: #0008; z-index: 29; border: 0; border-radius: 0; }
#game-form > label, #admin-password-form > label { margin: 20px 0; }
#currency-rates > input { max-width: 360px; margin: 4px 0 22px; }
#currency-rates table input:not([type=checkbox]) { min-width: 150px; }
#currency-rates table td:first-child { min-width: 160px; }
#activity-settings .filters, .withdraw-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 860px; align-items: end; }
#activity-settings .filters button, .withdraw-settings button { justify-self: start; }
#withdrawal-settings > h2:not(:first-child) { margin-top: 30px; }
.withdraw-summary .stat { background: #fff; padding: 18px; }
.withdraw-summary .stat strong { font-size: 24px; }
#community .center-toolbar { margin: 0 0 22px; justify-content: flex-end; }
.center-dialog .form-row { display: flex; flex-wrap: wrap; gap: 16px; }
.center-dialog .form-row > label { flex: 1 1 180px; }
.cell-number { text-align: right; }
.cell-description { min-width: 200px; max-width: 320px; white-space: normal; overflow-wrap: anywhere; }

/* 用户统计沿用后台字体与表格，图表不挤压窄屏内容。 */
#user-analytics { min-width:0; }
.analytics-section { margin-top:28px; border-top:1px solid var(--border, #2c3d50); padding-top:20px; }
.user-trend { display:block; width:100%; min-height:180px; max-height:300px; color:#64748b; }
.user-trend text { fill:currentColor; font:14px sans-serif; }
.trend-legend { display:flex; gap:24px; flex-wrap:wrap; }
.trend-legend span:first-child { color:#2864ad; }
.trend-legend span:last-child { color:#168164; }
#user-analytics .table-wrap { overflow-x:auto; }
#user-analytics td, #user-analytics th { white-space:nowrap; }
#user-analytics .warning { border-left:3px solid #c18822; padding:10px 14px; color:#8c6419; }

.trend-scroll { overflow-x:auto; }
.trend-scroll .user-trend { min-width:640px; }


.registration-currency { margin-bottom: 28px; }
.registration-currency h2 { font-size: 17px; margin: 0 0 16px; }
.registration-currency .filters { align-items: end; }
.registration-currency .filters [hidden] { display: none; }
.registration-currency .muted { margin-top: 10px; }
/* 托管设置复用原后台表单与按钮，仅增加局部排版。 */
.hosting-card{padding:24px;border:1px solid var(--border,#e5e7eb);border-radius:10px;background:var(--surface);margin-bottom:20px;min-width:0}.hosting-card h2{margin:0 0 16px;font-size:18px}.hosting-card label{display:grid;gap:8px;max-width:480px;margin:16px 0}.hosting-card input{width:100%;min-width:0}.hosting-copy{display:grid;grid-template-columns:100px minmax(0,1fr) auto;gap:12px;align-items:center;padding:10px 0}.hosting-copy code{overflow-wrap:anywhere;white-space:normal}.hosting-add{display:flex;gap:12px;align-items:center;margin:16px 0;max-width:640px}.hosting-domain{border-top:1px solid var(--border);margin-top:20px;padding-top:16px}.hosting-domain summary{cursor:pointer;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.hosting-domain summary span{font-size:13px;color:var(--muted)}@media(max-width:640px){.hosting-card{padding:16px}.hosting-copy{grid-template-columns:minmax(0,1fr) auto}.hosting-copy>span{grid-column:1/-1}.hosting-add{flex-wrap:wrap}}

.hosting-add button{flex-shrink:0;white-space:nowrap}.hosting-add input{flex:1;min-width:160px}

/* 账号与权限沿用工作台表格、按钮和弹窗，避免另一套管理界面。 */
#scope-control { display:flex; flex-direction:row; align-items:center; gap:8px; white-space:nowrap; font-size:12px; }
#scope-control select { appearance:none; width:210px; height:36px; min-height:36px; max-width:210px; padding:4px 30px 4px 8px; font-size:12px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23263445' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; }
#scope-control { color:#e2edfc; }
.access-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:24px; }
.access-heading h2 { margin:0 0 8px; }
.access-heading p { margin:0; }

.access-form { display:grid; gap:14px; }
.access-form label { display:grid; gap:8px; }
.access-form input[type=checkbox], .permission-matrix input { width:18px; height:18px; accent-color:var(--primary,#2563eb); }
.permission-matrix { max-height:32vh; overflow:auto; border:1px solid var(--border); border-radius:8px; }
.permission-matrix th { position:sticky; top:0; background:var(--surface); }
.permission-matrix tbody th { position:static; font-weight:500; }
.access-secondary { margin-top:24px; padding-top:18px; border-top:1px solid var(--border); }
#access td button { margin:3px; }
.global-tabs { display:flex; overflow:auto; gap:4px; margin:20px 0; border-bottom:1px solid var(--border); padding-bottom:0; }
.global-tabs button { white-space:nowrap; border:0; border-radius:0; background:transparent; border-bottom:2px solid transparent; padding:10px 14px; }
.global-tabs [aria-current=page] { background:transparent; color:#2463ad; border-bottom-color:var(--accent); font-weight:600; }
#global .stats { margin:18px 0 24px; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
#global .stat { display:grid; gap:12px; padding:20px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
#global .stat strong { font-size:24px; }
#global .stat span { color:var(--muted); font-size:13px; }
#global td { max-width:360px; overflow-wrap:anywhere; }
@media(max-width:900px) { #identity { max-width:180px; overflow:hidden; text-overflow:ellipsis; } #scope-control select { max-width:170px; } .access-heading { flex-wrap:wrap; } }

/* 按内容选择表达方式：数据表紧凑，配置表单限宽，分析分区保持独立。 */
#global, #platform, #user-analytics { background:transparent; padding:0; border:0; }
#global > .filters, #user-analytics > .filters { background:#fff; padding:16px; border:1px solid var(--border); border-radius:5px; }
#global .table-wrap, #global .global-tabs { background:#fff; }
#global .stats { grid-template-columns:repeat(5,minmax(0,1fr)); }
#global .stat { gap:0; border-radius:5px; padding:18px; }
#global .stat strong { margin-top:10px; }
#global > .muted { font-size:12px; }
#global td.cell-description { white-space:normal; }
.hosting-card { padding:20px; border-radius:5px; }
.hosting-copy { background:#f7f9fc; padding:10px 12px; border-radius:4px; margin:8px 0; }
#platform .hosting-card:not(.hosting-profile):first-child { max-width:none; }
#platform .hosting-card:not(.hosting-profile) label { max-width:440px; }
.settings-form { display:grid; gap:20px; max-width:560px; }
.settings-form label { gap:6px; }
.settings-form small { font-size:12px; font-weight:400; }
.settings-form button { justify-self:start; }
.settings-help { max-width:760px; color:var(--muted); margin-top:24px; padding-top:16px; border-top:1px solid var(--border); font-size:13px; }
.settings-help summary { cursor:pointer; color:var(--accent); }
.settings-help p { margin:12px 0 0; }
#currency-rates .registration-currency { border-bottom:1px solid var(--border); padding-bottom:4px; }
#currency-rates table input:not([type=checkbox]) { max-width:220px; }
#currency-rates td:nth-child(4), #currency-rates th:nth-child(4) { text-align:right; }
.withdraw-settings { max-width:700px; }
.withdraw-settings button { grid-column:1/-1; }
.analytics-section { background:#fff; border:1px solid var(--border); padding:20px; border-radius:5px; margin-top:16px; }
#user-analytics .warning { background:#fffbef; border-radius:4px; font-size:12px; }
#user-analytics .stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
#user-analytics .stat strong { font-size:26px; }
#access .access-heading h2 { display:none; }
.access-heading { align-items:center; gap:16px; margin-bottom:20px; }
.access-heading > button { flex-shrink:0; }
.access-heading p { font-size:13px; }
.permission-matrix { max-height:40vh; }
.permission-matrix td, .permission-matrix th { padding:8px 14px; }
.permission-matrix td { text-align:center; }
.permission-matrix thead th:not(:first-child) { text-align:center; }
#access td button, #global td button { color:var(--accent); background:transparent; border:0; padding:3px 8px; min-height:28px; }
.status-tag { display:inline-block; padding:1px 7px; border-radius:3px; background:#edf4ff; color:#2463ad; font-size:12px; }
.status-tag.good { background:#eaf7f0; color:#147d55; }
.status-tag.bad { background:#fff0f0; color:#b42332; }
.center-filters button { height:36px; }
.center-filters input, .center-filters select { min-height:36px; }
.center-dialog .warning, .center-warning { color:#835b14; background:#fffbef; }
.center-dialog .timeline-item { background:#f7f9fc; }
@media(min-width:801px) {
  .nav-collapsed { --sidebar:64px; }
  .nav-collapsed .sidebar-heading, .nav-collapsed .nav-items span, .nav-collapsed .aside-bottom { display:none; }
  .nav-collapsed .nav-items button { justify-content:center; padding:12px; }
}
@media(max-width:1250px) {
  :root { --header-height:94px; }
  .topbar { display:grid; grid-template-columns:190px minmax(0,1fr); grid-template-rows:52px 42px; gap:0; }
  #primary-nav { grid-column:1/-1; grid-row:2; }
  .topbar-end { justify-content:flex-end; }
  #global .stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:800px) {
  #sidebar { transform:translateX(-100%); width:228px; }
  .nav-open #sidebar { transform:translateX(0); }
  main, .workspace-heading, .workspace-tabs { margin-left:0; }
  main { padding:0 14px 24px; }
  .workspace-heading { padding:14px; }
  #identity { max-width:100px; }
  #user-analytics .stats, .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:540px) {
  :root { --header-height:132px; }
  .topbar { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:44px 44px 44px; padding:0 12px; }
  body:has(#scope-control[hidden]) { --header-height:88px; }
  body:has(#scope-control[hidden]) .topbar { grid-template-rows:44px 44px; }
  body:has(#scope-control[hidden]) .topbar-end { grid-row:1; grid-column:2; }
  body:has(#scope-control[hidden]) #primary-nav { grid-row:2; }
  .topbar-start { width:auto; gap:8px; }
  .topbar-end { grid-row:2; grid-column:1/-1; justify-content:flex-end; gap:24px; }
  #primary-nav { grid-row:3; }
  #primary-nav button { padding:0 12px; }
  #scope-control { min-width:0; }
  #scope-control { flex-direction:row; align-items:center; gap:8px; }
  #scope-control select { width:132px; min-width:0; }
  .account-menu #identity { display:none; }
  .workspace-heading { align-items:flex-start; }
  #scope-badge { max-width:50%; font-size:11px; }
  #title { font-size:18px; }
  .page-section, .analytics-section, .hosting-card { padding:16px; }
  .stats, #global .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .stat, #global .stat { padding:14px; }
  .stat strong, #global .stat strong { font-size:23px; }
  .stat span { font-size:12px; }
  .filters, .center-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .filters label, .center-filters label { min-width:0; grid-column:1/-1; }
  .filters label:has(input[type=date]), .center-filters label:has(input[type=date]) { grid-column:auto; }
  .withdraw-settings { grid-template-columns:1fr; }
  dialog, dialog.admin-dialog { padding:0 16px 20px; max-height:calc(100dvh - 24px); }
  dialog.admin-dialog.admin-drawer { padding:0 16px 20px; }
  .admin-drawer .management-details { grid-template-columns:100px minmax(0,1fr); gap:0 10px; }
  dialog.admin-drawer .detail-grid > div, dialog.admin-drawer .detail-list > div { grid-template-columns:100px minmax(0,1fr); gap:10px; }
  .admin-drawer .management-details dd { margin-bottom:0; }
  .admin-drawer form > .actions, .admin-drawer form > .management-actions { bottom:-20px; }
  .detail-grid > div, .detail-list > div, .center-dialog .detail-list > div { grid-template-columns:100px minmax(0,1fr); gap:10px; }
  .access-heading { flex-wrap:wrap; }
  .pagination, .center-pagination { gap:8px; justify-content:space-between; }
}
@media(prefers-reduced-motion:no-preference) { #sidebar { transition:transform .18s ease; } }

/* 长汇率列表内部滚动，表头保持可见；行内保存采用次级按钮避免满屏主操作。 */
#currency-rates > .table-wrap { max-height:65vh; }
#currency-rates thead th { position:sticky; top:0; z-index:1; }


.access-form { gap:14px; }
.access-form label { margin:0; gap:6px; }
.access-form label:has(> input[type=checkbox]) { display:flex; flex-direction:row-reverse; justify-content:flex-end; align-items:center; }
.access-form .permission-matrix { max-height:32vh; }
.access-form > p { margin:0; font-size:12px; }
.access-form > button { justify-self:end; }
.center-dialog textarea { background:#fff; border-radius:4px; }

/* 记录页保留分页在表格外，长列表不把页脚推到数屏之后。 */
#records .table-wrap, #community .table-wrap { max-height:62vh; }
#records thead th, #community thead th { position:sticky; top:0; z-index:1; }
#community .center-filters button[type=submit] { background:var(--primary); color:#fff; border-color:var(--primary); }
/* 官方合作商管理沿用查询表格与分区表单，不嵌入内部后台或重复维护身份。 */
#management { background:#fff; padding:20px; border:1px solid var(--border); border-radius:5px; }
.management-filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; padding:16px 0; }
.management-filters label { display:grid; gap:6px; min-width:150px; }
.management-actions { display:flex; gap:8px; flex-wrap:wrap; }
.management-details { display:grid; grid-template-columns:140px minmax(0,1fr); gap:12px; margin:20px 0; }
.management-details dt { color:var(--muted); }.management-details dd { margin:0; overflow-wrap:anywhere; }
.management-form { display:grid; gap:16px; max-width:600px; margin-top:20px; }
.management-form label { display:grid; gap:8px; }
.management-badge { padding:4px 8px; border-radius:4px; background:#f1f4f8; white-space:nowrap; }
.management-badge.success { color:#147d55; background:#eaf7f0; }.management-badge.warning { color:#8c6419; background:#fffbef; }
#management .table-wrap { max-height:60vh; overflow:auto; } #management table { min-width:760px; }
@media(max-width:760px){#management{padding:14px}.management-filters label{flex:1;min-width:130px}.management-details{grid-template-columns:1fr;gap:6px}.management-details dd{margin-bottom:10px}}

/* 登录卡片内置本地拼图，图片同比缩放，触屏拖动不会触发页面滚动。 */
.admin-verification[hidden],#login-form[hidden]{display:none!important}
.admin-verification .captcha-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}
.admin-verification .captcha-refresh{width:auto;padding:6px 10px;margin:0;background:transparent;color:#2563eb}
.admin-verification .captcha-picture{position:relative;width:100%;aspect-ratio:2;overflow:hidden;border-radius:8px;background:#d9e5ed}
.admin-verification .captcha-background{display:block;width:100%;height:100%}
.admin-verification .captcha-piece{position:absolute;width:15.625%;height:31.25%;filter:drop-shadow(0 0 2px #fff);pointer-events:none}
.admin-verification .captcha-slider{display:block;width:100%;height:40px;padding:0;margin:8px 0;cursor:ew-resize;accent-color:#2563eb;touch-action:none}
.admin-verification .captcha-status{font-size:12px;color:#64748b;min-height:18px}
.admin-verification .verify-back{width:100%}

/* 密码重置只有账号、影响与操作，不继承复杂管理表单的宽度和网格留白。 */
dialog.password-reset-dialog { width:min(520px,calc(100vw - 32px)); }
dialog:focus { outline:none; }
.password-reset-form { margin:0; }
.reset-account { display:grid; gap:6px; margin-bottom:20px; }
.reset-account span { font-size:12px; }
.reset-account strong { font-size:14px; font-weight:500; overflow-wrap:anywhere; }
.reset-impact { padding:14px 16px; border:1px solid var(--border); border-radius:4px; background:#f7f9fc; }
.reset-impact strong { display:block; font-size:13px; margin-bottom:8px; }
.reset-impact p { margin:0; font-size:13px; line-height:1.7; }
.reset-impact p + p { margin-top:8px; }
.password-reset-form > .error:empty { display:none; }
.password-reset-form > .error:not(:empty) { margin:12px 0 0; }
.password-reset-dialog .generated-password { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }

.brand-settings > p { font-size:13px; }
.brand-setting { padding:20px 0; border-top:1px solid var(--border); }
.brand-setting-heading { display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.brand-setting-heading h3 { margin:0; font-size:14px; }
.brand-setting > p { margin:8px 0; font-size:12px; }
.brand-previews { display:flex; flex-wrap:wrap; gap:12px; margin:14px 0; }
.brand-preview { width:220px; padding:12px; border:1px solid var(--border); border-radius:4px; }
.brand-preview.dark { background:#171e25; }
.brand-preview.light { background:#f6f8f5; }
.brand-preview small { display:block; margin-bottom:10px; font-size:11px; }
.brand-preview.dark small { color:#aab6c2; }
.brand-logo-preview { width:140px; height:32px; }
.brand-icon-preview { width:32px; height:32px; }
.brand-preview img { display:block; width:100%; height:100%; object-fit:contain; object-position:left center; }
.brand-preview.dark .system-logo-preview { filter:invert(91%) sepia(27%) saturate(640%) hue-rotate(29deg); }
.brand-setting input[type=file] { display:block; width:min(100%,420px); margin:12px 0; }
.brand-feedback:empty { display:none; }
.brand-feedback { color:var(--accent); overflow-wrap:anywhere; }

/* 固定输出框，透明棋盘仅为预览背景，不写入 PNG。触屏拖动不滚动页面。 */
dialog.brand-editor { width:min(680px,calc(100vw - 24px)); }
.brand-editor > p { font-size:13px; line-height:1.6; }
.brand-editor canvas { display:block; width:100%; height:auto; max-width:512px; margin:18px auto; border:1px solid var(--border); background:repeating-conic-gradient(#edf0f4 0% 25%,#fff 0% 50%) 0/16px 16px; touch-action:none; cursor:move; }
.brand-editor canvas:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
.brand-editor .brand-zoom { display:flex; flex-direction:row; align-items:center; gap:12px; }
.brand-editor .brand-zoom input { flex:1; min-width:0; padding:0; accent-color:var(--primary); }
.brand-zoom output { width:48px; text-align:right; font-variant-numeric:tabular-nums; }

/* 页内功能用下划线页签，与顶部工作页标签区分；窄屏横向滚动。 */
.hosting-tabs { display:flex; gap:24px; overflow-x:auto; border-bottom:1px solid var(--border); margin-bottom:20px; }
.hosting-tabs [role=tab] { flex:none; padding:12px 2px; color:var(--muted); background:transparent; border:0; border-bottom:2px solid transparent; border-radius:0; font-size:14px; }
.hosting-tabs [role=tab][aria-selected=true] { color:var(--primary); border-bottom-color:var(--primary); font-weight:600; }
.hosting-tabs [role=tab]:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
.hosting-panel[hidden] { display:none!important; }
.hosting-panel > .hosting-card { margin-bottom:0; }
@media(max-width:600px) { .hosting-tabs { gap:16px; } }

/* 页面级发布入口与标题同行；长表单抽屉的首尾固定，中间字段独立滚动。 */
.workspace-heading>.workspace-heading-actions{display:flex;flex-direction:row;align-items:center;gap:16px;flex-shrink:0}
dialog.admin-drawer.notification-compose{width:min(640px,100%);padding:0;overflow:hidden}
dialog.notification-compose[open]{display:flex;flex-direction:column}
.notification-compose>.dialog-header{flex:none;margin:0;padding:16px 24px}
.admin-drawer.notification-compose form.notification-form{display:flex;flex-direction:column;flex:1;min-height:0;margin:0;padding:0;border:0}
.notification-fields{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px}
.notification-compose .notification-fields label{margin:0 0 18px;gap:8px}
.notification-compose .notification-fields .subtle{font-size:12px;line-height:1.6;margin:-8px 0 22px}
.notification-compose textarea{min-height:100px;resize:vertical}
.notification-compose textarea[name=body]{min-height:160px}
.notification-compose .dialog-actions{flex:none;flex-wrap:wrap;margin:0;padding:16px 24px;background:var(--surface);border-top:1px solid var(--border)}
.notification-compose .dialog-actions .center-error{flex-basis:100%;margin:0;font-size:13px}
.notification-compose .dialog-actions .center-error:empty{display:none}
@media(max-width:600px){.notification-compose>.dialog-header,.notification-fields,.notification-compose .dialog-actions{padding:16px}.workspace-heading-actions{gap:8px}}

.seo-preview{border:1px solid var(--border,#d5dce6);border-radius:8px;padding:20px;margin:20px 0;max-width:650px;overflow-wrap:anywhere}.seo-preview strong,.seo-preview small{display:block}.seo-preview strong{color:#245ca4}.seo-preview small{margin-top:4px}.seo-preview p{margin-bottom:0}

.hosting-card label.seo-enable{display:flex;flex-direction:row;align-items:center;gap:10px;margin:20px 0}.hosting-card .seo-enable input[type=checkbox]{width:18px;height:18px;margin:0;flex:none}
