/* 捕鱼运维后台样式：深色侧栏 + 青绿主色，卡片、表格、标签、开关、弹层。页面安全策略只许同源样式表，样式一律写在这里。 */
:root {
  --side: #10233a; --side-2: #18324f; --side-text: #c8d4e3; --accent: #0f766e; --accent-2: #14b8a6; --bg: #f3f5f8; --card: #fff;
  --line: #e5e7eb; --text: #1f2937; --muted: #6b7280; --red: #dc2626; --orange: #ea580c; --green: #16a34a; --blue: #2563eb; --purple: #7c3aed;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 7px; padding: 6px 14px; white-space: nowrap; }
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #115e59; color: #fff; }
button.danger { color: var(--red); border-color: #fca5a5; }
button.danger:hover { background: #fef2f2; }
button.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
button.ghost { background: transparent; }
button.small { padding: 3px 10px; font-size: 13px; }
button.wide { width: 100%; padding: 10px; font-size: 15px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; border: 1px solid #d1d5db; border-radius: 7px; padding: 6px 10px; background: #fff; color: var(--text); min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
textarea { width: 100%; resize: vertical; }
label { color: var(--muted); font-size: 13px; }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--text); white-space: nowrap; }
a { color: var(--accent); }
h3 { font-size: 14px; margin: 16px 0 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.err { color: var(--red); } .ok { color: var(--green); } .muted { color: var(--muted); } .hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

/* 登录 */
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #10233a, #0f766e); }
.login-card { width: 380px; max-width: 94vw; background: #fff; border-radius: 14px; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card label { display: block; margin: 12px 0 0; }
.login-card label input { display: block; width: 100%; margin-top: 4px; padding: 9px 12px; }
.login-card .wide { margin-top: 18px; }
.token-login { margin-top: 14px; font-size: 13px; } .token-login summary { cursor: pointer; color: var(--muted); }
.token-login button { margin-top: 10px; }

/* 外壳 */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px; }
.brand b { display: block; color: #fff; font-size: 16px; } .brand small { color: #8aa0b8; font-size: 12px; }
.brand.big b { color: var(--text); font-size: 20px; } .brand.big { padding: 0 0 10px; }
.logo { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
nav .group { font-size: 12px; color: #6f86a0; padding: 14px 18px 6px; }
nav a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; margin: 1px 8px; border-radius: 7px; color: var(--side-text); text-decoration: none; cursor: pointer; }
nav a:hover { background: var(--side-2); color: #fff; }
nav a.on { background: var(--accent); color: #fff; }
nav a .ic { width: 18px; text-align: center; opacity: .85; }
.side-foot { margin-top: auto; padding: 12px 18px; font-size: 12px; color: #6f86a0; }
.main { min-width: 0; }
.top { height: 52px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  position: sticky; top: 0; z-index: 5; gap: 12px; }
.crumb { color: var(--muted); white-space: nowrap; } .crumb .sep { margin: 0 8px; } .crumb b { color: var(--text); }
.top-right { display: flex; gap: 12px; align-items: center; min-width: 0; }
.who { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12px; border-radius: 99px; padding: 1px 9px; border: 1px solid var(--line); background: #f9fafb; color: var(--muted); white-space: nowrap; }
.pill.on { background: #ecfdf5; border-color: #a7f3d0; color: #047857; } .pill.off { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.pill.warn { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.page { padding: 22px 26px 60px; max-width: 1400px; }
.page h1 { font-size: 20px; margin: 0 0 4px; } .page .sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }

/* 卡片与布局 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card h2 .actions { display: flex; gap: 8px; font-weight: normal; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12px; } .stat .v { font-size: 22px; font-weight: 650; margin-top: 2px; word-break: break-all; }
.stat .s { font-size: 12px; color: var(--muted); }
.form { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 14px; align-items: center; }
.form > label { text-align: right; }
.form .full { grid-column: 1 / -1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input:not([type=checkbox]), .row > select { flex: 1 1 140px; }
.bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.bar > input:not([type=checkbox]), .bar > select { flex: 0 1 200px; }
.bar > .grow, .bar > input.grow:not([type=checkbox]) { flex: 1 1 260px; }
.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.warnbox { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; word-break: break-all; }
.warnbox p { margin: 2px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 6px 14px; } .seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 14px; color: var(--muted); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.result { margin-top: 10px; font-size: 13px; padding: 8px 12px; border-radius: 8px; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; word-break: break-all; }
.result.bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.preview { font-size: 13px; color: var(--accent); min-height: 1em; }
.steps { counter-reset: step; }

/* 表格 */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 640px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 9px 12px; border-bottom: 1px solid #f0f1f3; text-align: left; vertical-align: top; font-size: 13px; }
th { background: #f9fafb; color: var(--muted); font-weight: 500; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody tr:hover { background: #f8fafc; } tr.click { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; } td.nowrap .mono { word-break: normal; }
td.wide, th.wide { min-width: 240px; }
td.long { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .row { flex-wrap: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }
.tag { display: inline-block; font-size: 12px; border-radius: 5px; padding: 0 7px; margin: 1px 3px 1px 0; background: #f3f4f6; color: #374151; white-space: nowrap; }
.tag.green { background: #dcfce7; color: #166534; } .tag.red { background: #fee2e2; color: #991b1b; } .tag.blue { background: #dbeafe; color: #1e40af; }
.tag.orange { background: #ffedd5; color: #9a3412; } .tag.purple { background: #ede9fe; color: #5b21b6; } .tag.gray { background: #f3f4f6; color: #6b7280; }
.tag.teal { background: #ccfbf1; color: #115e59; }

/* 道具选择器：按名称或编号搜后台道具目录，结果标明该填哪一栏 */
.picker { border: 1px dashed #cbd5e1; border-radius: 10px; padding: 10px; background: #fafbfc; }
.combo { position: relative; } .combo > input { width: 100%; }
.combo .list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 9px; max-height: 340px;
  overflow-y: auto; box-shadow: 0 12px 30px rgba(15,23,42,.14); z-index: 30; }
.combo .opt { padding: 7px 11px; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.combo .opt.hl { background: #f0fdfa; }
.combo .opt.off { cursor: not-allowed; color: var(--muted); }
.combo .opt small { color: var(--muted); white-space: nowrap; }
.combo .more { padding: 6px 11px; color: var(--muted); font-size: 12px; }
.picker .chosen { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.picker .line { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; }
.picker .line .unit { display: flex; gap: 6px; align-items: center; }
.picker .line .unit input { width: 110px; }
.money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.money label { display: flex; flex-direction: column; gap: 3px; }
.money small { color: var(--muted); font-size: 12px; min-height: 1em; }

/* 开关 */
.switch { position: relative; width: 44px; height: 24px; display: inline-block; flex: none; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--accent); } .switch input:checked + span::after { left: 23px; }
.switch.red input:checked + span { background: var(--red); }
.toggle-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; margin-bottom: 16px; }
.toggle-card b { display: block; font-size: 15px; } .toggle-card small { color: var(--muted); }

/* 弹层与提示 */
.toasts { position: fixed; right: 20px; top: 64px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-width: 460px; word-break: break-all; }
.toast.bad { border-left-color: var(--red); }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: min(760px, 94vw); max-height: 90vh; overflow-y: auto; padding: 20px 22px; }
.modal.wide { width: min(1120px, 96vw); }
.modal h3 { margin: 0 0 14px; font-size: 17px; } .modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.modal ul.lines { margin: 0; padding-left: 18px; } .modal ul.lines li { margin: 3px 0; word-break: break-all; }
.modal .typed { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
pre.code { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px; overflow: auto; max-height: 460px; font-size: 12px; white-space: pre-wrap;
  word-break: break-all; margin: 8px 0 0; }
pre.diff { background: #fff; color: var(--text); border: 1px solid var(--line); }
pre.diff .add { color: #166534; background: #f0fdf4; display: block; }
pre.diff .del { color: #991b1b; background: #fef2f2; display: block; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.kv div { border-bottom: 1px dashed var(--line); padding: 4px 0; word-break: break-all; }
.kv > div > span:first-child { color: var(--muted); font-size: 12px; display: block; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .grid2, .grid3, .money { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; } .form > label { text-align: left; } .top { height: auto; flex-wrap: wrap; padding: 10px 16px; }
}
