/* ============================================================
   钢结构行业数据管理平台 · 二期界面样式（v2.0）
   设计语言：深钢蓝 + 工程金 · 轻阴影 · 圆角卡片 · 零外部依赖
   兼容说明：保留一期全部类名，JS 无需改动
   ============================================================ */
:root {
  --brand-deep: #0B3D6E;
  --brand: #185FA5;
  --brand-light: #378ADD;
  --brand-soft: #E6F1FB;
  --accent: #E8A33D;
  --accent-soft: #FDF3E0;
  --ok: #0F6E56;
  --ok-soft: #E1F5EE;
  --err: #A32D2D;
  --err-soft: #FCEBEB;
  --bg: #F0F4F9;
  --bg-deep: #E7EEF6;
  --card: #FFFFFF;
  --text: #22324A;
  --text-sub: #6B7C93;
  --text-light: #9AA8BC;
  --line: #E2E9F2;
  --line-strong: #C9D6E6;
  --shadow-sm: 0 1px 3px rgba(11,61,110,.06), 0 1px 2px rgba(11,61,110,.05);
  --shadow-md: 0 6px 20px rgba(11,61,110,.09);
  --shadow-lg: 0 16px 40px rgba(11,61,110,.14);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -120px, rgba(55,138,221,.14), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 320px);
  color: var(--text); font-size: 14px; line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-deep); text-decoration: underline; }

/* ============ 顶部导航 ============ */
.topbar {
  background: linear-gradient(135deg, #082F57 0%, var(--brand-deep) 40%, #1A6CB8 100%);
  color: #fff; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  min-height: var(--topbar-h);
  box-shadow: 0 2px 12px rgba(8,47,87,.28);
  border-bottom: 2px solid var(--accent);
}
.topbar .brand { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.topbar .brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #2E7BC4, #6FB1E8);
  box-shadow: 0 2px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff;
  letter-spacing: 0;
  position: relative;
}
.topbar .brand .logo::after {
  content: ""; position: absolute; inset: 3px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.35);
}
.topbar .brand .t1 {
  font-size: 16.5px; font-weight: 700; letter-spacing: .5px;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.topbar .brand .t2 { font-size: 12px; color: #B5D4F4; letter-spacing: .3px; }
.topbar nav { display: flex; gap: 6px; align-items: center; }
.topbar nav a {
  color: #C7DEF5; padding: 8px 16px; border-radius: 999px; font-size: 14px;
  transition: all .18s ease; position: relative;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; }
.topbar nav a.active {
  color: #082F57; background: #fff;
  font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* ============ 提示横幅 ============ */
.demo-banner {
  background: linear-gradient(90deg, var(--accent-soft), #FBF3E3);
  color: #6B4A12; border-bottom: 1px solid #F3D9A4;
  padding: 9px 28px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 8px;
}
.demo-banner::before {
  content: "ℹ"; flex: 0 0 auto; font-weight: 700;
  display: inline-block; width: 18px; height: 18px; line-height: 18px;
  text-align: center; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; margin-top: 2px;
}
.demo-banner b { font-weight: 600; color: #7A5213; }
.demo-banner .todo { color: var(--err); }

/* ============ 页面容器 ============ */
.page { max-width: 1280px; margin: 0 auto; padding: 26px 28px 52px; }
.page-title {
  font-size: 22px; font-weight: 700; margin: 6px 0 6px;
  color: var(--brand-deep);
  display: flex; align-items: center; gap: 10px;
}
.page-title::before {
  content: ""; width: 5px; height: 24px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--brand-light));
  box-shadow: 0 1px 4px rgba(232,163,61,.5);
}
.page-sub { color: var(--text-sub); font-size: 13px; margin-bottom: 24px; padding-left: 15px; }

/* ============ KPI 仪表卡片 ============ */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px;
}
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column; gap: 2px;
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
}
.kpi:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.kpi { padding-right: 62px; }
.kpi .ic {
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.kpi .ic svg { width: 19px; height: 19px; }
.kpi .num {
  font-size: 30px; font-weight: 800; color: var(--brand-deep);
  font-variant-numeric: tabular-nums; letter-spacing: .5px;
  line-height: 1.15;
}
.kpi .lbl { font-size: 13px; color: var(--text-sub); font-weight: 500; }
.kpi .tag {
  font-size: 11.5px; color: var(--brand); margin-top: 2px;
  background: var(--brand-soft); border-radius: 999px;
  padding: 1px 10px; align-self: flex-start;
}

/* ============ 面板 ============ */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease;
}
.panel:hover { box-shadow: var(--shadow-md); }
.panel h3 {
  font-size: 15.5px; font-weight: 700; margin-bottom: 14px; color: var(--brand-deep);
  display: flex; align-items: center; gap: 8px; letter-spacing: .3px;
}
.panel h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--brand-light));
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } .page { padding: 16px 14px 40px; } .topbar { padding: 0 14px; } .topbar .t2 { display: none; } }

/* ============ 权益清单（填报页） ============ */
.benefit {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; margin-bottom: 12px;
  background: linear-gradient(180deg, #FBFDFF, #F7FAFE);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.benefit:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.benefit .bt {
  font-size: 14px; font-weight: 700; color: var(--brand-deep); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.benefit ul { margin: 6px 0 0 20px; }
.benefit li { font-size: 13px; color: #3B4C63; margin: 4px 0; line-height: 1.75; }
.benefit .note { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.panel h4.sec {
  font-size: 14px; font-weight: 700; color: var(--brand-deep); margin: 18px 0 10px;
  padding-left: 10px; border-left: 3px solid var(--accent);
}
.panel h4.sec:first-child { margin-top: 0; }
.todo { color: var(--err); font-weight: 600; }

/* ============ 表格 ============ */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  background: linear-gradient(180deg, #F4F8FC, #EAF1F8);
  color: var(--brand-deep); font-weight: 600; white-space: nowrap;
  font-size: 12.5px; letter-spacing: .3px;
}
tr:hover td { background: #F7FBFF; }
tr:last-child td { border-bottom: none; }

/* ============ 徽标 ============ */
.badge {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.8; margin-left: 6px; font-weight: 500;
  vertical-align: 1px;
}
.badge.demo { background: var(--accent-soft); color: #8A5A14; border: 1px solid #F3D9A4; }
.badge.auto { background: var(--ok-soft); color: var(--ok); border: 1px solid #9FE1CB; }
.badge.fill { background: var(--brand-soft); color: var(--brand); border: 1px solid #85B7EB; }

/* ============ 表单 ============ */
.form-row { margin-bottom: 15px; }
.form-row label {
  display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px;
  font-weight: 500;
}
.form-row label::after { content: ""; }
input[type=text], input[type=tel], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(55,138,221,.15);
}
textarea { min-height: 120px; resize: vertical; }
.btn {
  display: inline-block; padding: 9px 24px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; cursor: pointer; font-weight: 600; letter-spacing: .5px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff; box-shadow: 0 2px 6px rgba(24,95,165,.3);
  transition: all .18s ease;
}
.btn:hover { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); box-shadow: 0 4px 12px rgba(24,95,165,.38); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: #fff; color: var(--brand); border: 1px solid #85B7EB;
  box-shadow: none;
}
.btn.ghost:hover { background: var(--brand-soft); box-shadow: none; }
.btn.danger { background: #fff; color: var(--err); border: 1px solid #F09595; box-shadow: none; }
.btn.danger:hover { background: var(--err-soft); box-shadow: none; }
.btn.sm { padding: 5px 14px; font-size: 12.5px; border-radius: 6px; }

/* ============ 检索区 ============ */
.search-bar {
  display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.search-bar input { max-width: 340px; flex: 1; }
.search-bar select { max-width: 190px; }

/* ============ Tab ============ */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text-sub); cursor: pointer; font-size: 13.5px;
  transition: all .16s ease; font-weight: 500;
  display: inline-flex; align-items: center;
}
.tabs button svg { vertical-align: -2px; opacity: .85; }
.tabs button:hover { border-color: var(--brand-light); color: var(--brand); }
.tabs button.active {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(24,95,165,.3);
}

/* ============ 卡片列表 ============ */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 2px; background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0; transition: opacity .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 8px; color: var(--brand-deep); }
.card .meta { font-size: 12.5px; color: var(--text-sub); margin: 4px 0; line-height: 1.7; }
.card .meta b { color: #33445C; font-weight: 600; }

/* ============ 动态列表 ============ */
.dyn-list { list-style: none; }
.dyn-list li { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.dyn-list li:last-child { border-bottom: none; }
.dyn-list .date {
  color: var(--text-light); font-size: 12px; margin-right: 10px; white-space: nowrap;
}
.dyn-list .cat {
  display: inline-block; background: var(--brand-soft); color: var(--brand);
  border-radius: 5px; font-size: 11.5px; padding: 1px 7px; margin-right: 8px; font-weight: 500;
}
.dyn-list a { color: #33445C; }
.dyn-list a:hover { color: var(--brand); }

/* ============ 提示条 ============ */
.msg {
  padding: 11px 15px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 13px;
  display: none; line-height: 1.6;
}
.msg.ok {
  background: var(--ok-soft); color: var(--ok); display: block;
  border: 1px solid #9FE1CB; border-left: 4px solid var(--ok);
}
.msg.err {
  background: var(--err-soft); color: var(--err); display: block;
  border: 1px solid #F09595; border-left: 4px solid var(--err);
}

/* ============ 底部 ============ */
.footer {
  text-align: center; color: var(--text-light); font-size: 12px;
  padding: 28px 0 12px; letter-spacing: .3px;
  border-top: 1px solid var(--line); margin-top: 30px;
}
.footer b { color: var(--text-sub); font-weight: 600; }

/* ============ 图表容器 ============ */
.chart-box { height: 240px; }
.chart-box svg { width: 100%; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-sub); }
.legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 4px; vertical-align: -1px;
}

/* ============ 加载与空态 ============ */
.empty { text-align: center; color: var(--text-light); padding: 34px 0; }
.loading { text-align: center; color: var(--text-light); padding: 22px 0; }

/* ============ 后台管理补充 ============ */
#loginBox input[type=text], #loginBox input[type=password] {
  width: 118px; padding: 5px 9px; font-size: 12px; border-radius: 6px;
}
#loginBox .btn { margin-left: 4px; }
code {
  background: var(--brand-soft); color: var(--brand-deep); padding: 1px 7px;
  border-radius: 5px; font-size: 12px; font-family: Consolas, "Courier New", monospace;
}

/* ============ 滚动条（Chrome/Edge） ============ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #C3CFDF; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #A8B8CD; }
::-webkit-scrollbar-track { background: transparent; }
