:root{color-scheme:light;--bg:#f8f3e7;--card:#fffdf8;--ink:#2b2619;--muted:#5c5444;--line:#e8dec8;--accent:#c9a34a}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.55 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",Segoe UI,sans-serif}
a{color:var(--ink);text-decoration:none}
.topbar{position:sticky;top:0;z-index:20;background:rgba(255,253,248,.96);border-bottom:1px solid var(--line);backdrop-filter:blur(12px)}
.topbar .nav{max-width:1280px;margin:0 auto;padding:0 22px;min-height:62px;display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.topbar .brand{font-weight:750;letter-spacing:.08em;color:#8a6a24;font-size:15px;white-space:nowrap}
.topbar .links{display:flex;gap:2px;flex-wrap:wrap;align-items:center;margin-left:auto}
.topbar .links a{color:#4f4838;padding:0 12px;min-height:40px;display:inline-flex;align-items:center;border-radius:999px;font-size:14.5px;white-space:nowrap}
.topbar .links a:hover{color:var(--ink);background:#f4ead4}
.topbar .links a.on{color:#2a2413;background:var(--accent);font-weight:700}
.topbar .group{color:var(--muted);font-size:11.5px;letter-spacing:.08em;margin:0 6px 0 10px;white-space:nowrap}
.topbar .who{margin-left:14px;display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px;white-space:nowrap}
.topbar .logout{background:#b5564c;color:#fff;border:0;border-radius:8px;padding:0 12px;min-height:36px;font-weight:650;cursor:pointer}
.topbar .logout:hover{background:#c26358}
main{padding:22px;max-width:1280px;margin:0 auto}  /* D-269 内容区与顶栏同宽居中 */
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:18px}
.toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin:0 0 14px}
.toolbar>div{display:flex;flex-direction:column;justify-content:flex-end;gap:4px;min-width:150px}
.toolbar label{display:block;font-size:12px;color:#5c5444;margin:0;line-height:18px;height:18px}
.toolbar input,.toolbar select{min-height:38px}
.toolbar .btn,.toolbar a.btn{margin-bottom:0}

/* D-281 柔和金色成为全站默认主题（布局统一由 D-280 保留） */
/* 通用页面组件（所有页面统一到柔和金色后台风格） */
.sub{margin:4px 0 12px;color:#4f4838;font-size:13.5px;font-weight:500;line-height:1.6}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin:18px 0}
.kpi{font-size:30px;font-weight:800;color:var(--accent);margin:6px 0;line-height:1.15}
.tag,.desc{color:var(--muted);font-size:13px}
.hint{background:#fbf4e1;border:1px dashed var(--line);border-radius:10px;padding:12px 14px;color:#4f4838;font-size:13px}
.modal{max-height:calc(100vh - 24px);overflow-y:auto}
.modal h3{margin:0 0 6px}
.modal label{display:block;font-size:12px;color:var(--muted);margin:10px 0 5px}
.modal input,.modal select{width:100%}
.modal .actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}

.pager{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:12px 0 4px;flex-wrap:wrap}
.pager button[disabled]{opacity:.45;cursor:not-allowed}
.empty-cell{text-align:center;color:var(--muted);padding:26px 12px}
h1,h2,h3{font-weight:650}
h2{margin:0 0 4px;font-size:20px}
.sub{color:#4f4838;font-size:13.5px;margin:0 0 16px}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:9px 10px;border-bottom:1px solid var(--line);font-size:13px;vertical-align:top}
th{color:#4f4838;font-size:12px;font-weight:600;background:#f2e7cd}
tr:last-child td{border-bottom:0}
.btn{border:1px solid var(--accent);background:var(--accent);color:#2a2413;border-radius:8px;padding:7px 12px;font-size:12.5px;cursor:pointer;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:4px}
.btn.ghost{background:transparent;color:var(--ink);border-color:var(--line);font-weight:500}
.btn.small{padding:4px 8px;font-size:12px}
input::placeholder{color:#6a6252;opacity:1}
input,select{background:#fffdf8;color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:0 10px;font-size:13px;height:38px;min-height:38px;box-sizing:border-box}
select{appearance:none;-webkit-appearance:none;padding-right:32px;cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236a6252' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;background-size:12px 8px}
input[type=date]::-webkit-calendar-picker-indicator{opacity:.55;cursor:pointer}
label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
.f{margin:10px 0}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin:0 0 14px}
.chip{display:inline-block;padding:1px 8px;border-radius:999px;font-size:11.5px;border:1px solid var(--line);color:#4f4838;background:#f6efdd}
.chip.ok{color:#2f5a35;border-color:#c4d8bf;background:#e7efe4}.chip.warn{color:#7a5a12;border-color:#e3cc91;background:#f6e6bd}.chip.bad{color:#8a2f1d;border-color:#e3bcb2;background:#f6e2dd}
.muted{color:var(--muted);font-size:12.5px}
.empty{padding:30px;text-align:center;color:var(--muted);border:1px dashed #e3d3ae;border-radius:10px}
.alert{border:1px solid #e3bcb2;background:#f9e7e2;color:#8a2f1d;padding:8px 12px;border-radius:8px;font-size:12.5px;margin:10px 0}
.modal-bg{position:fixed;inset:0;background:rgba(43,38,25,.35);display:flex;align-items:center;justify-content:center;padding:16px;z-index:30}
.modal{background:#fffdf8;border:1px solid var(--line);border-radius:12px;max-width:460px;width:100%;padding:20px}
.modal .actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}
.form-inline{display:inline-block;vertical-align:top;margin:0 18px 14px 0;min-width:220px}
.code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px}
.login{max-width:420px;margin:8vh auto}
.login .card{padding:26px}
.login-form .login-row{display:grid;grid-template-columns:56px minmax(0,1fr);gap:12px;align-items:center;margin-bottom:18px}
.login-form .captcha-row{grid-template-columns:56px minmax(0,1fr) auto}
.login-form label{margin:0;font-size:13px;color:var(--ink);font-weight:600;line-height:1.4}
.login-form input{width:100%;height:42px;font-size:14px}
.login-form > button[type=submit]{width:100%;margin-top:4px;height:42px}
.captcha-q{height:42px;padding:0 10px;border:1px dashed var(--line);background:#fbf4e1;border-radius:8px;font-weight:700;color:#5c5444;cursor:pointer;white-space:nowrap;font-size:13px}
.captcha-q:disabled{opacity:.6;cursor:wait}
@media(max-width:420px){.login-form .login-row{grid-template-columns:48px minmax(0,1fr);gap:8px}.login-form .captcha-row{grid-template-columns:48px minmax(0,1fr)}.captcha-q{grid-column:2;justify-self:start}}
@media(max-width:760px){.login-form input{font-size:16px}}
@media(max-width:760px){
 main{padding:14px}
 .topbar .nav{padding:6px 14px;gap:10px}
 .topbar .links{order:3;width:100%;flex-wrap:wrap}
 .topbar .links a{min-height:40px}
 .topbar .who{margin-left:auto}
 table{display:block;overflow-x:auto}
 th,td{white-space:nowrap}
 /* H5 口径：触摸目标 ≥40px、输入字号 ≥16px（防 iOS 聚焦缩放） */
 .btn{min-height:40px;padding:9px 12px;font-size:13.5px}
 .topbar .logout{min-height:40px}
 .grid{grid-template-columns:1fr}
 .btn.small{min-height:40px}
 input,select,textarea{font-size:16px;min-height:40px}
}

/* 运营参数：固定卡片分组 */
.config-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:16px}
.config-card{display:flex;flex-direction:column}
.config-card .kv{display:flex;justify-content:space-between;gap:14px;padding:7px 0;border-bottom:1px dashed var(--line);font-size:13px}
.config-card .kv:last-of-type{border-bottom:0}
.config-card .kv span{color:#5c5444;flex:0 0 auto}
.config-card .kv b{text-align:right;font-weight:600;word-break:break-all;max-width:65%}
@media(max-width:760px){.config-grid{grid-template-columns:1fr}}

/* 列表分页大小（桌面 32px，移动端满足 40px/16px 触达） */
.pager select.page-size{width:76px;height:32px;min-height:32px;padding:0 8px;font-size:12.5px}
@media(max-width:760px){.pager select.page-size{width:88px;height:40px;min-height:40px;font-size:16px;padding:0 8px}}

/* 页面内 Tab（授权列表 / 授权异常） */
.tabs{display:flex;gap:4px;margin:0 0 14px;border-bottom:1px solid var(--line)}
.tabs button{background:transparent;border:0;border-bottom:2px solid transparent;padding:9px 14px;font-size:14px;font-weight:600;color:#5c5444;cursor:pointer}
.tabs button:hover{color:#2b2619}
.tabs button.on{color:#2b2619;border-bottom-color:var(--accent)}

/* 激活码：左批次 / 右明细 */
.codes-split{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:start}
.batch-list{height:440px;overflow:auto;margin-top:2px}
.batch-item{padding:8px 10px;border:1px solid var(--line);border-radius:8px;margin-bottom:4px;cursor:pointer;background:#fffdf8;min-height:38px}
.batch-item:hover{border-color:var(--accent)}
.batch-item.on{border-color:var(--accent);background:#fbf4e1;box-shadow:inset 0 0 0 1px var(--accent)}
@media(max-width:900px){.codes-split{grid-template-columns:1fr}.batch-list{max-height:none}.batch-item{min-height:44px;padding:10px}}
@media(max-width:760px){.agent-picker label{min-height:40px}}

/* 配置项：代理名单搜索勾选 */
.selected-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.sel-chip{display:inline-flex;align-items:center;gap:4px;background:#f3e8cb;border:1px solid #e0d3b5;border-radius:999px;padding:2px 8px;font-size:12.5px;color:#2b2619}
.sel-chip button{border:0;background:transparent;cursor:pointer;color:#7a5a12;font-size:14px;line-height:1;padding:0}
.agent-picker{max-height:190px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:#fffdf8;margin-top:6px;padding:4px}
.agent-picker label{display:flex;align-items:center;gap:8px;padding:6px 8px;margin:0;border-radius:6px;cursor:pointer}
.agent-picker label:hover{background:#fbf4e1}

/* 激活码：顶部批次生成表单 */
.batch-form{display:grid;grid-template-columns:1.4fr .6fr .7fr 1fr auto;gap:10px;align-items:end;margin-top:10px}
.batch-form label{display:block;margin-bottom:4px}
.batch-form input{width:100%}
@media(max-width:900px){.batch-form{grid-template-columns:1fr 1fr}.batch-form>div:nth-child(4){grid-column:1/-1}.batch-form>button{grid-column:1/-1}}

.batch-line{display:flex;align-items:center;gap:6px;white-space:nowrap;overflow:hidden;line-height:1.3}
.batch-line .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.side-pager{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:6px;font-size:12px;color:var(--muted)}
@media(max-width:900px){.batch-list{height:auto;max-height:440px}}

.child-switch{width:44px;height:40px;border:0;background:transparent;position:relative;cursor:pointer;padding:0;vertical-align:middle}
.child-switch::before{content:'';position:absolute;left:3px;top:9px;width:38px;height:21px;border-radius:99px;background:#cfc7b5;transition:background .15s}
.child-switch span{position:absolute;left:6px;top:12px;width:15px;height:15px;border-radius:50%;background:#fff;transition:left .15s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.child-switch.on::before{background:#2f5d3a}
.child-switch.on span{left:23px}

@media(max-width:760px){.pnl-detail-link{display:inline-flex;align-items:center;min-height:40px;padding:0 6px}}

/* 统一对话框（D-362）：所有 alert/confirm/prompt 走这里，不弹浏览器原生框 */
body.mt-dialog-open{overflow:hidden}
.mt-dialog-mask{position:fixed;inset:0;z-index:200;background:rgba(43,38,25,.42);display:flex;align-items:center;justify-content:center;padding:20px}
.mt-dialog{width:min(420px,100%);max-height:calc(100vh - 40px);overflow:auto;background:#fffdf8;color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 50px rgba(43,38,25,.25);padding:20px}
.mt-dialog-title{margin:0 0 8px;font-size:17px;font-weight:700}
.mt-dialog-message{margin:0;color:#4f4838;font-size:14px;line-height:1.7;white-space:pre-line}
.mt-dialog-input{width:100%;margin-top:12px}
.mt-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.mt-dialog-actions .btn{min-height:40px;min-width:74px;padding:8px 16px}
.mt-dialog-actions .btn.danger{background:#b5564c;border-color:#b5564c;color:#fff}
.mt-dialog-actions .btn.danger:hover{background:#c26358}
@media(max-width:520px){.mt-dialog-mask{padding:14px}.mt-dialog{width:100%;padding:18px}.mt-dialog-actions{flex-direction:column-reverse}.mt-dialog-actions .btn{width:100%}}
