/* ============================================================
   MyAuth 自建授权系统 - 统一样式
   ============================================================ */
:root {
    --bg: #f6f7fa;
    --panel: #ffffff;
    --line: #e9ecf2;
    --line-soft: #f0f2f7;
    --ink: #171c28;
    --ink2: #687182;
    --brand: #4c6fff;
    --brand-dark: #3b55e6;
    --brand-grad: linear-gradient(135deg, #4c6fff 0%, #7b5bff 100%);
    --ok: #129c54;
    --warn: #d97706;
    --bad: #de3d3d;
    --sidebar: #10141f;
    --sidebar-ink: #99a1b3;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16,24,40,.05);
    --ring: 0 0 0 3px rgba(76,111,255,.13);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef1f8; padding: 1px 6px; border-radius: 5px; font-family: Consolas, "JetBrains Mono", monospace; font-size: 12.5px; word-break: break-all; }
button.link:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: var(--sidebar); color: var(--sidebar-ink);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.brand { padding: 22px 20px 16px; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .3px; line-height: 1.4; }
.brand::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--brand-grad); margin-right: 8px; vertical-align: 1px; }
.brand span { display: block; font-size: 11.5px; font-weight: 400; color: var(--sidebar-ink); margin-top: 5px; letter-spacing: 0; }
.sidebar nav { flex: 1; padding: 8px 10px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 2px;
    border-radius: 9px; color: var(--sidebar-ink); font-size: 13.5px;
    transition: background .15s, color .15s;
}
.nav-item i { font-style: normal; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav-item.on { background: rgba(90,116,255,.18); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); display: flex; justify-content: space-between; align-items: center; }
.side-foot a { color: var(--sidebar-ink); font-size: 13px; }
.side-foot a:hover { color: #fff; }
.side-foot .balance { color: #ffd166; font-size: 12.5px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 13px 24px; display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.topbar-right { color: var(--ink2); font-size: 13px; }
.content { padding: 22px 24px; flex: 1; }
.foot { padding: 12px 24px; color: var(--ink2); font-size: 12px; border-top: 1px solid var(--line); }

/* ---------- 面板 / 统计卡 ---------- */
.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 18px; padding: 18px 20px; overflow-x: auto; box-shadow: var(--shadow);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.panel-head h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head h2::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--brand-grad); flex-shrink: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow);
}
.stat-card b { font-size: 23px; color: var(--brand); letter-spacing: -.3px; }
.stat-card.warn b { color: var(--bad); }
.stat-card span { color: var(--ink2); font-size: 12.5px; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.tbl th { color: var(--ink2); font-weight: 600; font-size: 12px; white-space: nowrap; letter-spacing: .4px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8f9fd; }
.tbl .empty { text-align: center; color: var(--ink2); padding: 30px 0; }
.tbl .logrow td { background: #f8f9fd; }
.mono { font-family: Consolas, "JetBrains Mono", monospace; font-size: 12.5px; }
.logcell { max-width: 320px; }
.ops { white-space: nowrap; }
.ops form, form.inline { display: inline; }
button.link { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 13px; padding: 0; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--bad); }

/* ---------- 表单 ---------- */
.form label, .login-card label { display: block; font-size: 13px; color: var(--ink2); margin: 12px 0 5px; }
input[type=text], input[type=password], select, textarea {
    width: 100%; max-width: 420px; padding: 9px 12px; border: 1px solid #dde1ea;
    border-radius: 8px; font-size: 13.5px; background: #fff; color: var(--ink); outline: none;
    transition: border-color .15s, box-shadow .15s;
}
textarea { max-width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
.form .btn, .login-card .btn { margin-top: 16px; }
.row-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.row-form > div { min-width: 180px; }
.row-form .btn { margin-top: 0; }
.form-tbl td, .form-tbl th { border-bottom: 1px solid var(--line-soft); }
.filter { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filter input, .filter select { max-width: 220px; width: auto; min-width: 160px; }
textarea.code {
    width: 100%; font-family: Consolas, "JetBrains Mono", monospace; font-size: 12.5px; line-height: 1.6;
    background: #10141f; color: #cfe0ff; border: none; border-radius: 10px; padding: 14px; white-space: pre;
}

/* ---------- 按钮 / 徽章 / 提示 ---------- */
.btn {
    display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid #dde1ea;
    background: #fff; color: var(--ink); font-size: 13.5px; cursor: pointer; text-decoration: none;
    transition: border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand-grad); border: none; color: #fff; box-shadow: 0 2px 8px rgba(76,111,255,.3); }
.btn.primary:hover { color: #fff; box-shadow: 0 4px 14px rgba(76,111,255,.4); transform: translateY(-1px); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn.block { width: 100%; text-align: center; }
.badge { display: inline-block; padding: 2.5px 10px; border-radius: 999px; font-size: 12px; background: #eef1f8; color: var(--ink2); }
.badge.ok { background: #e5f6ec; color: var(--ok); }
.badge.warn { background: #fdf1df; color: var(--warn); }
.badge.bad { background: #fdeaea; color: var(--bad); }
.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 12px; font-size: 13.5px; border-left: 3px solid transparent; }
.alert.ok { background: #e5f6ec; color: var(--ok); border-left-color: var(--ok); }
.alert.bad { background: #fdeaea; color: var(--bad); border-left-color: var(--bad); }
.hint { color: var(--ink2); font-size: 12.5px; line-height: 1.7; margin-bottom: 10px; }
ul.tips { padding-left: 18px; color: var(--ink2); font-size: 13px; line-height: 2; }
.tabs { display: flex; gap: 6px; }
.tabs a { padding: 5px 14px; border-radius: 999px; font-size: 13px; color: var(--ink2); border: 1px solid var(--line); transition: all .15s; }
.tabs a.on { background: var(--brand-grad); color: #fff; border-color: transparent; }
.tabs a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.tabs a.on:hover { color: #fff; }
.pager { margin-top: 12px; color: var(--ink2); font-size: 13px; display: flex; gap: 12px; align-items: center; }

/* ---------- 登录页 / 安装页 ---------- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(900px 480px at 15% -10%, rgba(99,102,241,.28), transparent 60%),
        radial-gradient(800px 460px at 110% 110%, rgba(59,130,246,.2), transparent 60%),
        #10141f;
    padding: 20px;
}
.login-card {
    width: 400px; max-width: 100%; background: var(--panel); border-radius: 16px;
    padding: 36px 32px; box-shadow: 0 24px 70px rgba(2,6,23,.45);
}
.login-card h1 { font-size: 20px; text-align: center; letter-spacing: .3px; }
.login-card .sub { text-align: center; color: var(--ink2); font-size: 13px; margin: 8px 0 18px; }
.login-card input { max-width: 100%; }
.install-card { width: 620px; }
.install-card .tbl { margin-bottom: 16px; }
.row2 { display: flex; gap: 10px; }
.row2 input { max-width: none; }

/* ---------- 入口页 ---------- */
.home-hero {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background:
        radial-gradient(900px 480px at 15% -10%, rgba(99,102,241,.28), transparent 60%),
        radial-gradient(800px 460px at 110% 110%, rgba(59,130,246,.2), transparent 60%),
        #10141f;
    color: #fff; text-align: center; padding: 20px;
}
.home-hero h1 { font-size: 34px; margin-bottom: 10px; letter-spacing: -.5px; }
.home-hero p { color: #aab4d0; margin-bottom: 30px; }
.home-hero .btns { display: flex; gap: 14px; }
.home-hero .btn { padding: 12px 34px; font-size: 15px; border: none; border-radius: 10px; }
.home-hero .btn.primary { box-shadow: 0 6px 22px rgba(76,111,255,.45); }
.home-hero .btn.ghost { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- 门户 / 商城 ---------- */
body.portal { background: var(--bg); }
.topnav { background: rgba(255,255,255,.86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topnav .wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 58px; }
.topnav .logo { font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: .2px; }
.topnav .logo::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2.5px; background: var(--brand-grad); margin-right: 7px; }
.topnav nav { display: flex; gap: 18px; align-items: center; }
.topnav nav a { color: var(--ink2); font-size: 13.5px; }
.topnav nav a.on, .topnav nav a:hover { color: var(--brand); text-decoration: none; }
.topnav .nav-btn { background: var(--brand-grad); color: #fff; padding: 6px 16px; border-radius: 8px; box-shadow: 0 2px 8px rgba(76,111,255,.3); }
.topnav .nav-btn:hover { text-decoration: none; box-shadow: 0 4px 12px rgba(76,111,255,.4); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hero2 {
    background:
        radial-gradient(900px 480px at 15% -60%, rgba(99,102,241,.3), transparent 60%),
        radial-gradient(800px 420px at 110% 140%, rgba(59,130,246,.22), transparent 60%),
        #10141f;
    color: #fff; text-align: center; padding: 52px 20px;
}
.hero2 h1 { font-size: 28px; margin-bottom: 8px; letter-spacing: -.4px; }
.hero2 p { color: #aab4d0; font-size: 14px; }
.portal-body { padding: 26px 20px 40px; }
.query-panel h2, .section-head h2 { font-size: 16px; margin-bottom: 10px; }
.query-form { display: flex; gap: 10px; margin-bottom: 14px; }
.query-form input { flex: 1; max-width: 480px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 14px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.store-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; }
.store-card:hover { box-shadow: 0 10px 26px rgba(30,50,120,.1); transform: translateY(-2px); }
.store-card h3 { font-size: 15px; }
.store-card .desc { color: var(--ink2); font-size: 12.5px; line-height: 1.7; flex: 1; min-height: 42px; }
.store-card .card-foot { display: flex; justify-content: space-between; align-items: center; }
.price { color: #e0342b; font-weight: 700; font-size: 20px; }
.price i { font-style: normal; font-size: 13px; margin-right: 1px; }
.price small { color: var(--ink2); font-weight: 400; font-size: 12px; }
.price.big { font-size: 28px; }
.detail-panel { padding: 26px; }
.crumb { color: var(--ink2); font-size: 12.5px; margin-bottom: 12px; }
.detail-name { font-size: 22px; margin-bottom: 10px; }
.detail-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.detail-desc { color: var(--ink); font-size: 14px; line-height: 2; border-top: 1px solid var(--line); padding-top: 16px; }
.detail-buy { margin-top: 20px; display: flex; gap: 12px; align-items: center; }
.portal-foot { text-align: center; color: var(--ink2); font-size: 12px; padding: 22px 0 34px; }
.login-links { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; max-width: none; }
.code-row .btn { white-space: nowrap; margin-top: 0; }
.amount-presets { display: flex; gap: 10px; flex-wrap: wrap; }
.preset { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; margin: 0; color: var(--ink); }
.preset:has(input:checked) { border-color: var(--brand); color: var(--brand); }
.form-tbl { margin-bottom: 6px; }
.form-tbl th { width: 140px; }
.crumb a { color: var(--ink2); }
.crumb a:hover { color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .sidebar nav { display: flex; flex-wrap: wrap; padding: 4px 10px; }
    .brand { padding: 12px 16px; }
    .side-foot { border-top: none; padding: 8px 12px; }
    .content { padding: 14px; }
    .tbl { font-size: 12.5px; }
}

/* --- v1.2: 商城封面 / 图文描述 / 行内换绑 --- */
.store-cover { display:block; margin:-18px -18px 12px; border-radius:10px 10px 0 0; overflow:hidden; background:#f3f5fa; }
.store-cover img { width:100%; height:140px; object-fit:cover; display:block; }
.detail-desc.rich img { max-width:100%; height:auto; border-radius:8px; }
.detail-desc.rich h1,.detail-desc.rich h2,.detail-desc.rich h3 { margin:18px 0 8px; }
.detail-desc.rich p { margin:8px 0; line-height:1.9; }
.inline-form { display:inline-flex; gap:6px; margin:6px 0 0; align-items:center; }
.inline-form input[type=text] { width:190px; padding:5px 8px; font-size:12px; }

/* --- v1.3: 商城 UI 重构（封面 16:9 约束） --- */
.store-grid { grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 18px; }
.store-card {
  padding: 0; overflow: hidden; border-radius: 12px; display: flex; flex-direction: column;
  border: 1px solid #e8ecf4; box-shadow: 0 2px 10px rgba(24,39,75,.05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.store-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(24,39,75,.12); }
.store-card .store-cover {
  display: block; margin: 0; border-radius: 0; overflow: hidden; background: #f3f5fa;
  aspect-ratio: 16 / 9; position: relative;
}
.store-card .store-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s ease;
}
.store-card:hover .store-cover img { transform: scale(1.045); }
.store-card .store-cover.nocover {
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-grad);
}
.store-card .store-cover.nocover span { color: #fff; font-size: 40px; font-weight: 700; opacity: .9; text-transform: uppercase; }
.store-card h3 { margin: 14px 16px 6px; font-size: 15.5px; color: #1f2733; }
.store-card .desc {
  margin: 0 16px 12px; color: #8a93a6; font-size: 12.5px; line-height: 1.7; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.store-card .card-foot {
  margin: 0 16px 14px; padding-top: 12px; border-top: 1px dashed #eceff5;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.store-card .price small { font-size: 11px; color: #9aa3b5; }
.detail-cover {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px;
  margin-bottom: 18px; display: block; background: #f3f5fa;
}
.detail-desc.rich { border-top: 1px dashed #eceff5; margin-top: 14px; padding-top: 14px; }

/* --- v1.4: 首页极简风 --- */
.mhero { text-align: center; padding: 64px 20px 40px; }
.mhero .chip {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  background: #eef1ff; color: var(--brand); font-size: 12.5px; margin-bottom: 18px; font-weight: 500;
}
.mhero h1 { font-size: 34px; margin: 0 0 10px; color: var(--ink); letter-spacing: -.8px; }
.mhero .sub { color: var(--ink2); font-size: 14px; margin: 0 0 26px; }
.mquery { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.mquery input {
  flex: 1; padding: 12px 16px; border: 1px solid #dde1ea; border-radius: 10px;
  font-size: 14px; outline: none; transition: border .15s, box-shadow .15s;
}
.mquery input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.mquery .btn { padding: 12px 26px; border-radius: 10px; }
.mstats { display: flex; justify-content: center; flex-wrap: wrap; gap: 40px; margin-top: 34px; }
.mstats div { display: flex; flex-direction: column; gap: 3px; }
.mstats b { font-size: 14px; color: var(--ink); }
.mstats span { font-size: 12px; color: #9aa3b5; }
@media (max-width: 640px) {
  .mhero h1 { font-size: 26px; }
  .mstats { gap: 18px; }
  .mstats div { min-width: 40%; }
}

/* ---------------- 分页条 ---------------- */
.pager{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;padding:16px 0 4px}
.pager .pg-info{font-size:13px;color:var(--ink2);margin-right:8px}
.pager .pg-btn{display:inline-block;min-width:32px;padding:5px 10px;border:1px solid #dde1ea;border-radius:8px;font-size:13px;color:var(--ink);text-decoration:none;text-align:center;background:#fff;transition:all .15s}
.pager .pg-btn:hover{border-color:var(--brand);color:var(--brand)}
.pager .pg-btn.on{background:var(--brand-grad);border-color:transparent;color:#fff;font-weight:600}
.pager .pg-dots{color:#9aa3b5;padding:0 2px}

/* ---------------- v1.6: 前台公告条 ---------------- */
.ad-wrap { margin-bottom: 14px; }
.ad-banner { display: flex; gap: 10px; align-items: flex-start; background: linear-gradient(135deg, #eef4ff, #f6f0ff); border: 1px solid #dfe7ff; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.ad-banner b { color: #2b56d4; font-size: 13.5px; display: block; margin-bottom: 2px; }
.ad-body { color: #475069; font-size: 13px; line-height: 1.8; word-break: break-word; }
.ad-body a { color: #2b56d4; }
.ad-main { flex: 1; min-width: 0; }
.ad-link { font-size: 12.5px; white-space: nowrap; }
.ad-close { background: none; border: none; color: #9aa3b5; font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px; flex-shrink: 0; }

/* 公告通知板块（账户概览） */
.notice-list { list-style: none; padding: 0; }
.notice-list li { padding: 12px 2px; border-bottom: 1px dashed var(--line); }
.notice-list li:last-child { border-bottom: none; padding-bottom: 2px; }
.notice-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.notice-head b { color: var(--ink); font-size: 13.5px; }
.notice-time { color: var(--ink2); font-size: 12px; white-space: nowrap; }
.notice-body { color: #475069; font-size: 13px; line-height: 1.8; margin-top: 5px; word-break: break-word; }
.notice-body a { color: var(--brand); }
.notice-link { display: inline-block; margin-top: 5px; font-size: 12.5px; }

/* ---------------- v1.7: 表格操作列收紧（防横向溢出） ---------------- */
.tbl td.ops { white-space: normal; max-width: 300px; }
.tbl td.ops form, .tbl td.ops form.inline { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0; vertical-align: middle; }
.tbl td.ops input[type=text] { width: 74px; max-width: 74px; padding: 3px 6px; font-size: 12.5px; border-radius: 6px; }
.tbl td.ops select { width: auto; max-width: 92px; padding: 3px 6px; font-size: 12.5px; border-radius: 6px; }
.tbl td.ops .link { white-space: nowrap; }

/* ---------------- v1.9: 按钮质感升级（去素） ---------------- */
.btn { box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.btn:hover { background: #f5f7ff; box-shadow: 0 2px 8px rgba(76,111,255,.14); }
.btn.sm { padding: 6px 14px; font-weight: 500; }
/* 表格行内操作按钮 → 柔色胶囊 */
.tbl td.ops button.link {
  display: inline-block; padding: 3.5px 11px; border-radius: 999px;
  background: rgba(76,111,255,.09); color: var(--brand); font-size: 12px; font-weight: 500;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tbl td.ops button.link:hover { background: var(--brand); color: #fff; text-decoration: none; box-shadow: 0 2px 6px rgba(76,111,255,.35); }
.tbl td.ops button.link.danger { background: rgba(222,61,61,.09); color: var(--bad); }
.tbl td.ops button.link.danger:hover { background: var(--bad); color: #fff; box-shadow: 0 2px 6px rgba(222,61,61,.35); }
/* 行内小按钮（非表格）：淡底胶囊 */
form.inline > button.link {
  display: inline-block; padding: 3.5px 11px; border-radius: 999px;
  background: rgba(76,111,255,.09); color: var(--brand); font-size: 12px; font-weight: 500;
  transition: background .15s, color .15s;
}
form.inline > button.link:hover { background: var(--brand); color: #fff; text-decoration: none; }
form.inline > button.link.danger { background: rgba(222,61,61,.09); color: var(--bad); }
form.inline > button.link.danger:hover { background: var(--bad); color: #fff; }

/* ---------------- v1.10: 统计卡可点击 ---------------- */
a.stat-card { text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
a.stat-card:hover { text-decoration: none; border-color: var(--brand); box-shadow: 0 4px 14px rgba(76,111,255,.15); transform: translateY(-2px); }
a.stat-card:hover b { color: var(--brand-dark); }
a.stat-card.warn:hover b { color: var(--bad); }

/* ---------------- v1.5: 移动端布局优化 ---------------- */
@media (max-width: 760px) {
    body { font-size: 13.5px; }

    /* 后台/用户中心框架：侧栏变为抽屉菜单（汉堡按钮唤出） */
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-right: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 16px; cursor: pointer; padding: 0; flex-shrink: 0; }
    .topbar { gap: 10px; }
    .topbar h1 { flex: 1; }
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: 240px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; transform: translateX(-105%); transition: transform .25s ease; z-index: 60; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .layout.drawer-open .sidebar { transform: translateX(0); }
    .sidebar nav { flex-direction: column; flex-wrap: nowrap; overflow-y: auto; padding: 8px 10px; }
    .side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 12px 14px; }
    .drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
    .layout.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }
    .topbar { padding: 10px 14px; position: static; }
    .topbar h1 { font-size: 15px; }
    .topbar-right { font-size: 12px; max-width: 55%; text-align: right; }
    .content { padding: 12px; }
    .foot { padding: 10px 14px; text-align: center; }

    /* 面板 / 统计卡 */
    .panel { padding: 12px; border-radius: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .panel-head h2 { font-size: 14px; }
    .stat-grid { gap: 10px; }
    .stat-card { padding: 12px; }
    .stat-card b { font-size: 19px; }

    /* 数据表格：横向滚动查看，避免挤压变形 */
    .tbl { min-width: 620px; font-size: 12.5px; }
    .tbl th, .tbl td { padding: 8px; }
    .logcell { max-width: 200px; }

    /* 编辑表单堆叠为单列（标签在上、控件在下） */
    .form-tbl, .form-tbl tbody { display: block; min-width: 0; }
    .form-tbl tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
    .form-tbl th, .form-tbl td { display: block; width: auto !important; border-bottom: none; padding: 4px 0; }
    .form-tbl th { font-size: 12px; color: var(--ink2); padding-top: 8px; }
    input[type=text], input[type=password], select { max-width: 100%; }
    .row-form > div { min-width: 100%; }
    .filter input, .filter select { width: 100%; max-width: 100%; min-width: 0; }
    textarea.code { font-size: 11.5px; padding: 10px; }

    /* 按钮 / 标签页 */
    .btn { padding: 9px 16px; }
    .form .btn, .login-card .btn { width: 100%; text-align: center; }
    .tabs { flex-wrap: wrap; }

    /* 门户顶部导航 */
    .topnav .wrap { padding: 0 12px; height: 52px; }
    .topnav nav { gap: 12px; }
    .topnav nav a { font-size: 13px; }

    /* 首页 / 商城 / 详情 */
    .hero2 { padding: 36px 16px; }
    .hero2 h1 { font-size: 22px; }
    .mhero { padding: 40px 16px 28px; }
    .mquery { flex-direction: column; }
    .mquery .btn { width: 100%; }
    .portal-body { padding: 18px 12px 30px; }
    .wrap { padding: 0 12px; }
    .store-grid { grid-template-columns: 1fr; gap: 14px; }
    .detail-panel { padding: 16px; }
    .detail-name { font-size: 19px; }
    .detail-meta { flex-wrap: wrap; gap: 10px; }
    .detail-buy { flex-wrap: wrap; }
    .detail-buy .btn { flex: 1 1 auto; }
    .query-form { flex-direction: column; }
    .query-form input { max-width: 100%; }
    .query-form .btn { width: 100%; }

    /* 登录 / 充值 / 行内操作 */
    .login-card { padding: 26px 20px; border-radius: 12px; }
    .preset { flex: 1 1 40%; justify-content: center; }
    .inline-form { flex-wrap: wrap; }
    .inline-form input[type=text] { width: 100%; }
}
@media (max-width: 400px) {
    .mhero h1 { font-size: 22px; }
    .topnav .logo { font-size: 14px; }
    .topnav nav { gap: 10px; }
    .topnav nav a { font-size: 12px; }
}
