/* ============================================================
 * ledger.css —— v11.1.1 Task 3 私有台账（仅内部，不入 Git）
 * 基调沿用站内视觉：暗色紫渐变 / 卡片 / 徽章（无需与公开站完全一致）
 * 响应式两档（桌面 >768 / 手机 ≤768）
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #0a0e1a; color: #e0e0e0; min-height: 100vh; line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
a { color: #8fa4f5; text-decoration: none; }
button { font-family: inherit; }

/* ---------- 头部 ---------- */
.lg-header { background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%); border-bottom: 1px solid rgba(255,255,255,0.08); }
.lg-header-inner { max-width: 1280px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lg-title { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }
.lg-sub { color: rgba(255,255,255,0.55); font-size: 12px; margin-top: 4px; }
.lg-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---------- Tab 导航 ---------- */
.lg-tabs { position: sticky; top: 0; z-index: 100; background: rgba(10, 8, 24, 0.94); border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lg-tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: #9aa0b5; padding: 12px 16px; font-size: 14px; white-space: nowrap; cursor: pointer; transition: color .2s, border-color .2s; }
.lg-tab:hover { color: #fff; }
.lg-tab.is-active { color: #fff; border-bottom-color: #667eea; font-weight: 600; }

.lg-main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
.lg-panel[hidden] { display: none; }

/* ---------- 通用组件 ---------- */
.lg-chip { display: inline-block; background: rgba(102,126,234,0.14); border: 1px solid rgba(102,126,234,0.4); color: #8fa4f5; font-size: 11px; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.lg-chip-ok { background: rgba(72,199,142,0.12); border-color: rgba(72,199,142,0.45); color: #6fd3a3; }
.lg-chip-warn { background: rgba(240,166,72,0.12); border-color: rgba(240,166,72,0.45); color: #f0b86e; }
.lg-chip-dim { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15); color: #8b91a8; }
.lg-btn { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.lg-btn:hover { opacity: .92; }
.lg-btn:active { opacity: .85; transform: scale(.98); }
.lg-btn-ghost { background: rgba(255,255,255,0.08); color: #e0e0e0; border: 1px solid rgba(255,255,255,0.2); }
.lg-btn-sm { padding: 5px 12px; font-size: 12px; }
.lg-select, .lg-input { background: rgba(20,18,38,0.9); border: 1px solid rgba(255,255,255,0.18); color: #e0e0e0; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.lg-select:focus, .lg-input:focus { outline: 2px solid #667eea; outline-offset: 1px; }
.lg-label { color: #9aa0b5; font-size: 12px; }
.lg-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: #c9d0ea; }
.lg-dim { color: #7a8098; font-size: 11px; }
.lg-bad { color: #f08a8a; }
.lg-num { text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lg-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }

/* 错误条（服务端拒绝信息展示） */
.lg-error { background: rgba(240,90,90,0.1); border: 1px solid rgba(240,90,90,0.45); color: #f0a2a2; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; word-break: break-all; }
.lg-note { color: #8b91a8; font-size: 12px; margin-top: 14px; line-height: 1.8; }

/* ---------- ① 五分开统计看板：五卡分开渲染 ---------- */
.lg-cards { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 14px; }
.lg-card { background: rgba(30,28,50,0.8); border: 1px solid rgba(255,255,255,0.07); border-radius: 16px; padding: 18px 16px; }
.lg-card-title { color: #fff; font-size: 14px; font-weight: 700; }
.lg-card-num { color: #b3c1f8; font-size: 34px; font-weight: 700; margin: 10px 0 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lg-card-unit { font-size: 12px; color: #8b91a8; margin-left: 6px; font-family: inherit; font-weight: 500; }
.lg-card-def { color: #6d7389; font-size: 11px; line-height: 1.7; margin-top: 8px; border-top: 1px dashed rgba(255,255,255,0.08); padding-top: 8px; }
.lg-buckets { margin: 8px 0 2px; }
.lg-bucket { display: flex; justify-content: space-between; font-size: 12px; color: #9aa0b5; padding: 2px 0; }
.lg-bucket b { color: #c9d0ea; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- 表格 ---------- */
.lg-table-wrap { overflow-x: auto; border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; background: rgba(30,28,50,0.55); }
.lg-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
.lg-table th { text-align: left; color: #aab2cf; font-size: 12px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.1); background: rgba(20,18,38,0.7); white-space: nowrap; }
.lg-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
.lg-table tr:last-child td { border-bottom: none; }

/* 状态徽章（八态色标） */
.lg-badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 10px; border: 1px solid; white-space: nowrap; }
.lg-badge-inquiry { background: rgba(143,164,245,0.12); border-color: rgba(143,164,245,0.45); color: #8fa4f5; }
.lg-badge-qualified { background: rgba(102,126,234,0.14); border-color: rgba(102,126,234,0.5); color: #93a6f7; }
.lg-badge-scoped { background: rgba(186,104,232,0.13); border-color: rgba(186,104,232,0.5); color: #cb93ec; }
.lg-badge-contracted { background: rgba(240,166,72,0.12); border-color: rgba(240,166,72,0.5); color: #f0b86e; }
.lg-badge-paid { background: rgba(72,199,142,0.12); border-color: rgba(72,199,142,0.5); color: #6fd3a3; }
.lg-badge-delivered { background: rgba(64,186,213,0.12); border-color: rgba(64,186,213,0.5); color: #6fc6de; }
.lg-badge-followup { background: rgba(196,148,58,0.14); border-color: rgba(196,148,58,0.5); color: #d3ab63; }
.lg-badge-closed { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.25); color: #9aa0b5; }
.lg-badge-none { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.18); color: #7a8098; }

/* 能力标签与授权状态 */
.lg-tag { display: inline-block; background: rgba(102,126,234,0.12); border: 1px solid rgba(102,126,234,0.4); color: #8fa4f5; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin: 1px 2px 1px 0; }
.lg-auth { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin: 1px 2px 1px 0; border: 1px solid; }
.lg-auth-on { background: rgba(72,199,142,0.1); border-color: rgba(72,199,142,0.45); color: #6fd3a3; }
.lg-auth-off { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); color: #8b91a8; }

/* ---------- 行内操作表单 ---------- */
.lg-op-row td { background: rgba(16,14,32,0.75); }
.lg-op-forms { display: flex; gap: 16px; flex-wrap: wrap; }
.lg-form { flex: 1; min-width: 300px; background: rgba(30,28,50,0.7); border: 1px solid rgba(255,255,255,0.09); border-radius: 12px; padding: 14px; }
.lg-form-title { color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.lg-form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.lg-form-row label { color: #8b91a8; font-size: 11px; }
.lg-form-actions { flex-direction: row; align-items: center; gap: 10px; }
.lg-form-err { color: #f0a2a2; font-size: 12px; margin-top: 6px; word-break: break-all; }
.lg-form-ok { color: #6fd3a3; }

/* ---------- 页脚纪律注记 ---------- */
.lg-footer { border-top: 1px solid rgba(255,255,255,0.06); margin-top: 24px; padding: 20px 16px 32px; }
.lg-footer p { max-width: 1280px; margin: 0 auto 6px; color: #5b6178; font-size: 11px; line-height: 1.8; }

/* ---------- 响应式（手机 ≤768 单列） ---------- */
@media (max-width: 768px) {
  .lg-cards { grid-template-columns: 1fr; }
  .lg-card-num { font-size: 28px; }
  .lg-header-inner { flex-direction: column; align-items: flex-start; }
  .lg-main { padding: 14px 12px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
