:root {
  --bg: #f5f6f7;
  --panel: #ffffff;
  --line: #e6e8eb;
  --text: #1a1a1a;
  --muted: #6b7280;
  --brand: #07c160;
  --brand-dark: #06ad56;
  --red: #e54545;
  --amber: #d98b0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.hidden { display: none !important; }
.hint { color: var(--muted); font-size: 12px; }
.error { color: var(--red); font-size: 13px; min-height: 20px; }
.spacer { flex: 1; }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--panel); padding: 32px; border-radius: 12px; width: 320px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 10px;
}
.login-card h1 { font-size: 18px; margin: 0; }
.login-card p { margin: 0; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 56px;
  background: #1f2937; color: #fff; position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: bold; }
.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent; color: #cbd5e1; border: 0; padding: 8px 14px;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.tab:hover { background: rgba(255,255,255,.08); }
.tab.active { background: var(--brand); color: #fff; }
#who { color: #cbd5e1; }

main { padding: 18px 20px 40px; max-width: 1240px; margin: 0 auto; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 16px;
}
.panel h2 { font-size: 15px; margin: 0 0 12px; }

/* 控件 */
input, textarea, select {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid rgba(7,193,96,.35); border-color: var(--brand); }
label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
label.check { color: var(--text); }

button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 14px;
  cursor: pointer; font: inherit;
}
button:hover { background: #f0f2f4; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); }
button.ghost { background: transparent; color: #cbd5e1; border-color: rgba(255,255,255,.25); }
button.ghost:hover { background: rgba(255,255,255,.08); }
button.danger { color: var(--red); border-color: #f3c9c9; }
button.danger:hover { background: #fdf1f1; }
button.tiny { padding: 3px 8px; font-size: 12px; }

.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 统计卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.card .n { font-size: 24px; font-weight: bold; }
.card .t { color: var(--muted); font-size: 12px; }

/* 柱状图 */
.trend { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.trend .bar { flex: 1; background: var(--brand); min-height: 2px; border-radius: 2px 2px 0 0; position: relative; }
.trend .bar:hover::after {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.bars .b { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.bars .fill { height: 8px; background: var(--brand); border-radius: 4px; }
.bars .nm { width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .vl { color: var(--muted); font-size: 12px; }

/* 服务器页：占用率表盘 */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.gauge {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fafbfc;
}
.gauge .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gauge .nm { font-size: 13px; color: var(--muted); }
.gauge .pc { font-size: 20px; font-weight: bold; }
.gauge .meter { height: 8px; background: #e9ebee; border-radius: 4px; overflow: hidden; margin: 8px 0 6px; }
.gauge .meter > i { display: block; height: 100%; border-radius: 4px; transition: width .4s ease; }
.gauge .sub { font-size: 12px; color: var(--muted); }
.gauge.ok .pc { color: var(--text); }
.gauge.ok .meter > i { background: var(--brand); }
.gauge.warn .pc { color: var(--amber); }
.gauge.warn .meter > i { background: var(--amber); }
.gauge.bad .pc { color: var(--red); }
.gauge.bad .meter > i { background: var(--red); }
.gauge.none .pc { color: var(--muted); }

/* 双折线（CPU / 内存历史） */
.legend { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend.cpu { background: var(--brand); }
.legend.mem { background: #1a5fb4; }
.legend-row { gap: 6px; flex-wrap: wrap; margin-top: 6px; }
h2.inline { margin: 0; }

/* 证书小列表 */
.certlist { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.certlist .hint { font-size: 12px; }

/* 表格（后台四处用得到） */
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.grid th { color: var(--muted); font-weight: normal; background: #fafbfc; }
.grid td.mono { font-family: Consolas, monospace; font-size: 12px; }
.tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.ok { background: #e7f7ee; color: #0a7a45; }
.tag.off { background: #f1f2f4; color: #6b7280; }
.tag.bad { background: #fdecec; color: var(--red); }
/* 三档套餐各一个颜色：体验（蓝）/ 一年（绿）/ 永久尊贵（金） */
.tag.trial { background: #e8f1fd; color: #1a5fb4; }
.tag.vip { background: #fff4d6; color: #a2680a; }

/* 生成结果 */
.codes {
  margin-top: 12px; padding: 12px; background: #f8f9fa; border: 1px dashed var(--line);
  border-radius: 8px; font-family: Consolas, monospace; font-size: 13px; line-height: 1.9;
  max-height: 260px; overflow: auto;
}
.codes .head { display: flex; justify-content: space-between; margin-bottom: 6px; font-family: inherit; }
.codelist { display: flex; flex-direction: column; }
.codeline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.codeline:hover { background: #f1f7f3; }
.codeline .mono { font-family: Consolas, monospace; font-size: 13px; letter-spacing: .5px; }

/* 更新「试查」结果 */
.trybox { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 22px; }
.trybox .tag { align-self: flex-start; }

@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
