/* 丰野官网数据分析系统 - 现代商业看板风格 */
:root {
  --brand: #c17513;
  --brand-light: #f5e7d4;
  --ink: #1e2a3a;
  --ink-2: #5b6b82;
  --bg: #f2f4f8;
  --card: #ffffff;
  --line: #e6e9f0;
  --nav: #16213a;
  --ok: #1a9c6e;
  --down: #d64545;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #16213a 0%, #1f3357 55%, #3d5a8f 100%); padding: 16px;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 40px 34px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(10, 20, 45, .45); text-align: center;
}
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), #e09a3a);
  color: #fff; font-weight: 800; font-size: 24px; line-height: 58px;
}
.login-card h1 { font-size: 19px; margin-bottom: 6px; }
.login-sub { color: var(--ink-2); font-size: 12px; margin-bottom: 24px; }
#pwdInput {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; outline: none; margin-bottom: 14px;
}
#pwdInput:focus { border-color: var(--brand); }
.btn-primary {
  width: 100%; padding: 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), #d68a28); color: #fff; font-size: 15px; font-weight: 600;
}
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; }
.login-err { color: var(--down); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- 布局 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: 52px;
  background: var(--nav); color: #fff; display: flex; align-items: center; padding: 0 14px; gap: 10px;
}
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }
.topbar-title { font-size: 15px; font-weight: 600; flex: 1; }
.btn-ghost {
  background: rgba(255,255,255,.12); color: #fff; border: 0; padding: 7px 14px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.layout { display: flex; min-height: calc(100vh - 52px); }
.sidenav {
  width: 216px; background: var(--nav); color: #cfd8ea; padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700;
  padding: 10px 12px 18px; font-size: 15px;
}
.brand-badge {
  width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #e09a3a);
  color: #fff; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.nav-item {
  padding: 11px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; color: #cfd8ea;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--brand), #d68a28); color: #fff; font-weight: 600; }
.nav-foot { margin-top: auto; padding: 14px 12px; font-size: 11px; color: #7d8cab; line-height: 1.7; }
.side-mask { display: none; }
.content { flex: 1; padding: 18px 22px 40px; min-width: 0; }

/* 日期筛选条 */
.range-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.range-bar select {
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 13px; color: var(--ink); cursor: pointer;
}
.custom-dates { display: flex; align-items: center; gap: 6px; }
.custom-dates input {
  padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 13px;
}
.range-label { color: var(--ink-2); font-size: 12px; }

/* ---------- 卡片与网格 ---------- */
.page-content { max-width: 1180px; }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 1px 4px rgba(30, 42, 58, .06);
}
.card h3 { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-bottom: 12px; }
.stat-num { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.stat-num small { font-size: 13px; color: var(--ink-2); font-weight: 500; margin-left: 4px; }
.stat-sub { color: var(--ink-2); font-size: 12px; margin-top: 6px; }
.trend-up { color: var(--ok); } .trend-down { color: var(--down); }
.chart-box { width: 100%; height: 340px; }
.chart-box-sm { width: 100%; height: 260px; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-2); font-weight: 600; font-size: 12px; background: #f8f9fc; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--brand-light); }
.share-bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; }
.share-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #e09a3a); }

/* 徽章 / 提示 */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-blue { background: #e3edff; color: #2563c4; }
.badge-orange { background: var(--brand-light); color: #a35f0e; }
.badge-green { background: #dff3ec; color: #12765a; }
.note { font-size: 12px; color: var(--ink-2); line-height: 1.7; margin-top: 10px; }
.empty-tip { color: var(--ink-2); text-align: center; padding: 40px 0; font-size: 13px; }

/* AI 报告 */
.ai-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ai-tab { padding: 8px 18px; border-radius: 20px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.ai-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.report { line-height: 1.9; font-size: 14px; }
.report h2 { font-size: 16px; margin: 18px 0 8px; }
.report h3 { font-size: 14px; margin: 14px 0 6px; color: var(--ink); }
.report ul { padding-left: 20px; margin: 6px 0; }
.report li { margin: 4px 0; }
.report strong { color: #a35f0e; }

/* 模块标题 */
.page-h { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--ink-2); font-size: 12px; margin-bottom: 16px; }

/* ---------- 手机适配 ---------- */
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .sidenav {
    position: fixed; left: -240px; top: 52px; bottom: 0; z-index: 60; width: 230px;
    transition: left .22s; box-shadow: 6px 0 24px rgba(0,0,0,.25);
  }
  .sidenav.open { left: 0; }
  .side-mask { display: none; position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.4); z-index: 55; }
  .side-mask.show { display: block; }
  .content { padding: 14px 12px 90px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stat-num { font-size: 24px; }
  .chart-box { height: 280px; }
}
@media (min-width: 901px) { .sidenav { position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; } }
