/* 灰隼速制管理后台样式（批次A）：墨绿 + 香槟金主题（与专属海报同族），响应式，手机可操作 */
:root {
  --ink: #0d4d35;
  --ink-deep: #083820;
  --ink-soft: #12604a;
  --gold: #d9c293;
  --paper: #f7f5f0;
  --card: #ffffff;
  --line: #e6e1d6;
  --text: #2c2c2c;
  --muted: #8a8578;
  --danger: #c0392b;
  --side-w: 236px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ===== 登录 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--ink-deep) 0%, var(--ink) 55%, var(--ink-soft) 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border-radius: 16px;
  padding: 40px 34px 30px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  border-top: 4px solid var(--gold);
}
.login-logo { font-size: 44px; text-align: center; }
.login-title { font-size: 22px; text-align: center; color: var(--ink-deep); margin-top: 8px; letter-spacing: 2px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 22px; }
.field { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.field input {
  display: block; width: 100%; margin-top: 6px;
  padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fbfaf7; color: var(--text);
  outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--ink); }
.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.btn-primary {
  width: 100%; padding: 12px;
  background: var(--ink); color: #fff;
  border: none; border-radius: 8px;
  font-size: 16px; letter-spacing: 6px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--ink-soft); }
.btn-primary:disabled { background: #9bb5a9; cursor: not-allowed; }
.login-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* ===== 主框架 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  background: var(--ink-deep); color: #cfe3d8;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  padding: 20px 18px 16px;
  font-size: 17px; font-weight: 600; color: #fff; letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-ico { margin-right: 6px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; font-size: 14.5px;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav-item.active { background: rgba(217, 194, 147, .14); border-left-color: var(--gold); color: #fff; }
.nav-ico { width: 20px; text-align: center; }
.nav-batch {
  margin-left: auto; font-size: 11px; color: var(--gold);
  border: 1px solid rgba(217, 194, 147, .5); border-radius: 8px; padding: 0 7px;
}
.side-foot { padding: 12px 18px; font-size: 12px; color: rgba(255, 255, 255, .35); border-top: 1px solid rgba(255, 255, 255, .08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 0 20px; height: 56px;
  position: sticky; top: 0; z-index: 5;
}
.menu-btn { display: none; background: none; border: none; font-size: 20px; color: var(--ink); }
.page-title { font-size: 17px; font-weight: 600; color: var(--ink-deep); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--muted); }
.btn-ghost {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 14px; font-size: 13px; color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }

.content { padding: 22px 20px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 16px;
}
.card h2 { font-size: 19px; color: var(--ink-deep); }
.card h3 { font-size: 15px; color: var(--ink-deep); margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 13.5px; }
.hero { border-top: 3px solid var(--gold); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mod { display: block; text-align: center; padding: 18px 10px; transition: transform .12s, box-shadow .12s; }
.mod:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13, 77, 53, .10); }
.mod-ico { font-size: 26px; }
.mod-name { font-size: 14.5px; font-weight: 600; margin-top: 6px; color: var(--ink-deep); }
.mod-state { font-size: 12px; color: var(--muted); margin-top: 2px; }

.placeholder { text-align: center; padding: 56px 24px; }
.ph-ico { font-size: 40px; }
.placeholder h2 { margin: 10px 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
  background: rgba(8, 56, 32, .92); color: #fff;
  padding: 10px 22px; border-radius: 22px; font-size: 14px;
  z-index: 99; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  max-width: 86vw; text-align: center;
}

/* 手机端：侧栏抽屉化 */
.side-mask { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 9; }

/* ===== 批次B：表格/工具栏/弹窗/表单 ===== */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar-sp { flex: 1; }
.inp {
  padding: 8px 11px; font-size: 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none;
}
.inp:focus { border-color: var(--ink); }
.inp[readonly] { background: #f2efe8; color: var(--muted); }
.sel { min-width: 100px; }
.btn-primary-sm {
  padding: 8px 16px; font-size: 14px; color: #fff; background: var(--ink);
  border: none; border-radius: 8px; transition: background .15s;
}
.btn-primary-sm:hover { background: var(--ink-soft); }
.btn-primary-sm:disabled { background: #9bb5a9; cursor: not-allowed; }
.btn-primary-sm.btn-danger { background: var(--danger); }
.btn-outline-sm {
  padding: 8px 14px; font-size: 14px; color: var(--ink); background: #fff;
  border: 1px solid var(--ink); border-radius: 8px;
}
.btn-outline-sm:hover { background: rgba(13, 77, 53, .06); }
.btn-outline-sm:disabled { opacity: .45; cursor: not-allowed; }

.table-card { padding: 0; overflow-x: auto; }
/* 批次9（9/28 任务7）：主数据表固定布局 + 逐页 colgroup 显式列宽（窄屏保留横向滚动）
   🔴 只作用于 .table-card 直系主表；弹窗内 .import-preview 预览表不受影响（保持自适应） */
.table-card > .tbl { table-layout: fixed; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 1040px; }
/* 长文本单元格：单行截断 + 悬浮 title 看全文（多行 <br> 单元格不受影响，仍随内容撑高行） */
.tbl td.ell, .tbl th.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl col { min-width: 0; }
.tbl th {
  text-align: left; padding: 10px 12px; color: var(--ink-deep); font-size: 12.5px;
  background: #f2efe6; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid #f0ede4; vertical-align: middle; line-height: 1.4; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.row-disabled td { opacity: .55; }
.tbl .mono { font-family: ui-monospace, Consolas, monospace; }
.tbl .num { white-space: nowrap; }
.tbl .mch { font-size: 12px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.badge-on { background: rgba(13, 77, 53, .1); color: var(--ink); }
.badge-off { background: rgba(192, 57, 43, .1); color: var(--danger); }
.ops { white-space: nowrap; }
.btn-link { background: none; border: none; color: var(--ink); font-size: 13px; padding: 2px 6px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.op-off { color: var(--danger); }
.btn-link.op-on { color: var(--ink); }
.logo-thumb { height: 34px; max-width: 90px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--line); vertical-align: middle; }
.logo-cell { min-width: 96px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-top: 1px solid var(--line); }
.pager-info { font-size: 13px; color: var(--muted); }

.hidden-input { display: none; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 30, 20, .45); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto;
}
.modal-box {
  width: 100%; max-width: 560px; background: var(--card); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); border-top: 3px solid var(--gold);
}
.modal-title { font-size: 17px; color: var(--ink-deep); margin-bottom: 12px; }
.modal-text { font-size: 13.5px; color: var(--text); margin-bottom: 14px; line-height: 1.7; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid label { display: block; font-size: 12.5px; color: var(--muted); }
.form-grid .inp { display: block; width: 100%; margin-top: 4px; }
.form-logo { margin-top: 12px; font-size: 13px; color: var(--muted); }
.import-preview { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.import-preview .tbl { min-width: 0; }
.ok-num { color: var(--ink); }
.bad-num { color: var(--danger); }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar-sp { display: none; }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 10;
    transform: translateX(-100%); transition: transform .18s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .side-mask.show { display: block; }
  .menu-btn { display: block; }
  .content { padding: 16px 12px 32px; }
  .who { display: none; }
}

/* 批次D：config 页 checkbox 行 + details 历史 */
.ck { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #33413a; }
.ck input[type=checkbox] { width: 18px; height: 18px; accent-color: #0d4d35; cursor: pointer; }
details summary { user-select: none; }
