/* ============================================================
 * 用户自助面板 / 代理中心 布局（依赖 /theme.css）
 * 浅色内容 + 深蓝侧栏
 * ============================================================ */

/* ===== 登录页 ===== */
.panel-login-wrap, #login-view.panel-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #eef3ff 0%, #f6f8fd 55%, #eef1fb 100%);
}
.panel-login-wrap::before, .panel-login-wrap::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none;
}
.panel-login-wrap::before { width: 520px; height: 520px; background: #cfe0ff; top: -180px; left: -120px; }
.panel-login-wrap::after  { width: 460px; height: 460px; background: #e6d9ff; bottom: -200px; right: -120px; }

.panel-login-card, .auth-card {
  position: relative; width: 404px; max-width: 92vw;
  padding: 40px 36px 30px;
  background: #fff;
  border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(23, 35, 64, 0.14);
  overflow: hidden;
}
.panel-login-card::before, .auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}
.panel-login-card .btn-primary, .auth-card .btn { width: 100%; margin-top: 4px; height: 40px; font-size: 14px; }
.panel-login-card .form-group, .auth-card .form-group { margin-bottom: 14px; }
.auth-card h1 { font-size: 18px; }

.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-logo .mark {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 18px rgba(59,109,246,.35);
}
.login-logo h1, .login-logo .t { font-size: 18px; }
.login-logo .s, .login-logo + .sub { font-size: 12px; color: var(--text-muted); }
.login-err, .auth-err {
  margin-top: 14px; padding: 9px 12px; min-height: 18px;
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid rgba(220,38,38,.2); border-radius: var(--radius-sm); font-size: 12px; display: none;
}
.login-err.show, .auth-err.show { display: block; }
.auth-err { margin-top: 8px; }

/* 密码输入框（带显示/隐藏按钮） */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input-wrap input {
  flex: 1;
  padding-right: 40px;
}
.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.toggle-password:hover {
  opacity: 1;
}

/* 登录选项 */
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.login-options .chk {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 输入提示 */
.input-hint {
  font-size: 11px;
  margin-top: 4px;
  min-height: 16px;
  color: var(--text-muted);
}
.input-hint.error {
  color: var(--danger);
}
.input-hint.success {
  color: var(--success);
}

/* 密码强度指示器 */
.password-strength {
  margin-top: 8px;
}
.strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  background: var(--danger);
  transition: width 0.3s, background 0.3s;
  border-radius: 2px;
}
.strength-fill.weak { background: var(--danger); width: 33%; }
.strength-fill.medium { background: var(--warning); width: 66%; }
.strength-fill.strong { background: var(--success); width: 100%; }
.strength-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 按钮加载状态 */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ===== 主框架 ===== */
.panel-main { display: none; }
.panel-main.show { display: block; }
.layout { display: flex; min-height: 100vh; }

/* 侧边栏（深蓝） */
.sidebar {
  width: var(--sidebar-width); position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  background: linear-gradient(180deg, #1c2542 0%, #141b30 100%);
  display: flex; flex-direction: column;
  box-shadow: 2px 0 12px rgba(23, 35, 64, 0.08);
}
.brand { height: var(--topbar-height); display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #6f9bff, #8a5cf6);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff;
}
.brand .t { font-size: 15px; font-weight: 600; color: #fff; }
.brand .s { font-size: 11px; color: #8592ad; }

.nav { flex: 1; overflow-y: auto; padding: 12px 12px 16px; }
.nav .group { display: none; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 3px; border-radius: 9px;
  color: #a9b4cc; cursor: pointer; font-size: 13px; user-select: none;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(111,155,255,.18); color: #fff; font-weight: 500; }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: #6f9bff;
}
.nav-item .ico { width: 18px; text-align: center; font-size: 14px; opacity: .95; }
.sidebar .foot { padding: 13px 20px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #7f8aa6; text-align: center; }

/* 内容区 */
.main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-height); position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar .page-title { font-size: 15px; font-weight: 600; }
.topbar .logo { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.topbar .logo .dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-secondary); }
.topbar .right b { color: var(--text-primary); font-weight: 600; }
.topbar .logout { cursor: pointer; padding: 5px 12px; border: 1px solid var(--border-light); border-radius: 20px; transition: all .15s; background: #fff; }
.topbar .logout:hover { color: var(--accent); border-color: rgba(59,109,246,.4); background: var(--accent-light); }
.content { flex: 1; padding: 22px 24px 40px; overflow-y: auto; max-width: 1120px; margin: 0 auto; width: 100%; }

/* 页面切换 */
.page { display: none; animation: fadeUp .18s ease; }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 顶部横向导航（代理中心） */
.nav.horizontal {
  display: flex; gap: 6px; padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: #fff; flex-wrap: wrap; flex: none; overflow: visible;
}
.nav.horizontal .nav-item { margin: 0; padding: 7px 16px; border-radius: 20px; color: var(--text-secondary); }
.nav.horizontal .nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav.horizontal .nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav.horizontal .nav-item.active::before { display: none; }

/* ===== 套餐卡片 ===== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 16px; }
.plan-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.plan-card:hover { box-shadow: 0 8px 24px rgba(23,35,64,.1); transform: translateY(-2px); }
.plan-card.hot { border-color: rgba(59,109,246,.5); box-shadow: 0 0 0 1px rgba(59,109,246,.25), 0 10px 30px rgba(59,109,246,.12); }
.plan-card .p-name { font-size: 15px; font-weight: 700; }
.plan-card .p-tag { font-size: 10px; color: var(--accent); margin-top: 3px; letter-spacing: 1px; }
.plan-card .p-price { margin: 14px 0; }
.plan-card .p-price b { font-size: 28px; font-family: ui-monospace, Consolas, monospace; }
.plan-card .p-price span { font-size: 12px; color: var(--text-muted); }
.plan-card .p-feats { flex: 1; font-size: 12px; color: var(--text-secondary); line-height: 2.2; }
.plan-card .p-feats b { color: var(--text-primary); font-family: ui-monospace, Consolas, monospace; }
.plan-card .btn { margin-top: 16px; width: 100%; }

/* ===== 流量柱状图 ===== */
.chart-area { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.chart-col { flex: 1; min-width: 30px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart-col .bar { width: 70%; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--accent), var(--purple)); }
.chart-col .bar.empty { background: #e6e9f2; }
.chart-col .lbl { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.chart-col .val { font-size: 10px; color: var(--accent); font-family: ui-monospace, Consolas, monospace; }

/* 小徽标 / 汇总块 */
.agent-badge { display: inline-block; background: linear-gradient(180deg, #fb923c, #e8590c); color: #fff; font-size: 11px; padding: 1px 9px; border-radius: 20px; margin-left: 6px; vertical-align: middle; }
.sum-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: 12px; color: var(--text-secondary); }
.sum-chip b { color: var(--text-primary); font-family: ui-monospace, Consolas, monospace; }
.row { display: flex; align-items: center; }
