﻿/* ── 设计变量 ──────────────────────────────────────────────────────────── */
:root {
  --bg:        #0d0b18;
  --card:      #14112a;
  --card2:     #1a1636;
  --border:    rgba(255,255,255,0.07);
  --text:      #e8e4ff;
  --muted:     #6b6899;
  --green:     #4ade80;
  --purple:    #7c4dff;
  --purple2:   #a06aff;
  --red:       #f87171;
  --banner-bg: #fff3e0;
  --banner-tx: #7b4a1e;
  --r:         12px;
  --r-sm:      8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

a { color: var(--purple2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 公告栏 ── */
.announce-bar {
  background: rgba(124,77,255,.12);
  border-bottom: 1px solid rgba(124,77,255,.25);
  padding: 10px 24px;
}
.announce-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.announce-icon {
  color: var(--purple2);
  flex-shrink: 0;
  margin-top: 2px;
}
.announce-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  line-height: 1.5;
}
.announce-title {
  font-weight: 700;
  color: var(--purple2);
}
.announce-content {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── 通用组件 ──────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 10px 14px;
  background: #09071a;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--purple); }
.input-sm { padding: 8px 12px; font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: filter .18s, opacity .18s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:not(:disabled):hover { filter: brightness(1.15); }
.btn-primary { background: linear-gradient(135deg, #7c4dff 0%, #a06aff 100%); color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-ghost    { background: transparent; border: 1.5px solid transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border); }
.btn-sm { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.btn-block { width: 100%; }
.mt8 { margin-top: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green {
  background: rgba(74,222,128,.15);
  color: var(--green);
  border: 1px solid rgba(74,222,128,.3);
}

.alert { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; }
.alert-error {
  background: rgba(248,113,113,.1);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.3);
}

.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 登录页 ───────────────────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrap { width: 100%; max-width: 420px; padding: 24px; }
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 40px 36px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 28px;
}
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-sub   { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.form-group  { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.login-footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 20px; }

/* ── 顶部横幅 ─────────────────────────────────────────────────────────── */
.top-banner {
  background: var(--banner-bg);
  color: var(--banner-tx);
  text-align: center;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
}
.top-banner a { color: var(--banner-tx); font-weight: 700; }

/* ── 顶部导航栏 ──────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 36px;
  height: 72px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}
.nav-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: 120px;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 20px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.nav-link:hover {
  background: rgba(255,255,255,.07);
  color: var(--text);
}
/* ── 仪表盘布局 ───────────────────────────────────────────────────────── */
body.dashboard-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.dash-outer {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px 0;
  gap: 0;
}
/* 内嵌条幅与布局等宽 */
.dash-notice {
  width: 100%;
  max-width: 1200px;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
  border-radius: var(--r);
  margin-bottom: 12px;
}
.dash-notice .announce-inner {
  max-width: none;
  margin: 0;
}
.dash-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 22px 24px;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.panel-hd h3 { font-size: 16px; font-weight: 700; }
.panel-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

/* 卡密展示框 */
.key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #09071a;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .18s;
  margin-bottom: 4px;
}
.key-box:hover { border-color: var(--purple); }
.key-text {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  word-break: break-all;
  flex: 1;
}
.copy-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0 0 8px;
  transition: color .18s;
}
.copy-btn:hover { color: var(--purple2); }
.copy-tip { font-size: 11px; color: var(--green); min-height: 16px; margin-bottom: 14px; }

/* 信息列表 */
.info-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}
.info-row dt {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-weight: normal;
}
.info-row dd { font-weight: 500; }
.info-row dd.green { color: var(--green); }
.plan-val { color: var(--green) !important; font-weight: 700 !important; }

/* 进度条 */
.prog-wrap {
  height: 5px;
  background: rgba(255,255,255,.07);
  border-radius: 3px;
  overflow: hidden;
  margin: -6px 0 6px;
}
.prog-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--purple), var(--green));
  transition: width .5s ease;
}

/* 续费区 */
.renew-box { margin-bottom: 10px; }
.renew-lbl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.renew-row { display: flex; gap: 8px; }
.renew-row .input { flex: 1; }
.renew-msg { font-size: 12px; min-height: 18px; margin-top: 6px; }
.renew-msg.ok  { color: var(--green); }
.renew-msg.err { color: var(--red); }

/* ── 右侧统计区 ───────────────────────────────────────────────────────── */
.range-tag { font-size: 12px; color: var(--muted); }

.stat-nums {
  display: flex;
  gap: 32px;
  margin: 18px 0 16px;
}
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.num { font-size: 30px; font-weight: 700; }
.num.green { color: var(--green); }
.num-lbl { font-size: 12px; color: var(--muted); }

.chart-box {
  position: relative;
  height: 185px;
  margin-bottom: 22px;
}

/* 模型详情 */
.model-sec { border-top: 1px solid var(--border); padding-top: 16px; }
.model-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.model-tag { margin-left: auto; font-size: 12px; }

.model-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.model-tbl th {
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.model-tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.model-tbl tr:last-child td { border-bottom: none; }
.model-tbl tr:hover td { background: rgba(255,255,255,.025); }
.empty-td {
  text-align: center !important;
  color: var(--muted) !important;
  padding: 28px 0 !important;
}
