﻿/* 孔海龙海鲜团购，三分必须准，投的要快姿势要帅 —— 海洋生鲜风格 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --sea: #0b6e99; --sea-dark: #08557a; --sea-light: #e6f4fb;
  --coral: #ff7a59; --gold: #f5a623; --green: #2e9e6b;
  --red: #e5484d; --gray: #64748b; --bg: #f2f7fa; --card: #fff;
  --line: #e2e8f0; --text: #1e293b;
}
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--sea); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--sea); }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--sea-light); color: var(--sea-dark); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #f8fcfd; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: linear-gradient(180deg, #0b6e99, #085a80); color: #fff; padding: 16px 0; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 8px 20px 18px; font-size: 18px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sidebar .menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,.85); cursor: pointer; font-size: 14px; }
.sidebar .menu-item:hover { background: rgba(255,255,255,.12); }
.sidebar .menu-item.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; border-left: 3px solid var(--coral); }
.main { flex: 1; padding: 20px 24px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.topbar h1 { font-size: 20px; color: var(--sea-dark); }
.topbar .user { display: flex; align-items: center; gap: 10px; color: var(--gray); }
.badge { display: inline-block; background: var(--sea-light); color: var(--sea); padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.badge.coral { background: #ffe8e1; color: var(--coral); }
.badge.green { background: #e3f5ec; color: var(--green); }
.badge.gray { background: #eef1f4; color: var(--gray); }
.badge.danger { background: #fde8e8; color: var(--red); }
.badge.gold { background: #fdf3e0; color: var(--gold); }

/* 卡片 */
.card { background: var(--card); border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(15,60,90,.08); margin-bottom: 16px; }
.card h3 { font-size: 15px; color: var(--sea-dark); margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(15,60,90,.08); border-top: 3px solid var(--sea); }
.stat-card .label { color: var(--gray); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--sea-dark); margin-top: 6px; }
.stat-card.coral { border-top-color: var(--coral); } .stat-card.coral .value { color: var(--coral); }
.stat-card.green { border-top-color: var(--green); } .stat-card.green .value { color: var(--green); }
.stat-card.gold { border-top-color: var(--gold); } .stat-card.gold .value { color: var(--gold); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; background: var(--sea); color: #fff; }
.btn:hover { background: var(--sea-dark); }
.btn.ghost { background: #fff; color: var(--sea); border: 1px solid var(--sea); }
.btn.ghost:hover { background: var(--sea-light); }
.btn.gray { background: #eef1f4; color: var(--gray); }
.btn.green { background: var(--green); }
.btn.coral { background: var(--coral); }
.btn.gold { background: var(--gold); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.danger { background: var(--red); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,40,60,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 14px; width: min(640px, 94vw); max-height: 88vh; overflow-y: auto; padding: 20px; }
.modal h3 { margin-bottom: 14px; color: var(--sea-dark); }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* 状态点 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.sea { background: var(--sea); } .dot.green { background: var(--green); } .dot.coral { background: var(--coral); } .dot.gray { background: #cbd5e1; } .dot.red { background: var(--red); } .dot.gold { background: var(--gold); }

/* 打印/汇总样式 */
.batch-block { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.muted { color: var(--gray); }
.tag { display: inline-block; background: #f1f5f9; border-radius: 6px; padding: 2px 8px; font-size: 12px; margin: 0 4px 4px 0; }
.empty { text-align: center; color: var(--gray); padding: 40px 0; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; justify-content: flex-end; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #0b6e99 0%, #0a4f75 55%, #083a58 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 36px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card h2 { color: var(--sea-dark); margin-bottom: 6px; font-size: 22px; }
.login-card .sub { color: var(--gray); margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card input { width: 100%; padding: 11px 12px; }

@media (max-width: 900px) {
  .sidebar { width: 62px; }
  .sidebar .menu-item span { display: none; }
  .sidebar .logo span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ===== 弹窗统一样式 ===== */
#modal-root { position: fixed; inset: 0; background: rgba(15, 40, 60, .45); align-items: center; justify-content: center; z-index: 100; padding: 20px; }
#modal-root .modal { background: #fff; border-radius: 14px; width: min(680px, 96vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overflow: hidden; }
#modal-root .modal h3 { margin-bottom: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; color: var(--sea-dark); }
.modal-close { border: none; background: #eef1f4; color: var(--gray); width: 28px; height: 28px; border-radius: 50%; font-size: 16px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: #e2e8f0; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafcfd; }

/* ===== 商品表单分区 ===== */
.form-section { background: #f8fbfd; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.form-section-title { font-size: 13px; font-weight: 700; color: var(--sea-dark); margin-bottom: 12px; }
.field.req label::after { content: ' *'; color: var(--red); }
.add-link { font-size: 12px; color: var(--sea); cursor: pointer; font-weight: 400; margin-left: 6px; }
.img-preview { width: 64px; height: 64px; border-radius: 10px; background: var(--sea-light); display: flex; align-items: center; justify-content: center; font-size: 32px; overflow: hidden; flex-shrink: 0; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text); cursor: pointer; }
.pb-add { display: flex; gap: 8px; margin-bottom: 8px; }
.pb-add select { flex: 2; }
.pb-add input { flex: 1; }
.pb-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
#modal-root .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical; }
#modal-root .modal input, #modal-root .modal select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; width: 100%; background: #fff; }
#modal-root .modal input:focus, #modal-root .modal select:focus, #modal-root .modal textarea:focus { outline: 2px solid rgba(11, 110, 153, .25); border-color: var(--sea); }
/* ===== 商品表单独立页面 ===== */
.pf-wrap { max-width: 1080px; }
.pf-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pf-top h2 { font-size: 18px; color: var(--sea-dark); flex: 1; margin: 0; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.pf-main { display: flex; flex-direction: column; gap: 14px; }
.pf-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.pf-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; position: sticky; bottom: 12px; box-shadow: 0 6px 24px rgba(15, 60, 90, .12); z-index: 5; }
.img-preview-lg { width: 120px; height: 120px; border-radius: 12px; background: var(--sea-light); display: flex; align-items: center; justify-content: center; font-size: 52px; overflow: hidden; flex-shrink: 0; border: 1px dashed var(--line); }
.img-preview-lg img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn { display: inline-block; background: var(--sea); color: #fff; border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.upload-btn:hover { background: var(--sea-dark); }
@media (max-width: 900px) { .pf-grid { grid-template-columns: 1fr; } .pf-side { position: static; } }