/* ============================================================
   黄金矿工 | 跨境Agent — 本地高保真复刻 · 设计系统
   ============================================================ */
:root{
  --bg:#F6F4EF; --surface:#FFFFFF; --surface-2:#FBF9F4; --surface-3:#F2EEE4;
  --border:#EBE5D9; --border-2:#DED5C3;
  --text:#2C2721; --text-2:#5E574C; --text-sub:#968D7F;
  --gold:#C79A3D; --gold-2:#E6BE70; --gold-deep:#A87A24;
  --gold-soft:#FBF2DE; --gold-line:#EFE0BB;
  --blue:#2D6AE3; --blue-soft:#EAF1FF;
  --green:#2E9E6B; --green-soft:#E5F5EC;
  --red:#D65A50; --red-soft:#FDEDEC;
  --amber:#CE8A24; --amber-soft:#FFF3E1;
  --purple:#7B61D1; --purple-soft:#F0EBFF;
  --shadow:0 4px 20px rgba(70,58,32,.07);
  --shadow-lg:0 18px 52px rgba(55,44,22,.16);
  --r:14px; --r-sm:10px; --r-lg:22px;
  --sidebar-w:216px; --topbar-h:58px; --tabbar-h:44px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",Roboto,sans-serif;
}
[data-theme="dark"]{
  --bg:#141311; --surface:#1D1C1A; --surface-2:#232220; --surface-3:#2B2926;
  --border:#35322D; --border-2:#46423A;
  --text:#F1ECE2; --text-2:#C4BCAE; --text-sub:#8F887B;
  --gold:#DCB05A; --gold-2:#EBC985; --gold-deep:#C39742;
  --gold-soft:#3A3020; --gold-line:#57462A;
  --blue:#7EA6FF; --blue-soft:#1E2C46;
  --green:#5FCB96; --green-soft:#1C3529;
  --red:#F08A80; --red-soft:#3D2220;
  --amber:#E9AF55; --amber-soft:#3A2C18;
  --purple:#A996EE; --purple-soft:#2B2340;
  --shadow:0 4px 20px rgba(0,0,0,.28);
  --shadow-lg:0 18px 52px rgba(0,0,0,.5);
}
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased;overflow:hidden}
[hidden]{display:none !important}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
a{color:var(--blue);text-decoration:none}
a:hover{text-decoration:underline}
svg{display:block}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:9px}
::-webkit-scrollbar-track{background:transparent}
:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

/* ---------- 通用组件 ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 15px;border-radius:10px;font-size:13px;font-weight:600;white-space:nowrap;transition:.16s;border:1px solid var(--border);background:var(--surface);color:var(--text)}
.btn:hover{background:var(--surface-3);border-color:var(--border-2)}
.btn:active{transform:translateY(1px)}
.btn[disabled]{opacity:.5;cursor:not-allowed;transform:none}
.btn.primary{background:linear-gradient(100deg,var(--gold-2),var(--gold));color:#3A2A0C;border-color:transparent;box-shadow:0 3px 10px rgba(199,154,61,.24)}
.btn.primary:hover{filter:brightness(1.05)}
[data-theme="dark"] .btn.primary{color:#2A1E08}
.btn.ghost{background:transparent;border-color:transparent;color:var(--text-2)}
.btn.ghost:hover{background:var(--surface-3)}
.btn.danger{color:var(--red);border-color:var(--red-soft);background:var(--red-soft)}
.btn.soft{background:var(--gold-soft);border-color:var(--gold-line);color:var(--gold-deep)}
.btn.sm{height:30px;padding:0 10px;font-size:12px;border-radius:8px}
.btn.xs{height:26px;padding:0 8px;font-size:11px;border-radius:7px;font-weight:500}
.btn.icon{width:34px;height:34px;padding:0;border-radius:9px}
.btn.block{width:100%}
.btn-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.input,.select,.textarea{width:100%;height:38px;padding:0 12px;border:1px solid var(--border);background:var(--surface);border-radius:10px;outline:none;transition:.15s;font-size:13px}
.input:focus,.select:focus,.textarea:focus{border-color:var(--gold);box-shadow:0 0 0 3px var(--gold-soft)}
.textarea{height:auto;min-height:88px;padding:10px 12px;resize:vertical;line-height:1.6}
.select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--text-sub) 50%),linear-gradient(135deg,var(--text-sub) 50%,transparent 50%);background-position:calc(100% - 16px) 16px,calc(100% - 11px) 16px;background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:30px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field>label{font-size:12px;font-weight:600;color:var(--text-2)}
.think-toggle{display:inline-flex;align-items:center;gap:6px;padding:0 11px;height:30px;border:1px solid var(--border);border-radius:8px;font-size:12.5px;font-weight:600;color:var(--text-2);cursor:pointer;user-select:none;background:var(--surface);transition:.15s;white-space:nowrap}
.think-toggle input{width:auto;height:auto;margin:0;accent-color:var(--gold)}
.think-toggle:hover{border-color:var(--border-2)}
.think-toggle.on{border-color:var(--gold);color:var(--gold-deep);background:var(--gold-soft)}
.checkbox-inline{display:flex;flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap;font-weight:600;font-size:12.5px;color:var(--text-2);cursor:pointer;min-width:0}
.checkbox-inline input{width:auto;height:auto;margin:0;accent-color:var(--gold)}
.field .hint{font-size:11px;color:var(--text-sub)}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-grid .full{grid-column:1/-1}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow)}
.card-pad{padding:18px}
.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;background:var(--surface-3);color:var(--text-2);white-space:nowrap}
.badge.gold{background:var(--gold-soft);color:var(--gold-deep)}
.badge.green{background:var(--green-soft);color:var(--green)}
.badge.blue{background:var(--blue-soft);color:var(--blue)}
.badge.red{background:var(--red-soft);color:var(--red)}
.badge.amber{background:var(--amber-soft);color:var(--amber)}
.badge.purple{background:var(--purple-soft);color:var(--purple)}
.muted{color:var(--text-sub)}
.small{font-size:12px}
.tiny{font-size:11px}
.strong{font-weight:700}
.row{display:flex;align-items:center;gap:10px}
.between{display:flex;align-items:center;justify-content:space-between;gap:10px}
.wrap{flex-wrap:wrap}
.divider{height:1px;background:var(--border);margin:14px 0}
.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}
.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:54px 20px;color:var(--text-sub);text-align:center}
.empty .ico{font-size:34px;opacity:.55}
.switch{position:relative;width:38px;height:22px;border-radius:999px;background:var(--border-2);transition:.2s;flex:none}
.switch.on{background:var(--gold)}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.switch.on::after{transform:translateX(16px)}
.progress{height:6px;border-radius:99px;background:var(--surface-3);overflow:hidden}
.progress>i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--gold-2),var(--gold));transition:width .3s}
.spin{width:16px;height:16px;border:2px solid var(--border-2);border-top-color:var(--gold);border-radius:50%;animation:sp .7s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.fade{animation:fadeUp .22s ease both}

/* ---------- 认证页 ---------- */
.auth{height:100%;display:grid;grid-template-columns:1.12fr .88fr;background:var(--surface)}
.auth-left{position:relative;display:flex;flex-direction:column;padding:28px 42px 22px;background:radial-gradient(120% 90% at 18% 8%,#FFF9E9 0%,#FAEED2 55%,#F3E4C2 100%);overflow:hidden}
[data-theme="dark"] .auth-left{background:radial-gradient(120% 90% at 18% 8%,#3A3221 0%,#2A2418 60%,#211D14 100%)}
.auth-brand{display:flex;align-items:center;gap:9px;position:relative;z-index:2}
.auth-brand img{width:34px;height:34px;object-fit:contain}
.auth-brand b{font-size:17px;letter-spacing:1px}
.auth-brand span{display:block;font-size:9px;letter-spacing:3px;color:var(--text-sub);margin-top:-3px}
.auth-hero{flex:1;display:flex;align-items:center;justify-content:center;position:relative;z-index:1;min-height:0}
.auth-hero img{width:min(82%,510px);object-fit:contain;filter:drop-shadow(0 12px 20px rgba(90,70,30,.12))}
.auth-slogan{position:relative;z-index:2;text-align:center;font-size:clamp(20px,2.4vw,32px);font-weight:500;letter-spacing:1px;color:#4A3B1E;padding-bottom:12px}
[data-theme="dark"] .auth-slogan{color:#E8D4A6}
.auth-right{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;background:linear-gradient(180deg,var(--surface-2),var(--surface))}
.auth-tools{position:absolute;top:20px;right:24px;display:flex;gap:8px}
.auth-card{width:min(100%,420px);background:var(--surface);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow-lg);padding:30px 30px 26px}
.auth-card h1{margin:0;font-size:28px;font-weight:500;letter-spacing:1px}
.auth-card .sub{margin:6px 0 20px;color:var(--text-sub);font-size:13px}
.auth-card .field{margin-bottom:14px}
.auth-card .btn.block{height:44px;border-radius:11px;font-size:14px;margin-top:6px}
.auth-note{padding:10px 12px;border-radius:10px;background:var(--green-soft);color:var(--green);font-size:12px;margin-bottom:16px;line-height:1.5}
.auth-card .links{display:flex;justify-content:space-between;align-items:center;font-size:12px;margin:12px 0 16px}
.auth-foot{text-align:center;font-size:11px;color:var(--text-sub);margin-top:18px;line-height:1.8}
.pw-wrap{position:relative}
.pw-wrap .input{padding-right:40px}
.pw-eye{position:absolute;right:6px;top:4px;width:30px;height:30px;display:grid;place-items:center;color:var(--text-sub);border-radius:7px}
.pw-eye:hover{background:var(--surface-3)}
.auth-agree{font-size:11px;color:var(--text-sub);margin-top:14px;text-align:center}
.pill{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:999px;background:var(--surface-3);font-size:12px;color:var(--text-2)}
.pill:hover{background:var(--gold-soft);text-decoration:none}

/* ---------- App Shell ---------- */
.shell{display:flex;height:100%;overflow:hidden}
.sidebar{width:var(--sidebar-w);flex:none;display:flex;flex-direction:column;background:var(--surface-2);border-right:1px solid var(--border);transition:width .2s,transform .22s;z-index:40}
.side-head{height:var(--topbar-h);display:flex;align-items:center;gap:9px;padding:0 14px;border-bottom:1px solid var(--border);flex:none}
.side-head img{width:30px;height:30px;object-fit:contain;flex:none}
.side-head .txt{min-width:0}
.side-head b{display:block;font-size:14px;letter-spacing:.6px;white-space:nowrap}
.side-head small{display:block;font-size:9px;letter-spacing:2.5px;color:var(--text-sub);margin-top:-2px}
.side-toggle{margin-left:auto;width:26px;height:26px;border-radius:7px;display:grid;place-items:center;color:var(--text-sub)}
.side-toggle:hover{background:var(--surface-3)}
.side-nav{flex:1;overflow-y:auto;padding:10px 9px 16px}
.nav-item{display:flex;align-items:center;gap:10px;height:38px;padding:0 10px;border-radius:10px;color:var(--text-2);font-size:13px;font-weight:500;cursor:pointer;user-select:none;transition:.14s;white-space:nowrap;text-decoration:none}
.nav-item:hover{background:var(--surface-3);text-decoration:none}
.nav-item.active{background:var(--gold-soft);color:var(--gold-deep);font-weight:700;box-shadow:inset 0 0 0 1px var(--gold-line)}
.nav-item .ico{width:19px;flex:none;text-align:center;font-size:15px}
.nav-item .lbl{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.nav-item .arrow{font-size:10px;color:var(--text-sub);transition:transform .2s}
.nav-group.open .arrow{transform:rotate(180deg)}
.nav-sub{padding:2px 0 4px 0}
.nav-sub .nav-item{height:33px;padding-left:38px;font-size:12.5px;font-weight:400}
.nav-sub .nav-item.active{background:var(--gold-soft)}
.nav-badge{font-size:9px;padding:1px 5px;border-radius:5px;background:var(--gold);color:#fff;font-weight:700}
.nav-badge.new{background:var(--blue)}
.side-foot{padding:10px;border-top:1px solid var(--border);flex:none}
.side-foot .plug{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:9px 10px;border-radius:10px;background:var(--surface-3);font-size:11.5px;color:var(--text-2);text-decoration:none}
.side-foot .plug:hover{background:var(--gold-soft);text-decoration:none}
.sidebar.collapsed{width:62px}
.sidebar.collapsed .side-head .txt,.sidebar.collapsed .nav-item .lbl,.sidebar.collapsed .nav-item .arrow,.sidebar.collapsed .nav-badge,.sidebar.collapsed .side-foot,.sidebar.collapsed .side-toggle{display:none}
.sidebar.collapsed .side-head{justify-content:center;padding:0}
.sidebar.collapsed .nav-item{justify-content:center;padding:0}
.sidebar.collapsed .nav-sub{display:none}
.sidebar.collapsed .nav-item .ico{font-size:17px}

.main{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}
.topbar{height:var(--topbar-h);flex:none;display:flex;align-items:center;gap:8px;padding:0 14px;background:var(--surface);border-bottom:1px solid var(--border);overflow:hidden}
.platform{display:flex;gap:4px;padding:3px;border-radius:999px;background:var(--surface-3);flex:none}
.platform button{height:28px;padding:0 12px;border-radius:999px;font-size:12px;font-weight:700;color:var(--text-sub);display:flex;align-items:center;gap:5px}
.platform button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.platform .dot{width:14px;height:14px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:8px;font-weight:800}
.dot.oz{background:#1B63E6}.dot.wb{background:#A32BC9}
.top-spacer{flex:1}
.top-chip{height:30px;display:inline-flex;align-items:center;gap:6px;padding:0 10px;border-radius:999px;background:var(--surface-3);font-size:12px;color:var(--text-2);white-space:nowrap}
.top-chip:hover{background:var(--gold-soft)}
.top-chip.vip{background:var(--gold-soft);color:var(--gold-deep);border:1px solid var(--gold-line);font-weight:600}
.top-chip .coin{width:15px;height:15px;border-radius:50%;background:linear-gradient(140deg,#F4D27A,#C79A3D);display:grid;place-items:center;color:#fff;font-size:9px;font-weight:800}
.avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;background:var(--gold-soft);display:grid;place-items:center;color:var(--gold-deep);font-weight:700;font-size:12px;flex:none}
.icon-btn{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;color:var(--text-2);position:relative;flex:none}
.icon-btn:hover{background:var(--surface-3)}
.icon-btn .dotmark{position:absolute;top:5px;right:5px;width:6px;height:6px;border-radius:50%;background:var(--red)}
.mobile-menu{display:none}
.tabbar{height:var(--tabbar-h);flex:none;display:flex;align-items:center;gap:6px;padding:0 12px;background:var(--surface-2);border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none}
.tabbar::-webkit-scrollbar{display:none}
.tab{height:30px;display:inline-flex;align-items:center;gap:7px;padding:0 10px;border-radius:8px;background:var(--surface);border:1px solid var(--border);font-size:12px;white-space:nowrap;color:var(--text-2);cursor:pointer;flex:none}
.tab.on{background:var(--gold-soft);border-color:var(--gold-line);color:var(--gold-deep);font-weight:700}
.tab .x{font-size:13px;opacity:.55;line-height:1}
.tab .x:hover{opacity:1}
.content{flex:1;overflow-y:auto;overflow-x:hidden;padding:16px 18px 40px;scroll-behavior:smooth}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.page-head h2{margin:0;font-size:20px;font-weight:700;letter-spacing:.3px}
.page-head p{margin:3px 0 0;color:var(--text-sub);font-size:12.5px}
.crumb{font-size:11px;color:var(--text-sub);margin-bottom:6px}

/* ---------- 数据页 ---------- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:14px}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:14px 16px;box-shadow:var(--shadow)}
.stat .k{font-size:11.5px;color:var(--text-sub)}
.stat .v{font-size:23px;font-weight:700;margin-top:4px;letter-spacing:-.5px}
.stat .d{font-size:11px;margin-top:3px;color:var(--green)}
.stat .d.down{color:var(--red)}
.filters{display:flex;gap:9px;flex-wrap:wrap;align-items:center;padding:12px 14px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r);margin-bottom:12px}
.filters .input,.filters .select{height:34px;width:auto;min-width:130px;font-size:12.5px}
.filters .search{min-width:210px;flex:1;max-width:320px}
.filters .field{flex-direction:row;align-items:center;gap:6px}
.filters .field>label{white-space:nowrap;font-size:12px}
.toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:12px}
.status-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px;overflow-x:auto;padding-bottom:2px}
.status-tab{height:30px;padding:0 13px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-2);font-size:12.5px;font-weight:600;cursor:pointer;white-space:nowrap;transition:.15s}
.status-tab:hover{border-color:var(--border-2);background:var(--surface-3)}
.status-tab.on{background:var(--gold-soft);border-color:var(--gold-line);color:var(--gold-deep)}
.table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);overflow:hidden;box-shadow:var(--shadow)}
.table-scroll{overflow-x:auto}
.data-table{width:100%;border-collapse:collapse;font-size:12.5px;min-width:680px}
.data-table th{background:var(--surface-2);text-align:left;padding:10px 12px;font-weight:600;color:var(--text-2);font-size:11.5px;white-space:nowrap;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:1}
.data-table th.sortable{cursor:pointer;user-select:none}
.data-table th.sortable:hover{color:var(--gold-deep)}
.data-table td{padding:10px 12px;border-bottom:1px solid var(--border);vertical-align:middle}
.data-table tbody tr:last-child td{border-bottom:0}
.data-table tbody tr:hover{background:var(--surface-2)}
.data-table tbody tr.sel{background:var(--gold-soft)}
.data-table .thumb{width:38px;height:38px;border-radius:8px;object-fit:cover;background:var(--surface-3);border:1px solid var(--border);flex:none}
.cell-main{display:flex;align-items:center;gap:9px;min-width:0}
.cell-main .t{font-weight:600;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cell-main .s{font-size:10.5px;color:var(--text-sub)}
.row-acts{display:flex;gap:4px;flex-wrap:wrap}
.link-btn{color:var(--blue);font-size:12px;padding:2px 4px;border-radius:5px;white-space:nowrap}
.link-btn:hover{background:var(--blue-soft);text-decoration:none}
.link-btn.danger{color:var(--red)}
.link-btn.danger:hover{background:var(--red-soft)}
.pager{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-top:1px solid var(--border);font-size:12px;color:var(--text-sub);flex-wrap:wrap}
.pager .pages{display:flex;gap:4px;align-items:center}
.pager .pages button{min-width:28px;height:28px;border-radius:7px;border:1px solid var(--border);font-size:12px}
.pager .pages button.on{background:var(--gold);color:#fff;border-color:transparent}
.chk{width:15px;height:15px;accent-color:var(--gold);cursor:pointer;flex:none}

/* ---------- 弹窗 / 抽屉 / Toast ---------- */
.overlay{position:fixed;inset:0;background:rgba(28,22,12,.42);backdrop-filter:blur(2px);z-index:100;display:flex;align-items:center;justify-content:center;padding:20px;animation:fadeUp .16s ease both}
.modal{width:min(100%,560px);max-height:88vh;display:flex;flex-direction:column;background:var(--surface);border-radius:18px;box-shadow:var(--shadow-lg);overflow:hidden}
.modal.wide{width:min(100%,860px)}
.modal.xwide{width:min(100%,1080px)}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 20px;border-bottom:1px solid var(--border);flex:none}
.modal-head h3{margin:0;font-size:16px;font-weight:700}
.modal-body{padding:20px;overflow-y:auto;flex:1}
.modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:13px 20px;border-top:1px solid var(--border);background:var(--surface-2);flex:none;flex-wrap:wrap}
.close-x{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;color:var(--text-sub);font-size:18px}
.close-x:hover{background:var(--surface-3)}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(100%,420px);background:var(--surface);box-shadow:var(--shadow-lg);z-index:101;display:flex;flex-direction:column;animation:slideIn .2s ease both}
@keyframes slideIn{from{transform:translateX(100%)}to{transform:none}}
.drawer-head{padding:16px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.drawer-body{flex:1;overflow-y:auto;padding:18px}
.toast-wrap{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{display:flex;align-items:center;gap:8px;padding:10px 16px;border-radius:11px;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow-lg);font-size:13px;font-weight:600;animation:fadeUp .2s ease both;max-width:90vw}
.toast.ok{border-color:var(--green);color:var(--green)}
.toast.err{border-color:var(--red);color:var(--red)}
.toast.info{border-color:var(--gold);color:var(--gold-deep)}

/* ---------- 特殊页面 ---------- */
.hero-card{position:relative;border-radius:var(--r-lg);overflow:hidden;border:1px solid var(--border);margin-bottom:14px;background:linear-gradient(110deg,#FBF2DE,#F7E6C4)}
[data-theme="dark"] .hero-card{background:linear-gradient(110deg,#3A3020,#2A2418)}
.hero-card img{width:100%;height:auto;display:block;max-height:210px;object-fit:cover;object-position:center}
.welcome{display:flex;align-items:center;gap:14px;padding:18px 20px;margin-bottom:12px}
.welcome h3{margin:0;font-size:20px}
.welcome p{margin:3px 0 0;color:var(--text-sub);font-size:12.5px}
.welcome .avatar{width:44px;height:44px;font-size:16px}
.vip-strip{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 16px;border-radius:11px;background:var(--gold-soft);border:1px solid var(--gold-line);font-size:12.5px;color:var(--gold-deep);margin-bottom:12px;flex-wrap:wrap}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.quick-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:10px}
.quick{display:flex;flex-direction:column;gap:6px;align-items:flex-start;padding:14px;border-radius:12px;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow);text-align:left;color:var(--text);transition:.15s}
.quick:hover{transform:translateY(-2px);border-color:var(--gold-line);text-decoration:none}
.quick .qico{font-size:20px}
.quick b{font-size:13px}
.quick small{color:var(--text-sub);font-size:11px}
.letter{max-height:260px;overflow:hidden;transition:max-height .3s}
.letter.open{max-height:3000px}
.plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.plan{position:relative;display:flex;flex-direction:column;padding:18px;border-radius:16px;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow)}
.plan.hot{border-color:var(--gold);box-shadow:0 0 0 2px var(--gold-soft),var(--shadow)}
.plan .tag{position:absolute;top:-10px;right:14px;padding:2px 9px;border-radius:999px;background:var(--gold);color:#fff;font-size:10px;font-weight:700}
.plan h4{margin:0 0 3px;font-size:15px}
.plan .price{font-size:26px;font-weight:800;color:var(--gold-deep);margin:8px 0}
.plan ul{margin:10px 0 16px;padding-left:16px;font-size:12px;color:var(--text-2);line-height:1.9;flex:1}
.chart{width:100%;height:230px}
.chart-box{padding:16px}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11.5px;color:var(--text-sub);margin-top:8px}
.legend i{display:inline-block;width:9px;height:9px;border-radius:3px;margin-right:5px}
.funnel-row{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.funnel-row .lbl{width:90px;font-size:12px;color:var(--text-2);flex:none}
.funnel-bar{height:26px;border-radius:6px;background:linear-gradient(90deg,var(--gold-2),var(--gold));display:flex;align-items:center;justify-content:flex-end;padding-right:8px;color:#3A2A0C;font-size:11px;font-weight:700;min-width:40px}
.calc-out{background:var(--gold-soft);border:1px solid var(--gold-line);border-radius:12px;padding:16px}
.calc-out .big{font-size:28px;font-weight:800;color:var(--gold-deep)}
.kv{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px dashed var(--border);font-size:12.5px}
.kv:last-child{border-bottom:0}
.doc{font-size:13px;line-height:1.9;color:var(--text-2)}
.doc h3{margin:22px 0 8px;font-size:15px;color:var(--text)}
.doc h4{margin:16px 0 6px;font-size:13.5px;color:var(--text)}
.doc p{margin:0 0 10px}
.doc ol,.doc ul{padding-left:22px;margin:0 0 12px}
.qr-img{width:220px;height:220px;object-fit:contain;border-radius:12px;border:1px solid var(--border);background:#fff;margin:0 auto;display:block}
.drop-zone{border:2px dashed var(--border-2);border-radius:12px;padding:26px;text-align:center;color:var(--text-sub);background:var(--surface-2);cursor:pointer;transition:.15s}
.drop-zone:hover{border-color:var(--gold);background:var(--gold-soft)}
.tile-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}
.tile{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;border:1px solid var(--border);background:var(--surface-3)}
.tile img{width:100%;height:100%;object-fit:cover}
.tile .del{position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;font-size:12px;display:grid;place-items:center}
.step-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border);font-size:12.5px}
.step-row:last-child{border-bottom:0}
.step-n{width:22px;height:22px;border-radius:50%;background:var(--gold-soft);color:var(--gold-deep);display:grid;place-items:center;font-size:11px;font-weight:700;flex:none}
.notice-item{display:flex;gap:10px;padding:12px 0;border-bottom:1px solid var(--border)}
.notice-item:last-child{border-bottom:0}
.notice-dot{width:8px;height:8px;border-radius:50%;background:var(--gold);margin-top:6px;flex:none}
.notice-item.read .notice-dot{background:var(--border-2)}
.cmd-pal{width:min(100%,560px);background:var(--surface);border-radius:16px;box-shadow:var(--shadow-lg);overflow:hidden}
.cmd-pal .input{height:48px;border:0;border-bottom:1px solid var(--border);border-radius:0;font-size:15px}
.cmd-list{max-height:340px;overflow-y:auto;padding:6px}
.cmd-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:9px;cursor:pointer;font-size:13px}
.cmd-item:hover,.cmd-item.on{background:var(--gold-soft);color:var(--gold-deep)}
.cmd-item small{margin-left:auto;color:var(--text-sub);font-size:11px}
.mobile-bottom{display:none}

/* ---------- 响应式 ---------- */
@media(max-width:1180px){
  .top-chip.hide-md{display:none}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:960px){
  .sidebar{position:fixed;top:0;left:0;bottom:0;width:250px;transform:translateX(-100%);box-shadow:var(--shadow-lg)}
  .sidebar.open{transform:none}
  .sidebar.collapsed{width:250px}
  .sidebar.collapsed .side-head .txt,.sidebar.collapsed .nav-item .lbl,.sidebar.collapsed .nav-item .arrow,.sidebar.collapsed .nav-badge,.sidebar.collapsed .side-foot,.sidebar.collapsed .side-toggle{display:initial}
  .sidebar.collapsed .side-head{justify-content:flex-start;padding:0 14px}
  .sidebar.collapsed .nav-item{justify-content:flex-start;padding:0 10px}
  .sidebar.collapsed .nav-sub{display:block}
  .mobile-menu{display:grid}
  .scrim{position:fixed;inset:0;background:rgba(20,16,8,.4);z-index:39}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .auth{grid-template-columns:1fr}
  .auth-left{display:none}
  .auth-right{min-height:100%;justify-content:flex-start;padding-top:64px;overflow-y:auto}
}
@media(max-width:760px){
  .content{padding:12px 12px 76px}
  .topbar{padding:0 10px;gap:6px}
  .topbar .hide-sm{display:none}
  .form-grid,.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .filters .search{max-width:none;width:100%}
  .filters .input,.filters .select{flex:1;min-width:110px}
  .page-head h2{font-size:18px}
  .data-table{min-width:0}
  .data-table thead{display:none}
  .data-table tbody tr{display:block;padding:10px 12px;border-bottom:1px solid var(--border);border-radius:0}
  .data-table tbody tr.sel{background:var(--gold-soft)}
  .data-table td{display:flex;align-items:center;justify-content:space-between;gap:10px;border:0;padding:5px 0;text-align:right}
  .data-table td::before{content:attr(data-label);color:var(--text-sub);font-size:11px;font-weight:600;text-align:left;flex:none;max-width:42%}
  .data-table td[data-label=""]::before{display:none}
  .data-table td.col-check{justify-content:flex-start;padding-bottom:8px}
  .data-table td.col-check::before{content:"选择"}
  .cell-main{justify-content:flex-end}
  .cell-main .t{max-width:52vw}
  .row-acts{justify-content:flex-end}
  .modal{max-height:92vh}
  .modal-body{padding:16px}
  .overlay{padding:10px;align-items:flex-end}
  .modal{border-radius:18px 18px 0 0;width:100% !important}
  .drawer{width:100%}
  .mobile-bottom{display:flex;position:fixed;left:0;right:0;bottom:0;height:58px;background:var(--surface);border-top:1px solid var(--border);z-index:38;align-items:center;justify-content:space-around;padding-bottom:env(safe-area-inset-bottom)}
  .mobile-bottom button{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10px;color:var(--text-sub);flex:1}
  .mobile-bottom button.on{color:var(--gold-deep)}
  .mobile-bottom .mi{font-size:18px}
  .hero-card img{max-height:140px}
  .auth-card{padding:22px 20px;box-shadow:none;border:0}
  .auth-tools{top:12px;right:12px}
  .toast-wrap{top:8px}
}
@media(max-width:420px){
  .platform button{padding:0 8px;font-size:11px}
  .top-chip{padding:0 7px;font-size:11px}
  .stats{grid-template-columns:1fr 1fr;gap:8px}
  .stat .v{font-size:19px}
  .quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media print{.sidebar,.topbar,.tabbar,.toolbar,.filters,.mobile-bottom{display:none !important}.content{overflow:visible;padding:0}.card,.table-wrap{box-shadow:none}}

/* ---------- API 数据源 / 店铺授权配置 ---------- */
.ds-chip{font-weight:700;border-color:var(--border-2)}
.ds-chip.live{color:var(--green);background:var(--green-soft);border-color:transparent}
.ds-chip.demo{color:var(--amber);background:var(--amber-soft);border-color:transparent}
.ds-chip.local{color:var(--text-2);background:var(--surface-3);border-color:transparent}
.api-hero{background:linear-gradient(120deg,var(--surface),var(--surface-2))}
.ds-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ds-line{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface)}
.ds-line>div{flex:1;min-width:0}
.ds-dot{width:9px;height:9px;border-radius:50%;flex:none}
.ds-dot.ok{background:var(--green);box-shadow:0 0 0 3px var(--green-soft)}
.ds-dot.warn{background:var(--amber);box-shadow:0 0 0 3px var(--amber-soft)}
.ds-dot.idle{background:var(--text-sub);box-shadow:0 0 0 3px var(--surface-3)}
.api-result{margin-top:12px;padding:10px 12px;border-radius:var(--r-sm);font-size:12px;line-height:1.75;border:1px solid var(--border);background:var(--surface-2);word-break:break-word}
.api-result.ok{background:var(--green-soft);border-color:transparent;color:var(--green)}
.api-result.err{background:var(--red-soft);border-color:transparent;color:var(--red)}
.api-result.warn{background:var(--amber-soft);border-color:transparent;color:var(--amber)}
.api-result.info{background:var(--blue-soft);border-color:transparent;color:var(--blue)}
.api-err{margin-top:6px;color:var(--red)}
.api-pre{margin:8px 0 0;padding:10px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:8px;max-height:280px;overflow:auto;font-size:11px;line-height:1.5;white-space:pre-wrap;word-break:break-all}
#gm-api-store .form-grid{grid-template-columns:1fr 1fr}
#gm-api-store .field.full{grid-column:1/-1}
#gm-api-store .card{min-width:0}
@media(max-width:760px){
  .ds-grid{grid-template-columns:1fr}
  #gm-api-store .form-grid{grid-template-columns:1fr}
  #gm-api-store .field.full{grid-column:auto}
  .ds-chip{padding:0 8px;font-size:11px}
}

/* ---------- 申请与开通中心 ---------- */
.apply-hero{background:linear-gradient(120deg,var(--surface),var(--gold-soft))}
.apply-progress{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.apply-progress .progress{height:8px;border-radius:99px;background:var(--surface-3);overflow:hidden}
.apply-progress .progress>i{display:block;height:100%;background:linear-gradient(90deg,var(--gold),var(--gold-2,#e0bd6d));border-radius:99px;transition:width .3s}
.apply-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.apply-card{min-width:0;display:flex;flex-direction:column}
.apply-card .between{align-items:flex-start}
.apply-card .between>div:first-child{flex:1;min-width:0}
.apply-card .between>a.btn{flex:0 0 auto;white-space:nowrap;max-width:100%}
.apply-card h3{overflow-wrap:anywhere}
.apply-num{width:26px;height:26px;flex:none;display:grid;place-items:center;border-radius:8px;background:var(--gold-soft);color:var(--gold);font-weight:700;font-size:13px}
.apply-link{margin:0 0 8px;padding:8px 10px;border:1px dashed var(--border-2);border-radius:8px;background:var(--surface-2);word-break:break-all}
.apply-link a,.apply-docs a{color:var(--blue);text-decoration:none}
.apply-link a:hover,.apply-docs a:hover{text-decoration:underline}
.apply-docs{display:flex;flex-wrap:wrap;gap:6px 14px;margin:8px 0 12px}
.apply-2col{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:10px 0}
.apply-2col>div{min-width:0}
.apply-list{margin:8px 0 0;padding-left:18px;font-size:12px;line-height:1.8;color:var(--text-2)}
.apply-list li{margin-bottom:3px}
.apply-list.warn li::marker{color:var(--amber)}
.apply-meta{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:auto;padding:10px 0 0;font-size:11px;color:var(--text-sub);line-height:1.8}
.apply-meta code{padding:1px 5px;border-radius:4px;background:var(--surface-3);color:var(--text-2);font-size:11px}
.svc-box{padding:12px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);min-width:0}
.svc-box .form-grid{grid-template-columns:1fr 1fr}
.svc-box .field.full{grid-column:1/-1}
.mail-list{display:flex;flex-direction:column;gap:10px;max-height:52vh;overflow:auto}
.mail-item{padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.badge.idle{background:var(--surface-3);color:var(--text-sub)}
#gm-ai-host .form-grid{grid-template-columns:1fr 1fr}
/* 邮件通道切换：按所选服务商显示对应字段 */
.svc-box[data-mail-provider="resend"] .mail-smtp,
.svc-box[data-mail-provider="local"] .mail-smtp,
.svc-box[data-mail-provider="local"] .mail-resend,
.svc-box[data-mail-provider="smtp"] .mail-resend{display:none}
#ai-out{word-break:break-word}
#ap-mail-out{word-break:break-word}
@media(max-width:960px){
  .apply-grid{grid-template-columns:1fr}
}
@media(max-width:760px){
  .apply-2col{grid-template-columns:1fr}
  .svc-box .form-grid,#gm-ai-host .form-grid{grid-template-columns:1fr}
  .svc-box .field.full,#gm-ai-host .field.full{grid-column:auto}
  .apply-progress .progress{width:160px}
  .apply-card .btn-row .btn{flex:1 1 auto}
}

/* ============================================================
   管理后台控制台专属样式（沿用设计系统变量，深浅皮肤自适应）
   ============================================================ */
.top-title{font-weight:700;font-size:15px;color:var(--text);white-space:nowrap}
.admin-shell .side-foot{padding:12px 16px;border-top:1px solid var(--border);margin-top:8px}
.nav-group-head{display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:600;font-size:13px}
.nav-group-head .lbl{flex:1}
.nav-group-head .arrow{transition:.2s;color:var(--text-sub);font-size:12px}
.nav-group.open>.nav-group-head .arrow{transform:rotate(180deg)}
.menu-group{border:1px solid var(--border);border-radius:var(--r-sm);margin-bottom:10px;overflow:hidden;background:var(--surface)}
.menu-group-head{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--surface-2);border-bottom:1px solid var(--border)}
.menu-group-head b{flex:1;font-size:13.5px}
.menu-group-head .mono{font-size:11px;color:var(--text-sub)}
.menu-row{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px dashed var(--border)}
.menu-row:last-child{border-bottom:0}
.menu-row .ico{width:18px;text-align:center;color:var(--gold-deep)}
.menu-row .lbl{flex:1;font-size:13px}
.menu-row .mono{font-size:11px;color:var(--text-sub)}
.doc-row{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-sm);padding:12px;margin-bottom:8px}
.doc-row .field label{font-size:11.5px}
