* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #222; font-size: 14px; }
a { color: #1890ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* topbar */
.topbar { background: #001529; color: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; }
.topbar .brand { font-weight: 600; font-size: 16px; margin-right: 32px; }
.topbar .nav { display: flex; gap: 24px; flex: 1; }
.topbar .nav a { color: #fff; opacity: 0.7; }
.topbar .nav a:hover, .topbar .nav a.active { opacity: 1; text-decoration: none; }
.topbar .right { margin-left: auto; color: #ccc; }
.topbar .right a { color: #fff; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.muted { color: #888; font-size: 12px; }
.err { background: #fff1f0; border: 1px solid #ffa39e; color: #cf1322; padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; }
.msg { background: #f6ffed; border: 1px solid #b7eb8f; color: #237804; padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; }

/* card */
.card { background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); padding: 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.card h3 { font-size: 14px; margin-top: 16px; color: #555; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-header h2 { margin: 0; }
.card.empty { text-align: center; color: #888; padding: 60px; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.tbl th { background: #fafafa; font-weight: 600; }
.tbl tr:hover td { background: #fafcff; }

/* stats grid */
.stats { display: flex; gap: 24px; margin: 12px 0; flex-wrap: wrap; }
.stat { min-width: 100px; }
.stat .label { color: #888; font-size: 12px; }
.stat .val { font-size: 22px; font-weight: 600; margin-top: 4px; }
.stat .val.accent { color: #1890ff; }
.stat .val.small { font-size: 13px; font-weight: normal; }

/* progress bar */
.bar { background: #f0f0f0; height: 10px; border-radius: 5px; overflow: hidden; margin: 10px 0 16px; }
.bar .fill { background: linear-gradient(90deg, #1890ff, #36cfc9); height: 100%; transition: width 0.3s; }

/* chart */
.chart { width: 100%; height: 280px; }

/* form */
.form { display: flex; flex-direction: column; gap: 12px; max-width: 500px; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: end; max-width: none; }
.form label { display: flex; flex-direction: column; gap: 4px; color: #555; font-size: 13px; }
.form input, .form select { padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; min-width: 180px; }
.form input:focus, .form select:focus { outline: none; border-color: #1890ff; }
.btn { background: #1890ff; color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
.btn:hover { background: #096dd9; text-decoration: none; }
.btn-link { background: none; border: none; color: #1890ff; cursor: pointer; padding: 0; font-size: 14px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger, a.danger { color: #cf1322; }

/* login page */
.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1890ff 0%, #001529 100%); }
.login-box { background: #fff; padding: 40px; border-radius: 8px; width: 360px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.login-box h1 { margin: 0 0 24px; font-size: 22px; text-align: center; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box input { padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; }
.login-box button { background: #1890ff; color: #fff; border: none; padding: 10px; border-radius: 4px; cursor: pointer; font-size: 15px; margin-top: 8px; }
.login-box button:hover { background: #096dd9; }

/* ============================================================
   客户控制台 — 商业化主题（body.app / .navbar / .kpi / .domain-card）
   只作用于客户后台，不影响 admin 旧样式
   ============================================================ */
body.app {
  background: #f5f7fb;
  color: #1f2533;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 顶栏 */
.navbar {
  background: #fff;
  border-bottom: 1px solid #eaeef5;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 3px rgba(20,30,60,0.04);
}
.navbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #4f7cff, #7b5cff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 3px 10px rgba(79,124,255,0.35);
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .3px; color: #1f2533; }
.navbar-right { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 14px; color: #46506a; font-weight: 500; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #4f7cff, #7b5cff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.btn-ghost {
  padding: 6px 14px; border-radius: 8px; font-size: 13px; color: #6b7488;
  border: 1px solid #e3e8f0; background: #fff; transition: .15s;
}
.btn-ghost:hover { background: #f2f5fb; color: #4f7cff; text-decoration: none; border-color: #cdd8 ; }

/* 页面容器 */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 60px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: .3px; }
.page-head .sub { margin: 6px 0 0; color: #8b94a8; font-size: 13px; }

/* KPI 概览卡 */
.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px;
}
.kpi {
  background: #fff; border-radius: 16px; padding: 22px 22px 18px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.05); border: 1px solid #eef1f7;
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,30,60,0.09); }
.kpi-label { color: #8b94a8; font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 700; margin: 10px 0 6px; letter-spacing: .5px; }
.kpi-foot { color: #aab2c4; font-size: 12px; }
.kpi-primary {
  background: linear-gradient(135deg, #4f7cff 0%, #7b5cff 100%);
  border: none; color: #fff;
}
.kpi-primary .kpi-label, .kpi-primary .kpi-foot { color: rgba(255,255,255,.82); }
.kpi-primary .kpi-value { color: #fff; }
.accent-green { color: #16b981; }
.accent-amber { color: #f59e0b; }

/* 域名卡 */
.domain-card {
  background: #fff; border-radius: 16px; margin-bottom: 22px;
  box-shadow: 0 2px 12px rgba(20,30,60,0.05); border: 1px solid #eef1f7;
  overflow: hidden;
}
.domain-head {
  padding: 20px 24px; border-bottom: 1px solid #f1f4f9;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.domain-title { display: flex; align-items: center; gap: 11px; }
.domain-title h2 { margin: 0; font-size: 18px; font-weight: 700; color: #1f2533; }
.dot-online { width: 9px; height: 9px; border-radius: 50%; background: #16b981; box-shadow: 0 0 0 4px rgba(22,185,129,.15); }
.badge-active {
  font-size: 11px; font-weight: 600; color: #16b981;
  background: rgba(22,185,129,.1); padding: 3px 10px; border-radius: 20px;
}
.domain-meta { color: #9aa3b5; font-size: 13px; }

.domain-body { padding: 22px 24px 8px; }
.usage-block { }
.usage-numbers { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.un-main { font-size: 16px; }
.un-used { font-size: 26px; font-weight: 700; color: #1f2533; }
.un-sep { color: #c4ccda; margin: 0 6px; }
.un-total { color: #8b94a8; font-size: 16px; }
.un-pct { font-size: 22px; font-weight: 700; color: #4f7cff; }
.un-pct.warn { color: #f59e0b; }
.un-pct.danger { color: #ef4444; }

.progress { background: #eef1f7; height: 12px; border-radius: 20px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, #4f7cff, #7b5cff);
  transition: width .5s ease;
}
.progress-fill.fill-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.fill-danger { background: linear-gradient(90deg, #ef4444, #f87171); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.mini { background: #f8fafc; border-radius: 12px; padding: 14px 16px; }
.mini-label { color: #9aa3b5; font-size: 12px; margin-bottom: 5px; }
.mini-val { font-size: 17px; font-weight: 700; color: #1f2533; }

.chart-wrap { padding: 8px 24px 22px; }
.chart-title { color: #6b7488; font-size: 13px; font-weight: 600; margin: 8px 0 6px; }
.app .chart { width: 100%; height: 240px; }

/* 空状态 */
.empty-state {
  background: #fff; border-radius: 16px; padding: 70px 20px; text-align: center;
  box-shadow: 0 2px 12px rgba(20,30,60,0.05); border: 1px solid #eef1f7;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 6px; font-size: 18px; }
.empty-state p { margin: 0; color: #9aa3b5; font-size: 14px; }

.page-foot { text-align: center; color: #b3bbcc; font-size: 12px; margin-top: 30px; }

/* 响应式 */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .navbar-inner, .page { padding-left: 16px; padding-right: 16px; }
}
