﻿/* ==========================================================================
   怒川上号器 · 运营后台  样式
   ========================================================================== */

:root {
  --bg:        #0b0f17;
  --bg-2:      #101623;
  --panel:     #131a28;
  --panel-2:   #182133;
  --line:      #243049;
  --line-2:    #2f3d5c;
  --text:      #e7ecf5;
  --text-2:    #9aa8c0;
  --muted:     #6b7a94;
  --accent:    #6d5efc;
  --accent-2:  #8b7cff;
  --green:     #22c55e;
  --amber:     #f59e0b;
  --red:       #ef4444;
  --blue:      #3b82f6;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 18px 46px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code { background: #0d1421; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; color: #c9d4ea; }
em.hint { font-style: normal; display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.muted { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.dim { color: var(--text-2); }
.nowrap { white-space: nowrap; }

/* ---------------- 布局 ---------------- */

.app { display: flex; min-height: 100vh; }

.side {
  width: 250px; flex: 0 0 250px;
  background: linear-gradient(180deg, #101726 0%, #0c1220 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #4f8cff 100%);
  display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff;
  box-shadow: 0 8px 22px rgba(109, 94, 252, .45);
}
.brand-mark.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 24px; margin: 0 auto 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.brand-text strong { font-size: 14.5px; letter-spacing: .2px; }
.brand-text span { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; text-decoration: none;
  border: 1px solid transparent; transition: .16s;
}
.nav a i { font-style: normal; width: 16px; text-align: center; opacity: .8; font-size: 13px; }
.nav a:hover { background: #17203300; background-color: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on {
  background: linear-gradient(90deg, rgba(109, 94, 252, .22), rgba(109, 94, 252, .06));
  border-color: rgba(109, 94, 252, .45); color: #fff;
}

.side-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.kv b { color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 28px 14px;
}
.top-title h1 { margin: 0; font-size: 21px; letter-spacing: .3px; }
.top-title p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.top-right .who { margin-right: 2px; }
.who { color: var(--text-2); font-size: 12.5px; }
.who b { color: var(--text); }

.content { padding: 6px 28px 40px; display: flex; flex-direction: column; gap: 18px; }

/* ---------------- 卡片 ---------------- */

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.head-actions { display: flex; gap: 8px; }

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.stats.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.two.wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-num { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.stat-num.green { color: var(--green); }
.stat-num.amber { color: var(--amber); }
.stat-sub { color: var(--muted); font-size: 11.5px; }

.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-size: 13px; font-family: inherit; text-decoration: none;
  transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: #fff; text-decoration: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #4f8cff 100%);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 10px 22px rgba(109, 94, 252, .32);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(239, 68, 68, .4); color: #fca5a5; background: rgba(239, 68, 68, .08); }
.btn.danger:hover { border-color: var(--red); color: #fff; background: rgba(239, 68, 68, .2); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn.block { width: 100%; height: 42px; font-size: 14px; }

/* ---------------- 表单 ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--text-2); font-size: 12px; }
.field.grow { flex: 1; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; background: #0c1320; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 10px; padding: 0 12px; height: 36px; font: inherit; font-size: 13px;
  outline: none; transition: .16s;
}
textarea { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 94, 252, .18); }
input::placeholder, textarea::placeholder { color: #4d5a72; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b7a94 50%), linear-gradient(135deg, #6b7a94 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.filter-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-btns { display: flex; gap: 8px; padding-bottom: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span2 { grid-column: span 2; }
.divider { grid-column: span 2; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.chk-line { flex-direction: row; align-items: center; gap: 9px; }
.chk-line input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.chk-line span { color: var(--text); font-size: 13px; }
.danger-line span { color: #fca5a5; }
.color-input { text-transform: uppercase; }

.flash {
  margin: 0 28px 4px; padding: 11px 16px; border-radius: 10px; font-size: 13px;
  border: 1px solid rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1); color: #86efac;
}
.flash.err { border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .1); color: #fca5a5; }
.flash.warn { border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .1); color: #fcd34d; }

/* ---------------- 表格 ---------------- */

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl thead th { background: #0e1522; color: var(--text-2); font-weight: 500; font-size: 12px; position: sticky; top: 0; z-index: 2; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl.hover tbody tr:hover { background: #141d2e; }
.tbl td.mono { font-size: 12px; color: #b9c6de; }
.w36 { width: 36px; } .w60 { width: 60px; } .w70 { width: 70px; } .w80 { width: 80px; }
.w90 { width: 90px; } .w100 { width: 100px; } .w110 { width: 110px; } .w120 { width: 120px; }
.w130 { width: 130px; } .w140 { width: 140px; } .w150 { width: 150px; }

.ops { display: flex; gap: 6px; }
.copyable { cursor: pointer; border-bottom: 1px dashed var(--line-2); }
.copyable:hover { color: #fff; border-color: var(--accent); }

.bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 2px 12px; flex-wrap: wrap; }
.bulkbar select { width: auto; min-width: 150px; height: 32px; }
.chk { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.chk input { accent-color: var(--accent); }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 14px; }
.pager-info { color: var(--muted); font-size: 12.5px; }

/* ---------------- 徽章 ---------------- */

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; border: 1px solid transparent; white-space: nowrap;
}
.badge.green { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); color: #86efac; }
.badge.red { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
.badge.amber { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
.badge.blue { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); color: #93c5fd; }
.badge.gray { background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .28); color: #cbd5e1; }

/* ---------------- 条形图 ---------------- */

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 38px; align-items: center; gap: 10px; }
.bar-name { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 999px; background: #0d1421; overflow: hidden; border: 1px solid var(--line); }
.bar-track.slim { height: 6px; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #4f8cff); }
.bar-fill.green { background: linear-gradient(90deg, #16a34a, #22c55e); }
.bar-fill.amber { background: linear-gradient(90deg, #d97706, #f59e0b); }
.bar-fill.red { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.bar-fill.blue { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.bar-fill.gray { background: linear-gradient(90deg, #475569, #94a3b8); }
.bar-val { text-align: right; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }

.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-item { display: grid; grid-template-columns: 76px 1fr 34px; align-items: center; gap: 10px; }
.status-item b { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------------- 弹窗 ---------------- */

.dlg {
  width: min(720px, 92vw); padding: 0; border: 1px solid var(--line-2);
  border-radius: var(--radius); background: var(--panel); color: var(--text);
  box-shadow: var(--shadow);
}
.dlg::backdrop { background: rgba(4, 7, 13, .72); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.dlg-head h3 { margin: 0; font-size: 15px; }
.dlg-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }

.kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kv-grid > div { background: #0d1421; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; }
.kv-grid span { color: var(--muted); font-size: 11.5px; }
.kv-grid b { font-size: 12.8px; font-weight: 500; }

.field-line > label { display: block; color: var(--text-2); font-size: 12px; margin-bottom: 6px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; padding: 8px 10px; overflow: auto; white-space: nowrap; }
.status-form { display: flex; gap: 12px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.status-form .field { min-width: 180px; }

/* ---------------- 代码块 / 文档 ---------------- */

pre.code {
  margin: 0; padding: 14px 16px; background: #0a101b; border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: auto; font-size: 12.2px; line-height: 1.6; color: #c7d3e8;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.api-list { display: flex; flex-direction: column; gap: 14px; }
.api-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: #0d1421; }
.api-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.api-head code { background: #0a101b; }
.method { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .5px; }
.method.post { background: rgba(34, 197, 94, .15); color: #86efac; border: 1px solid rgba(34, 197, 94, .35); }
.method.get { background: rgba(59, 130, 246, .15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, .35); }
.api-item p { margin: 4px 0 10px; color: var(--text-2); font-size: 12.8px; }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13px; }
.steps li { margin: 8px 0; }
.steps ul { margin: 6px 0; padding-left: 18px; }

.hint-box { border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; color: var(--text-2); font-size: 12.5px; }
.hint-box p { margin: 6px 0; }
.hint-box code { font-size: 11.5px; }
.hint { color: var(--muted); font-size: 12.5px; }

.flash-card { border-color: rgba(109, 94, 252, .4); }
.flash-card textarea { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; }

.pw { font-family: "JetBrains Mono", Consolas, monospace; letter-spacing: 1px; color: #dbe4f5; }

/* ---------------- 登录页 ---------------- */

.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(109, 94, 252, .28), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(79, 140, 255, .18), transparent 55%),
    var(--bg);
}
.login-wrap { width: min(400px, 92vw); }
.login-card {
  background: linear-gradient(180deg, rgba(23, 31, 48, .96), rgba(13, 18, 30, .98));
  border: 1px solid var(--line-2); border-radius: 18px; padding: 30px 28px 24px;
  box-shadow: var(--shadow);
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-head h1 { margin: 0 0 6px; font-size: 18px; letter-spacing: .4px; }
.login-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-foot { margin-top: 18px; text-align: center; color: #47536b; font-size: 11.5px; }
.flash { margin-bottom: 14px; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.two.wide-left { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { width: auto; flex: none; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { padding: 12px 14px; }
  .brand-text { display: none; }
  .nav { flex-direction: row; padding: 8px; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .side-foot { display: none; }
  .top { padding: 16px 16px 10px; }
  .content { padding: 8px 16px 32px; }
  .flash { margin: 0 16px 4px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span2, .divider { grid-column: span 1; }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.stats.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
