/* 小水豚能耗记 · 样式（与 xiaoshuitun.cn 小水豚Ai 首页风格统一：暖橙 + 深棕） */
:root {
  --accent: #dd844c;
  --accent-soft: #e59866;
  --accent-dark: #c06a33;
  --accent-light: #fdf0e6;
  --bg: #eef5fc;
  --card: #ffffff;
  --text: #2c2421;
  --muted: #9a8a80;
  --red: #d64b3c;
  --green: #2e7d5b;
  --border: #e7dccf;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(44, 34, 30, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid rgba(229, 152, 102, .3);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { height: 42px; width: auto; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 18px; font-weight: 700; color: var(--accent-dark); }
.brand-sub { font-size: 11px; color: var(--muted); }
.topnav { display: flex; align-items: center; gap: 10px; }
.link-back { font-size: 13px; }
.user-chip { font-size: 13px; color: var(--accent-dark); background: var(--accent-light); padding: 4px 10px; border-radius: 20px; }

/* 车辆切换条 */
.car-nav {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--accent-light);
  border-bottom: 1px solid rgba(229, 152, 102, .3);
}
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.select, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=file] {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--text); max-width: 100%;
}
.select:focus, input:focus { outline: none; border-color: var(--accent); }
.car-tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; }
.tab {
  padding: 6px 14px; border-radius: 20px; font-size: 13px; color: var(--muted); background: #fff;
  border: 1px solid var(--border); text-decoration: none;
}
.tab:hover { text-decoration: none; color: var(--accent-dark); }
.tab-on { background: var(--accent); color: #fff; border-color: var(--accent); }


/* ---------- 车辆切换行右侧油价条（暖橙主题） ---------- */
.car-oil {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #fff7ec, #ffefdc);
  border: 1px solid #f0c99a;
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.car-oil .co-label {
  font-weight: 700;
  color: var(--accent-dark);
}
.car-oil b { color: #c2410c; }
.car-oil .co-sep { color: #e6b37e; }
@media (max-width: 720px) {
  .car-oil { margin-left: 0; font-size: 12px; }
}

/* 主容器 */
.container { max-width: 980px; margin: 20px auto; padding: 0 16px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card-warn { border-color: #f5d2a3; background: #fffaf1; }
.card h2 { font-size: 16px; margin-bottom: 12px; color: var(--accent-dark); }
.section-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.section-title h2 { margin-bottom: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 按钮 */
.btn {
  display: inline-block; border: none; border-radius: 10px; cursor: pointer;
  padding: 8px 16px; font-size: 14px; text-decoration: none; line-height: 1.4;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: #fff; color: var(--accent-dark); border: 1px solid var(--border); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f3c9c4; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-icon { background: none; border: none; color: var(--accent-dark); cursor: pointer; font-size: 13px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; background: #fdf9f4; }
.table tr:hover td { background: #fdf9f4; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: #fdf9f4; border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.stat-num { font-size: 18px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-hl { background: var(--accent-light); border-color: #f5c9a8; }
.stat-hl .stat-num { color: var(--accent-dark); }

/* 车辆卡片 */
.veh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.veh-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fdf9f4; }
.veh-card.veh-on { border-color: var(--accent); background: var(--accent-light); }
.veh-head { display: flex; justify-content: space-between; align-items: center; }
.veh-name { font-weight: 700; color: var(--accent-dark); }
.veh-mile { font-size: 13px; color: var(--muted); margin: 6px 0 8px; }
.veh-mile b { color: var(--text); }
.veh-ops { display: flex; gap: 6px; }
.badge { font-size: 11px; background: #ffe8c2; color: #a9711a; padding: 2px 8px; border-radius: 10px; }

/* 表单 */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.form-row input { width: 100%; }
.box-form { border: 1px dashed var(--border); background: #fdf9f4; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.edit-row td { background: #fdf9f4 !important; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.alert-red { background: #fdecea; color: #b34033; border: 1px solid #f5c9c3; }
.alert-ok { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #f5c9a8; }
.alert-warn { background: #fff7e6; color: #8a6116; border: 1px solid #f3e0b0; }
.muted { color: var(--muted); font-size: 13px; }
.red { color: var(--red); }
.green { color: var(--green); }
.empty { text-align: center; color: var(--muted); padding: 26px 0; }

/* 图表 */
.chart-box { position: relative; height: 280px; margin-bottom: 24px; }

/* 登录/注册页 */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eef5fc, #fdeee0); padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 30px 28px; border: 1px solid var(--border); }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand img { height: 72px; width: auto; }
.auth-brand h1 { font-size: 22px; color: var(--accent-dark); margin: 8px 0 4px; }
.auth-brand p { color: var(--muted); font-size: 13px; }
.auth-form label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.auth-form input { width: 100%; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 14px; }
.auth-back { text-align: center; margin-top: 10px; font-size: 13px; }
.auth-back a { color: var(--muted); }

/* 安装页 */
.check-list { list-style: none; font-size: 14px; margin: 8px 0 12px; }
.check-list li { padding: 4px 0; }

/* 页脚 */
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 10px 30px; }

/* 响应式 */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .brand-sub { display: none; }
  .car-nav { padding: 8px 12px; }
  .container { padding: 0 10px; margin-top: 12px; }
  .stat-num { font-size: 15px; }
}

/* ---------- 外部参考能耗 ---------- */
.ext-ref {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(247, 177, 83, 0.07);
  border: 1px dashed rgba(247, 177, 83, 0.45);
  border-radius: 10px;
}
.ext-ref-title {
  font-weight: 600;
  color: #b95e00;
  margin-bottom: 6px;
  font-size: 14px;
}
.ext-ref .table { margin-bottom: 6px; }
.ext-ref .table td { padding: 7px 10px; font-size: 13px; }
.ext-ref .td-src { text-align: right; white-space: nowrap; font-size: 12px; color: #9a9a9a; }
.ext-ref .td-src a { color: #b95e00; }
.ext-ref-note { font-size: 12px; line-height: 1.6; }

/* ---------- 今日油价条 ---------- */
.oil-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  background: linear-gradient(135deg, #fff7ec, #ffefdc);
  border: 1px solid #f7d9b0;
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.oil-bar-title { font-weight: 600; color: #b95e00; }
.oil-item b { color: #c2410c; }
.oil-src { font-size: 12px; margin-left: auto; }

/* ---------- 车辆卡片元信息 ---------- */
.veh-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: #8a8a8a;
}


/* ---------- 外部参考能耗：字号统一 ---------- */
.ext-ref-title { font-size: 13px; }
.ext-ref .table td { font-size: 13px; padding: 8px 10px; }
.ext-ref .table td b { font-size: 13px; }
.ext-ref .td-src { font-size: 13px; }
.ext-ref .td-src a { font-size: 13px; }
.ext-ref-note { font-size: 13px; }

/* ---------- 编辑车辆弹窗 ---------- */
#editVehModal form label { display: block; margin-bottom: 4px; font-size: 13px; }
#editVehModal .form-row > div { flex: 1; min-width: 180px; }

/* ---------- 登录/注册：邮箱验证码、登录方式切换 ---------- */
.code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.code-row input { flex: 1; min-width: 0; width: auto; }
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f0dcc8;
  padding-bottom: 10px;
}
.auth-tab {
  font-size: 14px;
  color: #a06a2f;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: #faf3ea;
  border: 1px solid #f0dcc8;
  user-select: none;
}
.auth-tab.tab-on {
  background: linear-gradient(135deg, #b95e00, #e67e22);
  color: #fff;
  border-color: transparent;
}
.auth-divider {
  display: flex;
  align-items: center;
  color: #c9a26e;
  font-size: 12px;
  margin: 14px 0 10px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f0dcc8;
}
.auth-divider span { padding: 0 10px; }
.tg-code {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #b95e00;
  background: #faf3ea;
  border: 1px dashed #e0b58a;
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0;
}

/* ---------- 管理后台配置卡 ---------- */
.cfg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cfg-ico {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #b95e00;
  background: linear-gradient(135deg, #fdeee0, #fff);
  border: 1px solid #f0dcc8;
}
.cfg-head h2 { margin: 0; }
.cfg-hint { font-size: 13px; color: #8a8a8a; line-height: 1.8; margin: 0 0 12px; }
.cfg-hint code, .cfg-code {
  background: #fdf6ee; border: 1px solid #f0dcc8; border-radius: 6px;
  padding: 1px 6px; color: #a06a2f; font-size: 12px;
}
.cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 12px;
  margin-bottom: 14px;
}
.cfg-grid label { display: block; font-size: 12px; color: #8a8a8a; margin-bottom: 4px; }
.cfg-grid input, .cfg-grid select { width: 100%; }
.cfg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cfg-status { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.cfg-status.on { background: #e8f7ec; color: #1e7b34; border: 1px solid #b7e3c4; }
.cfg-status.off { background: #fdf0f0; color: #b3261e; border: 1px solid #f2c1bd; }
.cfg-cb {
  background: #fdf6ee; border: 1px solid #f0dcc8; border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: #8a5a20;
  margin: 0 0 12px; word-break: break-all; font-family: monospace;
}
.cfg-test { border-top: 1px dashed #f0dcc8; margin-top: 12px; padding-top: 12px; }
