/* 两用物项出口管制风险智能核查系统 - BESAFE 品牌视觉（智慧蓝 #003DAE · 中安红 #FA101F） */
:root {
  --primary: #003dae;
  --primary-2: #1655d0;
  --accent: #fa101f;
  --info: #00bfff;
  --warm: #ff9927;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2a3a;
  --gray: #66738a;
  --border: #dce3ee;
  --green: #16a34a;
  --green-bg: #e8f7ee;
  --yellow: #d97706;
  --yellow-bg: #fdf3e3;
  --red: #dc2626;
  --red-bg: #fdecec;
  --pending: #64707d;
  --pending-bg: #eef0f2;
  --shadow: 0 2px 8px rgba(0, 61, 174, .09);
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { color: var(--primary-2); text-decoration: none; }

/* ===== 顶部导航 ===== */
.topbar {
  background: linear-gradient(120deg, #002775, #003dae 55%, #1655d0);
  color: #fff; padding: 0 40px; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; font-weight: 800;
}
.brand small { display: block; font-size: 11px; font-weight: 400; opacity: .75; letter-spacing: 1px; }
.topbar .actions { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.topbar .user-chip { background: rgba(255,255,255,.12); padding: 5px 14px; border-radius: 20px; }
.topbar button.linkish { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 5px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.topbar button.linkish:hover { background: rgba(255,255,255,.15); }

/* ===== 主区 ===== */
.container { max-width: 1180px; margin: 0 auto; padding: 26px 24px 60px; }

.hero { text-align: center; padding: 30px 10px 24px; }
.hero h1 { font-size: 26px; color: var(--primary); margin-bottom: 8px; }
.hero p { color: var(--gray); font-size: 14.5px; }
.hero .tags { margin-top: 14px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero .tag { background: #fff; border: 1px solid var(--border); padding: 4px 14px; border-radius: 20px; font-size: 12.5px; color: var(--primary-2); }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 26px; margin-bottom: 22px; border: 1px solid #edf1f5;
}
.card h2 { font-size: 16.5px; color: var(--primary); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 4px; height: 18px; background: var(--accent); border-radius: 2px; }
.step-no { display:inline-flex; align-items:center; justify-content:center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12.5px; margin-right: 8px; }

/* ===== 表单 ===== */
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(45,90,142,.12); }
label { display: block; font-size: 13px; color: var(--gray); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 14px; } .row > * { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff; border: none; padding: 10px 22px;
  border-radius: 8px; font-size: 14px; cursor: pointer; transition: .15s; font-family: inherit;
}
.btn:hover { background: var(--primary-2); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--primary-2); background: #f6f9fc; }
.btn.small { padding: 6px 14px; font-size: 12.5px; border-radius: 6px; }
.btn.gold { background: var(--accent); color: #3a2f00; font-weight: 600; }
.btn.gold:hover { background: #d9b23c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }

/* ===== 密码框显示/隐藏开关 ===== */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 52px; }
.pwd-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-family: inherit; font-size: 12.5px;
  color: var(--gray); cursor: pointer; padding: 4px 8px; border-radius: 6px;
  user-select: none; transition: .15s;
}
.pwd-eye:hover { color: var(--primary-2); background: #f0f5fa; }

/* ===== 上传区 ===== */
.dropzone {
  border: 2px dashed #b9c6d4; border-radius: var(--radius); padding: 38px 20px;
  text-align: center; background: #f8fafc; cursor: pointer; transition: .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary-2); background: #eef4fa; }
.dropzone .icon { font-size: 38px; }
.dropzone .t1 { font-size: 15.5px; font-weight: 600; color: var(--primary); margin-top: 8px; }
.dropzone .t2 { font-size: 12.5px; color: var(--gray); margin-top: 4px; }
.file-list { margin-top: 14px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #f6f9fc;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: 13px;
}
.file-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { color: var(--gray); font-size: 12px; }
.file-item .del { color: var(--red); cursor: pointer; font-size: 15px; }

/* ===== 进度 ===== */
.progress-wrap { margin-top: 18px; }
.progress-bar { height: 10px; background: #e6ecf2; border-radius: 6px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: linear-gradient(90deg, var(--info), var(--primary-2)); width: 0; transition: width .4s; border-radius: 6px; }
.progress-msg { font-size: 13px; color: var(--gray); margin-top: 8px; display: flex; justify-content: space-between; }
.steps { display: flex; gap: 0; margin-top: 16px; }
.steps .st { flex: 1; text-align: center; font-size: 12px; color: var(--gray); position: relative; padding-top: 26px; }
.steps .st::before {
  content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%; background: #dfe6ee; color: #8794a3;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.steps .st.done::before { background: var(--green); color: #fff; }
.steps .st.active::before { background: var(--accent); color: #3a2f00; font-weight: 700; }
.steps .st::after { content: ""; position: absolute; top: 10px; left: calc(-50% + 16px); width: calc(100% - 32px); height: 2px; background: #dfe6ee; }
.steps .st:first-child::after { display: none; }
.steps .st.done::after, .steps .st.active::after { background: var(--green); }

/* ===== 风险徽章 ===== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.badge.green { background: var(--green-bg); color: var(--green); } .badge.green::before { background: var(--green); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); } .badge.yellow::before { background: var(--yellow); }
.badge.red { background: var(--red-bg); color: var(--red); } .badge.red::before { background: var(--red); }
.badge.pending { background: var(--pending-bg); color: var(--pending); } .badge.pending::before { background: var(--pending); }

/* ===== 表格 ===== */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: var(--primary); color: #fff; padding: 9px 10px; text-align: left; font-weight: 500; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:nth-child(even) td { background: #f8fafc; }
.tbl tr:hover td { background: #eef4fa; }

/* ===== 品目卡 ===== */
.item-card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.item-head { display: flex; align-items: center; gap: 14px; padding: 13px 18px; flex-wrap: wrap; }
.item-head.green { background: var(--green-bg); border-left: 5px solid var(--green); }
.item-head.yellow { background: var(--yellow-bg); border-left: 5px solid var(--yellow); }
.item-head.red { background: var(--red-bg); border-left: 5px solid var(--red); }
.item-head.pending { background: var(--pending-bg); border-left: 5px solid var(--pending); }
.item-head .nm { font-weight: 700; font-size: 15px; flex: 1; }
.item-head .sub { color: var(--gray); font-size: 12.5px; }
.item-body { padding: 16px 18px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 18px; margin-bottom: 12px; }
.kv { font-size: 13px; } .kv b { color: var(--primary); }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin: 10px 0; }
.alert.red { background: var(--red-bg); color: var(--red); border: 1px solid #f3c1c1; }
.alert.yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid #efd9ae; }
.alert.green { background: var(--green-bg); color: var(--green); border: 1px solid #bfe6cd; }
.alert.info { background: #e9f2fb; color: var(--primary-2); border: 1px solid #c7dcf0; }
.alert b { display: block; margin-bottom: 3px; }

.match-block { border: 1px solid var(--border); border-radius: 8px; margin: 12px 0; overflow: hidden; }
.match-title { background: #eef3f9; color: var(--primary); font-weight: 700; font-size: 13.5px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.clause-text { background: #f8fafc; padding: 12px 14px; font-size: 12.8px; white-space: pre-wrap; color: #37424e; max-height: 320px; overflow: auto; }
.cmp-table td.result-met { background: var(--red-bg) !important; color: var(--red); font-weight: 600; }
.cmp-table td.result-notmet { background: var(--green-bg) !important; color: var(--green); font-weight: 600; }
.cmp-table td.result-missing { background: var(--pending-bg) !important; color: var(--pending); font-weight: 600; }
.cmp-table th:nth-child(1) { width: 30%; } .cmp-table th:nth-child(2) { width: 20%; }
.cmp-table th:nth-child(3) { width: 11%; } .cmp-table th:nth-child(4) { width: 39%; }

.statement-box { background: #fffdf5; border: 1px dashed var(--accent); border-radius: 8px; padding: 18px 20px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.9; max-height: 500px; overflow: auto; }

/* ===== 模态框 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(16, 28, 43, .55); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 640px; max-width: 96vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.modal.wide { width: 900px; }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; color: var(--primary); display: flex; justify-content: space-between; align-items: center; }
.modal-head .x { cursor: pointer; font-size: 20px; color: var(--gray); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== 管理端 ===== */
.admin-layout { display: flex; min-height: calc(100vh - 62px); }
.sidebar { width: 210px; background: #fff; border-right: 1px solid var(--border); padding: 18px 12px; flex-shrink: 0; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 8px;
  color: var(--text); cursor: pointer; font-size: 14px; margin-bottom: 4px;
}
.sidebar .nav-item.active { background: var(--primary); color: #fff; }
.sidebar .nav-item:hover:not(.active) { background: #f0f4f8; }
.main-area { flex: 1; padding: 22px 26px; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--primary); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .lbl { font-size: 12.5px; color: var(--gray); }
.stat.g { border-top-color: var(--green); } .stat.g .num { color: var(--green); }
.stat.y { border-top-color: var(--yellow); } .stat.y .num { color: var(--yellow); }
.stat.r { border-top-color: var(--red); } .stat.r .num { color: var(--red); }
.stat.clickable { cursor: pointer; transition: .15s; }
.stat.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(30, 58, 95, .16); border-bottom: 1px solid var(--border); }
.stat.clickable::after { content: "查看明细 ›"; display: block; font-size: 11px; color: var(--primary-2); margin-top: 6px; opacity: .75; }
#summaryBar .stat.active { box-shadow: 0 0 0 2px var(--primary); }
#summaryBar .stat.active::after { opacity: 1; font-weight: 600; }
.item-card .item-head { cursor: pointer; }
.item-card .item-head::after { content: '▲'; margin-left: auto; font-size: 12px; color: rgba(255,255,255,.7); }
.item-card.collapsed .item-head::after { content: '▼'; }
.item-card.collapsed .item-body { display: none; }
.item-card.highlight { box-shadow: 0 0 0 3px var(--primary); }
.stat.p { border-top-color: var(--pending); } .stat.p .num { color: var(--pending); }
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { width: auto; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }

/* 提示 */
.toast { position: fixed; top: 76px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast-item { background: var(--primary); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 6px 18px rgba(0,0,0,.25); animation: slideIn .25s; max-width: 380px; }
.toast-item.err { background: var(--red); }
.toast-item.warn { background: var(--yellow); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { text-align: center; color: var(--gray); padding: 40px 0; font-size: 13.5px; }
.hidden { display: none !important; }

/* ===== 登录卡片 Tab 切换 ===== */
.login-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.login-tabs .l-tab {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 4px; font-family: inherit; font-size: 14px; color: var(--gray);
  cursor: pointer; transition: .15s;
}
.login-tabs .l-tab:hover { color: var(--primary-2); }
.login-tabs .l-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--accent); }

.footer-note { text-align: center; color: var(--gray); font-size: 12px; padding: 20px 0 40px; line-height: 1.8; }
.w-100 { width: 100%; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { background: #eef3f9; color: var(--primary-2); padding: 2px 10px; border-radius: 12px; font-size: 12px; margin: 2px 4px 2px 0; display: inline-block; }
.chip.warn { background: var(--yellow-bg); color: var(--yellow); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.green { background: var(--green-bg); color: var(--green); }

/* ===== 历史核查任务：卡片式 ===== */
.hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.hist-card {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; background: #fff;
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.hist-card:hover { border-color: #c3d5ef; box-shadow: 0 8px 20px rgba(0, 61, 174, .1); transform: translateY(-2px); }
.hist-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hist-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--gray); letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-name { font-size: 15px; font-weight: 700; color: var(--primary); line-height: 1.35; word-break: break-word; }
.hist-name em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--gray); margin-left: 5px; }
.hist-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 22px; }
.hist-chips .chip { margin: 0; }
.hist-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px dashed #e8eef7; padding-top: 10px; margin-top: auto; flex-wrap: wrap;
}
.hist-time { font-size: 12px; color: var(--gray); }
.hist-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.hist-acts .btn.small { padding: 4px 11px; }
.hist-acts .btn.danger { color: var(--red); }
.hist-acts .btn.danger:hover { border-color: var(--red); background: var(--red-bg); }
.hist-empty { grid-column: 1 / -1; text-align: center; color: var(--gray); padding: 28px 0; }
@media (max-width: 640px) {
  .hist-grid { grid-template-columns: 1fr; }
  .hist-foot { align-items: flex-start; }
}

/* ===== 登录方式切换 ===== */
.login-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.login-tabs .ltab {
  flex: 1; text-align: center; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  background: #f0f4f8; color: var(--gray); font-size: 13.5px; transition: .15s; user-select: none;
}
.login-tabs .ltab:hover { background: #e4ecf4; }
.login-tabs .ltab.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ===== 配额条与充值套餐 ===== */
.quota-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f6f9fc; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 14px; font-size: 13px;
}
.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pkg-card {
  position: relative; border: 2px solid var(--border); border-radius: 10px; padding: 16px 14px;
  text-align: center; cursor: pointer; transition: .15s; background: #fff;
}
.pkg-card:hover { border-color: var(--primary-2); box-shadow: var(--shadow); }
.pkg-card.hot { border-color: var(--accent); }
.pkg-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #3a2f00; font-size: 11px; font-weight: 700;
  padding: 2px 12px; border-radius: 10px; white-space: nowrap;
}
.pkg-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.pkg-price { font-size: 26px; font-weight: 800; color: var(--primary); margin: 6px 0 2px; }
.pkg-price::first-letter { font-size: 15px; }
.pkg-desc { font-size: 12px; color: var(--gray); margin-bottom: 10px; }
.pkg-picked { grid-column: 1 / -1; background: #eef3f9; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--primary); }
.ch-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ch-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 14px 10px; text-align: center;
  cursor: pointer; transition: .15s;
}
.ch-card:hover:not(.disabled) { border-color: var(--primary-2); box-shadow: var(--shadow); }
.ch-card.disabled { opacity: .45; cursor: not-allowed; }
.ch-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ch-desc { font-size: 12px; color: var(--gray); margin-top: 4px; }
.qr-wrap { grid-column: 1 / -1; text-align: center; padding: 10px 0 4px; }
.qr-img { width: 240px; height: 240px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #fff; }
.qr-tip { font-size: 15px; font-weight: 700; color: var(--primary); margin-top: 12px; }
.qr-sub { font-size: 12px; color: var(--gray); margin-top: 4px; }
.qr-status { font-size: 13px; color: var(--yellow); margin-top: 10px; font-weight: 600; }

/* ===== 移动端自适应 ===== */
@media (max-width: 768px) {
  .topbar { padding: 8px 14px; height: auto; min-height: 54px; flex-wrap: wrap; gap: 6px; }
  .brand { font-size: 14px; gap: 8px; }
  .brand small { display: none; }
  .topbar .actions { font-size: 12px; gap: 8px; }
  .container { padding: 14px 12px 40px; }
  .hero { padding: 18px 4px 16px; }
  .hero h1 { font-size: 19px; }
  .hero p { font-size: 13px; }
  .card { padding: 16px 14px; overflow-x: auto; }
  .card h2 { font-size: 15px; flex-wrap: wrap; }
  .row { flex-direction: column; gap: 0; }
  .code-row { flex-wrap: wrap; }
  .code-row .btn { flex: 1; }
  .dropzone { padding: 26px 14px; }
  .dropzone .icon { font-size: 30px; }
  .steps { flex-wrap: wrap; gap: 10px 0; }
  .steps .st { flex: 1 1 45%; font-size: 11px; padding-top: 24px; }
  .steps .st::after { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .num { font-size: 20px; }
  .kv-grid { grid-template-columns: 1fr; }
  .item-head { gap: 8px; padding: 11px 14px; }
  .item-head .nm { font-size: 13.5px; }
  .item-body { padding: 12px 14px; }
  .modal { width: 96vw; max-width: 96vw; max-height: 92vh; }
  .modal.wide { width: 96vw; }
  .modal-body { padding: 14px; }
  .modal-foot { flex-wrap: wrap; }
  .toast { top: 64px; right: 10px; left: 10px; }
  .toast-item { max-width: 100%; }
  .footer-note { padding: 14px 12px 30px; }

  /* 管理端：侧边栏 → 顶部横向导航 */
  .admin-layout { flex-direction: column; min-height: 0; }
  .sidebar {
    width: 100%; display: flex; overflow-x: auto; padding: 10px;
    border-right: none; border-bottom: 1px solid var(--border);
    position: sticky; top: 54px; z-index: 40; background: #fff;
  }
  .sidebar .nav-item { white-space: nowrap; margin-bottom: 0; padding: 8px 13px; font-size: 13px; }
  .main-area { padding: 14px 12px; }
  .filter-bar input, .filter-bar select { width: auto; flex: 1; min-width: 130px; }
  .pkg-grid { grid-template-columns: 1fr; }
  .ch-grid { grid-template-columns: 1fr; }
  .quota-bar { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (max-width: 480px) {
  .container { padding: 10px 8px 32px; }
  .card { padding: 13px 10px; }
  .steps .st { flex: 1 1 100%; }
  .btn { padding: 10px 16px; }
  .tbl th, .tbl td { padding: 7px 8px; font-size: 12px; }
}

/* ===== q5：工作台趋势图 / 快捷筛选 / 新查询页 ===== */
.stat.gold { border-top-color: var(--accent); } .stat.gold .num { color: var(--accent); }
.stat.blue { border-top-color: var(--primary-2); } .stat.blue .num { color: var(--primary-2); }

.trend-chart { display: flex; align-items: flex-end; gap: 4%; height: 190px; padding: 10px 6px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.trend-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; width: 100%; justify-content: center; }
.trend-bar { width: 16px; max-width: 26%; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .4s; }
.trend-bar.red { background: var(--red); }
.trend-bar.yellow { background: var(--yellow); }
.trend-bar.green { background: var(--green); }
.trend-bar.gray { background: #b9c6d4; }
.trend-date { font-size: 11.5px; color: var(--gray); white-space: nowrap; }
.trend-total { font-size: 11px; color: var(--primary-2); font-weight: 600; white-space: nowrap; }
.trend-empty { color: var(--gray); font-size: 13px; margin: auto; }
.trend-legend { display: flex; gap: 14px; font-size: 12px; color: var(--gray); flex-wrap: wrap; }
.trend-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.trend-legend .lg.red { background: var(--red); } .trend-legend .lg.yellow { background: var(--yellow); }
.trend-legend .lg.green { background: var(--green); } .trend-legend .lg.gray { background: #b9c6d4; }

.clickable-chip { cursor: pointer; transition: .15s; user-select: none; }
.clickable-chip:hover { background: var(--primary); color: #fff; }

.role-tag { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 11.5px; white-space: nowrap; }
.role-tag.admin { background: var(--red-bg); color: var(--red); }
.role-tag.reviewer { background: #e9f2fb; color: var(--primary-2); }
.role-tag.customer { background: var(--green-bg); color: var(--green); }
.role-tag.system { background: var(--pending-bg); color: var(--pending); }

td .mini-link { cursor: pointer; color: var(--primary-2); }
td .mini-link:hover { text-decoration: underline; }

/* 操作列按钮组：三个操作竖向堆叠，节省横向宽度 */
.btn-col { display: flex; flex-direction: column; gap: 5px; }
.btn-col .btn { width: 100%; min-width: 78px; padding: 4px 8px; font-size: 12px; white-space: nowrap; }

/* 表格单元格紧凑显示：超长截断、不换行 */
.cell-ellipsis { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-nowrap { white-space: nowrap; }
.cell-time { font-size: 12px; white-space: nowrap; line-height: 1.55; color: var(--gray); }
.cell-time > div { color: var(--gray); }

/* ===== 联系我们（页脚上方横幅） ===== */
.contact-band {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 30px;
  max-width: 760px; margin: 26px auto 0; padding: 24px 28px;
  background: linear-gradient(135deg, #f9fbfd 0%, #eef4fa 55%, #e9f0f8 100%);
  border: 1px solid #dfe8f1; border-radius: 16px;
  box-shadow: 0 8px 26px rgba(22, 48, 79, .10);
}
/* 右上角柔光装饰 */
.contact-band::before {
  content: ""; position: absolute; top: -60px; right: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 61, 174, .14), transparent 70%);
}
.contact-band.hidden { display: none; }

/* 二维码：白色卡片 + 扫码取景四角 */
.contact-qr { flex-shrink: 0; position: relative; z-index: 1; }
.contact-qr .qr-frame {
  position: relative; padding: 9px; background: #fff; border-radius: 14px;
  box-shadow: 0 5px 16px rgba(22, 48, 79, .14);
  transition: transform .22s ease, box-shadow .22s ease;
}
.contact-qr .qr-frame:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(22, 48, 79, .2); }
.contact-qr img {
  display: block; width: 152px; height: 152px; object-fit: contain; border-radius: 8px;
}
/* 取景四角 */
.contact-qr .qr-frame::before, .contact-qr .qr-frame::after,
.contact-qr .qr-tip::before, .contact-qr .qr-tip::after {
  content: ""; position: absolute; width: 17px; height: 17px; border: 2px solid var(--primary); opacity: .55;
}
.contact-qr .qr-frame::before { top: 3px; left: 3px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.contact-qr .qr-frame::after { bottom: 3px; right: 3px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }
.contact-qr .qr-tip::before { top: 3px; right: 3px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.contact-qr .qr-tip::after { bottom: 3px; left: 3px; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.contact-qr .qr-tip {
  position: absolute; inset: 0; pointer-events: none;
  font-size: 0; /* 四角装饰载体，不显示文字 */
}
.contact-qr .qr-empty {
  width: 152px; height: 152px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed #c6d2de; border-radius: 14px; color: var(--gray); font-size: 12.5px; background: #fff;
}

.contact-info { min-width: 0; position: relative; z-index: 1; flex: 1; }
.contact-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 18px; font-weight: 700; color: var(--primary); letter-spacing: .5px;
}
.contact-title::before {
  content: ""; width: 4px; height: 19px; border-radius: 2px; background: var(--accent);
}
.ct-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .5px; color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  padding: 2px 8px; border-radius: 20px;
}
.contact-sub { font-size: 12.5px; color: var(--gray); margin: 6px 0 12px 13px; }

.ci-list { margin-left: 13px; }
.ci-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-top: 1px solid #e4ecf4; font-size: 13.5px;
}
.ci-row:first-child { border-top: none; }
.ci-ico {
  width: 27px; height: 27px; flex-shrink: 0; border-radius: 9px;
  background: linear-gradient(135deg, #eaf1f8, #dfe9f3);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.ci-label { width: 40px; flex-shrink: 0; color: var(--gray); font-size: 12.5px; }
.ci-val { font-weight: 600; color: var(--text); letter-spacing: .3px; }
.ci-copy {
  margin-left: auto; flex-shrink: 0; cursor: pointer;
  background: #fff; border: 1px solid #cfdae6; color: var(--primary-2);
  font-size: 11.5px; padding: 3px 10px; border-radius: 6px; transition: all .18s;
}
.ci-copy:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.ci-copy.ok { background: var(--green); border-color: var(--green); color: #fff; }

/* ===== 充值赠送活动 ===== */
.promo-banner {
  grid-column: 1 / -1; background: linear-gradient(120deg, #fff1f0, #fff7e6);
  border: 1px dashed #ffa39e; border-radius: 10px; padding: 9px 14px;
  font-size: 13.5px; font-weight: 600; color: #cf1322; margin-bottom: 4px;
}
.pkg-tag.promo { background: var(--red); }

/* ===== 响应式补充：表格横向滚动、触摸友好、弹窗自适应 ===== */
/* 表格外层容器：列多时在容器内横向滚动，不撑宽整个页面 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap::-webkit-scrollbar { height: 8px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: #c6d2de; border-radius: 4px; }

@media (max-width: 900px) {
  /* 中等屏幕（平板竖屏/小笔记本）：表格允许滚动，避免列被挤成一团 */
  .tbl { min-width: 660px; }
}

@media (max-width: 768px) {
  /* 表格：缩小字号与内边距，减少需要滚动的宽度 */
  .tbl { min-width: 600px; }
  .tbl th, .tbl td { padding: 7px 8px; font-size: 12.5px; }

  /* 侧边栏改为顶部横向导航后不再吸顶，避免与换行后的顶栏错位 */
  .sidebar { position: static; }

  /* 触摸目标放大，手机上更好点 */
  .btn { min-height: 34px; padding: 8px 14px; }
  .btn.small { min-height: 30px; font-size: 12.5px; }
  .btn-col .btn { min-height: 30px; padding: 6px 8px; }
  .filter-bar input, .filter-bar select, .filter-bar button { min-height: 34px; }

  /* 弹窗：小屏更贴近全屏，底部按钮平分宽度 */
  .modal-mask { padding: 10px; }
  .modal { max-width: 100%; max-height: 94vh; border-radius: 10px; }
  .modal-head { padding: 13px 16px; font-size: 15px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; gap: 8px; }
  .modal-foot .btn { flex: 1; justify-content: center; }

  /* 详情里的键值对、统计数字在小屏换行显示 */
  .kv-grid { grid-template-columns: 1fr; }
  .stat .num { font-size: 22px; }
  .toast { right: 10px; left: 10px; top: 64px; }
  .toast-item { max-width: none; }
}

@media (max-width: 480px) {
  .main-area { padding: 12px 8px; }
  .card { padding: 12px 10px; }
  /* 联系我们：小屏竖排居中 */
  .contact-band { flex-direction: column; gap: 16px; padding: 20px 16px; }
  .contact-qr img, .contact-qr .qr-empty { width: 178px; height: 178px; }
  .contact-info { width: 100%; }
  .contact-title { justify-content: center; }
  .contact-sub { margin-left: 0; text-align: center; }
  .ci-list { margin-left: 0; }
  .ci-row { padding: 8px 0; }
  .pager-size { margin-left: 0; }
  .qr-img { width: 200px; height: 200px; }
}

/* 分页条 */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.pager-info { font-size: 12.5px; color: var(--gray); margin-right: 6px; }
.pager-gap { color: var(--gray); padding: 0 2px; font-size: 12.5px; }
.pager-size { margin-left: auto; padding: 5px 8px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); }
