/* ===== 基础 & 变量 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --gold: #C9A227;
  --gold-light: #E8D9A8;
  --gold-dark: #A8851A;
}

/* 浅色模式（默认） */
body[data-theme="light"] {
  --bg: #F7F5F0;
  --card: #FFFFFF;
  --card-hover: #FAFAF8;
  --text: #2D3142;
  --text-secondary: #7E8294;
  --text-tertiary: #A0A3B1;
  --border: rgba(0,0,0,0.05);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --gold: #C9A227;
  --gold-soft: #F5EFDC;
}

/* 深色模式 */
body[data-theme="dark"] {
  --bg: #0E1626;
  --card: #162033;
  --card-hover: #1B2840;
  --text: #F4F6FA;
  --text-secondary: #9BA3B4;
  --text-tertiary: #6B7488;
  --border: rgba(255,255,255,0.06);
  --shadow: 0 4px 20px rgba(0,0,0,0.35);
  --gold: #D4AF37;
  --gold-soft: rgba(212,175,55,0.12);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;
}

#app {
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  transition: background .25s ease;
}

.page {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.page.active { display: flex; }

/* ===== 顶部栏 ===== */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  transition: background .25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 78px;
  height: 40px;
  flex-shrink: 0;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.25;
}

.brand-sub {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  line-height: 1.3;
  margin-top: 2px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, background .2s ease, color .2s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 22px; height: 22px; }

/* 设置齿轮：点击转动效果 */
.settings-trigger svg { transform-origin: center; }
.settings-trigger.spin-cw svg { animation: gear-cw .55s cubic-bezier(.45,.05,.25,1); }
.settings-trigger.spin-ccw svg { animation: gear-ccw .55s cubic-bezier(.45,.05,.25,1); }
@keyframes gear-cw { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes gear-ccw { from { transform: rotate(0); } to { transform: rotate(-360deg); } }

/* ===== 首页主体 ===== */
.home-main {
  flex: 1;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 统计卡 */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: background .25s ease, box-shadow .25s ease;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 统计卡右上角工程筛选下拉 */
.stat-filter {
  position: absolute;
  top: 12px;
  right: 12px;
}
.proj-filter {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg);
  border: 1px solid var(--border-soft, var(--card-border));
  border-radius: 999px;
  padding: 4px 22px 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  outline: none;
  max-width: 96px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23C9A227' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
  transition: border-color .2s;
}
.proj-filter:hover { border-color: var(--gold); }
.proj-filter:focus { border-color: var(--gold); }
.proj-filter option {
  color: var(--text);
  background: var(--bg);
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.3px;
}

.stat-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 统计卡金额统一金色（继承 .stat-value） */
.stat-in,
.stat-out {
  color: var(--gold);
}

/* 功能宫格 */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-item {
  background: var(--card);
  border: none;
  border-radius: 18px;
  padding: 16px 8px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.grid-item:active { transform: scale(0.96); }
.grid-item:hover { background: var(--card-hover); }

.grid-item.primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
}
.grid-item.primary .grid-icon { color: #fff; }
.grid-item.primary .grid-title { color: #fff; }
.grid-item.primary .grid-desc { color: rgba(255,255,255,0.85); }

.grid-icon {
  width: 32px;
  height: 32px;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.grid-icon svg { width: 100%; height: 100%; }

.grid-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.grid-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  text-align: center;
  min-height: 30px;
}

/* 最新一笔 */
.latest-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: background .25s ease, box-shadow .25s ease;
}

.latest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.latest-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.latest-tag {
  font-size: 11px;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.latest-body {
  display: block;
}
.latest-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.latest-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.latest-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.2;
}
.latest-project {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.latest-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 首页 PC 补充区（移动端隐藏） ===== */
.home-below {
  display: none;
}

.panel {
  background: var(--card);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .25s ease, box-shadow .25s ease;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.panel-more {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 26px 0;
}

/* 最近记录列表 */
.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.recent-row:last-child { border-bottom: none; }

.recent-date {
  font-size: 12px;
  color: var(--text-tertiary);
  width: 44px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.recent-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-sub {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-amt {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* 本月收支柱状图 */
.trend-chart {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding-bottom: 2px;
}

.trend-col {
  flex: 1;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
}

.trend-col-track {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  border-radius: 4px 4px 1px 1px;
  background: rgba(0, 0, 0, 0.04);
}

.trend-bar {
  width: 5px;
  border-radius: 2px 2px 1px 1px;
  transition: height .3s ease;
  flex-shrink: 0;
}
.trend-in { background: #C43B3B; }
.trend-out { background: #2E8B57; }

.trend-label {
  font-size: 10px;
  color: var(--text-tertiary);
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.trend-label.empty {
  color: transparent;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-in { background: #C43B3B; }
.dot-out { background: #2E8B57; }

/* ===== 子页面 ===== */
.sub-header {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.sub-header .back-btn { justify-self: start; }
.sub-header h2 {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sub-header .header-actions { justify-self: end; }

.sub-main {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* ===== 设置面板 ===== */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 50;
}
.mask.show { opacity: 1; visibility: visible; }

.settings-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,0.18);
  transform: translateY(110%);
  transition: transform .3s cubic-bezier(.25,.8,.25,1), background .25s ease;
  z-index: 60;
  max-width: 560px;
  margin: 0 auto;
}
.settings-panel.show { transform: translateY(0); }

/* ===== AI 助手抽屉 ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-trigger {
  color: var(--text-secondary);
  transition: color .2s ease, transform .15s ease;
}
.ai-trigger:hover { color: var(--gold); }
.ai-trigger:active { transform: scale(.92); }

.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 86vw);
  background: var(--card);
  box-shadow: -6px 0 30px rgba(0,0,0,0.15);
  transform: translateX(110%);
  transition: transform .3s cubic-bezier(.25,.8,.25,1), background .25s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.ai-drawer.show { transform: translateX(0); }

.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-head h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  border: 2px solid var(--gold, #C9A227);
  flex-shrink: 0;
}

.ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-chip {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.ai-chip:hover { background: var(--gold); color: #fff; }

.ai-msg {
  display: flex;
  max-width: 88%;
}
.ai-msg.ai-user {
  align-self: flex-end;
  justify-content: flex-end;
}
.ai-msg.ai-ai {
  align-self: flex-start;
}
.ai-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.ai-user .ai-bubble {
  background: var(--gold);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-ai .ai-bubble {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.ai-ai.ai-refuse .ai-bubble {
  background: rgba(201,162,39,0.08);
  border: 1px dashed var(--gold);
  color: var(--text-secondary);
}

.ai-foot {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 5px 5px 14px;
}
.ai-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.ai-input-wrap input::placeholder { color: var(--text-hint); }
.ai-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .2s ease, transform .15s ease;
}
.ai-send:hover { opacity: .9; }
.ai-send:active { transform: scale(.94); }
.ai-send svg { width: 16px; height: 16px; }

.ai-mode-hint {
  text-align: center;
  font-size: 11px;
  color: var(--gold);
  margin-top: 8px;
  min-height: 15px;
  opacity: 0;
  transition: opacity .2s ease;
}
.ai-mode-hint.show { opacity: 1; }

@media (max-width: 560px) {
  .ai-drawer { width: 100%; }
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.settings-head h3 {
  font-size: 18px;
  font-weight: 600;
}

.settings-group {
  margin-bottom: 22px;
}
.settings-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}

.settings-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}
.option-btn.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.creator-card {
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  background: var(--gold-soft);
}
.creator-slogan {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.5;
}
.install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.install-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201, 162, 39, 0.25); }
.install-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.install-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-tertiary, #999);
  line-height: 1.6;
  text-align: center;
}

/* 账号 + 主动登出 */
.account-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--card);
  margin-bottom: 12px;
}
.account-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  background: var(--card);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.logout-btn:hover { background: var(--gold); color: #fff; }
.logout-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.change-pwd-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  background: var(--gold);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .2s ease;
}
.change-pwd-btn:hover { filter: brightness(1.06); }
.change-pwd-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

/* AI 反馈列表 */
.ai-fb-list { width: 100%; }
.ai-fb-title { font-weight: 600; margin-bottom: 8px; }
.ai-fb-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-fb-item { border-top: 1px dashed var(--border); padding-top: 6px; }
.ai-fb-item:first-child { border-top: none; padding-top: 0; }
.ai-fb-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; word-break: break-all; }
.ai-fb-content { font-size: 13px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.ai-fb-sec { margin-top: 10px; font-weight: 600; font-size: 13px; padding-left: 8px; border-left: 3px solid var(--gold, #C9A227); }
.ai-fb-sec:first-of-type { margin-top: 6px; }
.ai-fb-sec-q { border-left-color: #4A90D9; }
.ai-fb-sec-f { border-left-color: #D97B4A; }
.ai-fb-sec ul { margin-top: 6px; }
.ai-fb-none { color: var(--text-secondary); font-size: 12px; }

/* ===== 表单与通用组件 ===== */
.form-card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 14px;
}
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
}

/* ===== 查询页工程名称自定义下拉组合框 ===== */
.combo-wrap {
  position: relative;
  width: 100%;
}
.combo-wrap input {
  width: 100%;
  padding-right: 44px;
}
.combo-arrow {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .15s ease, transform .12s ease;
}
.combo-arrow:active { transform: translateY(-50%) scale(0.94); }
.combo-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(420px, 90vw);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  white-space: nowrap;
}
.combo-list.hidden { display: none; }
.combo-list li {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  transition: background .12s ease;
}
.combo-list li:hover,
.combo-list li.active {
  background: rgba(201,162,39,.15);
  color: var(--gold);
}
.combo-list .combo-empty {
  padding: 12px 14px;
  color: var(--text-tertiary);
  cursor: default;
}
body[data-theme="dark"] .combo-list {
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
body[data-theme="dark"] .combo-list li:hover,
body[data-theme="dark"] .combo-list li.active {
  background: rgba(201,162,39,.22);
}
.global-combo-list { z-index: 10000; }
/* 表格内工程名称组合框：输入框撑满单元格，避免被 .cell-in 固定宽度压窄 */
.data-table .combo-wrap .cell-in { width: 100%; padding-right: 44px; }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s ease, transform .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--gold);
  color: #fff;
}
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

/* 手动录入区块 */
.manual-entry {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 14px 0;
}
.manual-head { margin-bottom: 10px; }
.manual-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.manual-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.btn-add-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  width: 100%;
  background: transparent;
  color: var(--gold);
  border: 1.5px dashed var(--gold);
  border-radius: 12px;
  padding: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}
.btn-add-row svg { width: 18px; height: 18px; }
.btn-add-row:active { transform: scale(0.98); }
.btn-add-row:hover { background: rgba(201,162,39,0.08); }

/* 结果展示 */
.result-section {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.result-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  color: var(--text-tertiary);
}

/* 列表 */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.record-item {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.record-main {
  flex: 1;
  min-width: 0;
}
.record-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.record-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.badge-cost {
  color: var(--gold);
  background: var(--gold-soft);
}
.badge-flow {
  color: var(--blue, #3b82f6);
  background: rgba(59, 130, 246, .12);
}
.record-sub {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-meta {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-remark {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* 收支徽章 & 收入金额（中国习惯：收入红色） */
.dir-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1.4;
}
.dir-in {
  color: #C43B3B;
  background: rgba(196, 59, 59, .12);
}
.dir-out {
  color: #2E8B57;
  background: rgba(46, 139, 87, .12);
}
.amount-in {
  color: #C43B3B !important;
}

/* 修改台账：记录右侧操作区 */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.record-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.record-actions {
  display: flex;
  gap: 6px;
}
.btn-edit {
  background: var(--blue, #3b82f6);
  color: #fff;
}
.btn-danger {
  background: rgba(196, 59, 59, .12);
  color: #C43B3B;
}
.btn-danger.solid {
  background: #C43B3B;
  color: #fff;
}

/* 编辑 / 删除弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
.modal-card {
  background: var(--card);
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  animation: slideUp .2s ease;
}
.modal-card-sm {
  max-width: 360px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-head h3 {
  font-size: 17px;
  color: var(--text);
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.modal-tip {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.profit-export-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}
.profit-export-opt input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #C9A227;
  cursor: pointer;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 报价表保存冲突弹窗 */
.qc-count { font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.qc-row {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg);
}
.qc-row-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.qc-diff { padding: 5px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.qc-diff:first-child { border-top: none; }
.qc-field { color: var(--text-secondary); margin-bottom: 2px; }
.qc-vals { display: flex; justify-content: space-between; gap: 12px; }
.qc-mine { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.qc-their { color: var(--text); font-variant-numeric: tabular-nums; }

/* 应收提醒弹窗 */
.pay-reminder-card { max-width: 460px; }
.pay-reminder-tip {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 10px;
  line-height: 1.5;
}
.pay-reminder-head {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.pay-reminder-head span { flex: 1; text-align: left; }
.pay-reminder-head span:nth-child(2) { text-align: center; }
.pay-reminder-head span:nth-child(3) { text-align: right; }
.pay-reminder-body {
  max-height: 44vh;
  overflow-y: auto;
  padding-right: 4px;
}
.pay-reminder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.pay-reminder-row:last-child { border-bottom: none; }
.pay-r-project {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.pay-r-date {
  flex: 1;
  text-align: center;
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pay-r-amt {
  flex: 1;
  text-align: right;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 所属工程批量设置条 */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}
.batch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.batch-bar input {
  flex: 1;
  min-width: 110px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.batch-bar input:focus {
  border-color: var(--gold);
}
/* 批量栏「清空本列」：危险动作，红色胶囊与金色覆盖按钮区分 */
.btn-clear-col {
  border: 1px solid rgba(226,75,74,0.7);
  color: #C83C3C;
  border-radius: 999px;
}
.btn-clear-col:hover { background: rgba(226,75,74,0.08); }
body[data-theme="dark"] .btn-clear-col { color: #E08A85; }
.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
}
/* 批量设置条「选择已有」下拉：金色胶囊，与首页工程筛选同风格 */
.batch-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--card);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 6px 24px 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  outline: none;
  max-width: 110px;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23C9A227' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 10px;
  transition: border-color .2s;
}
.batch-select:hover { border-color: var(--gold); }
.batch-select:focus { border-color: var(--gold); }
.batch-select option {
  color: var(--text);
  background: var(--bg);
  font-weight: 500;
}

/* 表格 */
.data-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--bg);
}
/* 报价分析表：固定高度，支持横向 + 纵向滚动（配合鼠标拖拽平移） */
.quote-table-wrap {
  max-height: 62vh;
  overflow: auto;
  cursor: grab;
}
.quote-table-wrap.panning { cursor: grabbing; user-select: none; }
.quote-table-wrap ::selection { background: transparent; }

/* 记账录入/识别预览表格：鼠标左键拖拽平移 */
.pan-table-wrap { cursor: grab; }
.pan-table-wrap.panning { cursor: grabbing; user-select: none; }
.pan-table-wrap.panning ::selection { background: transparent; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 560px;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg);
  position: sticky;
  top: 0;
}
.data-table td { color: var(--text); }

/* 图表 */
.chart-box {
  width: 100%;
  height: 260px;
  background: var(--card);
  border-radius: 16px;
  margin-bottom: 14px;
}

/* 拍照记账 */
.upload-area {
  background: var(--card);
  border: 2px dashed var(--gold);
  border-radius: 20px;
  padding: 40px 20px;
  text-align: center;
  color: var(--gold);
  cursor: pointer;
  transition: background .2s ease;
  margin-bottom: 14px;
}
.upload-area:active { background: var(--gold-soft); }
.upload-area svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}
.upload-area p {
  font-size: 14px;
  color: var(--text-secondary);
}
.upload-area input { display: none; }

/* ===== 录入入口（拍照 / 选图 / Excel） ===== */
.entry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.entry-btn {
  background: var(--card);
  border: none;
  border-radius: 18px;
  padding: 22px 12px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--gold);
  transition: transform .12s ease, background .2s ease;
}
.entry-btn:active { transform: scale(0.96); }
.entry-btn svg { width: 32px; height: 32px; }
.entry-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.entry-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  text-align: center;
}
.entry-btn.primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
}
.entry-btn.primary .entry-title { color: #fff; }
.entry-btn.primary .entry-desc { color: rgba(255,255,255,0.85); }

/* Excel 拖拽区 */
.excel-zone {
  padding: 26px 20px;
}
.excel-zone svg { width: 36px; height: 36px; margin-bottom: 8px; }
.excel-zone.drag {
  background: var(--gold-soft);
  border-color: var(--gold-dark);
  transform: scale(1.01);
}

/* ===== 低置信度字段高亮（智能确认） ===== */
.form-group.uncertain-group { position: relative; }
.uncertain-badge {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 8px;
  font-weight: 500;
  vertical-align: 1px;
}
input.uncertain,
.form-group.uncertain-group input {
  border: 1.5px dashed var(--gold);
  background: var(--gold-soft);
}

/* ===== 可编辑预览表格 ===== */
.data-table.editable { min-width: 920px; }
.data-table.editable th,
.data-table.editable td { white-space: nowrap; padding: 6px 6px; }
.data-table.editable.manual-table { min-width: 1160px; }
.data-table.editable.manual-table th:nth-child(4),
.data-table.editable.manual-table td:nth-child(4) { min-width: 200px; }
.data-table .cell-in {
  width: 110px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.data-table .cell-in:focus { border-color: var(--gold); }
.data-table .cell-in.num { width: 84px; }
.data-table .uncertain-cell .cell-in,
.data-table .cell-in.uncertain {
  border: 1.5px dashed var(--gold);
  background: var(--gold-soft);
}
/* 行删除叉号：与内容拉开距离（左间距 + 虚线分隔），圆形底更醒目防误触 */
.row-del-cell {
  padding-left: 22px !important;
  padding-right: 10px !important;
  border-left: 1px dashed var(--border);
}
.row-del {
  border: none;
  background: rgba(226,75,74,0.12);
  color: #E24B4A;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s ease, transform .12s ease;
}
.row-del:hover { background: rgba(226,75,74,0.22); }
.row-del:active { transform: scale(0.9); }
body[data-theme="dark"] .row-del { background: rgba(226,75,74,0.22); color: #F0807F; }
body[data-theme="dark"] .row-del:hover { background: rgba(226,75,74,0.34); }

/* ===== 表头字段映射确认 ===== */
.map-table { min-width: 560px; }
.map-table td { padding: 6px 8px; }
.map-table .cell-in { width: 200px; }
.map-sel.map-guessed {
  border: 1.5px dashed var(--gold);
  background: var(--gold-soft);
}
.map-status { font-size: 12px; white-space: nowrap; }
.map-guess-badge {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 500;
}
.map-ok-badge {
  display: inline-block;
  font-size: 11px;
  color: #2E9E6B;
  background: rgba(46,158,107,0.12);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 500;
}
.map-missing-tip { color: var(--text-secondary); margin-top: 6px; }
.missing-chip {
  display: inline-block;
  font-size: 11px;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border: 1px dashed var(--gold);
  border-radius: 6px;
  padding: 1px 8px;
  margin: 0 3px;
}

/* ===== 缺列留空提示（可自行补充） ===== */
.col-missing {
  display: inline-block;
  font-size: 10px;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
  font-weight: 500;
  vertical-align: 1px;
}
.data-table .cell-in.cell-missing {
  border-style: dashed;
  border-color: var(--gold);
  background: var(--gold-soft);
  opacity: 0.85;
}
.data-table .cell-in.cell-missing::placeholder { color: var(--gold-dark); opacity: 0.75; }

.table-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* ===== 数据看板筛选栏（Excel 式） ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 12px;
  -webkit-overflow-scrolling: touch;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 96px;
  flex-shrink: 0;
}
.filter-item label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.filter-item select {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.filter-item select:focus { border-color: var(--gold); }

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary);
  font-size: 13px;
}

.preview-image {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,35,48,0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: all .25s ease;
  z-index: 100;
  white-space: nowrap;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ===== 可选栏目切换（金色胶囊 chips） ===== */
.col-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.col-chip {
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.col-chip:active { transform: scale(0.94); }
.col-chip:not(.active) {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text-tertiary);
}
.col-chip-add {
  min-width: 30px;
  padding: 5px 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  border-color: transparent;
}
.col-chip-add:not(.active) {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  border-color: transparent;
  opacity: 0.85;
}

/* ===== 对比分析 ===== */
/* 查询页行尾「保存」小按钮 */
.btn-save-compare {
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
  outline: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-save-compare:active { transform: scale(0.94); }
.btn-save-compare.saved {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text-tertiary);
  cursor: default;
  opacity: 0.7;
}
.op-th { white-space: nowrap; }
.op-cell { white-space: nowrap; }

/* 对比分析页 */
.compare-card { padding: 16px 18px; }
.compare-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.compare-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 999px;
  padding: 5px 6px 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.compare-chip:active { transform: scale(0.95); }
.compare-chip:not(.active) {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text-tertiary);
}
.compare-chip-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.compare-chip-x:hover { background: rgba(201,162,39,0.25); }
body[data-theme="dark"] .compare-chip-x { background: rgba(255,255,255,0.12); }

.compare-no-dim {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 10px 2px;
}
.compare-chart { height: 340px; }
@media (max-width: 768px) {
  .compare-chart { height: 280px; }
  .compare-chip-name { max-width: 140px; }
}

/* ===== 误删找回（回收站） ===== */
.trash-src-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border: 1px dashed var(--gold);
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 500;
}
.trash-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
}
.trash-item .record-actions { justify-content: flex-end; }

/* ===== 工程名单 ===== */
.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.project-card:active { transform: scale(.985); }
.project-card:hover { border-color: var(--gold); }
.project-card-main { flex: 1; min-width: 0; }
.project-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.project-card-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.project-card-amount .pc-out {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.project-card-amount .pc-in {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-dark);
}
.project-card-arrow {
  font-size: 22px;
  line-height: 1;
  color: var(--gold);
}
#project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 10px;
}

body[data-theme="dark"] .toast { background: rgba(245,246,250,0.92); color: #1e2330; }

/* ===== PC 适配 ===== */
@media (min-width: 768px) {
  #app { max-width: 1080px; }
  .home-main { padding: 16px 32px 44px; gap: 18px; }

  .stats-row { gap: 18px; }
  .stat-card { padding: 22px 24px; gap: 8px; }
  .stat-label { font-size: 14px; }
  .stat-value { font-size: 34px; }
  .stat-meta { font-size: 13px; }
  .proj-filter { font-size: 13px; padding: 5px 24px 5px 12px; max-width: 130px; }
  .stat-filter { top: 16px; right: 16px; }

  .grid { grid-template-columns: repeat(6, 1fr); gap: 16px; }
  .grid-item { padding: 26px 12px 20px; gap: 10px; }
  .grid-icon { width: 44px; height: 44px; }
  .grid-title { font-size: 15px; }
  .grid-desc { font-size: 12px; min-height: 32px; }
  .chart-box { height: 300px; }

  /* 首页补充区：最近记录 + 本月收支 */
  .home-below {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 18px;
    margin-top: 4px;
  }
  .trend-bar { width: 8px; }
}

/* ===== 报价分析 ===== */
.quote-upload { margin-bottom: 14px; }
.quote-header {
  background: var(--card); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow); margin-bottom: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
.quote-header .qh-item { display: flex; flex-direction: column; gap: 2px; }
.quote-header .qh-label { font-size: 11px; color: var(--text-tertiary); }
.quote-header .qh-value { font-size: 14px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-summary { background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); margin: 12px 0; }
.quote-summary-title { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600; }
.quote-sum-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.quote-sum-row:last-child { border-bottom: none; }
.quote-sum-row .qsr-label { color: var(--text); }
.quote-sum-row.labor .qsr-label { color: var(--gold-dark); font-weight: 600; }
.quote-sum-row.material .qsr-label { color: #3b82f6; font-weight: 600; }
.quote-sum-row .qsr-val { color: var(--text); font-variant-numeric: tabular-nums; }
.quote-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.quote-ca-hint {
  background: var(--card); border: 1px dashed var(--border); border-radius: 16px;
  padding: 22px 16px; margin: 12px 0; text-align: center; font-size: 13px;
  color: var(--text-tertiary); line-height: 1.6;
}
.quote-chart { width: 100%; height: 240px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.quote-chart-title { text-align: center; font-size: 13px; color: var(--text-secondary); font-weight: 600; padding: 8px 0 4px; }
.quote-advice {
  background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 16px;
  padding: 14px 16px; margin: 14px 0; font-size: 13px; line-height: 1.7; color: var(--text);
}
.quote-advice .qa-head { font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.quote-cat-sel {
  appearance: none; -webkit-appearance: none;
  background: var(--card); border: 1px solid var(--gold); border-radius: 999px;
  padding: 5px 22px 5px 10px; font-size: 12px; font-weight: 600; color: var(--gold);
  cursor: pointer; outline: none; max-width: 120px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23C9A227' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 10px;
}
.quote-cat-sel:focus { border-color: var(--gold-dark); }
.quote-cat-sel option { color: var(--text); background: var(--bg); }
.quote-summary-cell { color: var(--text-tertiary); font-size: 14px; }
/* 报价行类型标记：普通 / 增项 / 后加 */
.qtag-cell { width: 66px; text-align: center; background: var(--bg); }
.qtag-sel { font-size: 12px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); max-width: 66px; }
.quote-row-extra td { background: rgba(46, 204, 113, 0.10); }
.quote-row-extra .qtag-cell { background: rgba(46, 204, 113, 0.20); }
.quote-row-added td { background: rgba(201, 162, 39, 0.10); }
.quote-row-added .qtag-cell { background: rgba(201, 162, 39, 0.20); }
.quote-summary-row td { font-weight: 600; background: var(--bg); }
.quote-grand-row td { background: rgba(201, 162, 39, 0.14); color: var(--gold, #C9A227); }
.quote-grand-row .quote-summary-cell { color: var(--gold, #C9A227); font-weight: 700; }
.quote-extra-sum { background: rgba(46, 204, 113, 0.14); }
.quote-extra-sum .qes-label { font-weight: 600; color: #1e8e4f; }
.quote-extra-sum .qes-amt { font-weight: 700; color: #1e8e4f; font-variant-numeric: tabular-nums; text-align: right; padding-right: 10px; }
.quote-sum-row.extra .qsr-label { color: #1e8e4f; font-weight: 600; }
.quote-sum-row.extra .qsr-val { color: #1e8e4f; font-weight: 600; }
.quote-sum-row.total { margin-top: 4px; padding-top: 10px; border-top: 2px solid var(--gold-light); border-bottom: none; font-weight: 700; font-size: 14px; }
.quote-sum-row.total .qsr-label { color: var(--gold-dark); }
.quote-sum-row.total .qsr-val { color: var(--gold); font-size: 15px; }
.quote-export-bar { display: flex; gap: 10px; margin-top: 14px; }
.quote-export-opt {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .2s ease; user-select: none;
}
.quote-export-opt.off { border-color: var(--border); background: var(--bg); color: var(--text-tertiary); }

/* 参考报价弹窗：工程分组 + 报价表卡片 */
.quote-ref-group { margin-bottom: 12px; }
.quote-ref-proj {
  font-size: 12px; font-weight: 600; color: var(--gold);
  background: var(--gold-soft); border: 1px dashed var(--gold);
  border-radius: 999px; padding: 3px 10px; display: inline-block; margin-bottom: 8px;
}
.quote-ref-list { display: flex; flex-direction: column; gap: 8px; }
.quote-ref-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; transition: all .2s ease;
}
.quote-ref-item:hover { border-color: var(--gold); background: var(--gold-soft); }
.qri-name { font-size: 14px; font-weight: 600; color: var(--text); }
.qri-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

/* 报价分析表格：可编辑单元格 */
.data-table .quote-cell-in {
  width: 100%; min-width: 60px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); border-radius: 8px; padding: 6px 7px; font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .2s;
}
.data-table .quote-cell-in:focus { border-color: var(--gold); }
.data-table .quote-cell-in.num { min-width: 70px; text-align: right; }
/* 文本列（项目内容等）加宽，避免长内容被挤窄 */
.data-table .quote-cell-in.txt { min-width: 200px; }
/* 备注列：多行文本框，自动换行、高度自适应 */
.data-table .quote-cell-ta {
  width: 240px; min-width: 220px; min-height: 46px; resize: none; overflow: hidden;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 7px; font-size: 13px; font-family: inherit; line-height: 1.45;
  outline: none; transition: border-color .2s;
}
.data-table .quote-cell-ta:focus { border-color: var(--gold); }

/* 工程名单详情：成本 / 报价 / 利润 三标签 */
.proj-tabs { display: flex; gap: 8px; margin: 0 4px 14px; }
.proj-tab { flex: 1; padding: 10px 0; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s ease; }
.proj-tab.active { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }

/* 工程名单 → 报价：已保存报价表卡片 */
.quote-saved-card { display: flex; align-items: stretch; gap: 8px; margin: 0 4px 10px; }
.quote-saved-card-btn { flex: 1; text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .2s ease; }
.quote-saved-card-btn:hover { border-color: var(--gold); }
.qsc-name { font-size: 14px; font-weight: 600; color: var(--text); }
.qsc-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.qsc-del { width: 44px; border: 1px solid var(--border); background: var(--card); border-radius: 12px; cursor: pointer; font-size: 16px; color: var(--text-tertiary); transition: all .2s ease; }
.qsc-del:hover { border-color: #e74c3c; color: #e74c3c; }

@media (max-width: 560px) { .quote-charts { grid-template-columns: 1fr; } .quote-chart { height: 220px; } }

/* ===== 利润表（工程名单 → 某工程 → 利润标签） ===== */
.profit-table {
  width: 100%; border-collapse: collapse; margin: 8px 0 4px;
  background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.profit-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); }
.profit-table tr:last-child td { border-bottom: none; }
.profit-table td.p-amt {
  text-align: right; font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.profit-table td.p-sub { font-size: 12px; font-weight: 400; color: var(--text-tertiary); padding-left: 0; }
.profit-table tr.p-total td { font-weight: 700; }
.profit-table tr.p-gross td { font-weight: 700; }
.profit-table tr.p-final td { font-weight: 800; font-size: 15px; }
.profit-table tr.p-final td:first-child { color: var(--gold); }
.profit-table tr.p-final { background: var(--gold-soft); }
.profit-table.profit-detail-table thead tr { background: var(--gold-soft); }
.profit-table.profit-detail-table th {
  padding: 11px 14px; font-size: 13px; font-weight: 700; color: var(--text);
  text-align: left; border-bottom: 1px solid var(--border);
}
.profit-table.profit-detail-table th:not(:first-child) { text-align: right; }
.profit-table.profit-detail-table tbody td:first-child { font-weight: 600; }
.p-craft-row td:first-child { display: flex; align-items: center; gap: 8px; }
.p-craft-name { font-weight: 600; }
.p-type-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; line-height: 1.3;
}
.p-tag-labor { background: #FFF3E0; color: #E65100; }
.p-tag-material { background: #E3F2FD; color: #1565C0; }
@media (max-width: 560px) {
  .profit-table.profit-detail-table th { padding: 9px 10px; font-size: 12px; }
}
.p-share-input {
  width: 118px; text-align: right; appearance: none; -webkit-appearance: none;
  background: var(--card-hover); border: 1px solid var(--gold); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--text);
}
.p-share-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.18); }
@media (max-width: 560px) {
  .profit-table td { padding: 9px 10px; font-size: 13px; }
  .profit-table td.p-sub { display: none; }
  .p-share-input { width: 100px; }
}

/* ===== 报价单分项标题行（Excel 原始分项：一 / 二 / 三 …） ===== */
.quote-section-row td {
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 700;
  padding: 10px 12px !important;
  text-align: left;
}
.quote-section-row .qsr-name { font-size: 14px; letter-spacing: .5px; }
.quote-section-add {
  float: right;
  width: 26px; height: 26px; line-height: 1;
  border: 1px solid var(--gold); background: var(--card);
  border-radius: 50%; color: var(--gold);
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all .18s ease;
}
.quote-section-add:hover { background: var(--gold); color: #fff; }
.quote-section-add:active { transform: scale(.92); }

/* ===== 报价表新增交互：隐藏列 / 折叠 / 行高亮 / 序号 / 表头编辑 ===== */

/* 表头单元格：承载隐藏按钮；拖拽平移时整体可被抓取 */
.data-table.quote-tbl thead th {
  position: relative;
  user-select: none;
}
/* 列隐藏按钮：hover 表头时显示，点击隐藏该列 */
.col-hide-btn {
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px; line-height: 14px;
  border: none; border-radius: 4px;
  background: var(--border); color: var(--text-secondary);
  font-size: 11px; cursor: pointer; opacity: 0;
  transition: opacity .15s ease;
}
.data-table.quote-tbl thead th:hover .col-hide-btn { opacity: .85; }
.col-hide-btn:hover { background: #e74c3c; color: #fff; opacity: 1 !important; }

/* 被隐藏列留下的「黑线」痕迹：点击恢复该列 */
.col-seam {
  min-width: 10px !important; width: 10px !important; padding: 0 !important;
  background: repeating-linear-gradient(45deg, var(--border) 0 3px, transparent 3px 6px);
  cursor: pointer; position: relative;
}
.col-seam:hover { background: var(--gold); }
.col-seam .col-seam-tip {
  display: none;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 4px; padding: 3px 8px; z-index: 30;
  background: #2b2b2b; color: #fff; font-size: 11px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
}
.col-seam:hover .col-seam-tip { display: block; }

/* 点击单元格 → 整行高亮 */
.data-table.quote-tbl tbody tr.row-active > td {
  background: var(--gold-soft);
}
.data-table.quote-tbl tbody tr.row-active > td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}

/* 分项标题行：可折叠 + 汉字序号可编辑 */
.quote-section-row { cursor: pointer; }
.quote-section-row .qsr-inner { display: flex; align-items: center; gap: 8px; }
.quote-section-row .qsec-toggle {
  flex: 0 0 auto;
  width: 18px; height: 18px; line-height: 16px; text-align: center;
  border: 1px solid var(--gold); border-radius: 4px; color: var(--gold);
  font-size: 11px; cursor: pointer; background: var(--card);
  transition: transform .15s ease;
}
.quote-section-row.collapsed .qsec-toggle { transform: rotate(-90deg); }
.quote-section-row .qsec-seq-in {
  flex: 0 0 auto; width: 38px; text-align: center;
  border: 1px solid transparent; border-radius: 6px; background: rgba(255,255,255,.55);
  color: var(--gold); font-weight: 700; font-size: 14px; padding: 3px 2px;
}
.quote-section-row .qsec-seq-in:focus { outline: none; border-color: var(--gold); background: #fff; }
.quote-section-row .qsr-name-in {
  flex: 1 1 auto; min-width: 80px;
  border: 1px solid transparent; border-radius: 6px; background: rgba(255,255,255,.55);
  color: var(--gold); font-weight: 700; font-size: 14px; letter-spacing: .5px; padding: 3px 6px;
}
.quote-section-row .qsr-name-in:focus { outline: none; border-color: var(--gold); background: #fff; }
.quote-section-row .quote-section-add { margin-left: auto; }

/* 表头信息（工程名称 / 日期 / 面积 / 联系人）可编辑 */
.quote-header .qh-value-in {
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  font-size: 14px; color: var(--text); font-weight: 600; padding: 3px 6px;
  width: 100%; box-sizing: border-box;
}
.quote-header .qh-value-in:focus { outline: none; border-color: var(--gold); background: var(--card); }

/* ===== 修改台账：修改成本 / 修改报价 ===== */
.el-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px 18px; margin: 10px 4px;
}
.el-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.el-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.el-type-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 16px 14px; cursor: pointer; text-align: left;
  background: var(--card-hover); border: 1px solid var(--border);
  border-radius: 16px; transition: all .2s ease;
}
.el-type-btn:hover { border-color: var(--gold); }
.el-type-btn.active { background: var(--gold-soft); border-color: var(--gold); }
.el-tb-name { font-size: 15px; font-weight: 700; color: var(--text); }
.el-type-btn.active .el-tb-name { color: var(--gold); }
.el-tb-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }
@media (max-width: 560px) { .el-btn-row { grid-template-columns: 1fr; } }

/* 可编辑表格：行尾红色叉 / 成本表输入格 */
.qdel-th { width: 46px; }
.qrow-del-cell { text-align: center; }
.qrow-del {
  width: 26px; height: 26px; line-height: 1;
  border: none; background: rgba(231, 76, 60, 0.12); border-radius: 50%;
  color: #e74c3c; font-size: 17px; font-weight: 700; cursor: pointer;
  transition: all .18s ease;
}
.qrow-del:hover { background: #e74c3c; color: #fff; }
.qrow-del:active { transform: scale(.9); }
.cost-cell-in {
  width: 100%; box-sizing: border-box;
  background: var(--card-hover); border: 1px solid transparent;
  border-radius: 8px; padding: 6px 8px; font-size: 13px; color: var(--text);
}
.cost-cell-in:focus { outline: none; border-color: var(--gold); background: var(--card); }
.cost-cell-in.num { text-align: right; font-variant-numeric: tabular-nums; }
.cost-type-sel { min-width: 70px; appearance: none; -webkit-appearance: none; background: var(--card); border: 1px solid var(--gold); border-radius: 999px; padding: 4px 18px 4px 8px; font-size: 12px; font-weight: 600; color: var(--gold); cursor: pointer; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23C9A227' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>"); background-repeat: no-repeat; background-position: right 4px center; background-size: 10px; }
.cost-type-sel:disabled { opacity: 0.6; cursor: not-allowed; border-color: var(--border); color: var(--text-tertiary); background-image: none; }

/* ===== 工程款项页面 ===== */
.payments-page { padding: 12px 0 90px; }
.pay-stats-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 0 16px 16px;
}
.pay-stat-card {
  background: var(--card); border-radius: 18px; padding: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
  transition: background .25s ease, box-shadow .25s ease;
}
.pay-stat-un { background: linear-gradient(135deg, var(--card) 0%, var(--gold-soft) 100%); border: 1px solid var(--gold-light); }
.pay-stat-got { background: var(--card); border: 1px solid var(--border); }
.pay-stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.pay-stat-val { font-size: 22px; font-weight: 700; color: var(--gold); letter-spacing: -0.5px; }

.pay-projects-panel { margin: 0 16px 16px; }
.pay-list { display: flex; flex-direction: column; gap: 10px; }
.pay-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}
.pay-item:hover { border-color: var(--gold-light); box-shadow: 0 6px 18px rgba(201,162,39,0.12); }
.pay-item:active { transform: scale(0.985); }
.pay-item-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pay-item-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-item-sub { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-item-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold-dark); border: 1px solid var(--gold-light);
  border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.pay-item-arrow { width: 18px; height: 18px; color: var(--text-tertiary); flex: none; }

/* 工程款项列表页 - 表格风格 */
.pay-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pay-list-table {
  width: 100%; min-width: 520px; background: var(--card); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden;
}
.pay-list-head, .pay-list-row {
  display: grid;
  grid-template-columns: 1.6fr 70px 1fr 1fr 1fr;
  align-items: center; gap: 8px; padding: 0 12px;
}
.pay-list-head {
  background: var(--gold-soft);
  border-bottom: 1px solid var(--gold-light);
  font-size: 12px; font-weight: 600; color: var(--gold-dark);
  padding: 12px; text-align: center;
}
.pay-list-head span { display: flex; align-items: center; justify-content: center; }
.pay-list-row {
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  cursor: pointer; transition: background .15s ease;
  min-height: 48px;
}
.pay-list-row:last-child { border-bottom: none; }
.pay-list-row:hover { background: var(--gold-soft); }
.pay-list-row:active { background: rgba(201,162,39,0.14); }
.pay-list-row span {
  display: flex; align-items: center; justify-content: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 10px 0;
}
.pay-list-row .col-project { justify-content: flex-start; font-weight: 600; }
.pay-list-row .col-un, .pay-list-row .col-got { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.pay-list-row .col-next { color: var(--text-secondary); font-size: 12px; }

.pay-add-btn {
  position: fixed; bottom: 24px; left: 16px; right: 16px;
  border-radius: 999px; padding: 14px; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(201,162,39,0.28); z-index: 10;
}

/* 工程名单 → 工程 → 成本：Excel 表格风（标题已由外层 table-hint 给出，这里只做表头+内容） */
.rec-table-card {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  overflow-x: auto; margin: 4px 0 12px;
}
.rec-table { width: 100%; min-width: 860px; border-collapse: collapse; }
.rec-table thead th {
  position: sticky; top: 0;
  background: var(--gold-soft); color: var(--gold-dark);
  font-size: 12px; font-weight: 600; padding: 12px 10px; text-align: left;
  border-bottom: 1px solid var(--gold-light); white-space: nowrap;
}
.rec-table thead th.r { text-align: right; }
.rec-table tbody td {
  padding: 11px 10px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text); vertical-align: top; line-height: 1.5;
}
.rec-table tbody tr:last-child td { border-bottom: none; }
.rec-table tbody tr:hover { background: var(--gold-soft); }
.rec-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.rec-table td.rec-amount { font-weight: 700; white-space: nowrap; }
.rec-table td.rec-dir-in { color: #D93025; }
.rec-table td.rec-date, .rec-table td.rec-unit-price, .rec-table td.rec-quantity, .rec-table td.rec-unit, .rec-table td.rec-remark { color: var(--text-secondary); }
.rec-table td.rec-remark { max-width: 160px; }

/* 工程款项编辑页 */
.pay-edit { padding: 12px 16px 100px; }
.pay-table-card {
  background: var(--card); border-radius: 18px; padding: 12px 8px;
  box-shadow: var(--shadow); margin: 16px 0; overflow-x: auto;
}
.pay-table-head, .pay-row {
  display: grid;
  grid-template-columns: 58px 74px 58px 58px 1fr 64px 40px;
  align-items: center; gap: 6px;
  min-width: 520px;
}
.pay-table-head {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  padding: 0 6px 8px; border-bottom: 1px solid var(--border);
  text-align: center;
}
.pay-row { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: none; }
.pay-table-head span, .pay-row > span { display: flex; align-items: center; justify-content: center; }
.pay-table-head .col-amount, .pay-row .col-amount { justify-content: flex-end; }
.pay-period-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: #fff; border-radius: 999px;
  padding: 3px 9px; font-size: 12px; font-weight: 700; min-width: 44px;
}
.pay-cell {
  width: 100%; box-sizing: border-box;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--text);
  text-align: center; transition: border-color .2s, background .2s;
}
.pay-cell:focus { outline: none; border-color: var(--gold); background: var(--card); }
.pay-cell-num { font-variant-numeric: tabular-nums; }
.pay-cell-amt { text-align: right; font-variant-numeric: tabular-nums; }

.pay-switch {
  position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer;
}
.pay-switch input { opacity: 0; width: 0; height: 0; }
.pay-switch-slider {
  position: absolute; inset: 0; border-radius: 999px; background: var(--border);
  transition: background .25s ease; border: 1px solid transparent;
}
.pay-switch-slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 2px; top: 2px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.18);
  transition: transform .25s ease;
}
.pay-switch input:checked + .pay-switch-slider { background: var(--gold); }
.pay-switch input:checked + .pay-switch-slider::before { transform: translateX(18px); }

.pay-del-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold-light);
  background: var(--gold-soft); color: var(--gold-dark); font-size: 18px; line-height: 1;
  cursor: pointer; transition: all .18s ease; display: inline-flex; align-items: center; justify-content: center;
}
.pay-del-btn:hover { background: var(--gold); color: #fff; }
.pay-del-btn:active { transform: scale(0.9); }

.pay-total-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gold-soft); border: 1px solid var(--gold-light);
  border-radius: 14px; padding: 14px 18px; margin: 12px 0 18px;
}
.pay-total-label { font-size: 15px; font-weight: 600; color: var(--gold-dark); }
.pay-total-val { font-size: 18px; font-weight: 700; color: var(--gold); }

.pay-edit-actions { display: flex; flex-direction: column; gap: 12px; }
.pay-edit-actions .btn { width: 100%; border-radius: 999px; padding: 13px; font-size: 15px; font-weight: 600; }
.pay-edit-actions .btn-add-row { border-style: dashed; }

@media (min-width: 640px) {
  .pay-add-btn { left: 50%; right: auto; transform: translateX(-50%); width: calc(100% - 32px); max-width: 480px; }
  .pay-edit-actions { flex-direction: row; }
  .pay-edit-actions .btn { width: auto; flex: 1; }
  .pay-table-head, .pay-row { grid-template-columns: 72px 86px 68px 68px 1fr 74px 44px; gap: 8px; }
}
