/* 峰源科技双向机器人 · 黑金后台 */
:root {
  --bg0: #07080c;
  --bg1: #0d1017;
  --panel: rgba(255, 255, 255, .032);
  --panel2: rgba(255, 255, 255, .055);
  --line: rgba(212, 175, 55, .18);
  --line2: rgba(212, 175, 55, .34);
  --gold: #d4af37;
  --gold2: #f0c96a;
  --blue: #1e2a44;
  --txt: #e9e7e1;
  --dim: #9aa0ab;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --r: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: radial-gradient(1200px 700px at 12% -8%, #141a28 0%, var(--bg1) 42%, var(--bg0) 100%);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.6;
  overflow-x: hidden;
}
body { min-height: 100vh; }

h1, h2, h3, h4 { font-family: "Noto Serif SC", Georgia, "Songti SC", serif; margin: 0; font-weight: 600; }
a { color: var(--gold2); text-decoration: none; }
.wrap { overflow-wrap: anywhere; word-break: break-word; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 400px; padding: 34px 28px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--line); border-radius: 20px; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
}
.login-card .logo {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 18px;
  background: linear-gradient(145deg, #f0c96a, #a8791f);
  display: flex; align-items: center; justify-content: center;
  color: #17120a; font-weight: 800; font-size: 26px;
  box-shadow: 0 10px 26px rgba(212,175,55,.28);
}
.login-card h1 { font-size: 21px; color: var(--gold2); letter-spacing: .5px; }
.login-card p.sub { color: var(--dim); font-size: 12.5px; margin: 8px 0 22px; }

/* ---------- 框架 ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 214px; flex: 0 0 214px; padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(0,0,0,.22));
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; }
.side .brand .dot {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(145deg, #f0c96a, #a8791f);
  display: flex; align-items: center; justify-content: center;
  color: #17120a; font-weight: 800;
}
.side .brand b { display: block; color: var(--gold2); font-size: 13px; letter-spacing: .3px; }
.side .brand span { display: block; color: var(--dim); font-size: 10.5px; }

.nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; margin-bottom: 3px;
  border-radius: 10px; color: var(--dim); font-size: 13.5px; border: 1px solid transparent;
}
.nav a:hover { background: var(--panel2); color: var(--txt); }
.nav a.on {
  background: linear-gradient(90deg, rgba(212,175,55,.18), rgba(212,175,55,.04));
  color: var(--gold2); border-color: var(--line2);
}
.nav a .ic { width: 18px; text-align: center; font-size: 15px; }
.nav a .bdg {
  margin-left: auto; background: var(--bad); color: #fff; font-size: 10px;
  min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px;
  text-align: center; padding: 0 5px;
}

.main { flex: 1; min-width: 0; padding: 22px 24px 60px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.head h2 { font-size: 20px; color: var(--gold2); }
.head .desc { color: var(--dim); font-size: 12.5px; margin-top: 3px; }
.head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.topbar { display: none; }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.035);
}
.card + .card { margin-top: 14px; }
.card > h3 { font-size: 14.5px; color: var(--gold2); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card > h3 .hint { font-weight: 400; color: var(--dim); font-size: 11.5px; font-family: inherit; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.stat { padding: 15px 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); min-width: 0; }
.stat .k { color: var(--dim); font-size: 12px; }
.stat .v { font-size: 25px; font-weight: 700; color: var(--gold2); font-family: "Noto Serif SC", serif;
  line-height: 1.25; overflow-wrap: anywhere; }
.stat .s { color: var(--dim); font-size: 11px; }

/* ---------- 表单 ---------- */
label.fld { display: block; margin-bottom: 11px; min-width: 0; }
label.fld > span { display: block; color: var(--dim); font-size: 12px; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 10px; color: var(--txt);
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.10);
  font-size: 13.5px; font-family: inherit; outline: none; min-width: 0;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--line2); box-shadow: 0 0 0 3px rgba(212,175,55,.10); }
input::placeholder, textarea::placeholder { color: #616875; }
select option { background: #12151d; color: var(--txt); }
input[type=checkbox] { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 10px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--line2); color: var(--gold2);
  background: linear-gradient(180deg, rgba(212,175,55,.16), rgba(212,175,55,.05));
  font-family: inherit; white-space: nowrap; transition: .15s;
}
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(145deg, #f0c96a, #b98f22); color: #17120a; font-weight: 700; border-color: #e0bb52; }
.btn.ghost { background: rgba(255,255,255,.04); color: var(--txt); border-color: rgba(255,255,255,.14); }
.btn.danger { border-color: rgba(248,113,113,.5); color: #fca5a5; background: rgba(248,113,113,.10); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.xs { padding: 3px 8px; font-size: 11px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spread { justify-content: space-between; }

/* ---------- 列表 / 表格 ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.item {
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 11px 13px;
  background: rgba(255,255,255,.022); min-width: 0;
}
.item:hover { border-color: var(--line); background: rgba(255,255,255,.035); }
.item.sel { border-color: var(--line2); background: linear-gradient(90deg, rgba(212,175,55,.12), transparent); }
.item .t { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .m { color: var(--dim); font-size: 11.5px; margin-top: 4px; }
.item .body { color: #cfd3da; font-size: 12.5px; margin-top: 6px; white-space: pre-wrap; }

.tblwrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 9px; border-bottom: 1px solid rgba(255,255,255,.07); vertical-align: top; }
th { color: var(--dim); font-weight: 500; font-size: 11.5px; white-space: nowrap; }
tr:hover td { background: rgba(255,255,255,.025); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px;
  border: 1px solid var(--line); color: var(--gold2); background: rgba(212,175,55,.08); white-space: nowrap; }
.tag.on { color: var(--ok); border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.09); }
.tag.off { color: var(--dim); border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.04); }
.tag.bad { color: var(--bad); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.09); }
.tag.warn { color: #e6a23c; border-color: rgba(230,162,60,.4); background: rgba(230,162,60,.09); }
.tag.blue { color: #93c5fd; border-color: rgba(147,197,253,.35); background: rgba(147,197,253,.08); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- 聊天 ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow-y: auto; padding: 4px 2px; }
.bub { max-width: min(78%, 620px); padding: 8px 12px; border-radius: 13px; font-size: 13px;
  white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid transparent; }
.bub.in { align-self: flex-start; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.08); }
.bub.out { align-self: flex-end; background: linear-gradient(145deg, rgba(212,175,55,.22), rgba(212,175,55,.09));
  border-color: var(--line2); }
.bub .st { display: block; color: var(--dim); font-size: 10.5px; margin-top: 4px; }
.reply-bar { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.reply-bar textarea { min-height: 46px; max-height: 130px; }

/* ---------- 提示 ---------- */
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 99;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 9px 17px; border-radius: 11px; font-size: 13px; color: #fff;
  background: rgba(20,24,32,.96); border: 1px solid var(--line2);
  box-shadow: 0 12px 34px rgba(0,0,0,.5); animation: pop .2s ease;
  max-width: 88vw; overflow-wrap: anywhere;
}
.toast.ok { border-color: rgba(74,222,128,.55); }
.toast.bad { border-color: rgba(248,113,113,.55); }
@keyframes pop { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.empty { color: var(--dim); text-align: center; padding: 30px 10px; font-size: 13px; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(212,175,55,.3);
  border-top-color: var(--gold2); border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.mask { position: fixed; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); z-index: 90; }
.modal {
  position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(560px, 92vw); max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, #14181f, #0c0f15);
  border: 1px solid var(--line2); border-radius: 18px; padding: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
}
.modal h3 { color: var(--gold2); font-size: 16px; margin-bottom: 14px; }

.bar { height: 7px; border-radius: 6px; background: rgba(255,255,255,.09); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #a8791f, #f0c96a); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; color: #cfd3da;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 12px; }
.scroll-y { max-height: 460px; overflow-y: auto; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 11px; }
.thumb { border: 1px solid rgba(255,255,255,.1); border-radius: 11px; overflow: hidden; background: rgba(0,0,0,.3); }
.thumb img, .thumb video { width: 100%; height: 104px; object-fit: cover; display: block; background: #000; }
.thumb .cap { padding: 7px 9px; font-size: 11.5px; color: var(--dim); overflow-wrap: anywhere; }
.hintline { color: var(--dim); font-size: 12px; }

/* ---------- 手机端 ---------- */
@media (max-width: 900px) {
  .app { display: block; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 95; width: 240px;
    transform: translateX(-102%); transition: transform .22s ease; height: 100vh;
    background: linear-gradient(180deg, #12161d, #080a0f); box-shadow: 14px 0 40px rgba(0,0,0,.6);
  }
  .side.open { transform: none; }
  .main { padding: 14px 13px 72px; }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 13px; margin: -14px -13px 12px;
    border-bottom: 1px solid var(--line); background: rgba(8,10,14,.9);
    position: sticky; top: 0; z-index: 40; backdrop-filter: blur(8px);
  }
  .topbar .ttl { font-family: "Noto Serif SC", serif; color: var(--gold2); font-size: 15px;
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .burger { width: 36px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
    background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center;
    color: var(--gold2); font-size: 16px; cursor: pointer; flex: 0 0 36px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .head h2 { font-size: 17.5px; }
  .bub { max-width: 90%; }
  .chat { max-height: 50vh; }
  .stat .v { font-size: 22px; }
  .modal { width: 94vw; padding: 16px; }
  .btn { padding: 8px 13px; }
  /* 手机端表格：低价值列直接收掉，别让用户左右拖 */
  .hide-sm { display: none !important; }
  .tblwrap table { font-size: 12.5px; }
  .tblwrap th, .tblwrap td { padding: 6px 4px; }
  .tblwrap td.wrap { max-width: 112px !important; }
  .tblwrap td.mono { font-size: 11.5px; }
}
@media (max-width: 380px) { .g2 { grid-template-columns: 1fr; }
  .tblwrap table { font-size: 12px; }
  .tblwrap th, .tblwrap td { padding: 5px 3px; }
  .tblwrap td.wrap { max-width: 96px !important; }
}

/* ---- 近 7 天走势柱状图（总览页） ---- */
.bars { display: flex; align-items: flex-end; gap: 7px; height: 132px; padding: 6px 2px 0; }
.bars .bar { flex: 1; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.bars .bv { font-size: 10.5px; color: var(--dim); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.bars .bf { width: 100%; max-width: 34px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #f0c96a, rgba(212,175,55,.28)); min-height: 4px; }
.bars .bl { font-size: 10px; color: var(--dim); margin-top: 5px; white-space: nowrap; }
@media (max-width: 420px) { .bars { height: 110px; gap: 4px; } .bars .bl { font-size: 9px; } }
