:root {
  --primary: #1668dc;
  --primary-dark: #0f4fb0;
  --primary-light: #e8f1fd;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --text-muted: #6b7280;
  --text-weak: #9aa0a6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --price: #e8590c;
  --cost: #10b981;
  --danger: #e11d48;
  --success: #16a34a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }
.hidden { display: none !important; }

/* ============ 顶部导航 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
}
.topbar .brand { font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.topbar .brand img { height: 28px; width: auto; }
.topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-select {
  appearance: none; background: var(--primary-light); border: 1px solid #c7ddf9;
  color: var(--primary-dark); border-radius: 20px; padding: 6px 26px 6px 12px;
  font-size: 14px; font-weight: 500; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f4fb0' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.user-chip { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.user-chip b { color: var(--text); }
.my-quotes-btn {
  flex-shrink: 0; padding: 6px 12px; border: 1px solid var(--border); background: #fff;
  border-radius: 18px; font-size: 13px; color: var(--text); white-space: nowrap;
}
.my-quotes-btn:active { background: var(--bg); }

/* ============ 电商式布局 ============ */
.layout { max-width: 1080px; margin: 0 auto; padding: 16px; display: flex; gap: 16px; align-items: flex-start; }

/* 左侧分类树侧栏 */
.cat-sidebar {
  flex: 0 0 230px; width: 230px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto;
  padding: 8px 0; box-shadow: var(--shadow);
}
.cat-sidebar-head {
  display: none; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px;
}
.cat-sidebar-close { display: none; background: none; border: none; font-size: 22px; color: var(--text-weak); line-height: 1; }

.cat-tree { padding: 6px 8px; }
.cat-node {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 14px; user-select: none;
}
.cat-node:hover { background: var(--bg); }
.cat-node.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.cat-arrow { display: inline-flex; align-items: center; color: var(--text-weak); transition: transform .15s; flex-shrink: 0; }
.cat-arrow.open { transform: rotate(90deg); }
.cat-node-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 右侧内容区 */
.main-content { flex: 1; min-width: 0; }

/* 移动端分类切换按钮（默认隐藏，窄屏显示） */
.mobile-cat-toggle { display: none; margin-bottom: 12px; }
.cat-toggle-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  font-size: 14px; color: var(--text); font-weight: 500;
}
.cat-toggle-btn svg { color: var(--text-muted); }

/* 面包屑 */
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.crumb-seg { color: var(--text-muted); }
.crumb-sep { color: var(--text-weak); margin: 0 2px; }

/* 分类抽屉遮罩（手机端） */
.cat-sidebar-mask {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}

/* ============ 搜索 ============ */
.search-bar { position: relative; margin-bottom: 12px; }
.search-bar input {
  width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); outline: none;
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-bar .search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-weak);
}

/* ============ 产品网格 ============ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); cursor: pointer; position: relative;
  transition: transform .12s, box-shadow .12s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.product-card .p-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.product-card .p-summary {
  font-size: 13px; color: var(--text-muted); margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .p-foot { display: flex; align-items: flex-end; justify-content: space-between; }
.product-card .p-price-label { font-size: 12px; color: var(--text-weak); }
.product-card .p-price { font-size: 20px; font-weight: 700; color: var(--price); }
.product-card .p-add {
  background: var(--primary-light); color: var(--primary-dark); border: none;
  width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.product-card .p-add:active { background: #c7ddf9; }
.product-card .p-add-text { width: auto; height: 34px; border-radius: 17px; padding: 0 14px; font-size: 14px; font-weight: 500; flex-shrink: 0; }
.empty { text-align: center; color: var(--text-weak); padding: 50px 0; }

/* ============ 底部悬浮购物车 ============ */
.cart-fab {
  position: fixed; right: 20px; bottom: 30px; z-index: 60;
  background: var(--primary); color: #fff; border: none; border-radius: 24px;
  padding: 13px 20px; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(22, 104, 220, .35);
  display: flex; align-items: center; gap: 8px;
}
.cart-fab .badge {
  background: #fff; color: var(--primary); border-radius: 20px;
  min-width: 20px; height: 20px; padding: 0 6px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ============ 底部弹层 ============ */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.sheet {
  background: var(--card); width: 100%; max-width: 560px; max-height: 88vh;
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .25s;
}
.overlay.show .sheet { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.sheet-head h3 { font-size: 17px; font-weight: 600; }
.sheet-close { background: none; border: none; font-size: 24px; color: var(--text-weak); line-height: 1; }
.sheet-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.sheet-foot { padding: 12px 20px 20px; border-top: 1px solid var(--border); }

/* ============ 产品详情 ============ */
.detail-hero { margin-bottom: 14px; }
.detail-hero .d-name { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.detail-hero .d-summary { color: var(--text-muted); font-size: 14px; }
.price-row { display: flex; gap: 12px; margin: 16px 0; }
.price-box { flex: 1; border-radius: var(--radius-sm); padding: 12px 14px; }
.price-box.quote { background: #fff5ee; border: 1px solid #ffd8bf; }
.price-box.cost { background: #ecfdf5; border: 1px solid #bff3da; }
.price-box .label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.price-box .val { font-size: 20px; font-weight: 700; }
.price-box.quote .val { color: var(--price); }
.price-box.cost .val { color: var(--cost); }
.info-block { margin-bottom: 16px; }
.info-block h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.info-block .info-text { font-size: 14px; color: #374151; white-space: pre-wrap; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.city-empty { margin: 18px 0; padding: 26px 16px; text-align: center; color: var(--text-muted); background: #fff7ed; border: 1px dashed #fbbf24; border-radius: var(--radius); font-size: 14px; }
.option-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 16px 0 8px; }
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.option-info { flex: 1; min-width: 0; }
.option-name { font-size: 15px; font-weight: 500; }
.option-remark { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #fff5ee; color: var(--price); font-size: 12px; font-weight: 500; vertical-align: 1px; }
.option-cost { font-size: 12px; color: var(--text-weak); margin-top: 2px; }
.option-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.option-price { font-size: 17px; font-weight: 700; color: var(--price); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 600;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost { background: #fff; color: var(--text-muted); border: 1px solid var(--border); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #fecdd3; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 报价单列表 ============ */
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-size: 15px; font-weight: 500; }
.ci-city {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 500; vertical-align: 1px;
}
.ci-controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ci-yen { color: var(--price); font-weight: 700; font-size: 15px; }
.ci-price-input {
  width: 84px; padding: 6px 7px; border: 1px solid var(--border-strong); border-radius: 7px;
  font-size: 15px; font-weight: 600; color: var(--price); text-align: center; outline: none; background: #fff;
}
.ci-price-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.ci-times { color: var(--text-weak); font-size: 13px; }
.ci-line { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.ci-line b { color: var(--text); font-weight: 600; }
.qty-ctl { display: flex; align-items: center; gap: 2px; }
.qty-ctl button { width: 30px; height: 30px; border: 1px solid var(--border); background: #fff; border-radius: 6px; font-size: 16px; }
.qty-ctl span { min-width: 32px; text-align: center; font-weight: 600; }
.ci-del { background: none; border: none; color: var(--text-weak); font-size: 18px; padding: 4px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; }
.cart-hint { font-size: 12px; color: var(--text-weak); padding-bottom: 2px; }.cart-total .label { font-size: 15px; color: var(--text-muted); }
.cart-total .amount { font-size: 24px; font-weight: 700; color: var(--price); }

/* ============ 报价单预览（打印/导出） ============ */
.quote-doc {
  background: #fff; padding: 30px 28px; border-radius: var(--radius); 
  border: 1px solid var(--border); max-width: 620px; margin: 0 auto;
}
.quote-doc .qd-head { text-align: center; padding-bottom: 18px; border-bottom: 2px solid #333; margin-bottom: 18px; }
.quote-doc .qd-head img { height: 52px; margin-bottom: 8px; }
.quote-doc .qd-title { font-size: 20px; font-weight: 700; letter-spacing: 4px; }
.quote-doc .qd-meta { display: flex; justify-content: space-between; font-size: 13px; color: #555; margin-bottom: 16px; }
.quote-doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.quote-doc th, .quote-doc td { border: 1px solid #ccc; padding: 9px 10px; text-align: left; }
.quote-doc th { background: #f5f6f8; font-weight: 600; }
.quote-doc .num { text-align: center; }
.quote-doc .money { text-align: right; }
.quote-doc .qd-total-row td { font-weight: 700; }
.quote-doc .qd-city { font-size: 12px; color: #888; margin-top: 2px; }
.quote-doc .qd-total-row .amount { color: var(--price); font-size: 16px; }
.quote-doc .qd-note { font-size: 12px; color: #888; margin-top: 14px; line-height: 1.8; }

/* ============ 我的报价单 ============ */
.quote-history-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.qh-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.qh-time { font-size: 13px; color: var(--text-muted); }
.qh-cities { flex: 1; font-size: 13px; color: var(--primary-dark); background: var(--primary-light); padding: 2px 10px; border-radius: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qh-total { font-size: 15px; font-weight: 700; color: var(--price); white-space: nowrap; }
.qh-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.qh-item:last-child { border-bottom: none; }
.qh-item-name { font-size: 14px; line-height: 1.5; }
.qh-city { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 10px; background: var(--bg); color: var(--text-muted); font-size: 12px; vertical-align: 1px; }
.qh-option { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 10px; background: #fff5ee; color: var(--price); font-size: 12px; vertical-align: 1px; }
.qh-item-amt { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.qh-item-amt b { color: var(--text); }

/* 历史报价单操作按钮 */
.qh-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.qh-btn { flex: 1; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; border: 1px solid var(--border); background: #fff; color: var(--primary); }
.qh-btn:active { background: var(--bg); }
.qh-btn-danger { color: var(--danger); border-color: #fecdd3; }

/* 再次编辑提示条 */
.cart-edit-tip {
  padding: 8px 20px; font-size: 13px; color: var(--price);
  background: #fff5ee; border-bottom: 1px solid #ffd8bf;
}

/* 分页器 */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 0 4px; }
.pager-btn {
  padding: 7px 16px; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  font-size: 14px; color: var(--text); cursor: pointer;
}
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-info { font-size: 14px; color: var(--text-muted); }

/* ============ 登录页 ============ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 34px 30px; width: 100%; max-width: 380px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-weak); margin-top: 4px; }
.error-tip { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 20px; }
.demo-box { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.demo-box .demo-title { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; text-align: center; }
.demo-users { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.demo-users button { padding: 7px 14px; border-radius: 18px; border: 1px solid var(--border); background: #fff; font-size: 13px; }

/* ============ 管理后台 ============ */
.admin-wrap { min-height: 100vh; }
.admin-nav { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.admin-nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.admin-nav .nav-brand { font-weight: 600; padding: 14px 8px 14px 0; white-space: nowrap; }
.nav-tab { padding: 14px 14px; font-size: 14px; color: var(--text-muted); border: none; background: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.nav-spacer { flex: 1; }
.admin-body { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-head h3 { font-size: 16px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th { background: #fafafa; font-weight: 600; color: var(--text-muted); font-size: 13px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .row-actions { display: flex; gap: 6px; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 14px; padding: 2px 4px; }
.link-btn.danger { color: var(--danger); }

/* 分类拖拽排序 */
.drag-handle { cursor: grab; color: var(--text-weak); font-size: 16px; letter-spacing: -1px; width: 36px; text-align: center; }
tr.dragging { opacity: .5; }
tr.drag-over td { border-top: 2px solid var(--primary) !important; }

/* 分类层级视觉（管理端分类表） */
.admin-table td { position: relative; }
.cat-lv {
  display: inline-block; vertical-align: middle; margin-right: 8px; padding: 1px 7px;
  border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .5px;
}
.cat-lv.lv-0 { background: var(--primary); color: #fff; }
.cat-lv.lv-1 { background: var(--primary-light); color: var(--primary-dark); }
.cat-lv.lv-2 { background: #f3f4f6; color: var(--text-muted); }
.cat-name-text { vertical-align: middle; }
/* 一级分类加粗醒目，子级字号递减、颜色减弱 */
tr.cat-row-0 .cat-name-text { font-weight: 600; font-size: 15px; color: var(--text); }
tr.cat-row-1 .cat-name-text { font-weight: 500; font-size: 14px; color: #374151; }
tr.cat-row-2 .cat-name-text,
tr.cat-row-3 .cat-name-text,
tr.cat-row-4 .cat-name-text,
tr.cat-row-5 .cat-name-text { font-weight: 400; font-size: 13px; color: var(--text-muted); }
/* 树形引导线：子级行左侧竖线 + 折角，强化父子归属 */
.cat-tree-line {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--border-strong);
}
.cat-tree-line::after {
  content: ''; position: absolute; top: 50%; left: 2px; width: 8px; height: 2px;
  background: var(--border-strong); transform: translateY(-50%);
}
/* 一级分类行给个淡底色区分 */
tr.cat-row-0 td:first-child { background: #fafbfc; }
/* 排序编号输入框 */
.cat-sort-input {
  width: 56px; padding: 5px 6px; border: 1px solid var(--border);
  border-radius: 6px; text-align: center; font-size: 13px; outline: none; background: #fff;
}
.cat-sort-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.tag.on { background: #ecfdf5; color: var(--success); }
.tag.off { background: #f3f4f6; color: var(--text-weak); }
.tag.admin { background: #fff5ee; color: var(--price); }
.tag.staff { background: var(--primary-light); color: var(--primary-dark); }

/* 城市价格编辑表格 */
.price-edit-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-edit-table th, .price-edit-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: center; }
.price-edit-table th { background: #fafafa; font-size: 13px; }
.price-edit-table input { width: 90px; padding: 7px; border: 1px solid var(--border); border-radius: 6px; text-align: center; }
.price-edit-table input:disabled { background: #f3f4f6; color: var(--text-weak); cursor: not-allowed; }
.city-can-edit { font-size: 11px; color: var(--success); margin-top: 2px; }
.city-readonly { font-size: 11px; color: var(--text-weak); margin-top: 2px; }

.city-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.city-check {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 18px; font-size: 13px; cursor: pointer; user-select: none;
}
.city-check input { accent-color: var(--primary); cursor: pointer; }
.city-check:has(input:checked) { background: var(--primary-light); border-color: #c7ddf9; color: var(--primary-dark); font-weight: 500; }

.city-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.city-tab {
  padding: 6px 15px; border-radius: 18px; border: 1px solid var(--border);
  background: #fff; color: var(--text-muted); font-size: 14px; white-space: nowrap;
}
.city-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.city-panel { margin-top: 14px; padding: 14px; background: var(--bg); border-radius: var(--radius); }

.option-edit-row { display: grid; grid-template-columns: 1fr 1fr 80px 90px 32px; gap: 6px; margin-bottom: 8px; align-items: center; }
.option-edit-row input { width: 100%; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px; outline: none; font-size: 14px; background: #fff; }
.option-edit-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.opt-del { background: none; border: none; color: var(--danger); font-size: 20px; line-height: 1; cursor: pointer; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(17, 24, 39, .92); color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: 14px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

@media (max-width: 560px) {
  .price-row { flex-direction: column; }
}

/* 窄屏：分类树改为左侧抽屉 */
@media (max-width: 820px) {
  .layout { padding: 12px; gap: 0; }
  .cat-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    width: 78%; max-width: 300px; height: 100vh; max-height: 100vh;
    border-radius: 0; transform: translateX(-100%); transition: transform .25s;
  }
  .cat-sidebar.open { transform: translateX(0); }
  .cat-sidebar-head { display: flex; }
  .cat-sidebar-close { display: block; }
  .cat-sidebar-mask { display: block; }
  .cat-sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .mobile-cat-toggle { display: block; }
}
