/* BigSeaCode — tech-style dark theme. Palette: deep black + emerald + amber.
   Strictly NO blue/purple. */
:root {
  --bg-0: #07090a;
  --bg-1: #0d1113;
  --bg-2: #141a1d;
  --bg-3: #1c2428;
  --line: #25313680;
  --text: #e6efe9;
  --text-mute: #8a9b94;
  --accent: #00d68f;       /* emerald */
  --accent-dim: #007a52;
  --warn: #ffaa00;
  --err: #ff5a5a;
  --shadow: 0 6px 28px rgba(0,214,143,.06);
  --radius: 10px;
  --radius-lg: 16px;
  --mono: 'JetBrains Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", sans-serif;
  font-size: 14px;
  min-height: 100vh;
}
body {
  position: relative;
  overflow-x: hidden;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    radial-gradient(circle at 18% 12%, rgba(0,214,143,.16), transparent 30%),
    radial-gradient(circle at 80% 4%, rgba(91,231,196,.10), transparent 26%),
    linear-gradient(115deg, rgba(0,214,143,.035) 0 1px, transparent 1px 44px),
    linear-gradient(25deg, rgba(0,214,143,.025) 0 1px, transparent 1px 56px),
    var(--bg-0);
  animation: bscAura 16s ease-in-out infinite alternate;
}
body::after {
  z-index: 0;
  background:
    linear-gradient(rgba(0,214,143,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,214,143,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 55% 20%, #000 0%, transparent 72%);
  animation: bscGrid 28s linear infinite;
}
@keyframes bscAura {
  from { filter: hue-rotate(0deg) brightness(1); transform: scale(1); }
  to { filter: hue-rotate(8deg) brightness(1.12); transform: scale(1.035); }
}
@keyframes bscGrid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 88px 44px, 44px 88px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .panel::after, .kpi::after { animation: none !important; }
}
.hidden { display: none !important; }
.muted { color: var(--text-mute); font-size: 12px; }
.hl { color: var(--accent); }
.bsc-loader-wrap {
  min-height:160px; padding:44px 32px;
  display:flex; align-items:center; justify-content:center; gap:16px;
  color:var(--text); text-align:left;
}
.bsc-spinner {
  width:34px; height:34px; border-radius:50%; flex:0 0 auto;
  border:3px solid rgba(0,214,143,.14);
  border-top-color:var(--accent);
  box-shadow:0 0 24px rgba(0,214,143,.18);
  animation:bscSpin .8s linear infinite;
}
.bsc-loader-text { font-size:15px; font-weight:600; color:#dff8ee; }
.bsc-loader-sub { margin-top:4px; font-size:12px; color:var(--text-mute); }
@keyframes bscSpin { to { transform:rotate(360deg); } }
button { cursor: pointer; font-family: inherit; }
input, select, textarea {
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--text); padding: 8px 10px; border-radius: 6px;
  font-family: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,214,143,.18);
}
table { width: 100%; border-collapse: collapse; }
table th, table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
table th { color: var(--text-mute); font-weight: 500;
           background: var(--bg-1); position: sticky; top: 0; }
table tbody tr:hover { background: rgba(0,214,143,.04); }

/* ---------- Login page ---------- */
.login-bg {
  background: radial-gradient(ellipse at top, #0e1614 0%, #07090a 70%);
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh; position: relative; overflow: hidden;
}
#bgCanvas { position: fixed; inset: 0; z-index: 0; opacity: 0.45; }
.login-card {
  position: relative; z-index: 1;
  width: 380px; padding: 36px 32px;
  background: linear-gradient(180deg, #0f1517 0%, #0a0d0e 100%);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand-glyph {
  font-size: 32px; color: var(--accent);
  width: 48px; height: 48px;
  display: flex; justify-content: center; align-items: center;
  border: 1px solid var(--accent-dim); border-radius: 10px;
  text-shadow: 0 0 10px var(--accent);
}
.brand h1 { margin: 0; font-size: 20px; letter-spacing: 1px; }
.brand p { margin: 2px 0 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px;
        background: var(--bg-1); padding: 4px; border-radius: 8px; }
.tab {
  flex: 1; padding: 8px; background: transparent; border: 0;
  color: var(--text-mute); border-radius: 6px; font-size: 13px;
}
.tab.active { background: var(--bg-3); color: var(--accent); }
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 12px; color: var(--text-mute);
              margin-top: 8px; }
.btn-primary {
  margin-top: 18px; padding: 11px;
  background: linear-gradient(180deg, #00e69b 0%, #00b378 100%);
  color: #001a10; font-weight: 700; letter-spacing: 1px;
  border: 0; border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,214,143,.25);
  transition: transform .1s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px);
                     box-shadow: 0 6px 18px rgba(0,214,143,.35); }
.btn-primary:active { transform: translateY(0); }
/* 短信验证码：输入框 + 按钮一行 */
.sms-row { display: flex; gap: 8px; align-items: stretch; }
.sms-row input { flex: 1; }
.btn-sms {
  flex: 0 0 auto; min-width: 110px; padding: 0 12px;
  background: rgba(0, 214, 143, 0.1); color: var(--accent);
  border: 1px solid rgba(0, 214, 143, 0.4); border-radius: 6px;
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.btn-sms:hover:not(:disabled) { background: rgba(0, 214, 143, 0.2); }
.btn-sms:disabled { opacity: 0.55; cursor: not-allowed; }
.msg { margin: 14px 0 0; min-height: 18px; font-size: 12px; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--accent); }
.footnote { margin-top: 22px; text-align: center;
            font-size: 11px; color: var(--text-mute); }

/* ---------- Dashboard layout ---------- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 220px; background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 20;
  box-shadow: 18px 0 60px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
}
.logo {
  padding: 18px 20px; font-size: 17px;
  border-bottom: 1px solid var(--line);
  color: var(--accent); letter-spacing: 1px;
}
.logo b { color: var(--text); margin-left: 4px; }
/* portal tag (admin / agent / user 入口标识) */
.portal-tag {
  display: inline-block; margin-left: 6px;
  padding: 1px 8px; border-radius: 10px;
  font-size: 11px; line-height: 1.6;
  background: rgba(0,214,143,.12); color: var(--accent);
  border: 1px solid rgba(0,214,143,.35);
  letter-spacing: 0;
}
.portal-tag.side { float: right; margin-top: 2px; }
#nav { flex: 1; padding: 10px 0; overflow-y: auto; }
#nav .nav-section { padding: 8px 20px 4px; font-size: 11px;
                    color: var(--text-mute); letter-spacing: 1px; }
#nav .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; cursor: pointer; font-size: 13px;
  border-left: 2px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
#nav .nav-item:hover { background: var(--bg-2); color: var(--accent); }
#nav .nav-item.active {
  background: linear-gradient(90deg, rgba(0,214,143,.13), transparent);
  color: var(--accent); border-left-color: var(--accent);
}
.side-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.user-badge { font-size: 12px; color: var(--text-mute); margin-bottom: 8px; }
.user-badge b { color: var(--text); display: block; font-size: 14px; }
.btn-ghost {
  width: 100%; padding: 8px; background: transparent;
  border: 1px solid var(--line); color: var(--text-mute);
  border-radius: 6px; font-size: 12px;
}
.btn-ghost:hover { color: var(--err); border-color: var(--err); }

.main { margin-left: 220px; padding: 22px 28px; min-height: 100vh; position: relative; z-index: 1; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
  position: sticky; top: 0; z-index: 5;
  padding: 10px 0;
  backdrop-filter: blur(12px);
}
.topbar h2 { margin: 0; font-size: 22px; font-weight: 600; }
.balance {
  font-family: var(--mono); font-size: 14px;
  background: var(--bg-2); padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line);
}
.balance .v { color: var(--accent); font-weight: 700; margin-left: 6px; }

/* Cards / KPIs */
.kpi-grid {
  display: grid; gap: 14px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.kpi {
  background: linear-gradient(180deg, rgba(20,26,29,.92), rgba(8,12,13,.88)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 36px rgba(0,0,0,.28), 0 0 0 1px rgba(0,214,143,.025) inset;
}
.kpi:before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: .8;
}
.kpi::after,
.panel::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(91,231,196,.08) 45%, transparent 58%);
  transform: translateX(-120%);
  animation: bscSheen 7s ease-in-out infinite;
}
@keyframes bscSheen {
  0%, 65% { transform: translateX(-120%); opacity: 0; }
  78% { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}
.kpi .lbl { font-size: 12px; color: var(--text-mute); }
.kpi .val { font-size: 22px; font-weight: 700; margin-top: 4px;
            font-family: var(--mono); }
.kpi .sub { font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.kpi.warn:before { background: var(--warn); }
.kpi.err:before { background: var(--err); }

.panel {
  background: linear-gradient(180deg, rgba(14,20,21,.94), rgba(8,11,12,.90)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
  position: relative; overflow: hidden;
  box-shadow: 0 12px 42px rgba(0,0,0,.24), 0 0 0 1px rgba(0,214,143,.025) inset;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.panel:hover { border-color: rgba(0,214,143,.28); box-shadow: 0 16px 54px rgba(0,0,0,.32), 0 0 24px rgba(0,214,143,.035) inset; }
.panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.panel-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- Key management notice (显眼提示卡片) ---------- */
.key-tip-panel { padding-top: 0; }
.key-tip {
  display: flex; gap: 14px; align-items: flex-start;
  margin: -16px -18px 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255,196,0,.14) 0%, rgba(255,140,0,.10) 55%, rgba(0,214,143,.10) 100%);
  border-bottom: 1px solid rgba(255,196,0,.35);
  position: relative;
  overflow: hidden;
}
.key-tip::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #ffc400, #ff8c00);
  box-shadow: 0 0 14px rgba(255,196,0,.6);
}
.key-tip-icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(255,196,0,.18);
  border: 1px solid rgba(255,196,0,.45);
  box-shadow: 0 0 16px rgba(255,196,0,.25);
  animation: keyTipPulse 2.4s ease-in-out infinite;
}
@keyframes keyTipPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 16px rgba(255,196,0,.25); }
  50%      { transform: scale(1.06); box-shadow: 0 0 22px rgba(255,196,0,.45); }
}
.key-tip-body { flex: 1 1 auto; min-width: 0; }
.key-tip-title {
  font-size: 14px; font-weight: 700; color: #ffd964;
  letter-spacing: .3px; margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(255,196,0,.25);
}
.key-tip-desc {
  font-size: 12.5px; line-height: 1.65; color: #d6dde0;
}
.key-tip-desc code {
  background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 4px;
  border: 1px solid rgba(0,214,143,.25); color: #7fe5b9;
  font-size: 12px;
}
.key-tip-desc b { color: #ffe089; }
@media (max-width: 700px) {
  .key-tip { flex-direction: column; gap: 10px; }
  .key-tip-icon { width: 32px; height: 32px; font-size: 18px; }
}
.btn-sm {
  padding: 6px 12px; font-size: 12px; border: 1px solid var(--accent-dim);
  background: rgba(0,214,143,.08); color: var(--accent);
  border-radius: 6px;
}
.btn-sm:hover { background: rgba(0,214,143,.16); }
.btn-sm.danger { color: var(--err); border-color: #ff5a5a55;
                 background: rgba(255,90,90,.06); }
.btn-sm.danger:hover { background: rgba(255,90,90,.14); }
.btn-sm.warn { color: var(--warn); border-color: #ffaa0055;
               background: rgba(255,170,0,.06); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-family: var(--mono);
}
.tag.ok { background: rgba(0,214,143,.12); color: var(--accent); }
.tag.err { background: rgba(255,90,90,.12); color: var(--err); }
.tag.warn { background: rgba(255,170,0,.12); color: var(--warn); }
.tag.dim { background: var(--bg-3); color: var(--text-mute); }
.mono { font-family: var(--mono); }
.copy { cursor: pointer; }
.copy:hover { color: var(--accent); }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; justify-content: center; align-items: center; z-index: 99;
  padding: 16px;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 24px;
  width: 480px; max-width: 100%; max-height: 88vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal .form { display: flex; flex-direction: column; gap: 4px; }
/* Inputs/selects/textarea inside modal forms always 100% width with consistent gap */
.modal .form > label,
.modal .form fieldset > label {
  font-size: 12px; color: var(--text-mute); margin-top: 10px; display: block;
}
.modal .form > input,
.modal .form > select,
.modal .form > textarea,
.modal .form fieldset > input,
.modal .form fieldset > select,
.modal .form fieldset > textarea {
  width: 100%; display: block;
}
/* Fieldset inside form: stack contents vertically, restyle to match theme */
.modal .form fieldset.form-fieldset {
  display: block;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px 14px; margin-top: 14px;
  background: rgba(0,0,0,.18);
}
.modal .form fieldset.form-fieldset > legend {
  padding: 0 6px; font-size: 12px; color: var(--text-mute);
}

/* ============ 公告弹窗（专属样式，避开 .form 干扰） ============ */
.ann-popup-mask { z-index: 200; }
.ann-popup-mask .modal.ann-popup {
  width: min(720px, 94vw);
  max-width: 94vw;
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(0,214,143,.08);
}
.ann-popup .ann-popup-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; gap: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,214,143,.10), rgba(0,214,143,0));
}
.ann-popup .ann-popup-head h3 {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--text);
  letter-spacing: .5px; word-break: break-word; flex: 1; min-width: 0;
}
.ann-popup .ann-popup-x {
  background: transparent; border: 0; color: var(--text-mute);
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 2px 10px; border-radius: 6px; transition: all .12s;
  flex: 0 0 auto;
}
.ann-popup .ann-popup-x:hover { background: rgba(255,255,255,.06); color: var(--text); }
.ann-popup .ann-popup-body {
  padding: 18px 20px; overflow: auto; flex: 1 1 auto;
  min-height: 60px; background: var(--bg-1);
}
.ann-popup .ann-popup-body iframe { display: block; width: 100%; border: 0; background: transparent; }
.ann-popup .ann-popup-rich .ql-editor { padding: 0; min-height: 0; }
.ann-popup .ann-popup-rich .ql-editor img,
.ann-popup .ann-popup-rich .ql-editor video { max-width: 100%; }
.ann-popup .ann-popup-rich .ql-editor h1,
.ann-popup .ann-popup-rich .ql-editor h2,
.ann-popup .ann-popup-rich .ql-editor h3 {
  color: var(--text); margin-top: 0;
}
.ann-popup .ann-popup-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
  background: rgba(0,0,0,.18);
}
.ann-popup .ann-popup-ok {
  background: linear-gradient(180deg, #00e69b, #00b378);
  color: #001a10; font-weight: 700; border: 0;
  padding: 8px 22px; border-radius: 8px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,214,143,.28); transition: transform .1s;
}
.ann-popup .ann-popup-ok:hover { transform: translateY(-1px); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
  position: sticky; bottom: -22px; padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--bg-1) 30%);
}
.modal-actions .btn-ghost { width: auto; padding: 8px 16px; }

/* Toast */
.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 6px; z-index: 999;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  font-size: 13px; min-width: 220px; max-width: calc(100vw - 40px);
  animation: toastIn .2s ease-out;
  word-break: break-word;
}
.toast.err { border-left-color: var(--err); color: var(--err); }
.toast.warn { border-left-color: var(--warn); color: var(--warn); }
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Charts */
.chart-wrap { height: 280px; position: relative; }

/* Sidebar drawer (mobile) – defaults: hidden hamburger on desktop */
.nav-toggle {
  display: none; background: transparent; border: 0; color: var(--accent);
  font-size: 22px; line-height: 1; padding: 4px 8px; margin-right: 6px;
  cursor: pointer;
}
.sidebar-mask {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 79;
}
.sidebar.open + .sidebar-mask { display: block; }

/* ---------- Responsive (mobile-first overrides) ---------- */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .kpi .val { font-size: 18px; }
  .panel { padding: 12px 14px; }
  table th, table td { padding: 8px 8px; font-size: 12px; }
}
@media (max-width: 720px) {
  body { font-size: 13px; }
  /* Sidebar becomes off-canvas drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    width: 240px; z-index: 80;
    box-shadow: 6px 0 20px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  /* Restore full labels on mobile (we are now full drawer) */
  .sidebar .logo b, #nav .nav-item span:not(.icon) { display: inline; }
  .main { margin-left: 0; padding: 14px 14px 24px; }
  .topbar { gap: 8px; flex-wrap: wrap; }
  .topbar h2 { font-size: 18px; flex: 1; min-width: 120px; }
  .topbar .balance { font-size: 12px; padding: 6px 10px; }
  .topbar-toggle { display: inline-block; }
  .modal { padding: 18px 16px; max-height: 92vh; border-radius: 12px; }
  .modal-actions { position: sticky; bottom: 0; }
  .toast { left: 12px; right: 12px; min-width: 0; bottom: 12px; }
  .panel-actions { flex-direction: column; align-items: stretch; }
  .panel-actions > .muted { text-align: left !important; }
  /* Tables horizontally scroll inside their panel container */
  .panel { overflow-x: auto; }
}
@media (min-width: 721px) {
  .sidebar-mask { display: none !important; }
}

/* === Added: plugins/tutorials/announcements/widget === */

/* Filter bar (admin_usage etc) */
.filter-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:12px 16px; }
.filter-bar input, .filter-bar select {
  background:#0a0d0e; color:var(--text); border:1px solid #25313680;
  padding:8px 10px; border-radius:6px; font-size:13px; min-width:160px;
}
.filter-bar input:focus, .filter-bar select:focus { outline:none; border-color:var(--accent); }

/* Wide modal (for Quill editor / user detail) */
.modal.wide { max-width: 920px; width: 92vw; }

/* Two-column rows in forms */
.form .row-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.form .row-2 > div { display:flex; flex-direction:column; }

/* Mini KPI grid (used inside detail modal) */
.kpi-grid.mini { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap:10px; }
.kpi-grid.mini .kpi { padding:12px 14px; }
.kpi-grid.mini .val { font-size:20px; }

/* Card grid for plugins / tutorials */
.card-grid {
  display:grid; gap:16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.content-card {
  background:linear-gradient(180deg,#0d1112,#0a0d0e);
  border:1px solid #25313680; border-radius:12px; padding:18px 18px 14px;
  position:relative; transition: transform .15s, border-color .15s;
}
.content-card.clickable { cursor:pointer; }
.content-card.clickable:hover { transform:translateY(-2px); border-color:var(--accent); }
.content-card h3 { margin:6px 0 8px; font-size:16px; color:var(--text); }
.content-card .cc-tag {
  position:absolute; top:14px; right:14px;
  background:rgba(0,214,143,.12); color:var(--accent);
  font-size:11px; padding:3px 8px; border-radius:999px;
  border:1px solid rgba(0,214,143,.3);
}
.content-card .cc-meta { font-size:12px; color:#8a9b94; display:flex; gap:6px; }
.content-card .btn-sm { display:inline-flex; align-items:center; gap:4px; }

/* Quill editor host inside modals */
.quill-host { background:#0a0d0e; border-radius:6px; min-height:280px; }
.ql-toolbar.ql-snow,
.ql-container.ql-snow { border-color:#25313680 !important; }
.ql-toolbar.ql-snow { background:#0d1112; border-radius:6px 6px 0 0; }
.ql-container.ql-snow { border-radius:0 0 6px 6px; }
.ql-snow .ql-stroke { stroke:#a8bdb4 !important; }
.ql-snow .ql-fill { fill:#a8bdb4 !important; }
.ql-snow .ql-picker { color:#a8bdb4 !important; }
.ql-snow .ql-active .ql-stroke { stroke:var(--accent) !important; }
.ql-snow .ql-active .ql-fill { fill:var(--accent) !important; }
.ql-snow .ql-picker-options { background:#0d1112 !important; border-color:#25313680 !important; }
.ql-editor { color:var(--text); font-size:14px; min-height:240px; }
.ql-editor h1, .ql-editor h2, .ql-editor h3 { color:var(--text); }
.ql-editor a { color:var(--accent); }
.ql-editor blockquote { border-left:3px solid var(--accent); color:#bcd; }
.ql-editor pre.ql-syntax,
.ql-editor code { background:#07090a; color:#d6f5e6; }
.ql-editor img { max-width:100%; border-radius:6px; }

/* Announcement floating widget (bottom-right card) */
#floatHost { position:fixed; right:18px; bottom:18px; z-index:60;
  display:flex; flex-direction:column; gap:12px; max-width:360px; }
.ann-float {
  background:linear-gradient(180deg,#0f1416,#0a0d0e);
  border:1px solid var(--accent); border-radius:12px;
  padding:14px 16px 12px; box-shadow:0 10px 30px rgba(0,0,0,.45),
            0 0 0 1px rgba(0,214,143,.15);
  animation: floatIn .25s ease;
}
@keyframes floatIn { from { transform:translateY(12px); opacity:0; } to { transform:none; opacity:1; } }
.ann-float .af-head {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:8px; gap:8px;
}
.ann-float .af-head h4 { margin:0; font-size:14px; color:var(--accent); }
.ann-float .af-close {
  background:transparent; border:0; color:#8a9b94; font-size:18px;
  cursor:pointer; line-height:1; padding:0 4px;
}
.ann-float .af-close:hover { color:var(--text); }
.ann-float .af-body { font-size:13px; color:#c9d6cf; max-height:240px; overflow:auto; }
.ann-float .af-body p { margin:4px 0; }
.ann-float .af-body img { max-width:100%; border-radius:4px; }

/* Announcement popup modal (uses same modal-mask but emerald tinted) */
.ann-popup-host .modal { border:1px solid var(--accent); }
.ann-popup-host .modal h3 { color:var(--accent); }

@media (max-width: 720px) {
  #floatHost { right:10px; bottom:10px; left:10px; max-width:none; }
  .modal.wide { width:96vw; max-height:92vh; }
  .form .row-2 { grid-template-columns: 1fr; }
}

/* === 售/成 双行单元格（模型价格表用） === */
.dual-cell {
  display:flex; flex-direction:column; gap:3px; min-width:84px;
  font-size:12px; line-height:1.3;
}
.dual-cell > div { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.dual-cell .dc-tag {
  display:inline-block; min-width:20px; text-align:center;
  font-size:10px; padding:1px 5px; border-radius:4px;
  font-weight:600; line-height:1.4;
}
.dual-cell .dc-tag.sale {
  background:rgba(0,214,143,.15); color:var(--accent);
  border:1px solid rgba(0,214,143,.3);
}
.dual-cell .dc-tag.cost {
  background:rgba(255,170,0,.12); color:var(--warn);
  border:1px solid rgba(255,170,0,.3);
}

/* === 全局：移动端通用增强 === */
/* 让表格永远能横向滚而不撑爆视口 */
.panel { max-width: 100%; }
.panel > div[id$="list"], .panel > div[style*="overflow"] { -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
  /* KPI 缩小 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .lbl { font-size: 11px; }
  .kpi .val { font-size: 16px; }
  .kpi .sub { font-size: 10px; }
  .kpi-grid.mini { grid-template-columns: 1fr 1fr; }

  /* 卡片网格变单列 */
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .content-card { padding: 14px 14px 12px; }

  /* 过滤栏：每个控件占满宽 */
  .filter-bar { gap: 8px; padding: 10px 12px; }
  .filter-bar input, .filter-bar select { min-width: 0; flex: 1 1 100%; }
  .filter-bar button { flex: 1 1 calc(50% - 4px); }

  /* 按钮组在窄屏自动换行 */
  table td .btn-sm, table td a.btn-sm { margin: 1px 1px; padding: 4px 8px; font-size: 11px; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }

  /* 模态：全屏化 */
  .modal { width: 96vw; max-width: 96vw; padding: 14px 12px; max-height: 94vh; }
  .modal h3 { font-size: 16px; margin: 0 0 10px; }
  .form label { font-size: 12px; }
  .form input, .form select, .form textarea { font-size: 13px; padding: 7px 9px; }

  /* 公告浮动卡：避免遮挡 */
  .ann-float { padding: 12px 14px 10px; }
  .ann-float .af-body { max-height: 180px; font-size: 12px; }

  /* dual-cell 收紧 */
  .dual-cell { min-width: 70px; font-size: 11px; }
  .dual-cell .dc-tag { font-size: 9px; min-width: 16px; padding: 0 4px; }

  /* Quill 编辑器在小屏的最小高度 */
  .quill-host { min-height: 220px; }
  .ql-editor { min-height: 180px; font-size: 13px; }

  /* 余额徽标在 topbar 行末换行不挤压标题 */
  .topbar .balance { order: 3; flex-basis: 100%; text-align: right; }

  /* 用户徽标不要太长 */
  .user-badge { font-size: 12px; word-break: break-all; }

  /* 表格内按次/请求等 b 标签更小 */
  table td b { font-size: 12px; }
}

/* 极窄屏（≤420px） */
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  table th, table td { padding: 6px 6px; font-size: 11px; }
  .ann-float { left: 6px; right: 6px; }
  .modal { padding: 12px 10px; }
  .topbar h2 { font-size: 16px; }
}

/* ========== 模型列表 · 卡片 + 筛选 ========== */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.filter-bar .fb-label {
  color: var(--text-mute); font-size: 12px; margin-right: 2px;
}
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 18px;
  font-size: 12px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  transition: all .15s;
}
.chip:hover { border-color: var(--accent-dim); color: var(--accent); }
.chip.active {
  background: var(--accent); color: #07090a; border-color: var(--accent);
  font-weight: 600;
}
.mc-section { margin-bottom: 22px; }
.mc-section:last-child { margin-bottom: 0; }
.mc-section-h {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 4px 10px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.mc-section-title {
  font-size: 13px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: .5px;
}
.model-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.mcard {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.mcard:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.mcard:before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent); opacity: .6;
}
.mcard .mc-row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.mcard .mc-name {
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  word-break: break-all; color: var(--text);
}
.mcard .mc-prices {
  display: grid; grid-template-columns: 1fr auto;
  gap: 6px 14px; font-size: 12px;
}
.mcard .mc-prices .pl { color: var(--text-mute); }
.mcard .mc-prices .pv {
  font-family: var(--mono); font-weight: 600; text-align: right;
}
.mcard .mc-once {
  background: rgba(255,170,0,.08);
  border: 1px dashed #ffaa0055;
  border-radius: 6px;
  padding: 8px 12px; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--warn);
}
.mcard .mc-once b { font-family: var(--mono); font-size: 14px; }
.mcard .mc-act {
  display: flex; gap: 6px; margin-top: 4px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
.tag.bill-token { background: rgba(0,214,143,.14); color: var(--accent); }
.tag.bill-once  { background: rgba(255,170,0,.16); color: var(--warn); }

/* ==================== 个人中心 / 工单 / 充值（v2026-05-06b） ==================== */
.profile-hero {
  display:flex; align-items:center; gap:18px;
  padding:18px 20px; border-radius:12px;
  background:linear-gradient(135deg, rgba(0,214,143,.10), rgba(0,214,143,.02));
  border:1px solid rgba(0,214,143,.25);
  margin-bottom:14px;
}
.profile-hero .avatar {
  width:64px; height:64px; border-radius:50%;
  background:linear-gradient(135deg,#00d68f,#0a7f5a);
  display:flex; align-items:center; justify-content:center;
  font-size:28px; color:#082018; font-weight:700;
  box-shadow:0 6px 18px rgba(0,214,143,.25);
}
.profile-hero .pname { font-size:18px; font-weight:600; color:#e6efe9; }
.profile-hero .psub  { color:#8a9b94; font-size:13px; margin-top:2px; }
.profile-hero .pright { margin-left:auto; text-align:right; }
.profile-hero .pbal { font-size:22px; color:#00d68f; font-weight:700; }

.kv {
  width:100%; border-collapse:separate; border-spacing:0;
}
.kv tr { transition: background .15s; }
.kv tr:hover { background:rgba(255,255,255,.02); }
.kv th, .kv td {
  padding:11px 12px; border-bottom:1px solid #1d2826;
  font-weight:400; vertical-align:middle;
}
.kv th {
  width:140px; color:#8a9b94; text-align:left; font-size:13px;
}
.kv td { color:#e6efe9; font-size:14px; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom:0; }

/* 余额变动记录 */
.bl-pos { color:#00d68f; }
.bl-neg { color:#ff7878; }
.bl-tag {
  display:inline-block; padding:2px 8px; border-radius:10px;
  background:#16241f; border:1px solid #1f3a32; color:#a7d8c4;
  font-size:12px; white-space:nowrap;
}

/* 工单对话气泡 */
.ticket-reply {
  margin:10px 0; padding:12px 14px; border-radius:10px;
  border:1px solid #1d2826; background:#10181645;
  position:relative;
}
.ticket-reply.admin {
  border-color:rgba(0,214,143,.35);
  background:rgba(0,214,143,.06);
}
.ticket-reply.user {
  border-color:rgba(120,160,200,.25);
  background:rgba(255,255,255,.02);
}
.ticket-reply img {
  max-width:100%; max-height:280px;
  border-radius:6px; margin-top:6px; cursor:zoom-in;
  border:1px solid #1d2826;
}
.ticket-attach-bar {
  display:flex; flex-wrap:wrap; gap:8px; margin-top:8px;
}
.ticket-attach-thumb {
  position:relative; width:64px; height:64px;
  border-radius:6px; overflow:hidden; border:1px solid #2a3a37;
}
.ticket-attach-thumb img { width:100%; height:100%; object-fit:cover; }
.ticket-attach-thumb .x {
  position:absolute; top:2px; right:2px; width:18px; height:18px;
  border-radius:50%; background:#000a; color:#fff; font-size:12px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.ticket-toolbar {
  display:flex; gap:8px; margin-top:6px; align-items:center;
  font-size:12px; color:#8a9b94;
}
.ticket-toolbar label.up-btn {
  display:inline-block; padding:5px 10px; border-radius:6px;
  border:1px dashed #2a3a37; cursor:pointer; color:#8a9b94;
}
.ticket-toolbar label.up-btn:hover { color:#00d68f; border-color:#00d68f; }

/* 充值金额芯片增强 */
#rcAmt .chip { font-size:15px; padding:8px 16px; min-width:70px; text-align:center; }
#rcAmt .chip.active { font-weight:600; }

/* 通用 .row-2/.row-3 与 form */
.row-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.row-2 > div, .row-3 > div { display:flex; flex-direction:column; gap:4px; min-width:0; }
.row-2 > div > label, .row-3 > div > label { font-size:12px; color:var(--text-mute); }
.row-2 > div > input, .row-2 > div > select, .row-2 > div > textarea,
.row-3 > div > input, .row-3 > div > select, .row-3 > div > textarea { width:100%; box-sizing:border-box; }
@media (max-width:720px) {
  .row-2, .row-3 { grid-template-columns:1fr; }
}

/* 系统配置：分区块 */
.cfg-sec { padding:14px 0; border-top:1px dashed var(--line); }
.cfg-sec:first-of-type { border-top:none; padding-top:4px; }
.cfg-sec h3 { margin:0 0 12px; font-size:15px; display:flex; align-items:center; gap:6px; }
.cfg-sec .cfg-tip { font-size:12px; color:var(--text-mute); margin:-6px 0 10px; }

/* 支付方式选择 */
.pay-method { display:flex; gap:10px; flex-wrap:wrap; margin:6px 0 14px; }
.pay-method .pm {
  flex:1; min-width:140px; padding:14px 16px; border:2px solid var(--line);
  border-radius:10px; cursor:pointer; display:flex; align-items:center; gap:10px;
  background:var(--bg-1); transition:all .15s;
}
.pay-method .pm:hover { border-color:var(--accent); }
.pay-method .pm.active { border-color:var(--accent); background:rgba(0,214,143,.08); }
.pay-method .pm .icon {
  width:34px; height:34px; border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:16px; font-weight:800; letter-spacing:.04em;
  color:#fff; box-shadow:0 8px 18px rgba(0,0,0,.22);
}
.pay-method .pm .icon.alipay { background:linear-gradient(135deg,#1677ff,#00a3ff); }
.pay-method .pm .icon.wxpay { background:linear-gradient(135deg,#07c160,#14d789); }
.pay-method .pm .icon.card { background:linear-gradient(135deg,#606b85,#303849); }
.pay-method .pm .lbl { font-weight:600; }
.pay-method .pm .sub { font-size:12px; color:var(--text-mute); }

.ql-editor img {
  max-width:100%; height:auto; border-radius:8px;
}
.ql-editor img.bsc-lazy-img[data-src] {
  display:block; min-height:160px; object-fit:contain;
  background:
    linear-gradient(90deg, rgba(255,255,255,.02), rgba(0,214,143,.12), rgba(255,255,255,.02)),
    linear-gradient(135deg, rgba(0,214,143,.08), rgba(255,255,255,.035));
  background-size:220% 100%, 100% 100%;
  border:1px dashed rgba(0,214,143,.22);
  animation:bscImgShimmer 1.25s ease-in-out infinite;
  opacity:.92;
}
.ql-editor img.bsc-lazy-loading { animation:bscImgShimmer 1.1s ease-in-out infinite; }
.ql-editor img.bsc-lazy-loaded {
  min-height:0; border-style:solid; animation:none; opacity:1;
}
.ql-editor img.bsc-lazy-error { min-height:80px; border-color:rgba(255,90,90,.35); animation:none; }
@keyframes bscImgShimmer {
  0% { background-position:220% 0, 0 0; }
  100% { background-position:-80% 0, 0 0; }
}

/* 二维码弹窗 */
.qr-box { display:inline-block; padding:12px; background:#fff; border-radius:10px; }
.qr-box canvas, .qr-box img, .qr-box svg { display:block; width:240px; height:240px; }
.pay-link {
  display:inline-block; margin-top:10px; padding:8px 14px;
  background:var(--accent); color:#001; border-radius:6px;
  text-decoration:none; font-weight:600;
}
.pay-link:hover { opacity:.9; }

/* 订单表“继续支付”按钮 */
.btn-pay-again {
  padding:4px 10px; border:1px solid var(--accent); color:var(--accent);
  background:transparent; border-radius:4px; cursor:pointer; font-size:12px;
}
.btn-pay-again:hover { background:rgba(0,214,143,.1); }

/* 通用 .btn / .btn.primary / .btn.danger（多处动态 HTML 里使用）*/
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 16px; min-height:34px;
  background:var(--bg-1); color:var(--text);
  border:1px solid var(--line); border-radius:6px;
  font-size:13px; font-family:inherit; cursor:pointer;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { border-color:var(--accent); color:var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn.primary {
  background: linear-gradient(180deg,#00e69b 0%,#00b378 100%);
  color:#001a10; font-weight:700; border:none;
  box-shadow: 0 3px 10px rgba(0,214,143,.25);
}
.btn.primary:hover { color:#001a10; transform: translateY(-1px);
                     box-shadow: 0 5px 14px rgba(0,214,143,.4); }
.btn.primary:disabled { background:#333; color:#777; box-shadow:none; }
.btn.danger { color:#ff7676; border-color:#ff5a5a55; }
.btn.danger:hover { background:rgba(255,90,90,.12); color:#ff5a5a; border-color:#ff5a5a; }

/* 订单倒计时 */
.rc-countdown {
  display:inline-block; padding:4px 10px; border-radius:14px;
  background:rgba(255,170,0,.12); color:#ffaa00; font-size:13px; font-weight:600;
  font-variant-numeric: tabular-nums;
}
.rc-countdown.warn { background:rgba(255,90,90,.14); color:#ff7676; }
.rc-countdown.expired { background:rgba(136,136,136,.18); color:#999; }

/* 预设金额编辑器 */
.rc-amts-editor {
  display:flex; flex-wrap:wrap; gap:8px;
  padding:10px; border:1px dashed var(--line); border-radius:8px;
  background:var(--bg-1); min-height:48px; align-items:center;
}
.amt-chip {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; background:rgba(0,214,143,.10);
  border:1px solid var(--accent); color:var(--accent);
  border-radius:14px; font-size:13px; font-weight:600;
}
.amt-chip button {
  background:transparent; border:none; color:var(--accent);
  cursor:pointer; padding:0 2px; font-size:16px; line-height:1;
}
.amt-chip button:hover { color:#ff7676; }
.amt-chip.add { background:transparent; border:1px dashed var(--line); color:var(--text-mute); }


/* ===== �����־�������������۵�չʾ ===== */
.audit-panel table { table-layout: auto; }
.audit-panel td:nth-child(7) {
  max-width: 520px;
  min-width: 280px;
}
.audit-detail {
  display: block;
  width: 100%;
  cursor: pointer;
}
.audit-detail summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}
.audit-detail summary::-webkit-details-marker { display: none; }
.audit-preview {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 12px;
  color: #b9d4c8;
  background: #0d1f17;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #25313640;
  transition: border-color .15s;
}
.audit-detail[open] .audit-preview {
  background: transparent;
  color: #5be7c4;
  border-color: transparent;
  font-weight: 600;
}
.audit-detail[open] .audit-preview::before { content: '���� �� '; opacity: .6; }
.audit-detail:not([open]) .audit-preview:hover { border-color: #5be7c4aa; }
.audit-pre {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: #0a1612;
  border: 1px solid #25313640;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #cfe7d8;
}
