/* 火之刃 · 运营后台样式 */
:root{
  --bg:#070504;--panel:#100b08;--panel-2:#16100c;
  --line:rgba(255,138,60,.14);--line-2:rgba(255,255,255,.07);
  --fire:#ff6a12;--gold:#ffd98a;--text:#f2e8de;--muted:#9c8e85;--muted-2:#75685f;
  --ok:#5fd08a;--err:#ff7a68;
  --font:"PingFang SC","Microsoft YaHei","Hiragino Sans GB",system-ui,sans-serif;
}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}
h1,h2,h3{margin:0;font-weight:700}
p{margin:0}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0}
input,select,textarea{
  width:100%;background:#080605;border:1px solid rgba(255,255,255,.09);border-radius:8px;
  padding:10px 12px;color:#fff;font-size:13.5px;transition:border-color .2s,box-shadow .2s;
}
input:focus,select:focus,textarea:focus{outline:none;border-color:rgba(255,140,50,.6);box-shadow:0 0 0 3px rgba(255,110,30,.1)}
label{display:block;font-size:12px;color:rgba(255,214,180,.8);margin:14px 0 6px}
textarea{resize:vertical}
input[type="checkbox"]{width:auto;height:auto;accent-color:#ff7a18;flex-shrink:0}
::selection{background:rgba(255,110,20,.35)}

/* ---------- 登录 ---------- */
.login-screen{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:20px;z-index:10}
.login-bg{
  position:absolute;inset:0;
  background:
    radial-gradient(60% 50% at 50% 0%,rgba(255,90,10,.22),transparent 70%),
    radial-gradient(80% 60% at 50% 110%,rgba(150,40,0,.25),transparent 70%),
    #070504;
}
.login-bg::after{
  content:"";position:absolute;inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  opacity:.6;
}
.login-card{
  position:relative;width:min(380px,100%);padding:34px 30px 30px;border-radius:18px;
  background:linear-gradient(180deg,rgba(26,17,12,.96),rgba(12,8,6,.98));
  border:1px solid rgba(255,138,60,.2);box-shadow:0 40px 90px rgba(0,0,0,.7);
}
.login-brand{text-align:center;margin-bottom:24px}
.login-brand svg{width:44px;height:44px;filter:drop-shadow(0 0 16px rgba(255,90,10,.55));margin-bottom:10px}
.login-brand h1{font-size:22px;letter-spacing:.1em}
.login-brand h1 span{font-size:13px;color:var(--muted);letter-spacing:.16em;font-weight:400}
.login-brand p{margin-top:6px;font-size:10px;letter-spacing:.32em;color:var(--muted-2)}
.btn-primary{
  display:flex;align-items:center;justify-content:center;gap:6px;width:100%;
  height:44px;margin-top:22px;border-radius:9px;font-weight:700;font-size:14px;color:#2a0d00;
  background:linear-gradient(180deg,#ffd08a,#ff9a2e 45%,#ff5a0a);
  box-shadow:0 10px 26px rgba(255,86,10,.3),inset 0 1px 0 rgba(255,255,255,.5);
  transition:transform .2s,box-shadow .25s;
}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 14px 32px rgba(255,86,10,.42)}
.btn-primary.btn-sm{height:36px;width:auto;padding:0 16px;margin:0;font-size:12.5px}
.login-err{margin-top:12px;font-size:12.5px;color:var(--err);text-align:center}

/* ---------- 布局 ---------- */
.app{display:grid;grid-template-columns:216px 1fr;min-height:100vh}
.sidebar{
  position:sticky;top:0;height:100vh;display:flex;flex-direction:column;
  background:linear-gradient(180deg,#120c08,#0a0705);border-right:1px solid var(--line);padding:22px 16px;
}
.side-brand{display:flex;align-items:center;gap:10px;padding:0 8px 20px;border-bottom:1px solid var(--line-2)}
.side-brand .dot{width:8px;height:8px;border-radius:50%;background:var(--fire);box-shadow:0 0 12px var(--fire)}
.side-brand b{display:block;font-size:16px;letter-spacing:.12em}
.side-brand em{font-style:normal;font-size:9px;letter-spacing:.3em;color:var(--muted-2)}
.side-nav{display:flex;flex-direction:column;gap:4px;margin-top:18px}
.nav-item{
  text-align:left;padding:10px 12px;border-radius:8px;font-size:13.5px;color:var(--muted);
  border:1px solid transparent;transition:.2s;
}
.nav-item:hover{background:rgba(255,110,30,.07);color:#ffd8b0}
.nav-item.is-active{background:linear-gradient(90deg,rgba(255,110,30,.18),rgba(255,110,30,.04));border-color:rgba(255,140,60,.28);color:#ffe6c6}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--line-2);font-size:12.5px;color:var(--muted-2)}
.side-foot a:hover,.side-foot button:hover{color:#ffd0a0}
.side-foot button{text-align:left;padding:4px 0;color:var(--muted-2)}

.main{padding:26px 30px 60px;min-width:0;background:
  radial-gradient(80% 50% at 100% 0%,rgba(255,90,10,.06),transparent 60%),var(--bg)}
.topbar{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:22px}
.topbar h2{font-size:22px;letter-spacing:.06em}
.topbar p{margin-top:4px;font-size:12.5px;color:var(--muted-2)}
.topbar-right{display:flex;align-items:center;gap:10px}
.stamp{font-size:11.5px;color:var(--muted-2);font-variant-numeric:tabular-nums}
.user-chip{padding:5px 12px;border-radius:20px;border:1px solid rgba(255,140,60,.3);background:rgba(255,110,30,.1);font-size:12px;color:#ffd8b0}

/* ---------- 卡片/统计 ---------- */
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px}
.stat-card{
  padding:18px 18px 16px;border-radius:14px;border:1px solid var(--line);
  background:linear-gradient(180deg,rgba(24,16,12,.9),rgba(12,8,6,.92));
  box-shadow:0 16px 40px rgba(0,0,0,.35);
}
.stat-label{font-size:11.5px;letter-spacing:.14em;color:var(--muted-2)}
.stat-card b{display:block;margin:8px 0 4px;font-size:26px;font-weight:800;letter-spacing:.02em;color:#fff4e6;font-variant-numeric:tabular-nums}
.stat-card b.txt-dim{font-size:17px}
.stat-card em{font-style:normal;font-size:11.5px;color:var(--muted-2);word-break:break-all}
.stat-card b.is-ok{color:var(--ok)}
.stat-card b.is-bad{color:var(--err)}

.grid-2{display:grid;grid-template-columns:1.5fr 1fr;gap:14px}
.grid-notice{grid-template-columns:1fr 1fr}
.card{padding:18px 18px 8px;border-radius:14px;border:1px solid var(--line);background:linear-gradient(180deg,rgba(20,14,10,.9),rgba(10,7,6,.94));box-shadow:0 16px 40px rgba(0,0,0,.3)}
.card.narrow{max-width:560px;padding-bottom:22px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.card-head h3{font-size:14.5px;letter-spacing:.06em;color:#ffe9d2}
.link{font-size:12px;color:rgba(255,170,100,.85)}
.link:hover{color:#fff}

/* ---------- 表格 ---------- */
.table{width:100%;border-collapse:collapse;font-size:12.6px}
.table th{text-align:left;font-weight:600;color:var(--muted-2);font-size:11.5px;letter-spacing:.08em;padding:8px 10px;border-bottom:1px solid var(--line-2);white-space:nowrap}
.table td{padding:10px;border-bottom:1px dashed rgba(255,255,255,.06);color:rgba(242,232,222,.9);white-space:nowrap}
.table tr:last-child td{border-bottom:0}
.table .empty{text-align:center;color:var(--muted-2);padding:26px 0}
.table .mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;color:var(--muted)}

.toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.toolbar input{max-width:240px}
.spacer{flex:1}
.muted{color:var(--muted-2);font-size:12px}
.pager{display:flex;align-items:center;justify-content:center;gap:14px;padding:14px 0}
.pager span{font-size:12.5px;color:var(--muted)}

.btn-ghost{height:36px;padding:0 14px;border-radius:8px;font-size:12.5px;color:#ffd8b0;border:1px solid rgba(255,140,60,.28);background:rgba(255,110,30,.06);transition:.2s}
.btn-ghost:hover{background:rgba(255,110,30,.14);border-color:rgba(255,140,60,.5)}
.btn-ghost:disabled{opacity:.4;cursor:not-allowed}

/* ---------- 公告列表 ---------- */
.notice-list{max-height:520px;overflow:auto}
.notice-list li{display:flex;align-items:center;gap:10px;padding:11px 2px;border-bottom:1px dashed rgba(255,255,255,.06);font-size:13px}
.notice-list li:last-child{border-bottom:0}
.notice-list .n-kind{flex-shrink:0;white-space:nowrap;font-size:10px;padding:1px 6px;border-radius:3px;border:1px solid rgba(255,140,60,.35);color:#ffb27a}
.notice-list .n-kind.is-act{border-color:rgba(120,180,255,.4);color:#9fc9ff}
.notice-list .n-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgba(242,232,222,.9)}
.notice-list .n-time{font-size:11px;color:var(--muted-2);flex-shrink:0}
.notice-list .n-act{display:flex;gap:8px;flex-shrink:0}
.notice-list .n-act button{font-size:11.5px;color:rgba(255,170,100,.85)}
.notice-list .n-act button:hover{color:#fff}
.notice-list .empty{justify-content:center;color:var(--muted-2)}
.notice-list .pin{font-size:10px;color:#ff8f5a;flex-shrink:0;white-space:nowrap}

/* ---------- 表单 ---------- */
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end}
.form-row .check{display:flex;align-items:center;height:42px}
.form-row .check label{margin:0;display:flex;align-items:center;gap:6px;white-space:nowrap}
.form-actions{display:flex;gap:10px;margin-top:18px}
.form-actions .btn-primary{width:auto;padding:0 22px;margin:0}
.form-actions .btn-ghost{height:44px}
.dl-form{padding-bottom:8px}
.hint{font-size:11.5px;color:var(--muted-2);margin-top:6px}

.o-badge{display:inline-block;padding:2px 8px;border-radius:20px;font-size:11px;border:1px solid transparent}
.o-badge.paid{color:#7cf0a8;border-color:rgba(90,220,140,.35);background:rgba(90,220,140,.1)}
.o-badge.pending{color:#ffc07a;border-color:rgba(255,160,60,.35);background:rgba(255,160,60,.1)}
.o-badge.closed{color:var(--muted-2);border-color:rgba(255,255,255,.12)}

/* ---------- 日志 ---------- */
.audit-list li{display:flex;gap:10px;padding:9px 2px;border-bottom:1px dashed rgba(255,255,255,.06);font-size:12.3px;color:rgba(242,232,222,.82)}
.audit-list li:last-child{border-bottom:0}
.audit-list .t{color:var(--muted-2);flex-shrink:0;font-size:11.5px}
.audit-list .a{color:#ffb27a;flex-shrink:0}
.audit-list .d{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.audit-list .empty{justify-content:center;color:var(--muted-2)}

/* ---------- toast ---------- */
.toast-wrap{position:fixed;left:50%;top:24px;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px}
.toast{padding:10px 16px;border-radius:9px;background:rgba(18,12,9,.97);border:1px solid rgba(255,140,60,.3);font-size:13px;color:#ffe9cf;box-shadow:0 16px 36px rgba(0,0,0,.5);animation:tin .3s ease}
.toast.is-err{border-color:rgba(255,90,70,.45);color:#ffc3b8}
.toast.is-ok{border-color:rgba(90,220,140,.4);color:#c5f7d8}
@keyframes tin{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

@media (max-width:1100px){
  .stat-grid{grid-template-columns:1fr 1fr}
  .grid-2,.grid-notice{grid-template-columns:1fr}
}
@media (max-width:760px){
  .app{grid-template-columns:1fr}
  .sidebar{position:static;height:auto;flex-direction:row;align-items:center;padding:12px;overflow:auto}
  .side-brand{border:0;padding:0 12px 0 4px}
  .side-nav{flex-direction:row;margin:0}
  .side-foot{display:none}
  .main{padding:18px}
  .stat-grid{grid-template-columns:1fr}
  .topbar{flex-direction:column;align-items:flex-start}
}

/* GM 工具 */
.gm-yuanbao{display:flex;align-items:center;gap:10px;margin:14px 0;padding:12px 14px;background:rgba(255,120,20,.08);border:1px solid rgba(255,120,20,.28);border-radius:10px;flex-wrap:wrap}
.gm-yuanbao b{font-size:18px;color:#ffb066;font-variant-numeric:tabular-nums}
.gm-yuanbao input{width:140px}
.gm-yuanbao .muted{font-size:12px}

/* 角色统一编辑面板：五个字段一次保存，不再使用浏览器弹窗。 */
.btn-role-edit{display:inline-flex;align-items:center;justify-content:center;min-width:88px;height:32px;padding:0 13px;border:1px solid rgba(255,150,65,.42);border-radius:7px;background:linear-gradient(135deg,rgba(255,116,25,.18),rgba(255,183,70,.08));color:#ffc383;font-size:12px;transition:.18s}
.btn-role-edit:hover{border-color:#ff9b4a;background:rgba(255,116,25,.25);color:#fff2df;transform:translateY(-1px)}
.role-editor[hidden]{display:none}
.role-editor{position:fixed;inset:0;z-index:150;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(5,3,2,.72);backdrop-filter:blur(8px);animation:role-fade .18s ease-out}
.role-editor-card{position:relative;width:min(620px,100%);max-height:calc(100vh - 48px);overflow:auto;padding:28px 30px 26px;border:1px solid rgba(255,157,63,.44);border-radius:18px;background:radial-gradient(90% 70% at 100% 0%,rgba(255,111,21,.15),transparent 65%),linear-gradient(150deg,#201710,#110e0c 65%);box-shadow:0 32px 100px rgba(0,0,0,.65),inset 0 1px rgba(255,218,167,.1);animation:role-rise .22s ease-out}
.role-editor-card:before{content:"";position:absolute;left:30px;right:30px;top:0;height:2px;background:linear-gradient(90deg,transparent,#ff9c42,transparent)}
.role-editor-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.role-editor-eyebrow{display:block;margin-bottom:5px;color:#bc7947;font-size:10px;letter-spacing:2px}
.role-editor-head h3{margin:0;color:#fff0d9;font-size:24px;letter-spacing:1px}
.role-editor-close{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid rgba(255,157,63,.2);border-radius:9px;color:#d7b495;background:rgba(255,255,255,.03);font-size:25px;line-height:1}
.role-editor-close:hover{background:rgba(255,110,30,.15);color:#fff}
.role-editor-identity{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:22px 0 20px;padding:13px 15px;border:1px solid rgba(255,160,75,.16);border-radius:10px;background:rgba(255,128,30,.05)}
.role-editor-identity b{color:#ffd29f;font-size:16px}
.role-editor-identity span{color:#a99784;font-size:12px}
.role-editor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.role-editor-grid label{display:block;margin:0}
.role-editor-grid label>span{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px;color:#d7bea5;font-size:13px}
.role-editor-grid label small{color:#8f7762;font-size:11px}
.role-editor-grid input{width:100%;height:46px;padding:0 13px;border:1px solid rgba(255,160,75,.24);border-radius:9px;background:rgba(5,3,2,.5);color:#ffe0ba;font-size:18px;font-variant-numeric:tabular-nums;transition:.15s}
.role-editor-grid input:focus{outline:none;border-color:#ee9849;box-shadow:0 0 0 3px rgba(255,125,35,.12);background:rgba(5,3,2,.72)}
.role-editor-grid label:first-child{grid-column:1/-1}
.role-editor-grid label:first-child input{color:#ffca7b}
.role-editor-tip{margin:17px 0 0;color:#9c8975;font-size:12px}
.role-editor-error{margin:14px 0 0;padding:11px 13px;border:1px solid rgba(255,96,75,.4);border-radius:8px;background:rgba(180,40,20,.1);color:#ffb7a6;font-size:12.5px;line-height:1.6}
.role-editor-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px;padding-top:20px;border-top:1px solid rgba(255,170,90,.13)}
.role-editor-actions .btn-primary{width:auto;height:42px;margin:0;padding:0 22px;background:linear-gradient(135deg,#e56b20,#b83414);box-shadow:0 7px 20px rgba(230,87,20,.18)}
.role-editor-actions .btn-ghost{height:42px}
html[data-theme="light"] .role-editor{background:rgba(47,31,16,.4)}
html[data-theme="light"] .role-editor-card{border-color:rgba(192,115,39,.36);background:radial-gradient(90% 70% at 100% 0%,rgba(255,154,54,.13),transparent 65%),linear-gradient(150deg,#fffdf8,#faf3e7);box-shadow:0 30px 90px rgba(65,38,12,.28)}
html[data-theme="light"] .role-editor-head h3{color:#4c2e13}
html[data-theme="light"] .role-editor-close{color:#916a44;background:#fff9ed}
html[data-theme="light"] .role-editor-identity{background:#fff8e9;border-color:rgba(180,120,50,.18)}
html[data-theme="light"] .role-editor-identity b{color:#9b4b13}
html[data-theme="light"] .role-editor-identity span{color:#8d745a}
html[data-theme="light"] .role-editor-grid input{background:#fffdf9;border-color:rgba(178,111,42,.28);color:#503218}
html[data-theme="light"] .role-editor-grid input:focus{background:#fff;border-color:#d48431;box-shadow:0 0 0 3px rgba(255,145,50,.12)}
html[data-theme="light"] .role-editor-grid label>span{color:#705236}
html[data-theme="light"] .role-editor-grid label small,html[data-theme="light"] .role-editor-tip{color:#9c8367}
html[data-theme="light"] .role-editor-error{background:#fff1eb;color:#b5432c}
html[data-theme="light"] .role-editor-actions{border-color:rgba(150,90,30,.14)}
html[data-theme="light"] .btn-role-edit{color:#a65513;background:#fff7e9}
html[data-theme="light"] .btn-role-edit:hover{color:#8a3c06;background:#ffedd5}
@keyframes role-fade{from{opacity:0}to{opacity:1}}
@keyframes role-rise{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:560px){.role-editor{padding:12px}.role-editor-card{padding:23px 20px;max-height:calc(100vh - 24px)}.role-editor-grid{gap:12px}.role-editor-head h3{font-size:21px}.role-editor-actions .btn-primary{padding:0 15px}}


/* ---------- 明亮主题（默认） ---------- */
html[data-theme="light"]{
  --bg:#f4efe6;--panel:#ffffff;--panel-2:#faf6ee;
  --line:rgba(160,100,30,.18);--line-2:rgba(0,0,0,.08);
  --text:#2b2015;--muted:#6d5c49;--muted-2:#97866f;
  --fire:#ff6a12;--gold:#c98a2e;--ok:#2f9e5f;--err:#d8472f;
}
html[data-theme="light"] body{color:var(--text)}
html[data-theme="light"] input,html[data-theme="light"] select,html[data-theme="light"] textarea{
  background:#fffdf9;border:1px solid rgba(160,110,50,.25);color:#2b2015;
}
html[data-theme="light"] label{color:#6d5c49}
html[data-theme="light"] .login-bg{
  background:
    radial-gradient(60% 50% at 50% 0%,rgba(255,150,40,.20),transparent 70%),
    radial-gradient(80% 60% at 50% 110%,rgba(255,120,30,.16),transparent 70%),
    #f4efe6;
}
html[data-theme="light"] .login-card{
  background:linear-gradient(180deg,#fffdf8,#faf4e9);
  border:1px solid rgba(180,120,50,.28);box-shadow:0 30px 70px rgba(90,50,10,.18);
}
html[data-theme="light"] .sidebar{
  background:linear-gradient(180deg,#fbf7ef,#f3ecdf);border-right:1px solid var(--line);
}
html[data-theme="light"] .main{
  background:radial-gradient(80% 50% at 100% 0%,rgba(255,140,40,.06),transparent 60%),var(--bg);
}
html[data-theme="light"] .stat-card{
  background:linear-gradient(180deg,#fffdf9,#faf5eb);box-shadow:0 14px 34px rgba(120,70,20,.10);
}
html[data-theme="light"] .stat-card b{color:#3a2410}
html[data-theme="light"] .card{
  background:linear-gradient(180deg,#fffdf9,#faf5eb);box-shadow:0 14px 34px rgba(120,70,20,.08);
}
html[data-theme="light"] .card-head h3{color:#5a3a1a}
html[data-theme="light"] .table th{color:#8f8172}
html[data-theme="light"] .table td{color:#3a2c1c;border-bottom:1px dashed rgba(0,0,0,.08)}
html[data-theme="light"] .table .mono{color:#7a6a55}
html[data-theme="light"] .nav-item{color:#7a6a55}
html[data-theme="light"] .nav-item:hover{background:rgba(255,130,30,.08);color:#b95f10}
html[data-theme="light"] .nav-item.is-active{background:linear-gradient(90deg,rgba(255,120,30,.16),rgba(255,120,30,.03));border-color:rgba(200,130,40,.4);color:#8a4a10}
html[data-theme="light"] .btn-ghost{color:#a05e1e;border:1px solid rgba(200,130,40,.4);background:rgba(255,140,40,.06)}
html[data-theme="light"] .btn-ghost:hover{background:rgba(255,140,40,.16)}
html[data-theme="light"] .user-chip{color:#a05e1e;border-color:rgba(200,130,40,.4);background:rgba(255,140,40,.1)}
html[data-theme="light"] .toast{background:rgba(255,252,246,.97);border:1px solid rgba(200,130,40,.35);color:#5a3a1a;box-shadow:0 16px 36px rgba(90,50,10,.18)}
html[data-theme="light"] .side-brand b{color:#3a2410}
html[data-theme="light"] .side-foot button,html[data-theme="light"] .side-foot a{color:#97866f}
html[data-theme="light"] .login-brand h1{color:#3a2410}
html[data-theme="light"] .stamp{color:#97866f}
html[data-theme="light"] .theme-toggle{font-size:12.5px}
