/* ══════════════════════════════
   全局基础
══════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f7;
  color: #333;
  min-height: 100vh;
}


/* ══════════════════════════════
   侧边栏
══════════════════════════════ */
.sidebar {
  width: 224px;
  min-width: 224px;
  background: #1e2a3a;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-title { font-size: 15px; font-weight: 700; color: #fff; }
.logo-title span { color: #4da3ff; }
.logo-sub { font-size: 11px; color: rgba(255,255,255,0.32); margin-top: 3px; }
.logo-store { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 4px; }

.nav-cat-label {
  padding: 14px 20px 5px;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.18s;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { border-left-color: #4da3ff; color: #fff; background: rgba(77,163,255,0.1); }

.nav-sub { overflow: hidden; max-height: 0; transition: max-height 0.28s ease; }
.nav-sub.open { max-height: 600px; }
.nav-sub-item {
  padding: 7px 20px 7px 32px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
}
.nav-sub-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-sub-item.active { color: #4da3ff; font-weight: 600; }
.nav-sub-item::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.nav-add {
  margin: 3px 14px 10px;
  padding: 7px 12px;
  background: rgba(77,163,255,0.1);
  border: 1px dashed rgba(77,163,255,0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #4da3ff;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
}
.nav-add:hover { background: rgba(77,163,255,0.2); }
.badge {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 8px;
  min-width: 22px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.btn-logout {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
}
.btn-logout:hover {
  background: rgba(229,57,53,0.2);
  border-color: rgba(229,57,53,0.4);
  color: #ef9a9a;
}

/* ══════════════════════════════
   主区域
══════════════════════════════ */
.main { margin-left: 224px; flex: 1; padding: 28px 32px; min-height: 100vh; }
.page-header { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; }
.page-header h1 { font-size: 20px; font-weight: 700; color: #1e2a3a; }
.page-header p { font-size: 13px; color: #888; margin-top: 4px; }
.breadcrumb { font-size: 12px; color: #aaa; margin-bottom: 6px; }
.breadcrumb span { color: #4da3ff; }

/* ══════════════════════════════
   卡片
══════════════════════════════ */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 22px 26px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e2a3a;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #f0f2f7;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 15px;
  background: #4da3ff;
  border-radius: 2px;
}

/* ══════════════════════════════
   统计卡片
══════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.stat-card .num { font-size: 28px; font-weight: 800; color: #1e2a3a; }
.stat-card .label { font-size: 12px; color: #aaa; margin-top: 4px; }
.stat-card.blue .num { color: #4da3ff; }
.stat-card.green .num { color: #51cf66; }
.stat-card.pink .num { color: #f06595; }
.stat-card.orange .num { color: #f57c00; }

/* ══════════════════════════════
   表单元素
══════════════════════════════ */
.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: #666; margin-bottom: 7px; }
.required { color: #e53935; margin-left: 2px; }

input[type=text], input[type=number], input[type=password], textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e0e4ee;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
  transition: border 0.2s;
  background: #fff;
  font-family: inherit;
}
input[type=text]:focus, input[type=number]:focus, input[type=password]:focus, textarea:focus {
  outline: none;
  border-color: #4da3ff;
}
textarea { resize: vertical; min-height: 68px; }

.input-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input-inline span { font-size: 13px; color: #555; white-space: nowrap; }
.input-inline input { width: 80px; }

/* ══════════════════════════════
   价格区域
══════════════════════════════ */
.price-row { display: flex; gap: 16px; flex-wrap: wrap; }
.price-field { flex: 1; min-width: 130px; }
.price-field label { display: block; font-size: 12px; font-weight: 600; color: #666; margin-bottom: 6px; }
.price-input-wrap { position: relative; display: flex; align-items: center; }
.price-input-wrap .unit { position: absolute; left: 11px; color: #aaa; font-size: 14px; }
.price-input-wrap input { padding-left: 26px; width: 100%; }
.price-discount { display: flex; align-items: flex-end; padding-bottom: 2px; }
.discount-tag {
  background: #f5f5f5; color: #bbb;
  border-radius: 8px; padding: 6px 12px;
  font-size: 13px; font-weight: 700;
  border: 1px solid #eee; white-space: nowrap;
  transition: all 0.2s;
}
.discount-tag.active { background: #fff3e0; color: #f57c00; border-color: #ffe0b2; }

/* 团单价格展示条 */
.ov-price-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding: 10px 14px;
  background: #f8fbff; border-radius: 10px;
  border: 1px solid #e8f0fe;
}
.ov-price-sale { font-size: 20px; font-weight: 800; color: #e53935; }
.ov-price-sale .unit { font-size: 13px; font-weight: 500; }
.ov-price-ori { font-size: 13px; color: #bbb; text-decoration: line-through; }
.ov-price-discount {
  margin-left: auto;
  background: #fff3e0; color: #f57c00;
  border-radius: 8px; padding: 3px 10px;
  font-size: 12px; font-weight: 700;
  border: 1px solid #ffe0b2;
}
.ov-price-empty { font-size: 13px; color: #ccc; font-style: italic; }

/* ══════════════════════════════
   选项按钮
══════════════════════════════ */
.option-group { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 7px 15px;
  border-radius: 20px;
  border: 1.5px solid #e0e4ee;
  background: #f7f8fc;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.opt:hover { border-color: #4da3ff; color: #4da3ff; background: #eef5ff; }
.opt.sel { border-color: #4da3ff; background: #4da3ff; color: #fff; font-weight: 600; }

/* ══════════════════════════════
   子块
══════════════════════════════ */
.sub-block {
  margin-top: 12px;
  background: #f7f8fc;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e8edf5;
  display: none;
}
.sub-block.show { display: block; }
.sub-label { font-size: 10px; font-weight: 700; color: #aaa; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 9px; }
.other-input-wrap { display: none; margin-top: 9px; }
.other-input-wrap.show { display: block; }

/* ══════════════════════════════
   操作按钮
══════════════════════════════ */
.action-bar { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.btn-reset {
  padding: 10px 26px;
  background: #fff; color: #999;
  border: 1.5px solid #e0e4ee;
  border-radius: 24px; font-size: 13px; cursor: pointer;
}
.btn-reset:hover { border-color: #e53935; color: #e53935; }
.btn-submit {
  padding: 10px 34px;
  background: #4da3ff; color: #fff;
  border: none; border-radius: 24px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(77,163,255,0.28);
}
.btn-submit:hover { background: #2e8de8; }
.btn-submit:disabled { background: #b0d4f7; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  padding: 9px 22px;
  background: #4da3ff; color: #fff;
  border: none; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: #2e8de8; }
.btn-cancel {
  padding: 9px 22px;
  background: #fff; color: #999;
  border: 1.5px solid #e0e4ee;
  border-radius: 10px; font-size: 13px; cursor: pointer;
}
.btn-confirm {
  padding: 9px 26px;
  background: #4da3ff; color: #fff;
  border: none; border-radius: 10px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-confirm:hover { background: #2e8de8; }

/* ══════════════════════════════
   团单总览卡片
══════════════════════════════ */
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; }
.ov-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 20px 22px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.ov-card:hover { border-color: #4da3ff; box-shadow: 0 4px 20px rgba(77,163,255,0.12); }
.ov-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #4da3ff, #74c0fc);
}
.ov-card.type-buya::before { background: linear-gradient(90deg, #51cf66, #94d82d); }
.ov-card.type-genguan::before { background: linear-gradient(90deg, #f06595, #f783ac); }
.ov-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.ov-card-name { font-size: 15px; font-weight: 700; color: #1e2a3a; line-height: 1.3; }
.ov-card-type {
  font-size: 11px; color: #fff;
  padding: 2px 9px; border-radius: 10px;
  background: #4da3ff; font-weight: 600;
  white-space: nowrap; margin-left: 8px; flex-shrink: 0;
}
.ov-card-type.type-buya { background: #51cf66; }
.ov-card-type.type-genguan { background: #f06595; }
.ov-store-tag {
  font-size: 11px; color: #888;
  background: #f0f2f7; padding: 2px 8px;
  border-radius: 6px; margin-bottom: 10px; display: inline-block;
}
.ov-fields { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.ov-field { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.ov-field-key { color: #999; white-space: nowrap; flex-shrink: 0; }
.ov-field-val { color: #333; font-weight: 500; }
.ov-field-val.empty { color: #f0a500; font-style: italic; }
.ov-card-actions { display: flex; gap: 8px; border-top: 1px solid #f0f2f7; padding-top: 10px; }
.ov-btn {
  flex: 1; padding: 6px 0;
  border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: center;
  transition: all 0.15s; border: 1.5px solid;
}
.ov-btn-copy { border-color: #e0e4ee; color: #888; background: #fff; }
.ov-btn-copy:hover { border-color: #4da3ff; color: #4da3ff; }
.ov-btn-del { border-color: #e0e4ee; color: #e53935; background: #fff; }
.ov-btn-del:hover { border-color: #e53935; background: #fff5f5; }

/* ══════════════════════════════
   门店管理表格
══════════════════════════════ */
.store-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.store-table th {
  background: #f7f8fc; padding: 12px 16px;
  text-align: left; font-size: 12px; color: #888;
  font-weight: 600; border-bottom: 1.5px solid #f0f2f7;
}
.store-table td { padding: 12px 16px; font-size: 13px; color: #333; border-bottom: 1px solid #f7f8fc; }
.store-table tr:last-child td { border-bottom: none; }
.store-table tr:hover td { background: #fafbff; }
.status-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.status-on { background: #e8f5e9; color: #43a047; }
.status-off { background: #fce4ec; color: #e53935; }
.tbl-btn {
  padding: 4px 12px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1.5px solid;
  transition: all 0.15s; margin-right: 4px;
}
.tbl-btn-primary { border-color: #4da3ff; color: #4da3ff; background: #fff; }
.tbl-btn-primary:hover { background: #eef5ff; }
.tbl-btn-danger { border-color: #e53935; color: #e53935; background: #fff; }
.tbl-btn-danger:hover { background: #fff5f5; }
.tbl-btn-success { border-color: #43a047; color: #43a047; background: #fff; }
.tbl-btn-success:hover { background: #e8f5e9; }

/* ══════════════════════════════
   筛选栏
══════════════════════════════ */
.filter-bar {
  background: #fff; border-radius: 12px;
  padding: 14px 20px; margin-bottom: 16px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.filter-bar select, .filter-bar input {
  padding: 7px 12px;
  border: 1.5px solid #e0e4ee;
  border-radius: 8px; font-size: 13px; color: #333; font-family: inherit;
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: #4da3ff; }
.btn-reset-filter {
  padding: 7px 16px; background: #fff; color: #999;
  border: 1.5px solid #e0e4ee; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.btn-reset-filter:hover { border-color: #4da3ff; color: #4da3ff; }

/* ══════════════════════════════
   弹窗
══════════════════════════════ */
.mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 1000; align-items: center; justify-content: center;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px;
  padding: 30px 34px;
  max-width: 520px; width: 93%;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.16);
  position: relative;
}
.modal h2 { font-size: 17px; color: #1e2a3a; margin-bottom: 20px; font-weight: 700; }
.modal pre {
  background: #f7f8fc; border-radius: 10px;
  padding: 15px; font-size: 13px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-all;
  border: 1px solid #e8edf5;
}
.modal-close {
  position: absolute; top: 14px; right: 18px;
  font-size: 22px; color: #bbb; cursor: pointer;
  background: none; border: none;
}
.modal-close:hover { color: #e53935; }
.modal-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.btn-copy-modal {
  padding: 9px 26px; background: #4da3ff; color: #fff;
  border: none; border-radius: 10px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn-copy-modal:hover { background: #2e8de8; }
.copy-tip { color: #43a047; font-size: 13px; }
.add-modal {
  background: #fff; border-radius: 16px;
  padding: 26px 30px; max-width: 400px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.add-modal h3 { font-size: 16px; font-weight: 700; color: #1e2a3a; margin-bottom: 16px; }
.add-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ══════════════════════════════
   空状态 & Toast
══════════════════════════════ */
.empty-state { text-align: center; padding: 80px 20px; color: #ccc; }
.empty-state .icon { font-size: 52px; margin-bottom: 14px; }
.empty-state p { font-size: 14px; line-height: 1.8; }
.empty-tip {
  text-align: center; padding: 60px 20px;
  color: #ccc; font-size: 14px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%);
  background: #323232; color: #fff;
  padding: 10px 24px; border-radius: 24px;
  font-size: 13px; z-index: 9999; display: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.toast.show { display: block; }

/* ══════════════════════════════
   登录页（仅 index.html 使用）
══════════════════════════════ */
body.login-page {
  background: linear-gradient(135deg, #1e2a3a 0%, #2d4a6e 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}


.login-box {
  background: #fff;
  border-radius: 20px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  align-self: center;        /* 新增 */
  flex-shrink: 0;            /* 新增 */
}

.logo { text-align: center; margin-bottom: 32px; }
.logo h1 { font-size: 22px; font-weight: 800; color: #1e2a3a; margin-top: 12px; }
.logo p { font-size: 13px; color: #aaa; margin-top: 4px; }
.logo .icon { font-size: 48px; }
.btn-login {
  width: 100%; padding: 13px;
  background: #4da3ff; color: #fff;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 8px; transition: background 0.2s;
  box-shadow: 0 4px 14px rgba(77,163,255,0.35);
}
.btn-login:hover { background: #2e8de8; }
.btn-login:disabled { background: #b0d4f7; cursor: not-allowed; }
.err-msg { color: #e53935; font-size: 13px; margin-top: 10px; text-align: center; min-height: 20px; }
.footer { text-align: center; margin-top: 24px; font-size: 12px; color: #ccc; }
