/* =========================================================================
 * 代发客群经营工作台 V0.1｜蓝金设计系统
 * 研究演示版｜非生产系统。色值为设计建议，非广州农商行官方VI标准色。
 * ========================================================================= */
:root {
  --brand-primary: #174D86;
  --brand-dark: #12345B;
  --brand-gold: #D4AB52;
  --canvas: #F5F7FA;
  --surface: #FFFFFF;
  --text: #203249;
  --muted: #65768A;
  --border: #DFE5ED;
  --success: #287A56;
  --warning: #98691A;
  --danger: #B43B35;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(18, 52, 91, 0.08), 0 1px 2px rgba(18, 52, 91, 0.06);
  --shadow-lg: 0 6px 20px rgba(18, 52, 91, 0.12);
  --nav-w: 220px;
  --top-h: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--brand-primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== 布局骨架 ===== */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; }

.topbar {
  grid-column: 1 / -1; grid-row: 1;
  background: var(--brand-dark); color: #fff;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark)); border: 1px solid var(--brand-gold); display: flex; align-items: center; justify-content: center; color: var(--brand-gold); font-weight: 700; flex: none; }
.brand .sub { font-size: 12px; color: #B9C7D8; font-weight: 400; }
.topbar .spacer { flex: 1; }
#topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25); white-space: nowrap; }
.pill.demo { background: rgba(212,171,82,0.18); border-color: var(--brand-gold); color: #F2E2B8; }
.pill.sim { background: rgba(255,255,255,0.12); color: #E4ECF5; }

/* 模式切换 */
.mode-toggle { display: flex; background: rgba(255,255,255,0.08); border-radius: 8px; padding: 3px; }
.mode-toggle button {
  border: none; background: transparent; color: #B9C7D8; padding: 6px 12px; border-radius: 6px; font-size: 13px;
}
.mode-toggle button.active { background: var(--brand-primary); color: #fff; }

/* ===== 侧栏 ===== */
.sidebar { grid-row: 2; background: var(--surface); border-right: 1px solid var(--border); padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px;
  color: var(--text); font-size: 13.5px; margin-bottom: 2px; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: #EEF3F9; }
.nav-item.active { background: var(--brand-primary); color: #fff; font-weight: 600; }
.nav-item .n { width: 22px; height: 22px; border-radius: 6px; background: #EEF3F9; color: var(--brand-primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.nav-item.active .n { background: rgba(255,255,255,0.2); color: #fff; }
.nav-item .d { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.nav-item.active .d { color: #B9C7D8; }
.sidebar .foot { margin-top: 18px; padding: 10px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }

/* ===== 主区 ===== */
.main { grid-row: 2; overflow-y: auto; padding: 20px 22px; }
.view { display: none; }
.view.active { display: block; }

.page-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* 横幅（研究演示版） */
.notice {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.notice b { color: var(--brand-gold); }

/* 卡片 */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 14px; }
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--brand-dark); display: flex; align-items: center; gap: 8px; }
.card h3 .tag { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 4px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* 指标卡 */
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.metric .label { font-size: 12px; color: var(--muted); }
.metric .value { font-size: 28px; font-weight: 700; color: var(--brand-primary); margin: 6px 0 2px; }
.metric .value.gold { color: var(--brand-gold); }
.metric .formula { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, monospace; }
.metric .unit { font-size: 13px; color: var(--muted); }

/* 状态徽章 */
.badge { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.badge.success { background: #E4F3EC; color: var(--success); }
.badge.warning { background: #F7EED9; color: var(--warning); }
.badge.danger { background: #FBE8E7; color: var(--danger); }
.badge.info { background: #E8F0F8; color: var(--brand-primary); }
.badge.muted { background: #EEF1F5; color: var(--muted); }
.badge.gold { background: #F6EBD0; color: #8A6A1F; }
.badge.sim { background: #EEF1F5; color: var(--muted); border: 1px dashed var(--border); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #F2F6FA; color: var(--brand-dark); font-weight: 600; font-size: 12px; white-space: nowrap; }
tr:hover td { background: #F8FAFC; }
.table-scroll { overflow-x: auto; }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  border: none; background: transparent; padding: 9px 14px; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer;
}
.tabs button.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); font-weight: 600; }

/* 按钮 */
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: 7px; font-size: 13px; }
.btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn.primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.gold { background: var(--brand-gold); border-color: var(--brand-gold); color: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.sm { padding: 4px 9px; font-size: 12px; }

/* 输入 */
input[type=text], input[type=number], input[type=date], select, textarea {
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 13px; color: var(--text); background: #fff; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 2px rgba(23,77,134,0.12); }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* 工具条 */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }

/* 经营参谋（右侧） */
.counsel { background: #FBFAF5; border: 1px solid #EFE6CE; border-radius: var(--radius); padding: 14px; }
.counsel h4 { margin: 0 0 8px; color: #8A6A1F; font-size: 13px; }
.counsel .item { font-size: 12.5px; color: #6B5B33; padding: 6px 0; border-bottom: 1px dashed #E7DDBE; }
.counsel .item:last-child { border-bottom: none; }
.counsel .note { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* 五环节 */
.stage-strip { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.stage-chip { padding: 8px 14px; border-radius: 8px; background: #EEF3F9; color: var(--muted); font-size: 13px; border: 1px solid var(--border); cursor: pointer; }
.stage-chip.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.stage-chip.done { background: #E4F3EC; color: var(--success); }

/* 天际线装饰背景 */
.skyline-hero {
  background: linear-gradient(135deg, rgba(23,77,86,0.94), rgba(18,52,91,0.96)), url('../guangzhou_skyline.png') center/cover;
  background-blend-mode: multiply;
  color: #fff; border-radius: var(--radius); padding: 26px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.skyline-hero h2 { margin: 0 0 6px; font-size: 20px; }
.skyline-hero p { margin: 0; color: #C9D6E4; font-size: 13px; }
.skyline-hero .goldline { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--brand-gold), transparent); }

/* 蓝图区块 */
.blueprint { border: 1px dashed var(--brand-gold); border-radius: var(--radius); padding: 14px; background: #FFFDF5; }
.blueprint h4 { color: #8A6A1F; margin: 0 0 8px; font-size: 13px; }
.blueprint .row { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: #6B5B33; padding: 5px 0; }
.blueprint .arrow { color: var(--brand-gold); }

/* 折叠区 */
.collapsible summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); font-size: 13.5px; }

/* 通用 */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.gold-text { color: #8A6A1F; }
.mt8 { margin-top: 8px; }
.mb8 { margin-bottom: 8px; }
.flex { display: flex; gap: 12px; align-items: flex-start; }
.flex-col { flex: 1; }
.kv { display: flex; font-size: 13px; padding: 4px 0; }
.kv .k { color: var(--muted); width: 150px; flex: none; }
.kv .v { color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 26px; font-size: 13px; }

/* 响应式：小屏横向滚动，页面不整体横溢 */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .g3, .g2 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 60px 1fr; }
  .nav-item .d, .nav-item span:not(.n) { display: none; }
  .brand .sub { display: none; }
}
