/* ============ 加油站管理系统 公共样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1e6fff;
  --primary-dark: #0d54cc;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --shadow: 0 2px 12px rgba(15, 40, 90, .06);
  --radius: 12px;
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ============ 按钮 / 表单 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 14px; background: #eef2f7; color: var(--text); transition: .15s;
}
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; background: #fff; transition: .15s; font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,111,255,.12); }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 13px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-item { flex: 1; }

/* ============ 卡片 / 表格 / 标签 ============ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--text-2); font-weight: 500; font-size: 13px; background: #f9fafb; }
.table tr:hover td { background: #f8fafc; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-orange { background: #fef3c7; color: #b45309; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-gray { background: #f3f4f6; color: #6b7280; }
.tag-purple { background: #ede9fe; color: #6d28d9; }

/* ============ 轻提示 ============ */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 10px 22px; border-radius: 8px; background: #111827; color: #fff; font-size: 14px; opacity: 0; transform: translateY(-12px); transition: .25s; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s; }
.modal { background: #fff; border-radius: 14px; width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto; animation: slideUp .2s; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-close { cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; background: none; border: none; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } }

/* ============ 空状态 ============ */
.empty { padding: 40px 0; text-align: center; color: var(--text-3); }

/* ============================================================
 * 门户页（版本选择）
 * ============================================================ */
.portal {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0b3d91 0%, #1e6fff 55%, #38bdf8 100%); padding: 24px;
}
.portal-logo { text-align: center; color: #fff; margin-bottom: 42px; }
.portal-logo .icon { font-size: 54px; }
.portal-logo h1 { font-size: 30px; margin: 12px 0 6px; letter-spacing: 2px; }
.portal-logo p { opacity: .8; font-size: 14px; letter-spacing: 4px; }
.version-cards { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.version-card {
  width: 240px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(10px); border-radius: 18px; padding: 34px 24px; text-align: center;
  color: #fff; cursor: pointer; transition: .25s;
}
.version-card:hover { transform: translateY(-6px); background: rgba(255,255,255,.2); box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.version-card .v-icon { font-size: 46px; margin-bottom: 14px; }
.version-card h2 { font-size: 20px; margin-bottom: 8px; }
.version-card p { font-size: 13px; opacity: .8; }
.portal-footer { margin-top: 44px; color: rgba(255,255,255,.6); font-size: 12px; letter-spacing: 1px; }

/* ============================================================
 * 登录页
 * ============================================================ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0b3d91 0%, #1e6fff 55%, #38bdf8 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 38px 34px; width: 400px; max-width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,.28); animation: slideUp .25s; }
.login-card .l-icon { font-align: center; text-align: center; font-size: 42px; }
.login-card h2 { text-align: center; margin: 10px 0 4px; font-size: 22px; }
.login-card .sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 26px; }
.login-hint { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-3); background: #f4f6fa; border-radius: 8px; padding: 8px; }

/* ============================================================
 * 电脑版布局
 * ============================================================ */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; background: linear-gradient(180deg, #0f2b5b 0%, #123a7a 100%);
  color: #cdd8ee; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
}
.sidebar .logo { padding: 22px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .logo .icon { font-size: 26px; }
.sidebar .logo .name { font-size: 16px; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar .logo .name small { display: block; font-size: 11px; color: #7f96c4; font-weight: 400; }
.menu { flex: 1; padding: 14px 10px; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 9px;
  color: #cdd8ee; cursor: pointer; margin-bottom: 4px; font-size: 14px; transition: .15s;
}
.menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active { background: var(--primary); color: #fff; }
.menu-item .m-icon { font-size: 17px; width: 20px; text-align: center; }
.sidebar .side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #7f96c4; }

.main { flex: 1; margin-left: 216px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 90;
}
.topbar .t-title { font-size: 17px; font-weight: 600; }
.topbar .t-right { display: flex; align-items: center; gap: 18px; color: var(--text-2); font-size: 13px; }
.topbar .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.topbar .user-box { display: flex; align-items: center; gap: 8px; }
.topbar .logout { color: var(--text-3); cursor: pointer; }
.topbar .logout:hover { color: var(--red); }
.content { padding: 22px; flex: 1; }

/* 工作台 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-card .s-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-card .s-val { font-size: 24px; font-weight: 700; }
.stat-card .s-name { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.bg-blue { background: #dbeafe; }
.bg-green { background: #dcfce7; }
.bg-orange { background: #fef3c7; }
.bg-purple { background: #ede9fe; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 18px; }
.dash-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart-box { height: 240px; }
.chart-box canvas { width: 100%; height: 100%; }

/* 油罐卡片 */
.tank-list { display: flex; flex-direction: column; gap: 14px; }
.tank-item .t-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.tank-item .t-info b { font-size: 14px; }
.progress { height: 10px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 6px; transition: width .4s; }
.p-green { background: linear-gradient(90deg, #4ade80, #22c55e); }
.p-blue { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.p-orange { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.p-red { background: linear-gradient(90deg, #f87171, #ef4444); }

/* 页面头部工具条 */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.page-head .filters { display: flex; gap: 10px; flex-wrap: wrap; }
.page-head .filters .input, .page-head .filters .select { width: auto; }

/* 油品价格颜色点 */
.fuel-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

/* 开单页 */
.sale-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.fuel-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.fuel-card { border: 2px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: .15s; text-align: center; }
.fuel-card:hover { border-color: #93c5fd; }
.fuel-card.active { border-color: var(--primary); background: #eff6ff; }
.fuel-card .f-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.fuel-card .f-price { color: var(--primary); font-size: 18px; font-weight: 700; }
.fuel-card .f-stock { color: var(--text-3); font-size: 12px; margin-top: 6px; }
.amount-preview { background: #f4f6fa; border-radius: 12px; padding: 18px; text-align: center; margin-bottom: 16px; }
.amount-preview .a-num { font-size: 32px; font-weight: 700; color: var(--primary); }
.amount-preview .a-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pay-item { border: 2px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; cursor: pointer; font-size: 13px; transition: .15s; }
.pay-item.active { border-color: var(--primary); background: #eff6ff; color: var(--primary); font-weight: 600; }

/* ============================================================
 * 手机版布局
 * ============================================================ */
.mobile-wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; box-shadow: 0 0 30px rgba(0,0,0,.08); }
.m-header { background: linear-gradient(135deg, #0b3d91, #1e6fff); color: #fff; padding: 16px; padding-top: 22px; position: sticky; top: 0; z-index: 100; }
.m-header h1 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.m-header .m-sub { font-size: 12px; opacity: .8; margin-top: 4px; }
.m-body { flex: 1; padding: 14px; padding-bottom: 86px; overflow-y: auto; }
.m-tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; display: flex; border-top: 1px solid var(--border); z-index: 100; height: 62px;
}
.m-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 11px; cursor: pointer; }
.m-tab .t-icon { font-size: 20px; }
.m-tab.active { color: var(--primary); }
.m-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.m-stat { padding: 14px; }
.m-stat .s-val { font-size: 21px; font-weight: 700; }
.m-stat .s-name { color: var(--text-3); font-size: 12px; margin-top: 3px; }
.m-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.m-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.m-list-item:last-child { border-bottom: none; }
.m-fab-pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-section-title { font-size: 15px; font-weight: 600; margin: 16px 2px 10px; }
.m-menu-list { background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.m-menu-item { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.m-menu-item:last-child { border-bottom: none; }
.m-menu-item .mi-left { display: flex; align-items: center; gap: 10px; }
.m-menu-item .mi-icon { font-size: 18px; }

/* 响应式 */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-2, .sale-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { width: 64px; }
  .sidebar .logo .name, .menu-item .m-text, .sidebar .side-foot { display: none; }
  .main { margin-left: 64px; }
}
