/* ===== 基础与变量 ===== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --primary: #2f54eb;
  --primary-dark: #1d39c4;
  --text: #1f2329;
  --text-soft: #646a73;
  --border: #e5e6eb;
  --up: #2ba471;
  --down: #d4380d;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2f54eb 0%, #1d39c4 100%);
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.login-brand { text-align: center; margin-bottom: 24px; }
.brand-logo {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-logo.sm { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; margin: 0; }
.login-brand h1 { font-size: 20px; margin: 0; }
.brand-sub { font-size: 12px; color: var(--text-soft); margin: 4px 0 0; letter-spacing: 1px; }

.login-form label { display: block; font-size: 13px; color: var(--text-soft); margin: 14px 0 6px; }
.login-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,84,235,.12); }

.btn-primary {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }

.alert {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: var(--down);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.login-foot { text-align: center; font-size: 12px; color: var(--text-soft); margin-top: 18px; }

/* ===== 门户首页 ===== */
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-weight: 600; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-name { font-size: 14px; color: var(--text-soft); }
.btn-logout {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
}
.btn-logout:hover { background: var(--bg); }

/* 横向 TAB */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  overflow-x: auto;
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-link { color: var(--primary); }
.tab-link:hover { background: rgba(47,84,235,.06); }

/* 内容区 */
.content { padding: 24px 20px; max-width: 1200px; margin: 0 auto; }
.panel { animation: fade .2s ease; }
.panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.panel-title { font-size: 18px; margin: 0 0 16px; }

/* KPI 卡片 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.kpi-label { font-size: 13px; color: var(--text-soft); }
.kpi-value { font-size: 24px; font-weight: 700; }
.kpi-trend { font-size: 13px; }
.kpi-trend.up { color: var(--up); }
.kpi-trend.down { color: var(--down); }

/* 图表占位 */
.chart-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
  color: var(--text-soft);
  text-align: center;
}
.ph-tag {
  display: inline-block;
  font-size: 12px;
  background: #eef2ff;
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 20px;
  margin: 0 0 10px;
}

/* 数据表 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.data-table th { background: #fafafa; color: var(--text-soft); font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }

/* 页脚：域名备注 */
.site-foot {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  padding: 18px 16px 22px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  background: var(--surface);
}
.site-foot a {
  color: var(--text-soft);
  text-decoration: none;
}
.site-foot a:hover { color: var(--primary); }
.login-foot a { color: inherit; text-decoration: none; }
.login-foot a:hover { color: var(--primary); }
/* 备案号（2026-11-09 加）：ICP 备案要求首页底部展示并链接工信部备案系统 */
.login-icp { text-align: center; font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.login-icp a { color: inherit; text-decoration: none; }
.login-icp a:hover { color: var(--primary); }
