/* ============================================================
   智能家居方案智能报价系统 —— Apple 极简设计风格
   浅色 / 深色双主题；左侧固定侧边栏；大量留白；柔和圆角
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 主题：浅色（默认） ---------- */
[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #f5f5f7;
  --bg-sidebar: #fbfbfd;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: #e8e8ed;
  --border-strong: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.09);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.13);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.1);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, 0.13);
  --purple: #af52de;
  --purple-soft: rgba(175, 82, 222, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.12);
  --glass: rgba(255, 255, 255, 0.72);
}

/* ---------- 主题：深色 ---------- */
[data-theme="dark"] {
  --bg: #000000;
  --bg-card: #1c1c1e;
  --bg-elevated: #2c2c2e;
  --bg-input: #2c2c2e;
  --bg-sidebar: #0d0d0f;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;
  --border: #333336;
  --border-strong: #48484a;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.16);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.16);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.16);
  --purple: #bf5af2;
  --purple-soft: rgba(191, 90, 242, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  --glass: rgba(28, 28, 30, 0.72);
}

/* ============================================================
   基础
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }
.hidden { display: none !important; }

/* ============================================================
   应用框架：侧边栏 + 主区
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  z-index: 300;
  transition: transform var(--transition);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 20px; color: var(--text); }
.sidebar-brand:hover { color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 4px 14px var(--accent-soft);
  display: inline-block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.2px; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--text-tertiary); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; margin-top: 4px; overflow-y: auto; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all var(--transition); white-space: nowrap;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-icon { width: 19px; height: 19px; flex: none; }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }

/* ---------- 主区 ---------- */
.app-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); position: relative;
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex: none;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-size: 13.5px; color: var(--text); font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--text-tertiary); }
.logout { display: inline-flex; align-items: center; color: var(--text-tertiary); padding: 8px; border-radius: var(--r-full); }
.logout:hover { color: var(--red); background: var(--red-soft); }
.logout svg { width: 18px; height: 18px; }

.nav-burger { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 8px; }
.nav-burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 290; opacity: 0; visibility: hidden; transition: opacity var(--transition); }

/* ============================================================
   主容器
   ============================================================ */
.main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 32px 72px; }
.main-fluid { max-width: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin: 0; }
.page-sub { color: var(--text-secondary); font-size: 14px; margin: 5px 0 0; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card + .card { margin-top: 20px; }
.card-title { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head .card-title { margin: 0; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 14px; font-weight: 500; line-height: 1;
  padding: 11px 20px; border-radius: var(--r-full);
  border: 1px solid transparent;
  transition: all var(--transition); white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text-tertiary); color: var(--text); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #e0342a; color: #fff; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-danger-soft:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--r-full); background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary); }
.btn-icon:hover { color: var(--text); border-color: var(--border-strong); }
.btn-icon.danger:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }

/* ============================================================
   表单
   ============================================================ */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.label .req { color: var(--red); margin-left: 2px; }
.hint { font-size: 12px; color: var(--text-tertiary); margin-top: 5px; }
.input, .textarea, .select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input.error, .textarea.error, .select.error { border-color: var(--red); }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%), linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
.form-grid-3 .full { grid-column: 1 / -1; }
.field-error { color: var(--red); font-size: 12px; margin-top: 5px; display: none; }

/* 搜索框 */
.search-box { position: relative; }
.search-box .input { padding-left: 40px; }
.search-box .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-tertiary); }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { color: var(--text-secondary); font-weight: 600; font-size: 12.5px; white-space: nowrap; background: var(--bg-input); }
.tbl tbody tr { transition: background var(--transition); }
.tbl tbody tr:hover { background: var(--bg-hover); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .center { text-align: center; }
.tbl-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl tfoot td { background: var(--bg-input); font-weight: 600; }

.thumb { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; background: var(--bg-input); border: 1px solid var(--border); }
.thumb-lg { width: 60px; height: 60px; border-radius: var(--r-md); object-fit: cover; background: var(--bg-input); border: 1px solid var(--border); }

/* ============================================================
   徽章 / 空状态 / 提示
   ============================================================ */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-gray { background: var(--bg-input); color: var(--text-secondary); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-tertiary); }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

.alert { padding: 13px 16px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 9px; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert-warning { background: var(--orange-soft); color: var(--orange); }

/* ============================================================
   弹窗
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%; max-width: 580px; max-height: 88vh; overflow: auto;
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  animation: pop 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.3px; }
.modal-close { background: var(--bg-input); border: none; width: 32px; height: 32px; border-radius: 50%; color: var(--text-secondary); font-size: 18px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ============================================================
   页脚
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 16px 32px; font-size: 13px; color: var(--text-tertiary); }

/* ============================================================
   登录 / 注册页
   ============================================================ */
.auth-body { min-height: 100vh; display: flex; background: var(--bg); }
.auth-left {
  flex: 1.1; display: flex; flex-direction: column; justify-content: center;
  padding: 64px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0a84ff 0%, #0071e3 45%, #004a9f 100%);
}
.auth-left .auth-logo { width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,0.2); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 28px; }
.auth-left h1 { font-size: 30px; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.5px; }
.auth-left .slogan { font-size: 16px; opacity: 0.85; margin: 0; line-height: 1.7; }
.auth-info { margin-top: 48px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.auth-info .ai { display: flex; align-items: center; gap: 10px; opacity: 0.92; }
.auth-info .ai svg { width: 17px; height: 17px; flex: none; }
.auth-qr { margin-top: 40px; }
.auth-qr .qr-box { width: 128px; height: 128px; background: #fff; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 12px; text-align: center; padding: 8px; overflow: hidden; }
.auth-qr .qr-box img { width: 100%; height: 100%; object-fit: contain; }
.auth-qr .qr-label { font-size: 12.5px; margin-top: 8px; opacity: 0.85; }

.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.4px; }
.auth-card .auth-sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 28px; }
.auth-foot { text-align: center; margin-top: 24px; font-size: 13.5px; color: var(--text-tertiary); }
.auth-foot a { font-weight: 600; }
.theme-toggle-float { position: absolute; top: 24px; right: 24px; }

/* ============================================================
   仪表盘统计
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 42px; height: 42px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.orange { background: var(--orange-soft); color: var(--orange); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.stat-label { color: var(--text-secondary); font-size: 13px; margin-top: 14px; }
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.quick {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; color: var(--text); transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.quick:hover { color: var(--text); border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.quick .qi { width: 42px; height: 42px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.quick .qi svg { width: 20px; height: 20px; }
.quick .qt { font-weight: 600; font-size: 15px; }
.quick .qd { font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; }

/* 两栏布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============================================================
   项目卡片
   ============================================================ */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.project-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-sm); transition: all var(--transition);
  display: flex; flex-direction: column;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card .pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.project-card .pc-name { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; margin: 0; line-height: 1.35; }
.project-meta { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; flex: 1; }
.project-meta .pm { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-secondary); }
.project-meta .pm svg { width: 15px; height: 15px; flex: none; color: var(--text-tertiary); }
.project-meta .pm .pm-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card .pc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }
.project-amount { display: flex; flex-direction: column; }
.project-amount .pa-label { font-size: 12px; color: var(--text-tertiary); }
.project-amount .pa-val { font-size: 19px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.project-card .pc-actions { display: flex; gap: 7px; }
.pc-creator { font-size: 12px; color: var(--text-tertiary); }

/* ============================================================
   报价编辑器
   ============================================================ */
.editor-layout { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
@media (max-width: 1024px) { .editor-layout { grid-template-columns: 1fr; } }

.area-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px; }
.area-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--bg-input); border-bottom: 1px solid var(--border); }
.area-head .area-name { font-weight: 600; flex: 1; font-size: 15px; }
.area-head .area-total { color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.area-head .area-count { color: var(--text-tertiary); font-size: 12px; }
.item-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 90px 64px 90px 34px; gap: 12px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: none; }
.item-info { min-width: 0; }
.item-name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--text-tertiary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-field-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 3px; }
.item-subtotal { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.item-row .input { padding: 7px 9px; font-size: 13.5px; }
.area-add-bar { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px dashed var(--border); }

.summary-panel { position: sticky; top: 78px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--text-secondary); }
.summary-line b { color: var(--text); font-weight: 600; }
.summary-line .val { font-variant-numeric: tabular-nums; }
.summary-divider { border-top: 1px dashed var(--border); margin: 10px 0; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; }
.summary-total .lbl { font-weight: 600; font-size: 15px; }
.summary-total .val { font-size: 28px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.fee-row { display: grid; grid-template-columns: 1fr 110px 100px 34px; gap: 10px; align-items: center; margin-bottom: 10px; }

/* 选品弹窗 */
.picker-list { max-height: 50vh; overflow-y: auto; }
.picker-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.picker-item:last-child { border-bottom: none; }

/* ============================================================
   图片上传
   ============================================================ */
.upload-box {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-md);
  padding: 22px; text-align: center; color: var(--text-tertiary); font-size: 13px;
  transition: all var(--transition); cursor: pointer;
}
.upload-box:hover { border-color: var(--accent); color: var(--accent); }
.upload-preview { display: flex; align-items: center; gap: 14px; }
.upload-preview img { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; border: 1px solid var(--border); }

/* ============================================================
   利润核算提示条
   ============================================================ */
.admin-only-bar { display: flex; align-items: center; gap: 10px; background: var(--orange-soft); color: var(--orange); border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 20px; font-size: 13.5px; }
.admin-only-bar svg { width: 18px; height: 18px; flex: none; }
.profit-positive { color: var(--green); font-weight: 600; }
.profit-negative { color: var(--red); font-weight: 600; }

/* ============================================================
   响应式（手机 / 平板自适应）
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mask.show { opacity: 1; visibility: visible; }
  .app-main { margin-left: 0; }
  .nav-burger { display: flex; }
  .auth-left { display: none; }
  .auth-body { justify-content: center; }
  .auth-right { flex: 1; }
  .user-meta, .user-role { display: none; }
  .form-grid, .form-grid-3, .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 56px; }
  .topbar { padding: 0 14px; }
  .page-title { font-size: 22px; }
  .page-head { margin-bottom: 20px; }
  .summary-panel { position: static; }
  .card { padding: 18px; }
}

@media (max-width: 640px) {
  .topbar-title { font-size: 15px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px 18px; }
  .stat-value { font-size: 24px; }
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .quick { padding: 14px; }
  .project-grid { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .tbl th, .tbl td { padding: 10px 12px; font-size: 13px; }
  .auth-card { padding: 0 4px; }
  .btn-lg { padding: 13px 20px; font-size: 15px; }
  .modal { padding: 20px; border-radius: var(--r-lg); }
  .auth-right { padding: 24px 16px; }

  /* 报价明细行：手机端改为两行网格 */
  .item-row {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
      "img info del"
      "img price qty"
      "img sub sub";
    row-gap: 8px;
  }
  .item-row > div:nth-child(1) { grid-area: img; }
  .item-row > .item-info { grid-area: info; }
  .item-row > div:nth-child(3) { grid-area: price; }
  .item-row > div:nth-child(4) { grid-area: qty; }
  .item-row > .item-subtotal { grid-area: sub; justify-self: end; }
  .item-row > div:nth-child(6) { grid-area: del; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .fee-row { grid-template-columns: 1fr 1fr 34px; }
}
