    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
    body {
      background: #050a12;
      color: #e2e8f0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif;
      overflow: hidden;
      width: 100vw;
      height: 100vh;
      user-select: none;
    }
    #engine-status {
      position: fixed; inset: 0; z-index: 3000; display: flex;
      align-items: center; justify-content: center; text-align: center;
      padding: 24px; background: rgba(2, 6, 23, .92); color: #bae6fd;
      font-size: 14px; font-weight: 600; pointer-events: auto;
    }
    #engine-status[data-state="error"] { color: #fecaca; }
    button, input, select, textarea {
      font-family: inherit;
    }
    .mono-num {
      font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", "Segoe UI", "PingFang SC", "Microsoft YaHei", monospace;
      font-variant-numeric: tabular-nums;
    }
    #canvas-container {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      cursor: grab;
    }
    #canvas-container:active { cursor: grabbing; }
    canvas { display: block; width: 100%; height: 100%; }

    /* 地图图鉴嵌入的只读地图模式：保留正式游戏的同一 Canvas 渲染管线，隐藏全部游戏 UI。 */
    html.map-only body > :not(#canvas-container):not(#engine-status) { display: none !important; }
    html.map-only #canvas-container { cursor: grab; }

    /* 顶部玻璃拟态信息栏 */
    .top-bar {
      position: absolute;
      top: 16px; left: 16px; right: 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      pointer-events: none;
    }
    .brand-card {
      width: 385px;
      box-sizing: border-box;
      background: rgba(10, 18, 30, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.14);
      padding: 12px 18px;
      border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
      pointer-events: auto;
    }
    .brand-title {
      font-size: 16px;
      font-weight: 700;
      letter-spacing: 0.5px;
      background: linear-gradient(135deg, #f59e0b, #ec4899, #10b981, #38bdf8);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .brand-desc {
      font-size: 12px;
      color: #94a3b8;
      margin-top: 4px;
    }
    .map-gallery-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
    .world-seed-control {
      margin: 8px 0 4px;
      padding: 9px;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 6px;
      align-items: center;
      border: 1px solid rgba(56, 189, 248, 0.28);
      border-radius: 8px;
      background: rgba(14, 116, 144, 0.13);
      color: #c8eaf4;
      font-size: 10px;
    }
    .world-seed-control label { color: #7dd3fc; font-weight: 700; white-space: nowrap; }
    .world-seed-control input {
      min-width: 0;
      width: 100%;
      padding: 5px 7px;
      border: 1px solid rgba(125, 211, 252, 0.4);
      border-radius: 5px;
      background: rgba(15, 23, 42, 0.75);
      color: #e0f2fe;
      font: inherit;
      font-weight: 700;
    }
    .world-seed-control button {
      padding: 5px 8px;
      border: 1px solid rgba(125, 211, 252, 0.45);
      border-radius: 5px;
      background: rgba(14, 116, 144, 0.72);
      color: #ecfeff;
      cursor: pointer;
      font: inherit;
      font-weight: 700;
      white-space: nowrap;
    }
    .world-seed-control button:hover { background: rgba(8, 145, 178, 0.85); }
    .world-seed-note { grid-column: 1 / -1; color: #9bbec9; line-height: 1.35; }
    body.theme-light .world-seed-control { background: rgba(14, 116, 144, 0.09); border-color: rgba(14, 116, 144, 0.25); color: #365b66; }
    body.theme-light .world-seed-control label { color: #0e7490; }
    body.theme-light .world-seed-control input { background: #fff; color: #164e63; border-color: rgba(14, 116, 144, 0.35); }
    body.theme-light .world-seed-control button { background: #0e7490; color: #fff; }
    body.theme-light .world-seed-note { color: #52717a; }

    /* 全局生命体征状态栏 (v1.9.0 改为窗口水平居中，不再居中于 brand 与存档之间的空位) */
    .stats-card {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 16px;
      background: rgba(10, 18, 30, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.14);
      padding: 10px 18px;
      border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
      pointer-events: auto;
    }
    .stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .stat-val {
      font-size: 17px;
      font-weight: 700;
      color: #38bdf8;
      font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", "Segoe UI", "PingFang SC", "Microsoft YaHei", monospace;
      font-variant-numeric: tabular-nums;
    }
    .stat-lbl {
      font-size: 11px;
      color: #94a3b8;
    }

    /* 全地图资源总览与产速控制面板 (左侧浮动，与顶部 brand-card 完全等宽 385px 对齐) */
    .global-resource-panel {
      position: absolute;
      top: 88px; left: 16px;
      width: 385px;
      box-sizing: border-box;
      background: rgba(10, 18, 30, 0.96);
      border: 1px solid rgba(56, 189, 248, 0.35);
      padding: 14px 16px;
      border-radius: 14px;
      box-shadow: 0 12px 36px rgba(0,0,0,0.6);
      display: flex;
      flex-direction: column;
      gap: 10px;
      font-size: 11px;
      pointer-events: auto;
      z-index: 10;
    }
    .panel-header {
      font-size: 12px;
      font-weight: 700;
      color: #38bdf8;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      padding-bottom: 6px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .res-meter-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .meter-row {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .meter-label {
      display: flex;
      justify-content: space-between;
      color: #94a3b8;
    }
    /* M8 房屋储备改纯数值：label 独占一行，用内边距补齐原进度条占位高度 */
    .meter-label.plain-stock {
      padding: 4px 0;
      line-height: 1.3;
    }
    .meter-bg {
      width: 100%;
      height: 7px;
      background: #1e293b;
      border-radius: 4px;
      overflow: hidden;
    }
    .meter-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 0.2s ease;
    }
    .slider-control-group {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .slider-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .slider-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: #cbd5e1;
    }
    input[type="range"] {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 5px;
      background: #334155;
      border-radius: 3px;
      outline: none;
      cursor: pointer;
    }
    input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #38bdf8;
      cursor: pointer;
      box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
      transition: all 0.15s ease;
    }
    input[type="range"]::-webkit-slider-thumb:hover {
      transform: scale(1.2);
      background: #7dd3fc;
    }
    .reset-btn-row {
      display: flex;
      justify-content: flex-end;
      margin-top: 2px;
    }
    .reset-rate-btn {
      background: #1e293b;
      color: #94a3b8;
      border: 1px solid rgba(255,255,255,0.08);
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 10px;
      cursor: pointer;
      text-align: center;
      transition: all 0.2s ease;
    }
    .reset-rate-btn:hover {
      background: #334155;
      color: #38bdf8;
      border-color: #38bdf8;
    }

    /* 右侧面板容器 */
    .right-panel-stack {
      position: absolute;
      top: 88px; right: 20px;
      bottom: 248px; /* ★ v1.50.64 底界让位于事件播报浮窗（bottom 20 + 高 216 + 12 缝隙），列内溢出由 #inspector-card 内部滚动承接 */
      width: 350px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      pointer-events: none;
      z-index: 10;
    }
    /* 全局活人属性平均值面板 (右侧 - 支持最小化折叠) */
    .global-averages-card {
      width: 100%;
      background: rgba(10, 18, 30, 0.95);
      border: 1px solid rgba(56, 189, 248, 0.28);
      padding: 12px 16px;
      border-radius: 14px;
      font-size: 11px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      color: #cbd5e1;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5);
      pointer-events: auto;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .global-averages-card.minimized {
      gap: 0;
      padding: 10px 14px;
    }
    .global-averages-card.minimized .avg-card-body {
      display: none;
    }
    .global-averages-card.minimized .legend-title {
      border-bottom: none;
      padding-bottom: 0;
    }
    .avg-card-body {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .avg-section-title {
      font-size: 10px;
      font-weight: 700;
      color: #94a3b8;
      letter-spacing: 0.3px;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      padding-bottom: 2px;
    }
    .avg-stat-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
      margin-top: 2px;
    }
    .avg-stat-item {
      display: flex;
      flex-direction: column;
      gap: 1px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.07);
      border-radius: 6px;
      padding: 4px 6px;
    }
    .avg-lbl {
      font-size: 9.5px;
      color: #94a3b8;
    }
    .avg-val {
      font-size: 11px;
      font-weight: 700;
      font-family: "SF Mono", Monaco, Consolas, monospace;
    }
    .avg-carry-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 4px;
    }
    .avg-carry-chip {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      font-size: 9.5px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 6px;
      padding: 4px 2px;
      text-align: center;
    }
    .avg-traits-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 4px;
    }
    .avg-trait-box {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 6px;
      padding: 3px 6px;
      font-size: 9.5px;
    }
    .avg-trait-box strong {
      color: #38bdf8;
      font-family: "SF Mono", Monaco, Consolas, monospace;
      font-size: 10px;
    }

    /* 通用小卡片标题与折叠按钮 (右侧面板共享) */
    .legend-title {
      font-size: 11px;
      font-weight: 700;
      color: #94a3b8;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      padding-bottom: 4px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      user-select: none;
      transition: color 0.2s ease;
    }
    .legend-title:hover {
      color: #e2e8f0;
    }
    .legend-collapse-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #94a3b8;
      width: 20px;
      height: 20px;
      padding: 0;
      border-radius: 4px;
      font-size: 13px;
      font-weight: 700;
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .legend-collapse-btn:hover {
      background: rgba(56, 189, 248, 0.2);
      border-color: #38bdf8;
      color: #38bdf8;
    }


    /* 道路悬浮提示卡片 (Tooltip) */
    .road-tooltip {
      position: absolute;
      pointer-events: none;
      background: rgba(10, 18, 30, 0.96);
      border: 1px solid rgba(245, 158, 11, 0.5);
      border-radius: 12px;
      padding: 10px 14px;
      width: 250px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(245, 158, 11, 0.2);
      font-size: 11px;
      color: #e2e8f0;
      display: none;
      flex-direction: column;
      gap: 6px;
      z-index: 50;
      transition: opacity 0.15s ease, transform 0.15s ease;
    }
    .road-tooltip-title {
      font-weight: 700;
      font-size: 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 4px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .road-tooltip-bar-bg {
      width: 100%;
      height: 6px;
      background: #1e293b;
      border-radius: 3px;
      overflow: hidden;
      margin-top: 2px;
    }
    .road-tooltip-bar-fill {
      height: 100%;
      border-radius: 3px;
      transition: width 0.1s ease;
    }

    /* 选中的 Inspector 监控面板 */
    .inspector-card {
      width: 100%;
      background: rgba(10, 18, 30, 0.96);
      border: 1px solid rgba(56, 189, 248, 0.35);
      padding: 12px 14px;
      border-radius: 14px;
      box-shadow: 0 12px 32px rgba(0,0,0,0.65);
      display: flex;
      flex-direction: column;
      gap: 7px;
      font-size: 11px;
      pointer-events: auto;
      transition: all 0.2s ease;
    }
    /* ★ v1.50.64 起桌面端限高 + 内部滚动（弹收缩不弹拉伸：矮内容保持自然高度，高内容在列内
       滚动，不再被底部播报浮窗遮挡；★ v1.50.65 激素分节已迁往族谱模态，此滚动保障家户
       大事记等长内容依旧可达，予以保留） */
    #inspector-card {
      flex: 0 1 auto;
      min-height: 0;
      overflow-y: auto;
    }
    #inspector-card::-webkit-scrollbar { width: 4px; }
    #inspector-card::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); border-radius: 2px; }
    .inspector-title {
      font-weight: 700;
      color: #38bdf8;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      padding-bottom: 5px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
    }
    .insp-title-left {
      display: flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .insp-title-left #insp-title-name {
      font-size: 13px;
      font-weight: 700;
      color: #f8fafc;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .inspector-title-right {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .state-badge {
      font-size: 9.5px;
      font-weight: 600;
      padding: 1px 6px;
      border-radius: 5px;
      background: rgba(245, 158, 11, 0.12);
      color: #f59e0b;
      border: 1px solid rgba(245, 158, 11, 0.3);
      max-width: 110px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .insp-subbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
      font-size: 10px;
      color: #94a3b8;
      padding: 0 1px;
    }
    .insp-home-chip {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 1px 6px;
      border-radius: 4px;
      background: rgba(56, 189, 248, 0.1);
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.25);
      font-size: 9.5px;
      font-weight: 600;
      max-width: 140px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .insp-prestige-chip {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 1px 6px;
      border-radius: 4px;
      background: rgba(251, 191, 36, 0.12);
      color: #fbbf24;
      border: 1px solid rgba(251, 191, 36, 0.35);
      font-size: 9.5px;
      font-weight: 600;
      white-space: nowrap;
      cursor: help;
    }
    .insp-close-btn {
      width: 18px;
      height: 18px;
      flex: 0 0 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(239, 68, 68, 0.15);
      border: 1px solid rgba(239, 68, 68, 0.4);
      color: #fca5a5;
      border-radius: 5px;
      font-size: 10px;
      line-height: 1;
      cursor: pointer;
      padding: 0;
      transition: all 0.2s ease;
    }
    .insp-close-btn:hover {
      background: rgba(239, 68, 68, 0.45);
      color: #fff;
      border-color: #ef4444;
      transform: scale(1.12);
    }
    
    /* 2x2 紧凑型生存指标网格 */
    .vital-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px 8px;
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 8px;
      padding: 6px 8px;
    }
    .vital-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .vital-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 9.5px;
      color: #94a3b8;
    }
    .vital-header span:first-child {
      font-weight: 600;
    }
    .vital-header span:last-child {
      font-weight: 700;
      color: #e2e8f0;
      font-size: 9.5px;
    }
    
    /* 🎒 随身行囊 (紧凑胶囊网格) */
    .carry-card {
      background: rgba(251, 191, 36, 0.06);
      border: 1px solid rgba(251, 191, 36, 0.22);
      border-radius: 8px;
      padding: 5px 7px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .carry-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: #fde68a;
      font-weight: 700;
      font-size: 10px;
    }
    .carry-chips-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 3px;
      margin-top: 1px;
    }
    .carry-chip {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 5px;
      padding: 2px 1px;
      font-size: 8.5px;
      color: #94a3b8;
      transition: all 0.2s ease;
    }
    .carry-chip.active {
      background: rgba(251, 191, 36, 0.15);
      border-color: rgba(251, 191, 36, 0.4);
      color: #fde68a;
      font-weight: 700;
    }
    .carry-chip .chip-icon {
      font-size: 10px;
      line-height: 1.1;
    }
    .carry-chip .chip-num {
      font-family: monospace;
      font-size: 9px;
    }
    .carry-hint {
      font-size: 9px;
      color: #94a3b8;
      line-height: 1.25;
    }
    /* 调试模式 · 累计开采资源量 (v1.26.3，仅调试模式显示) */
    .debug-mining-card {
      display: flex;
      flex-direction: column;
      gap: 3px;
      background: rgba(167, 139, 250, 0.07);
      border: 1px dashed rgba(167, 139, 250, 0.35);
      border-radius: 6px;
      padding: 4px 7px;
      font-size: 9.5px;
    }
    .mining-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    /* 🚚 搬运去向 */
    .carry-haul {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 4px;
      background: rgba(56, 189, 248, 0.06);
      border: 1px solid rgba(56, 189, 248, 0.18);
      border-radius: 5px;
      padding: 2px 5px;
      font-size: 9px;
    }
    .preg-container {
      background: rgba(236, 72, 153, 0.1);
      border: 1px solid rgba(236, 72, 153, 0.35);
      border-radius: 7px;
      padding: 5px 7px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .cooldown-badge {
      background: rgba(239, 68, 68, 0.12);
      border: 1px solid rgba(239, 68, 68, 0.35);
      border-radius: 5px;
      padding: 3px 5px;
      color: #fca5a5;
      font-size: 9.5px;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .poi-info-badge {
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.3);
      padding: 6px 8px;
      border-radius: 8px;
      color: #6ee7b7;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    /* ==========================================================================
       ★ v1.37.0 榷场互市行情看板与经营统计卡片 (Market Inspector Cards)
       ========================================================================== */
    .market-summary-card {
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(251, 191, 36, 0.25);
      border-radius: 8px;
      padding: 7px 10px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .market-stat-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }
    .market-stat-label {
      font-size: 9.5px;
      color: #94a3b8;
      font-weight: 600;
    }
    .market-stat-val {
      font-size: 13px;
      font-weight: 700;
      color: #f8fafc;
      line-height: 1.2;
    }
    .market-stat-sub {
      font-size: 9px;
      color: #64748b;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .market-goods-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 6px;
    }
    .market-good-card {
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 6px 7px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }
    .market-good-header {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 3px;
    }
    .good-name {
      font-weight: 700;
      font-size: 10.5px;
      white-space: nowrap;
    }
    .good-price {
      font-weight: 700;
      font-size: 10.5px;
      color: #fbbf24;
      white-space: nowrap;
    }
    .market-good-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 9px;
      color: #94a3b8;
      white-space: nowrap;
    }
    .lineage-chip {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      background: rgba(56, 189, 248, 0.15);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #38bdf8;
      padding: 2px 7px;
      border-radius: 6px;
      font-size: 10px;
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
    }
    .entity-link {
      font-family: inherit;
      line-height: inherit;
      text-align: left;
      appearance: none;
    }
    .lineage-chip:hover {
      background: rgba(56, 189, 248, 0.35);
      border-color: #38bdf8;
      transform: translateY(-1px);
    }
    .lineage-chip.female {
      background: rgba(236, 72, 153, 0.15);
      border-color: rgba(236, 72, 153, 0.35);
      color: #f472b6;
    }
    .lineage-chip.female:hover {
      background: rgba(236, 72, 153, 0.35);
      border-color: #ec4899;
    }
    .lineage-chip.dead {
      opacity: 0.6;
      text-decoration: line-through;
      background: rgba(148, 163, 184, 0.1);
      border-color: rgba(148, 163, 184, 0.3);
      color: #94a3b8;
    }

    /* 底部操作按钮栅格 */
    .insp-action-grid {
      display: flex;
      gap: 5px;
      margin-top: 3px;
    }
    .insp-btn {
      flex: 1;
      font-size: 10.5px;
      font-weight: 600;
      padding: 5px 8px;
      border-radius: 7px;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #38bdf8;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: all 0.2s ease;
      white-space: nowrap;
    }
    .insp-btn:hover {
      background: rgba(56, 189, 248, 0.25);
      border-color: #38bdf8;
      transform: translateY(-1px);
    }
    .insp-btn.house-btn {
      background: rgba(245, 158, 11, 0.12);
      border-color: rgba(245, 158, 11, 0.4);
      color: #facc15;
    }
    .insp-btn.house-btn:hover {
      background: rgba(245, 158, 11, 0.25);
      border-color: #facc15;
    }
    .insp-btn.detail-btn {
      background: rgba(167, 139, 250, 0.12);
      border-color: rgba(167, 139, 250, 0.35);
      color: #c4b5fd;
    }
    .insp-btn.detail-btn:hover {
      background: rgba(167, 139, 250, 0.25);
      border-color: #a78bfa;
    }
    .insp-btn.following {
      background: rgba(16, 185, 129, 0.22);
      border-color: #10b981;
      color: #34d399;
    }
    .lineage-modal-overlay {
      position: fixed;
      top: 0; left: 0; width: 100vw; height: 100vh;
      background: rgba(2, 6, 23, 0.82);
      backdrop-filter: blur(8px);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
    }
    .lineage-modal-card {
      background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(11, 18, 32, 0.98));
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 16px;
      width: 940px;
      max-width: min(960px, 94vw);
      max-height: 88vh;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      padding: 18px 22px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      overflow-y: auto;
      animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .lineage-modal-card::-webkit-scrollbar {
      width: 5px;
    }
    .lineage-modal-card::-webkit-scrollbar-thumb {
      background: rgba(148, 163, 184, 0.25);
      border-radius: 4px;
    }
    @keyframes modalPopIn {
      from { transform: scale(0.96); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }
    .lineage-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 10px;
      flex-shrink: 0;
    }
    .lineage-modal-header-left {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1;
    }
    .lineage-header-icon {
      width: 34px;
      height: 34px;
      border-radius: 9px;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      flex-shrink: 0;
    }
    .lineage-modal-title {
      font-size: 15px;
      font-weight: 700;
      color: #38bdf8;
      letter-spacing: 0.2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .lineage-modal-subtitle {
      font-size: 10.5px;
      color: #94a3b8;
      margin-top: 1px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .lineage-modal-header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      margin-left: 10px;
    }
    .lineage-modal-close {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #94a3b8;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      font-size: 13px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
    }
    .lineage-modal-close:hover {
      background: rgba(239, 68, 68, 0.25);
      border-color: #ef4444;
      color: #ef4444;
      transform: rotate(90deg);
    }
    .lineage-modal-body {
      display: flex;
      flex-direction: row;
      gap: 12px;
      align-items: flex-start;
    }
    /* ★ v1.50.67 双列布局：左档案列（角色卡+禀赋+激素）、右亲属列（关系网+子嗣+威望）；
       列容器为透明包装，仅承担纵向排布与弹性分配，窄屏回退单列 */
    .lineage-col {
      display: flex;
      flex-direction: column;
      gap: 11px;
      min-width: 0;
      flex: 1 1 0;
    }
    .lineage-col-profile { flex: 1.15 1 0; }
    .lineage-col-kin { flex: 1 1 0; }
    @media (max-width: 900px) {
      .lineage-modal-card {
        width: min(620px, 94vw);
        max-width: min(620px, 94vw);
      }
      .lineage-modal-body {
        flex-direction: column;
        align-items: stretch;
      }
    }

    /* 核心角色卡片 Hero Card */
    .lineage-self-card {
      background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
      border: 1px solid rgba(56, 189, 248, 0.25);
      border-radius: 12px;
      padding: 12px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
    .lineage-self-main {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
      flex: 1;
    }
    .lineage-self-avatar {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 25px;
      flex-shrink: 0;
      background: rgba(30, 41, 59, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.12);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
      transition: all 0.2s ease;
    }
    .lineage-self-avatar.male {
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(14, 165, 233, 0.06));
      border-color: rgba(56, 189, 248, 0.4);
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
    }
    .lineage-self-avatar.female {
      background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(219, 39, 119, 0.06));
      border-color: rgba(236, 72, 153, 0.4);
      box-shadow: 0 0 12px rgba(236, 72, 153, 0.15);
    }
    .lineage-self-avatar.dead {
      background: rgba(148, 163, 184, 0.12);
      border-color: rgba(148, 163, 184, 0.25);
      filter: grayscale(1);
    }
    .lineage-self-info {
      display: flex;
      flex-direction: column;
      gap: 5px;
      min-width: 0;
      flex: 1;
    }
    .lineage-self-name-row {
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
    }
    .lineage-self-name {
      font-size: 14px;
      font-weight: 700;
      color: #f8fafc;
      letter-spacing: 0.2px;
      white-space: nowrap;
    }
    .lineage-badge-gender {
      font-size: 9.5px;
      font-weight: 600;
      padding: 1.5px 6px;
      border-radius: 4px;
      line-height: 1.2;
    }
    .lineage-badge-gender.male {
      background: rgba(56, 189, 248, 0.15);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #38bdf8;
    }
    .lineage-badge-gender.female {
      background: rgba(236, 72, 153, 0.15);
      border: 1px solid rgba(236, 72, 153, 0.35);
      color: #f472b6;
    }
    .lineage-badge-gen {
      font-size: 9.5px;
      font-weight: 600;
      padding: 1.5px 6px;
      border-radius: 4px;
      background: rgba(245, 158, 11, 0.15);
      border: 1px solid rgba(245, 158, 11, 0.35);
      color: #fbbf24;
      line-height: 1.2;
    }
    .lineage-vitals-row {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .vital-item {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      background: rgba(15, 23, 42, 0.7);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 5px;
      padding: 2px 6px;
      font-size: 10px;
    }
    .vital-item .vital-label {
      color: #94a3b8;
      font-weight: 500;
    }
    .vital-item .vital-value {
      color: #f1f5f9;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
    }
    .vital-item.vital-warn {
      background: rgba(239, 68, 68, 0.15);
      border-color: rgba(239, 68, 68, 0.35);
    }
    .lineage-self-action-box {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 3px;
      flex-shrink: 0;
      max-width: 170px;
    }
    .lineage-action-title {
      font-size: 9.5px;
      color: #94a3b8;
      letter-spacing: 0.2px;
    }
    .lineage-self-need-badge {
      font-size: 10.5px;
      font-weight: 600;
      padding: 3.5px 9px;
      border-radius: 6px;
      background: rgba(56, 189, 248, 0.15);
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.3);
      white-space: nowrap;
      text-align: right;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    /* 禀赋属性与关系网 */
    .lineage-traits-block {
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .lineage-traits-source-badge {
      font-size: 9.5px;
      color: #94a3b8;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 1px 6px;
      border-radius: 4px;
      font-weight: normal;
    }
    .lineage-traits-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }
    .lineage-trait {
      display: flex;
      flex-direction: column;
      gap: 4px;
      background: rgba(30, 41, 59, 0.5);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 7px;
      padding: 6px 9px;
      transition: all 0.15s ease;
    }
    .lineage-trait:hover {
      border-color: rgba(56, 189, 248, 0.3);
      transform: translateY(-1px);
    }
    .lineage-trait .meter-label {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 10px;
    }
    .lineage-trait .meter-bg {
      height: 4px;
      background: rgba(0, 0, 0, 0.45);
      border-radius: 2px;
      overflow: hidden;
    }
    .lineage-trait .meter-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.25s ease;
    }

    /* ★ v1.50.65 H-06 激素观察分节（自 Inspector 迁入族谱模态）：与禀赋分节同款容器；
       显隐由 updateHormonePanel 置 display:block（初始 inline none），计量行惰性构建
       一次后只更新 textContent/width，遵守内容快照缓存红线，不高频重建 */
    .lineage-hormone-block {
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      padding: 10px 12px;
    }
    .lineage-hormone-block .lineage-section-title {
      border-bottom: none;
      padding-bottom: 0;
    }
    .lineage-hormone-block .meter-bg {
      height: 4px;
      background: rgba(0, 0, 0, 0.45);
      border-radius: 2px;
      overflow: hidden;
    }
    .lineage-hormone-block .meter-fill {
      height: 100%;
      border-radius: 2px;
    }

    .lineage-modal-grid {
      display: grid;
      /* ★ v1.50.67 父/母各仅一人，同行双列；配偶/私宅/子嗣/威望 inline 通栏 */
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .lineage-section {
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 9px;
      padding: 8px 12px;
      display: flex;
      flex-direction: column;
      gap: 5px;
      font-size: 11px;
    }
    .lineage-section-title {
      font-size: 11px;
      font-weight: 700;
      color: #38bdf8;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      padding-bottom: 4px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .lineage-section-content {
      display: flex;
      align-items: center;
      min-height: 24px;
    }
    .lineage-sub-badge {
      font-size: 9.5px;
      color: #94a3b8;
      font-weight: normal;
    }
    .lineage-children-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      width: 100%;
      max-height: 84px;
      overflow-y: auto;
    }
    .lineage-prestige-val {
      font-size: 11.5px;
      color: #64748b;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    @media (max-width: 640px) {
      .lineage-traits-grid { grid-template-columns: 1fr; }
      .global-resource-panel, .control-panel, .event-log, #inspector-card {
        position: fixed; left: 8px; right: 8px; width: auto; max-width: none;
      }
      .global-resource-panel { top: 72px; bottom: auto; max-height: 34vh; overflow-y: auto; }
      #inspector-card { top: 72px; bottom: auto; max-height: 42vh; overflow-y: auto; }
      .control-panel { left: 8px; bottom: 8px; max-height: 30vh; overflow-y: auto; }
      .event-log { left: 8px; bottom: calc(30vh + 18px); width: auto; height: 150px; }
      .save-bar-card, .stat-bar { transform: scale(.9); transform-origin: top right; }
      .brand-subtitle { display: none; }
    }

    /* 控制面板 */
    /* 🐞 调试监视器浮窗 (生态时钟控制台正上方) */
    .debug-hud {
      position: absolute;
      bottom: 20px; right: 20px;
      width: 320px;
      box-sizing: border-box;
      background: rgba(10, 18, 30, 0.95);
      border: 1px solid rgba(167, 139, 250, 0.45);
      border-radius: 14px;
      padding: 10px 14px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.6);
      font-size: 10.5px;
      color: #cbd5e1;
      display: flex;
      flex-direction: column;
      gap: 3px;
      pointer-events: auto;
      z-index: 10;
    }
    .debug-hud-title {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      font-size: 12px;
      font-weight: 700;
      color: #a78bfa;
      border-bottom: 1px solid rgba(167, 139, 250, 0.25);
      padding-bottom: 5px;
      margin-bottom: 3px;
    }
    .debug-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      line-height: 1.45;
    }
    .debug-row .mono-num {
      color: #e2e8f0;
      font-weight: 700;
    }
    .debug-hud-tip {
      margin-top: 4px;
      font-size: 9px;
      color: #f59e0b;
      line-height: 1.3;
    }

    .control-panel {
      position: absolute;
      bottom: 20px; left: 20px;
      width: 360px;
      height: auto;
      box-sizing: border-box;
      background: rgba(10, 18, 30, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.14);
      padding: 16px;
      border-radius: 16px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.6);
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      gap: 8px;
      z-index: 10;
    }
    .panel-title {
      font-size: 13px;
      font-weight: 600;
      color: #cbd5e1;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      padding-bottom: 6px;
      display: flex;
      justify-content: space-between;
    }
    .btn-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    button {
      background: #1e293b;
      color: #f1f5f9;
      border: 1px solid rgba(255,255,255,0.1);
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    button:hover {
      background: #334155;
      border-color: #38bdf8;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
    }
    button.primary {
      background: linear-gradient(135deg, #0284c7, #2563eb);
      border: none;
    }
    button.ecology-btn {
      background: linear-gradient(135deg, #d97706, #059669);
      border: none;
      color: #ffffff;
      font-weight: 600;
    }
    button.ecology-btn:hover {
      background: linear-gradient(135deg, #b45309, #047857);
      box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
    }
    /* 🧠 无头模式按钮 (v1.9.0 置于重演生态右侧空位，节省一行) */
    button.headless-btn {
      background: rgba(245, 158, 11, 0.12);
      border: 1px solid #f59e0b;
      color: #f59e0b;
      font-weight: 600;
      font-size: 11px;
      letter-spacing: 0.3px;
    }
    button.headless-btn:hover {
      background: rgba(167, 139, 250, 0.25);
      border-color: #a78bfa;
      color: #c4b5fd;
      box-shadow: 0 0 14px rgba(167, 139, 250, 0.4);
    }
    .toggle-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;
      color: #94a3b8;
    }

    /* 事件日志播报栏 (与控制台完全等高 216px) */
    .event-log {
      position: absolute;
      bottom: 20px; left: 396px;
      width: 480px;
      max-width: calc(100vw - 420px);
      height: 216px;
      box-sizing: border-box;
      background: rgba(10, 18, 30, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 16px;
      padding: 14px 16px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.6);
      display: flex;
      flex-direction: column;
      gap: 6px;
      overflow: hidden;
      pointer-events: auto;
      z-index: 10;
    }
    .log-title {
      font-size: 12px;
      font-weight: 600;
      color: #94a3b8;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 2px;
    }
    .log-list {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column-reverse;
      gap: 4px;
      overflow-y: auto;
      font-size: 11px;
      font-family: inherit;
    }
    .log-entry {
      padding: 4px 8px;
      border-radius: 6px;
      background: rgba(255,255,255,0.03);
      border-left: 3px solid #38bdf8;
      animation: fadeIn 0.3s ease;
    }
    .log-entry.food { border-left-color: #10b981; color: #6ee7b7; }
    .log-entry.water { border-left-color: #0284c7; color: #7dd3fc; }
    .log-entry.camp { border-left-color: #f59e0b; color: #fde68a; }
    .log-entry.birth { border-left-color: #ec4899; color: #fbcfe8; }
    .log-entry.death { border-left-color: #ef4444; color: #fca5a5; }
    .log-entry.miscarry { border-left-color: #dc2626; color: #fca5a5; }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* 族谱顶部操作按钮 */
    .lineage-header-action-btn {
      background: rgba(56, 189, 248, 0.15);
      border: 1px solid rgba(56, 189, 248, 0.45);
      color: #38bdf8;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .lineage-header-action-btn:hover {
      background: rgba(56, 189, 248, 0.3);
      border-color: #38bdf8;
      color: #ffffff;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
      transform: translateY(-1px);
    }

    /* =========================================================================
       🌳 直系血脉 DAG 族谱模态弹窗与画布组件样式
       ========================================================================= */
    .dag-modal-overlay {
      position: fixed;
      top: 0; left: 0; width: 100vw; height: 100vh;
      background: rgba(0, 0, 0, 0.88);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1050;
      backdrop-filter: blur(8px);
    }
    .dag-modal-window {
      background: rgba(10, 18, 30, 0.98);
      border: 1px solid rgba(56, 189, 248, 0.45);
      border-radius: 16px;
      width: 95vw;
      height: 90vh;
      max-width: 1400px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.2);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .dag-modal-header {
      padding: 14px 20px;
      background: rgba(15, 23, 42, 0.95);
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      justify-content: space-between;
      align-items: center;
      z-index: 20;
    }
    .dag-modal-tools {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .dag-filter-group {
      display: flex;
      background: rgba(30, 41, 59, 0.6);
      border-radius: 6px;
      padding: 2px;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }
    .dag-tool-btn {
      background: rgba(30, 41, 59, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #cbd5e1;
      padding: 5px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.2s ease;
    }
    .dag-tool-btn:hover {
      background: rgba(56, 189, 248, 0.2);
      border-color: #38bdf8;
      color: #38bdf8;
    }
    .dag-tool-btn.active {
      background: #0284c7;
      border-color: #38bdf8;
      color: #ffffff;
    }
    .dag-tool-btn.primary {
      background: rgba(56, 189, 248, 0.2);
      border-color: #38bdf8;
      color: #38bdf8;
    }
    .dag-tool-btn.primary:hover {
      background: #0284c7;
      color: #ffffff;
      box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    }
    .dag-modal-close {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #94a3b8;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      font-size: 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      margin-left: 6px;
    }
    .dag-modal-close:hover {
      background: rgba(239, 68, 68, 0.25);
      border-color: #ef4444;
      color: #ef4444;
      transform: rotate(90deg);
    }
    .dag-modal-body {
      flex: 1;
      position: relative;
      background: radial-gradient(circle at 50% 50%, #0f172a 0%, #060a10 100%);
      overflow: hidden;
    }
    .dag-viewport-container {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0; left: 0;
      cursor: grab;
      overflow: hidden;
      touch-action: none;
      user-select: none;
    }
    .dag-viewport-container:active {
      cursor: grabbing;
    }
    /* ---- 虚拟化视图宿主 ---- */
    .dag-view-host {
      position: absolute;
      inset: 0;
      overflow: hidden;
      cursor: grab;
      user-select: none;
    }
    .dag-view-host:active { cursor: grabbing; }
    .dag-vp {
      position: absolute;
      top: 0; left: 0;
      transform-origin: 0 0;
      will-change: transform;
      pointer-events: none;
    }
    .dag-nodes-layer {
      position: absolute;
      top: 0; left: 0;
      width: 100%; height: 100%;
      pointer-events: none;
    }
    .dag-svg-layer {
      position: absolute;
      top: 0; left: 0;
      pointer-events: none;
    }
    /* ---- 时间刻度尺 ---- */
    .dag-ruler {
      position: absolute;
      top: 0; left: 0;
      width: 74px; height: 100%;
      background: linear-gradient(90deg, rgba(9,14,23,0.96) 60%, rgba(9,14,23,0.55) 100%);
      border-right: 1px solid rgba(56,189,248,0.18);
      pointer-events: none;
      z-index: 5;
    }
    .dag-ruler-mark {
      position: absolute;
      left: 0; width: 68px;
      text-align: right; padding-right: 8px;
      font-size: 10px; color: #64748b;
      transform: translateY(-50%);
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .dag-ruler-mark.major { color: #94a3b8; font-weight: 600; }
    .dag-ruler-mark.major::after {
      content: '';
      position: absolute; right: -6px; top: 50%;
      width: 10px; height: 1px; background: rgba(56,189,248,0.35);
    }
    /* ---- 亲子边 ---- */
    .dag-edge {
      fill: none;
      stroke: rgba(148, 163, 184, 0.45);
      stroke-width: 2;
      vector-effect: non-scaling-stroke;
      transition: opacity 0.18s, stroke-width 0.18s;
    }
    .dag-edge.father-edge {
      stroke: #38bdf8;
      stroke-width: 2.2;
      marker-end: url(#dag-arrow-father);
    }
    .dag-edge.mother-edge {
      stroke: #f472b6;
      stroke-width: 2.2;
      marker-end: url(#dag-arrow-mother);
    }
    .dag-edge.descendant.father-edge {
      stroke: #38bdf8;
      stroke-width: 2.8;
      filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
    }
    .dag-edge.descendant.mother-edge {
      stroke: #ec4899;
      stroke-width: 2.8;
      filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.6));
    }
    .dag-edge.rel { opacity: 1; stroke-width: 3; }
    .dag-edge.faded { opacity: 0.12; }
    .lod-block .dag-edge { stroke-width: 1.1; marker-end: none; }
    .lod-block .dag-edge.rel { stroke-width: 2; }
    /* ---- 节点卡片 ---- */
    .dag-node {
      position: absolute;
      width: 184px;
      height: 80px;
      background: rgba(15, 23, 42, 0.94);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 10px;
      padding: 8px 10px;
      pointer-events: auto;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 4px;
      box-shadow: 0 6px 16px rgba(0,0,0,0.4);
      cursor: pointer;
      transition: opacity 0.18s, box-shadow 0.18s, border-color 0.18s;
    }
    .dag-node:hover {
      border-color: #38bdf8;
      box-shadow: 0 10px 24px rgba(56, 189, 248, 0.25);
      z-index: 10;
    }
    .dag-node.focus {
      border: 2px solid #ef4444;
      box-shadow: 0 0 22px rgba(239, 68, 68, 0.55), 0 8px 24px rgba(0,0,0,0.6);
      background: rgba(48, 14, 18, 0.98);
      z-index: 20;
    }
    .dag-node.ancestor {
      border-color: rgba(251, 191, 36, 0.8);
      background: rgba(36, 28, 12, 0.92);
    }
    .dag-node.descendant {
      border-color: rgba(56, 189, 248, 0.7);
      background: rgba(12, 32, 48, 0.92);
    }
    .dag-node.spine { box-shadow: 0 0 0 2px rgba(226,232,240,0.35), 0 6px 18px rgba(0,0,0,0.5); }
    .dag-node.dead { opacity: 0.72; filter: grayscale(0.4); }
    .dag-node.rel { opacity: 1; border-color: #38bdf8; }
    .dag-node.faded { opacity: 0.16; }
    /* LOD 概览档: 仅色块编码性别/生死/主干 */
    .dag-node--block {
      padding: 0; border-radius: 8px;
      background: #1e3a5f; border-color: rgba(255,255,255,0.18);
      box-shadow: none;
    }
    .dag-node--block.ancestor, .dag-node--block.descendant { background: #1e3a5f; }
    .dag-node.focus { border-color: #ef4444; box-shadow: 0 0 22px rgba(239,68,68,0.55); background: rgba(48,14,18,0.98); }
    .dag-node--block.female { background: #4c1d3a; }
    .dag-node--block.dead { background: #334155; opacity: 0.55; }
    .dag-node--block.spine { border-color: #e2e8f0; box-shadow: 0 0 0 1px rgba(226,232,240,0.5); }
    .dag-node--block.focus { background: #ef4444; border-color: #fecaca; }
    .dag-node--block .dag-node-dot { display: none; }
    .dag-node--simple { justify-content: center; }
    .dag-node-line { display: flex; align-items: center; gap: 8px; justify-content: center; }
    .dag-node-id { font-size: 14px; font-weight: 700; color: #f8fafc; }
    .dag-node-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .dag-node-name {
      font-size: 12px;
      font-weight: 700;
      color: #f8fafc;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .dag-node-gen {
      font-size: 9px;
      padding: 1px 5px;
      border-radius: 4px;
      background: #334155;
      color: #94a3b8;
    }
    .dag-node-status {
      font-size: 10px;
      color: #94a3b8;
      display: flex;
      justify-content: space-between;
    }
    .dag-node-traits {
      display: flex;
      gap: 6px;
      font-size: 9px;
      color: #cbd5e1;
      border-top: 1px solid rgba(255,255,255,0.06);
      padding-top: 3px;
    }
    /* 时间密度滑块 */
    .dag-density {
      display: flex; align-items: center; gap: 8px;
      padding: 3px 8px; border-radius: 6px;
      background: rgba(30,41,59,0.7); border: 1px solid rgba(255,255,255,0.08);
    }
    .dag-density input[type=range] { width: 110px; accent-color: #38bdf8; }
    .dag-floating-inspector {
      position: absolute;
      top: 16px; right: 16px;
      width: 290px;
      background: rgba(15, 23, 42, 0.96);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 12px;
      box-shadow: 0 16px 40px rgba(0,0,0,0.7);
      padding: 14px 16px;
      z-index: 110;
      backdrop-filter: blur(10px);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .dag-insp-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      padding-bottom: 6px;
    }
    .dag-insp-body {
      font-size: 11px;
      line-height: 1.6;
      color: #cbd5e1;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .dag-help-tip {
      position: absolute;
      bottom: 15px; left: 20px;
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 20px;
      padding: 6px 14px;
      font-size: 11px;
      color: #94a3b8;
      pointer-events: none;
      z-index: 50;
    }

/* ═══════════════════════════════════════════════════════════
   ★ 账本与家户/婚姻系统样式 (v0.9.72 M1)
   ═══════════════════════════════════════════════════════════ */

/* 家户与账本大盘面板 (与 global-averages-card / ecology-legend 风格对齐) */
.ledger-panel {
  width: 100%;
  background: rgba(10, 18, 30, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.28);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: auto;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ledger-panel.minimized {
  gap: 0;
  padding: 10px 14px;
}
.ledger-panel.minimized .ledger-panel-body {
  display: none;
}
.ledger-panel.minimized .legend-title {
  border-bottom: none;
  padding-bottom: 0;
}
.ledger-panel-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}
.ledger-panel-body::-webkit-scrollbar { width: 4px; }
.ledger-panel-body::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); border-radius: 2px; }

/* 概览统计行 */
.ledger-overview-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ledger-overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.ledger-ov-lbl { font-size: 9px; color: #64748b; }
.ledger-ov-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 分区标题 */
.ledger-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 4px;
  padding-left: 2px;
}

/* 家户列表项 */
.ledger-household-list { display: flex; flex-direction: column; gap: 3px; }
.ledger-hh-item {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ledger-hh-item:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(245, 158, 11, 0.4);
}
.ledger-hh-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ledger-hh-id { font-size: 10px; font-weight: 700; color: #f59e0b; min-width: 42px; }
.ledger-hh-head-name { font-size: 10px; }
.ledger-hh-members { font-size: 9px; color: #94a3b8; }
.ledger-hh-bal-total { font-size: 9px; color: #fbbf24; margin-left: auto; }
.ledger-hh-item-bal {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  padding-left: 42px;
}
.ledger-hh-more, .ledger-empty {
  font-size: 9px;
  color: #64748b;
  text-align: center;
  padding: 4px;
}

/* 婚姻列表项 */
.ledger-marriage-list { display: flex; flex-direction: column; gap: 3px; }
.ledger-mg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(236, 72, 153, 0.12);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 9.5px;
}
.ledger-mg-id { color: #ec4899; font-weight: 700; min-width: 42px; }
.ledger-mg-dur { color: #94a3b8; margin-left: auto; font-variant-numeric: tabular-nums; }

/* Agent Inspector 中的家户卡片 */
.ledger-household-card, .ledger-marriage-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 9.5px;
}
.ledger-marriage-card { border-color: rgba(236, 72, 153, 0.25); }
.ledger-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  font-weight: 700;
  color: #e2e8f0;
}
.ledger-role-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  font-weight: 600;
}
.ledger-hh-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #cbd5e1;
  margin-bottom: 4px;
}
.ledger-hh-info b { color: #f8fafc; }
.ledger-balances-title {
  font-size: 9px;
  color: #94a3b8;
  margin-bottom: 2px;
  font-weight: 600;
}
.ledger-balances-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}
.ledger-balance-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  padding: 2px 0;
  font-size: 9px;
}
.ledger-balance-chip .mono-num { font-weight: 700; color: #f1f5f9; }
.ledger-events-title {
  font-size: 9px;
  color: #94a3b8;
  margin-top: 4px;
  margin-bottom: 2px;
  font-weight: 600;
}
.ledger-events-list { max-height: 60px; overflow-y: auto; }
.ledger-events-list::-webkit-scrollbar { width: 3px; }
.ledger-events-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); }
.ledger-event-item {
  font-size: 8.5px;
  color: #94a3b8;
  padding: 1px 0;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* 婚姻登记卡片内布局 */
.ledger-mg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #cbd5e1;
  padding: 1px 0;
}
.ledger-mg-row b { color: #f8fafc; }
.ledger-mg-history-title {
  font-size: 9px;
  color: #94a3b8;
  margin-top: 3px;
  margin-bottom: 2px;
  font-weight: 600;
}
.ledger-mg-history-list { max-height: 48px; overflow-y: auto; }
.ledger-mg-history-list::-webkit-scrollbar { width: 3px; }
.ledger-mg-history-item {
  font-size: 8.5px;
  color: #64748b;
  padding: 1px 0;
  line-height: 1.3;
}

/* ═══════ M2 账本 UI 新增样式 ═══════ */

/* 标签页切换器 */
.ledger-tab-switcher {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ledger-tab-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  padding: 4px 2px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ledger-tab-btn:hover:not(.disabled) {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
}
.ledger-tab-btn.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.5);
  color: #f59e0b;
}
.ledger-tab-btn[data-tab="marriage"].active {
  background: rgba(236, 72, 153, 0.12);
  border-color: rgba(236, 72, 153, 0.5);
  color: #ec4899;
}
.ledger-tab-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(30, 41, 59, 0.3);
}

/* 标签页内容容器 */
.ledger-tab-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 账面余额可点击区域 */
.ledger-bal-click {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s;
}
.ledger-bal-click:hover {
  background: rgba(245, 158, 11, 0.08);
}

/* 分家标记 */
.ledger-split-badge {
  position: relative;
  font-size: 8.5px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 3px;
  padding: 0 4px;
  cursor: help;
  white-space: nowrap;
}
.ledger-split-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  background: rgba(10, 18, 30, 0.98);
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 9px;
  color: #cbd5e1;
  white-space: normal;
  width: 180px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  pointer-events: none;
}
.ledger-split-badge:hover .ledger-split-tooltip {
  display: block;
}
.split-tip-title { font-weight: 700; color: #f59e0b; margin-bottom: 3px; }
.split-tip-formula { color: #e2e8f0; margin-bottom: 2px; }
.split-tip-ratio { color: #e2e8f0; margin-bottom: 2px; }
.split-tip-note { font-size: 8px; color: #64748b; margin-top: 3px; line-height: 1.3; }

/* 已解散家户样式 */
.ledger-hh-item.ledger-dissolved {
  background: rgba(30, 41, 59, 0.35);
  border-color: rgba(100, 116, 139, 0.2);
  opacity: 0.75;
}
.ledger-hh-item.ledger-dissolved:hover {
  opacity: 0.95;
  border-color: rgba(100, 116, 139, 0.5);
}
.ledger-dissolved-tag {
  font-size: 8.5px;
  color: #94a3b8;
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 3px;
  padding: 0 4px;
  white-space: nowrap;
}

/* 家户大事记内嵌 */
.ledger-hh-events {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.ledger-event-item.event-split {
  color: #f59e0b;
  font-weight: 600;
}

/* 流水穿透抽屉 */
.ledger-journal-drawer {
  margin-top: 5px;
  background: rgba(5, 10, 20, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  overflow: hidden;
  animation: journalSlideUp 0.2s ease-out;
}
@keyframes journalSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ledger-journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  font-size: 9.5px;
  font-weight: 700;
  color: #f59e0b;
}
.ledger-journal-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 11px;
  padding: 0 4px;
  line-height: 1;
}
.ledger-journal-close:hover { color: #ef4444; }
.ledger-journal-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 3px 6px;
}
.ledger-journal-list::-webkit-scrollbar { width: 3px; }
.ledger-journal-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); border-radius: 2px; }
.ledger-journal-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 8.5px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  flex-wrap: wrap;
}
.journal-tick {
  color: #475569;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}
.journal-reason {
  color: #cbd5e1;
  min-width: 52px;
  font-weight: 600;
}
.journal-res {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
}
.journal-flow {
  color: #64748b;
  font-size: 8px;
  margin-left: auto;
  word-break: break-all;
}

/* 继承清算档案 */
.ledger-inherit-archive {
  margin-top: 5px;
  background: rgba(5, 10, 20, 0.85);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 6px;
  padding: 6px 8px;
  animation: journalSlideUp 0.2s ease-out;
}
.ledger-inherit-header {
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ledger-inherit-row {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: #94a3b8;
  padding: 1px 0;
}
.ledger-inherit-row b { color: #e2e8f0; }
.ledger-inherit-subtitle {
  font-size: 9px;
  font-weight: 700;
  color: #a78bfa;
  margin: 4px 0 2px;
}
.ledger-absolve {
  margin-top: 5px;
  padding: 4px 6px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 4px;
  font-size: 8.5px;
  color: #fbbf24;
  text-align: center;
}

/* 公仓兜底余额卡片 */
.ledger-public-granary {
  margin-top: 4px;
}
.ledger-public-granary-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 6px;
  padding: 5px 8px;
}
.pg-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 3px;
}
.pg-total {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 600;
}
.pg-balances {
  display: flex;
  gap: 10px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.pg-bal-chip { white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   ★ M3 宗族系统 UI 样式 (翡翠绿 #10b981 主题)
   ═══════════════════════════════════════════════════════════ */
.ledger-clan-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.clan-card {
  background: rgba(10, 18, 30, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 7px;
  padding: 6px 8px;
  backdrop-filter: blur(6px);
  transition: border-color 0.15s ease;
}
.clan-card:hover {
  border-color: rgba(16, 185, 129, 0.5);
}
.clan-card.clan-journal-open {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}
/* ★ v1.9.0 绝嗣宗族视觉提醒（Task11：所有男性已亡，族产已平分/入公仓） */
.clan-card.clan-extinct {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(60, 10, 16, 0.4);
}
.clan-card.clan-extinct:hover {
  border-color: rgba(239, 68, 68, 0.8);
}
.clan-extinct-badge {
  color: #f87171;
  font-weight: 700;
  font-style: normal;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
}
.clan-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.clan-emblem {
  font-size: 13px;
  filter: drop-shadow(0 0 3px rgba(16,185,129,0.4));
}
.clan-title {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.5px;
}
.clan-leader {
  font-size: 9px;
  color: #cbd5e1;
  margin-left: auto;
}
.clan-leader .lineage-chip {
  font-size: 9px;
}
.clan-frozen {
  color: #64748b;
  font-style: italic;
}
.clan-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: #94a3b8;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.clan-bal-total {
  font-weight: 700;
  color: #10b981;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(16,185,129,0.08);
  transition: background 0.15s;
}
.clan-bal-total:hover {
  background: rgba(16,185,129,0.18);
}
.clan-balances {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.clan-bal-chip { white-space: nowrap; }

/* 族税进度条 */
.clan-tribute-bar {
  margin-top: 4px;
}
.clan-tribute-label {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: #94a3b8;
  margin-bottom: 2px;
}
.clan-tribute-pct {
  color: #10b981;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.clan-tribute-track {
  height: 4px;
  background: rgba(16,185,129,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.clan-tribute-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981, #34d399);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 互助救济气泡 */
.clan-aid-bubble {
  margin-top: 4px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 3px solid #10b981;
  border-radius: 4px;
  padding: 4px 6px;
}
.clan-aid-item {
  font-size: 8.5px;
  color: #6ee7b7;
  line-height: 1.4;
  padding: 1px 0;
}

/* 近期宗族流水 */
.clan-recent-journal {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.clan-journal-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
  font-size: 8.5px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  flex-wrap: wrap;
}

/* 族长顺位 */
.clan-succession {
  margin-top: 4px;
  border-top: 1px solid rgba(16,185,129,0.12);
  padding-top: 3px;
}
.clan-succession-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
  transition: color 0.15s;
}
.clan-succession-toggle:hover {
  color: #10b981;
}
.clan-succession-arrow {
  font-size: 7px;
  color: #10b981;
  width: 10px;
  display: inline-block;
}
.clan-succession-list {
  margin-top: 2px;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: journalSlideUp 0.15s ease-out;
}
.clan-heir-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  padding: 1px 0;
}
.clan-heir-rank {
  color: #f59e0b;
  font-weight: 700;
  min-width: 16px;
}
.clan-heir-age {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.clan-heir-current {
  color: #10b981;
  font-weight: 700;
  font-size: 8px;
  background: rgba(16,185,129,0.1);
  padding: 0 4px;
  border-radius: 3px;
}

/* ═══════════ ★ M4 王国标签页样式 ═══════════ */
.kingdom-card {
  background: rgba(10,18,30,0.96);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kingdom-card:hover {
  border-color: rgba(251,191,36,0.5);
  box-shadow: 0 0 12px rgba(251,191,36,0.1);
}
.kingdom-card.kingdom-journal-open {
  border-color: rgba(251,191,36,0.6);
  box-shadow: 0 0 16px rgba(251,191,36,0.15);
}
.kingdom-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.kingdom-emblem { font-size: 14px; }
.kingdom-title {
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.5px;
}
.kingdom-king {
  font-size: 9.5px;
  color: #e2e8f0;
  margin-left: auto;
}
.kingdom-vacant {
  color: #f87171;
  font-weight: 600;
  animation: vacantPulse 2s ease-in-out infinite;
}
@keyframes vacantPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.kingdom-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 8.5px;
  color: #94a3b8;
  margin-bottom: 3px;
}
.kingdom-bal-total {
  margin-left: auto;
  color: #fbbf24;
  font-weight: 700;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(251,191,36,0.08);
  transition: background 0.15s;
}
.kingdom-bal-total:hover { background: rgba(251,191,36,0.18); }
.kingdom-balances {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 3px 0;
  border-top: 1px solid rgba(251,191,36,0.08);
  border-bottom: 1px solid rgba(251,191,36,0.08);
  cursor: pointer;
  margin-bottom: 3px;
}
.kingdom-bal-chip {
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kingdom-tax-bar { margin-bottom: 4px; }
.kingdom-tax-label {
  font-size: 8.5px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}
.kingdom-tax-pct { color: #fbbf24; font-weight: 700; }
.kingdom-tax-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.kingdom-tax-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 2px;
  transition: width 0.3s;
}
.kingdom-relief-bubble {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 6px;
  padding: 3px 6px;
  margin-bottom: 4px;
}
.kingdom-relief-item {
  font-size: 8.5px;
  color: #fde68a;
  line-height: 1.4;
}
.kingdom-arrival, .kingdom-succession {
  margin-top: 3px;
  border-top: 1px solid rgba(251,191,36,0.1);
  padding-top: 2px;
}
.kingdom-arrival-toggle, .kingdom-succession-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
  transition: color 0.15s;
}
.kingdom-arrival-toggle:hover, .kingdom-succession-toggle:hover { color: #fbbf24; }
.kingdom-arrow {
  font-size: 7px;
  color: #fbbf24;
  width: 10px;
  display: inline-block;
}
.kingdom-arrival-list, .kingdom-succession-list {
  margin-top: 2px;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: journalSlideUp 0.15s ease-out;
}
.kingdom-arrival-item, .kingdom-heir-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  padding: 1px 0;
}
.kingdom-arrival-rank, .kingdom-heir-rank {
  color: #f59e0b;
  font-weight: 700;
  min-width: 16px;
}
.kingdom-arrival-tick, .kingdom-heir-age {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.kingdom-founder-tag {
  color: #fbbf24;
  font-weight: 700;
  font-size: 8px;
  background: rgba(251,191,36,0.12);
  padding: 0 4px;
  border-radius: 3px;
}
.kingdom-heir-current {
  color: #fbbf24;
  font-weight: 700;
  font-size: 8px;
  background: rgba(251,191,36,0.12);
  padding: 0 4px;
  border-radius: 3px;
}
.kingdom-heir-crown {
  color: #fde68a;
  font-weight: 700;
  font-size: 8px;
  background: rgba(251,191,36,0.18);
  border: 1px solid rgba(251,191,36,0.3);
  padding: 0 4px;
  border-radius: 3px;
}
.kingdom-expedition {
  margin-top: 3px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 5px;
  padding: 3px 6px;
}
.kingdom-expedition-title {
  font-size: 9px;
  color: #f87171;
  font-weight: 700;
  margin-bottom: 2px;
}
.kingdom-expedition-list {
  font-size: 8.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}
.kingdom-empty {
  font-size: 8.5px;
  color: #64748b;
  padding: 2px 0;
}
.event-coronation {
  color: #fbbf24 !important;
  font-weight: 600;
  background: rgba(251,191,36,0.08) !important;
}
.clan-succession-empty {
  font-size: 8.5px;
  color: #64748b;
  font-style: italic;
  padding: 2px 0;
}

/* ==========================================================================
   马斯洛决策引擎视图 (decision-viz) · 深色科技 / 轻玻璃拟态
   ========================================================================== */
.dviz-window { width: 92vw; height: 88vh; }
.dviz-body { flex: 1; display: flex; min-height: 0; }
.dviz-left, .dviz-right {
  flex: 0 0 auto; overflow: auto; padding: 12px 12px 20px;
  background: linear-gradient(180deg, rgba(10,18,30,.72), rgba(7,13,23,.6));
}
.dviz-left { width: 236px; border-right: 1px solid rgba(255,255,255,.07); }
.dviz-right { width: 308px; border-left: 1px solid rgba(255,255,255,.07); }
.dviz-center { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── 左栏面板 ── */
.dviz-panel { margin-bottom: 16px; }
.dviz-panel-head {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 2px 8px;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px;
}
.dviz-panel-title { font-size: 12px; font-weight: 700; color: #e5eef7; letter-spacing: .5px; }
.dviz-panel-sub { font-size: 10px; color: #64748b; margin-left: auto; }

/* ── 操作指引 ── */
.dviz-legend { display: flex; flex-direction: column; gap: 10px; }
.dviz-legend-item { display: flex; gap: 10px; align-items: flex-start; }
.dviz-legend-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; margin-top: 1px;
}
.dviz-legend-item b { display: block; font-size: 12px; color: #e5eef7; line-height: 1.4; font-weight: 700; }
.dviz-legend-item div > span { display: block; font-size: 10px; color: #8aa0b5; line-height: 1.55; margin-top: 1px; }

/* ── 工具栏 ── */
.dviz-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
                border-bottom: 1px solid rgba(255,255,255,.1); flex: 0 0 auto; }
.dviz-status { font-size: 12px; color: #8aa0b5; padding: 3px 10px; border-radius: 7px;
               border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.03); transition: .15s; }

/* ── 中央画布 ── */
.dviz-viewport {
  flex: 1; position: relative; overflow: hidden; cursor: grab; background:
    radial-gradient(1200px 600px at 30% 20%, rgba(56,189,248,.05), transparent 60%),
    radial-gradient(900px 500px at 80% 80%, rgba(16,185,129,.04), transparent 60%), #070d17;
}
.dviz-viewport.dv-panning { cursor: grabbing; }
.dviz-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }

/* ── 右栏检查器 ── */
.dviz-empty { text-align: center; padding: 40px 14px 20px; }
.dviz-empty-ico { font-size: 38px; opacity: .85; margin-bottom: 12px; }
.dviz-empty-title { font-size: 14px; font-weight: 700; color: #cbd5e1; }
.dviz-empty-sub { font-size: 11px; color: #8aa0b5; margin-top: 8px; line-height: 1.7; }
.dviz-insp-card { border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.03); overflow: hidden; }
.dviz-insp-head {
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,.045), transparent);
}
.dviz-insp-title b { display: block; font-size: 14px; color: #f1f5f9; letter-spacing: .2px; }
.dviz-insp-title span { display: block; font-size: 10px; color: #8aa0b5; margin-top: 2px; }
.dviz-insp-body { padding: 8px 14px 12px; font-size: 12px; line-height: 1.7; }
.dviz-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.05); }
.dviz-row:last-child { border-bottom: none; }
.dviz-k { color: #8aa0b5; flex: 0 0 62px; font-size: 11px; padding-top: 2px; }
.dviz-v { color: #e5eef7; word-break: break-all; font-size: 12px; }
.dviz-sub { font-size: 11px; color: #8aa0b5; margin-top: 8px; line-height: 1.6; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.05); }
.dviz-code { font-family: Consolas, Menlo, monospace; font-size: 11px; color: #38bdf8;
             background: rgba(56,189,248,.08); padding: 2px 6px; border-radius: 5px; display: inline-block; }
.dviz-cfg { font-family: Consolas, Menlo, monospace; font-size: 11px; color: #fbbf24;
            background: rgba(251,191,36,.07); padding: 2px 6px; border-radius: 5px; display: inline-block; margin: 2px 2px 2px 0; }
.dviz-chip { font-size: 10px; font-weight: 700; color: #fff; padding: 3px 9px; border-radius: 6px; white-space: nowrap; flex: 0 0 auto; }

/* ── 节点卡 ── */
.dv-node {
  position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
  background: rgba(14,24,38,.95); box-shadow: 0 6px 18px rgba(0,0,0,.45);
  cursor: grab; user-select: none; padding: 8px 10px; box-sizing: border-box;
  transition: top .16s ease, box-shadow .15s, opacity .15s;
}
.dv-node:hover { box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.dv-node.dv-dragging { cursor: grabbing; box-shadow: 0 0 0 2px #38bdf8, 0 10px 28px rgba(0,0,0,.7); z-index: 9; transition: none; }
.dv-node.dv-selected { box-shadow: 0 0 0 2px #fbbf24, 0 8px 24px rgba(0,0,0,.6); }
.dv-node.dv-dim { opacity: .18; }
.dv-tag { font-size: 10px; color: #8aa0b5; letter-spacing: 1px; }
.dv-title { font-weight: 700; font-size: 13px; margin-top: 2px; line-height: 1.35; }
.dv-sub { font-size: 11px; color: #8aa0b5; margin-top: 3px; line-height: 1.45; }
.dv-result { font-size: 12px; font-weight: 600; margin-top: 3px; }
.dv-cols { display: flex; gap: 10px; align-items: stretch; height: 100%; }
.dv-col { flex: 1 1 54%; min-width: 0; }
.dv-col-l { flex: 1 1 46%; border-right: 1px solid rgba(255,255,255,.1); padding-right: 10px; }
.dv-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.dv-fsm {
  font-size: 10px; padding: 3px 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04);
  color: #e5eef7; display: inline-flex; align-items: baseline; gap: 5px;
}
.dv-fsm code { font-size: 9px; color: #64748b; font-family: Consolas, Menlo, monospace; }
.dv-kind-branch { border-left: 4px solid #38bdf8; }
.dv-branch-id {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 12px; font-weight: 800; color: #38bdf8; letter-spacing: .3px;
  margin-bottom: 3px;
}

/* ── 分界线（热区加宽：DIV_H=40 · 整条横贯卡宽 · 抓取手柄居中） ── */
.dv-kind-divider {
  border: none; background: transparent; box-shadow: none; padding: 0;
  cursor: grab; height: 40px; border-radius: 0;
}
.dv-kind-divider:hover { box-shadow: none; }
.dv-div {
  display: flex; align-items: center; gap: 10px; height: 100%;
  border-radius: 9px; padding: 0 6px;
  border: 1px dashed rgba(255,255,255,.14); background: rgba(255,255,255,.02);
}
.dv-kind-divider:hover .dv-div { border-color: rgba(56,189,248,.45); background: rgba(56,189,248,.05); }
.dv-kind-divider.dv-dragging .dv-div { border-color: rgba(56,189,248,.7); background: rgba(56,189,248,.09); }
.dv-line { flex: 1; border-top: 2px dashed rgba(255,255,255,.28); }
.dv-grab {
  font-size: 10px; font-weight: 700; color: #b6c6d6; white-space: nowrap;
  padding: 4px 12px; border-radius: 999px; letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(14,24,38,.9);
}

/* ══════════════════════════════════════════════════════════════
   💾 读档 / 存档系统 (v1.7.0)
   沿用暗色玻璃拟态：深底 + 细描边 + 蓝青渐变高亮 + 等宽数字
   ══════════════════════════════════════════════════════════════ */

/* 顶栏存档入口 */
.save-bar-card {
  display: flex;
  gap: 8px;
  pointer-events: auto;
  background: rgba(10, 18, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.save-bar-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(96, 165, 250, 0.10));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.18s ease;
}
.save-bar-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.34), rgba(96, 165, 250, 0.22));
  border-color: rgba(56, 189, 248, 0.7);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.28);
}
.save-bar-btn:active { transform: translateY(0); }

/* 存档面板 */
.save-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 16, 0.62);
  backdrop-filter: blur(3px);
  animation: saveFadeIn 0.16s ease;
}

@keyframes saveFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes savePopIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.save-modal {
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  box-sizing: border-box;
  background: linear-gradient(160deg, rgba(17, 26, 46, 0.98), rgba(11, 18, 32, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  padding: 16px 18px 14px;
  animation: savePopIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  font-size: 12px;
  color: #e2e8f0;
}

.save-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.save-modal-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  transition: all 0.16s ease;
}
.save-modal-close:hover { color: #fff; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.14); }

.save-tab-switcher {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(2, 6, 16, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.save-tab-btn {
  flex: 1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.save-tab-btn:hover { color: #e2e8f0; background: rgba(255, 255, 255, 0.05); }
.save-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.32), rgba(96, 165, 250, 0.18));
  border-color: rgba(56, 189, 248, 0.5);
}

.save-slot-list { display: flex; flex-direction: column; gap: 10px; }

.save-slot-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.18s ease;
}
.save-slot-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.06);
  transform: translateY(-1px);
}
.save-slot-card.empty { opacity: 0.75; }

.save-slot-head { display: flex; align-items: center; justify-content: space-between; }
.save-slot-name { font-size: 13px; font-weight: 600; }
.save-slot-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  color: #60a5fa;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.save-slot-badge.muted { color: #94a3b8; background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.25); }

.save-slot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
}
.save-slot-meta b { color: #38bdf8; font-weight: 700; }
.save-slot-desc { font-size: 11px; color: #64748b; }
.save-slot-time { margin-top: 6px; font-size: 10px; color: #64748b; }

.save-slot-actions { display: flex; gap: 6px; margin-top: 10px; }
.save-slot-btn {
  flex: 1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.16s ease;
}
.save-slot-btn:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.save-slot-btn.primary {
  color: #e0f2fe;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.26), rgba(96, 165, 250, 0.14));
  border-color: rgba(56, 189, 248, 0.45);
}
.save-slot-btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.42), rgba(96, 165, 250, 0.24));
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}
.save-slot-btn.danger:hover:not(:disabled) {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
}
.save-slot-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.save-status { min-height: 14px; margin-top: 12px; font-size: 11px; color: #94a3b8; }
.save-status.ok { color: #10b981; }
.save-status.err { color: #ef4444; }

.save-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.save-btn.import {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(56, 189, 248, 0.45);
  transition: all 0.16s ease;
}
.save-btn.import:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.8);
}
.save-hint { font-size: 10px; line-height: 1.5; color: #64748b; }

/* 本地文件存档卡片（v1.11.0） */
.save-slot-card.local-file-card {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(255, 255, 255, 0.02));
}
.save-slot-card.local-file-card:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.09), rgba(255, 255, 255, 0.03));
}
.save-slot-badge.local-connected {
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
}
#insp-camp-treasury-box {
  transition: all 0.2s ease;
}
#insp-camp-treasury-box:hover {
  background: rgba(251, 191, 36, 0.08) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
}

/* ══════════ 营地辖区详情模态框 (v1.12.0) ══════════ */
.camp-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.camp-detail-modal {
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: campDetailIn 0.2s ease-out;
}
@keyframes campDetailIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.camp-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(250, 204, 21, 0.06);
}
.camp-detail-header span {
  font-size: 14px;
  font-weight: 700;
  color: #facc15;
}
.camp-detail-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.camp-detail-close:hover { color: #f87171; background: rgba(248, 113, 113, 0.1); }
.camp-detail-body {
  padding: 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.camp-detail-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.camp-detail-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #facc15;
  letter-spacing: 0.3px;
  padding-bottom: 2px;
  border-bottom: 1px dashed rgba(250, 204, 21, 0.15);
}
.camp-detail-content {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.6;
}
.camp-detail-ledger {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.camp-detail-journal {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.5;
  margin-top: 4px;
}
.camp-detail-btn:hover {
  background: rgba(250, 204, 21, 0.2) !important;
  border-color: rgba(250, 204, 21, 0.55) !important;
}

/* ══════════ 🏛️ 房屋拍卖交易所模态大盘 (v1.15.0) ══════════ */
.house-auction-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
.house-auction-modal {
  width: min(1240px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: linear-gradient(165deg, #1e293b, #0f172a 90%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 158, 11, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: auctionModalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Compact auction dashboard: give the two live columns room while keeping the
   modal usable on laptop screens. */
.house-auction-body { overflow:auto; }
.auction-details-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap:10px; }
.auction-buyers-list, .auction-bids-feed, .auction-deals-list { max-height:240px; overflow:auto; }
@media (max-width: 760px) {
  .house-auction-modal { max-height:calc(100vh - 20px); }
  .auction-details-grid { grid-template-columns:1fr; }
}
@keyframes auctionModalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.house-auction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(245, 158, 11, 0.08);
}
.house-auction-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.house-auction-title {
  font-size: 15px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.4px;
}
.house-auction-count-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
}
.house-auction-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.house-auction-close:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.house-auction-nav-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.house-auction-tabs {
  display: flex;
  gap: 8px;
}
.auction-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.auction-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}
.auction-tab-btn.active {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
}

.auction-house-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.auction-house-strip::-webkit-scrollbar {
  height: 4px;
}
.auction-house-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.auction-strip-card {
  min-width: 130px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.auction-strip-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}
.auction-strip-card.selected {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}
.strip-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #f8fafc;
}
.strip-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #94a3b8;
}

.house-auction-body {
  padding: 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 220px);
}
.auction-view-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 核心资产信息卡 */
.auction-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
}
.auction-hero-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auction-hero-tier-icon {
  font-size: 32px;
}
.auction-hero-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auction-hero-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.auction-phase-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}
.auction-phase-pill.obs {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}
.auction-phase-pill.dec {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}
.auction-phase-pill.clr {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}
.auction-camp-chip {
  font-size: 10px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 4px;
  padding: 1px 6px;
}
.auction-hero-sub {
  font-size: 11px;
  color: #94a3b8;
}
.auction-hero-valuation {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auction-hero-price {
  font-size: 20px;
  font-weight: 800;
  color: #fbbf24;
}
.auction-hero-land-status {
  font-size: 10px;
}

/* 🌾 麦穗时间轴标尺 */
.auction-timeline-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auction-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.auction-timeline-title {
  font-size: 12px;
  color: #f8fafc;
}
.auction-timeline-legend {
  display: flex;
  gap: 8px;
  font-size: 10px;
}
.legend-pip {
  padding: 1px 6px;
  border-radius: 4px;
}
.legend-pip.obs { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.legend-pip.dec { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.legend-pip.clr { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.auction-timeline-bar-wrapper {
  position: relative;
  height: 38px;
  margin: 6px 0 2px 0;
}
.auction-timeline-track {
  position: relative;
  width: 100%;
  height: 20px;
  background: #090d16;
  border-radius: 4px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.auction-timeline-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 9px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.auction-timeline-segment.obs {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.45));
  border-right: 2px dashed #fbbf24;
  color: #fef08a;
}
.auction-timeline-segment.dec {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.45));
  border-right: 2px dashed #38bdf8;
  color: #bae6fd;
}
.auction-timeline-segment.clr {
  background: rgba(239, 68, 68, 0.4);
  border-right: 2px solid #ef4444;
  color: #fca5a5;
}
.segment-label {
  white-space: nowrap;
  padding: 0 4px;
  pointer-events: none;
}
.timeline-threshold-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  pointer-events: none;
  z-index: 5;
}
.timeline-threshold-line.obs-threshold {
  background: #fbbf24;
}
.timeline-threshold-line.deadline-threshold {
  background: #ef4444;
}
.threshold-tag {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8.5px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 4px;
  border-radius: 3px;
}

/* 实时耐久移动指针 */
.timeline-needle {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  pointer-events: none;
  z-index: 10;
  transition: left 0.1s linear;
}
.needle-flag {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #000;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.needle-line {
  width: 2px;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.auction-timeline-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 6px;
  margin-top: 2px;
}
.stat-pill {
  font-size: 10.5px;
  color: #cbd5e1;
}
.stat-pill .lbl {
  color: #94a3b8;
  margin-right: 3px;
}

/* 双列布局 */
.auction-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.auction-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}
.auction-col-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #fbbf24;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}
.col-sub {
  font-size: 10px;
  font-weight: normal;
  color: #94a3b8;
}

.auction-buyers-list,
.auction-bids-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}
.auction-buyers-list::-webkit-scrollbar,
.auction-bids-feed::-webkit-scrollbar {
  width: 4px;
}
.auction-buyers-list::-webkit-scrollbar-thumb,
.auction-bids-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.auction-empty-hint {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  padding: 20px 0;
}

.auction-buyer-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
}
.buyer-card-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.buyer-card-name {
  display: flex;
  align-items: center;
  gap: 4px;
}
.buyer-tag {
  font-size: 9px;
  padding: 0 4px;
  border-radius: 3px;
}
.buyer-tag.local { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.buyer-tag.foreign { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.buyer-card-status {
  font-size: 10px;
}
.buyer-card-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.buyer-gold-val {
  font-weight: 700;
  color: #fbbf24;
}
.buyer-jump-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.buyer-jump-btn:hover {
  background: rgba(56, 189, 248, 0.25);
}

.auction-bid-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bid-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bid-tick-tag {
  font-size: 9.5px;
  color: #94a3b8;
}
.bid-phase-badge {
  font-size: 9px;
  padding: 0 5px;
  border-radius: 3px;
  margin-left: auto;
}
.bid-phase-badge.obs { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.bid-phase-badge.dec { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.bid-phase-badge.clr { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.bid-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.bid-amount strong {
  color: #fbbf24;
}
.bid-verdict {
  font-size: 10px;
  font-weight: 600;
}

/* 历史成交视图 */
.auction-deals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}
.auction-deal-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.deal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.deal-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #6ee7b7;
}
.deal-badge {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  padding: 1px 6px;
  border-radius: 4px;
}
.auction-deal-card.flop {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(30, 15, 20, 0.6);
}
.auction-deal-card.flop .deal-card-title {
  color: #fca5a5;
}
.deal-badge.flop {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.deal-tick-lbl {
  font-size: 11px;
  color: #94a3b8;
}
.deal-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 6px;
}
.deal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #94a3b8;
}

.house-auction-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
}
.auction-footer-btn {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
}
.auction-footer-btn.focus-btn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.auction-footer-btn.focus-btn:hover {
  background: rgba(245, 158, 11, 0.3);
}
.auction-footer-btn.close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}
.auction-footer-btn.close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
}

.auction-bar-btn.has-active {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* ══════════════════════════════════════════════════════════════
   ⏪ 时光倒流控制器模态框样式
   ══════════════════════════════════════════════════════════════ */
.rewind-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rewind-modal-card {
  width: min(500px, calc(100vw - 32px));
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: rewindFadeIn 0.18s ease-out;
}
@keyframes rewindFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.rewind-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rewind-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.rewind-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}
.rewind-modal-body {
  padding: 18px;
}
.rewind-info-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rewind-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}
.rewind-input-section {
  margin-top: 14px;
}
.rewind-tick-input {
  flex: 1;
  background: #090e1a;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.rewind-tick-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
.rewind-primary-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.rewind-primary-btn:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}
.rewind-slider-section {
  margin-top: 14px;
}
.rewind-slider {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}
.rewind-chips-section {
  margin-top: 14px;
}
.rewind-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rewind-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.rewind-chip-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.rewind-status-msg {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.rewind-status-msg.ok {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.rewind-status-msg.err {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ══════════════════════════════════════════════════════════════
   ☀️ 明亮主题 (Light Theme) 适配样式
   ══════════════════════════════════════════════════════════════ */
body.theme-light {
  background: #f1f5f9;
  color: #0f172a;
}
body.theme-light .brand-card,
body.theme-light .stats-card,
body.theme-light .save-bar-card,
body.theme-light .global-resource-panel,
body.theme-light .event-log,
body.theme-light .debug-hud,
body.theme-light .inspector-card,
body.theme-light .global-averages-card,
body.theme-light .ledger-panel {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  color: #0f172a;
}
body.theme-light .brand-desc,
body.theme-light .stat-lbl,
body.theme-light .meter-label,
body.theme-light .log-title,
body.theme-light .panel-title,
body.theme-light .panel-title span:last-child {
  color: #475569;
}
/* 「生态时钟与倍速控制台」浅色适配：底色与「族群动态播报」正文区（.log-list #f8fafc）完全同色，
   避免纯白浮窗在浅色画布上刺眼；标题色同步为 .log-title 的 #475569。 */
body.theme-light .control-panel {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  color: #0f172a;
}
body.theme-light .control-panel .panel-title {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
/* 面板内动态注入的内联色在浅色底上过浅/刺眼，统一加深 */
body.theme-light .control-panel .toggle-row > span[style*="#facc15"] { color: #b45309 !important; }
body.theme-light .control-panel .toggle-row > span[style*="#38bdf8"] { color: #0284c7 !important; }
body.theme-light #stat-actual-speed { color: #475569 !important; }
/* ☀️ 动态季节光照开关与光位读数浅色适配（v1.48.0） */
body.theme-light .control-panel label[for="chk-dynamic-light"] { color: #b45309 !important; }
body.theme-light .control-panel .toggle-row > span[style*="#fbbf24"] { color: #b45309 !important; }
body.theme-light #stat-sun { color: #475569 !important; }
body.theme-light #btn-open-rewind-ctrl {
  color: #b45309 !important;
  border-color: rgba(180, 83, 9, 0.45) !important;
  background: rgba(245, 158, 11, 0.16) !important;
}
body.theme-light #btn-open-rewind-ctrl:hover {
  background: rgba(245, 158, 11, 0.28) !important;
}
body.theme-light .stat-val {
  color: #0284c7;
}
body.theme-light #stat-temp {
  color: #334155 !important;
}
body.theme-light #stat-deaths-natural {
  color: #16a34a !important;
}
body.theme-light #stat-deaths-unnatural {
  color: #dc2626 !important;
}
body.theme-light .version-tag {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #2563eb !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
body.theme-light .save-bar-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
body.theme-light .save-bar-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}
body.theme-light .ecology-btn {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.5);
  color: #0284c7;
}
body.theme-light .ecology-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}
body.theme-light .headless-btn {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
  color: #475569;
}
body.theme-light .headless-btn:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #0f172a;
}
body.theme-light .reset-rate-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light .reset-rate-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}
body.theme-light #lbl-water-rate { color: #0284c7 !important; }
body.theme-light #lbl-food-rate { color: #16a34a !important; }
body.theme-light #lbl-wood-rate { color: #65a30d !important; }
body.theme-light #lbl-stone-rate { color: #475569 !important; }
body.theme-light #lbl-gold-rate { color: #d97706 !important; }
body.theme-light .slider-header span[style*="#cbd5e1"] { color: #475569 !important; }
body.theme-light .meter-bg {
  background: #e2e8f0;
}
body.theme-light .log-list {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .log-entry {
  color: #334155;
  border-bottom-color: #e2e8f0;
}
body.theme-light .debug-row {
  color: #475569;
}
body.theme-light .debug-row span:last-child {
  color: #0f172a;
}
body.theme-light .toggle-row {
  border-top-color: rgba(0, 0, 0, 0.08) !important;
}
body.theme-light .toggle-row label {
  color: #334155 !important;
}
body.theme-light select#sel-speed {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* 📊 全局族人均值大盘浅色适配 */
body.theme-light .legend-title {
  color: #334155;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .legend-collapse-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light .legend-collapse-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
body.theme-light .avg-section-title {
  color: #475569;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .avg-stat-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .avg-lbl {
  color: #64748b;
}
body.theme-light .avg-carry-chip {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}
body.theme-light .avg-trait-box {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}
body.theme-light .avg-trait-box strong {
  color: #0284c7;
}

/* 📒 家户与账本大盘浅色适配 */
body.theme-light .ledger-tab-switcher {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .ledger-tab-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}
body.theme-light .ledger-tab-btn:hover:not(.disabled) {
  background: #e2e8f0;
  color: #0f172a;
}
body.theme-light .ledger-tab-btn.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}
body.theme-light .ledger-tab-btn[data-tab="marriage"].active {
  background: #fce7f3;
  border-color: #ec4899;
  color: #be185d;
}
body.theme-light .ledger-tab-btn[data-tab="clan"].active {
  background: #dcfce7;
  border-color: #10b981;
  color: #047857;
}
body.theme-light .ledger-tab-btn[data-tab="region"].active {
  background: #fef9c3;
  border-color: #eab308;
  color: #a16207;
}
body.theme-light .ledger-overview-row {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .ledger-ov-lbl {
  color: #64748b;
}
body.theme-light .ledger-ov-val {
  color: #0f172a;
}
body.theme-light .ledger-section-title {
  color: #475569;
}
body.theme-light .ledger-household-list,
body.theme-light .ledger-marriage-list {
  color: #334155;
}
body.theme-light .ledger-hh-item {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}
body.theme-light .ledger-hh-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
body.theme-light .ledger-hh-head-name {
  color: #0f172a;
}
body.theme-light .ledger-hh-members {
  color: #64748b;
}
body.theme-light .ledger-hh-id {
  color: #b45309;
}
body.theme-light .ledger-hh-bal-total {
  color: #d97706;
}
body.theme-light .ledger-hh-item.ledger-dissolved {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
body.theme-light .ledger-dissolved-tag {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
}
body.theme-light .ledger-split-badge {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}
body.theme-light .ledger-mg-item {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #334155;
}
body.theme-light .ledger-mg-id {
  color: #be185d;
}
body.theme-light .ledger-mg-dur {
  color: #64748b;
}
body.theme-light .clan-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #334155;
}
body.theme-light .clan-card:hover {
  border-color: #86efac;
}
body.theme-light .clan-card.clan-extinct {
  background: #fef2f2;
  border-color: #fca5a5;
}
body.theme-light .clan-extinct-badge {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
body.theme-light .region-card {
  background: #fffbeb;
  border-color: #fde68a;
  color: #334155;
}
body.theme-light .ledger-public-granary-card {
  background: #fffbeb;
  border-color: #fde68a;
  color: #334155;
}
body.theme-light .pg-title {
  color: #b45309;
}
body.theme-light .pg-total {
  color: #78350f;
}
body.theme-light .ledger-journal-drawer,
body.theme-light .ledger-inherit-archive {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
body.theme-light .ledger-journal-header {
  background: #fef3c7;
  border-bottom-color: #fde68a;
  color: #92400e;
}
body.theme-light .ledger-journal-item {
  border-bottom-color: #e2e8f0;
}
body.theme-light .journal-tick {
  color: #64748b;
}
body.theme-light .journal-reason {
  color: #0f172a;
}
body.theme-light .journal-flow {
  color: #475569;
}
body.theme-light .ledger-inherit-header {
  color: #334155;
  border-bottom-color: #e2e8f0;
}
body.theme-light .ledger-inherit-row {
  color: #475569;
}
body.theme-light .ledger-inherit-row b {
  color: #0f172a;
}

/* 🔍 Inspector 详情卡片浅色与高对比文字适配 */
body.theme-light .inspector {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
}
body.theme-light .inspector-title {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .insp-title-left #insp-title-name {
  color: #0f172a !important;
}
body.theme-light .state-badge {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}
body.theme-light .state-badge[style*="#f59e0b"] { color: #b45309 !important; }
body.theme-light .state-badge[style*="#38bdf8"] { color: #0284c7 !important; }
body.theme-light .state-badge[style*="#10b981"] { color: #15803d !important; }
body.theme-light .state-badge[style*="#ef4444"] { color: #dc2626 !important; }
body.theme-light .insp-close-btn {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
body.theme-light .insp-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}
body.theme-light .insp-subbar {
  color: #64748b;
}
body.theme-light .insp-home-chip {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
body.theme-light #insp-age-val[style*="#38bdf8"] { color: #0284c7 !important; }
body.theme-light #insp-age-val[style*="#ec4899"] { color: #be185d !important; }
body.theme-light #insp-age-val[style*="#a78bfa"] { color: #6d28d9 !important; }
body.theme-light .insp-prestige-chip {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}
body.theme-light .insp-section-title {
  color: #334155;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* 决策行动中枢高对比度优化 */
body.theme-light .decision-hub-badge {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
}
body.theme-light #insp-maslow-reason {
  color: #1e293b !important;
}
body.theme-light #insp-maslow-box > div > span:first-child {
  color: #475569 !important;
}
body.theme-light .decision-col-title.col-intent {
  color: #0284c7;
}
body.theme-light .decision-col-title.col-strategy {
  color: #7c3aed;
}
body.theme-light .decision-col-title.col-primitive {
  color: #059669;
}
body.theme-light #insp-task-itinerary-row {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
body.theme-light #insp-task-itinerary {
  color: #0f172a !important;
}
body.theme-light #insp-task-itinerary-row span:first-child {
  color: #0284c7 !important;
}
body.theme-light #insp-task-status[style*="#38bdf8"] { color: #0284c7 !important; }
body.theme-light #insp-task-status[style*="#34d399"] { color: #059669 !important; }
body.theme-light #insp-task-status[style*="#10b981"] { color: #15803d !important; }
body.theme-light #insp-maslow-badge {
  font-weight: 700;
  filter: contrast(1.3) brightness(0.85);
}

/* 2x2 生存指标网格修复白底白字 */
body.theme-light .vital-grid {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .vital-header {
  color: #475569;
}
body.theme-light .vital-header span:first-child {
  color: #475569;
}
body.theme-light .vital-header span:last-child,
body.theme-light .vital-header .mono-num {
  color: #0f172a !important;
}
body.theme-light .vital-item {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light .vital-item .vital-label {
  color: #64748b;
}
body.theme-light .vital-item .vital-value {
  color: #0f172a;
}

/* 🎒 随身行囊卡片 */
body.theme-light .carry-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .carry-header {
  color: #334155;
}
body.theme-light #insp-carry-cap {
  color: #b45309 !important;
}
body.theme-light .carry-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light .carry-chip.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
body.theme-light .carry-hint {
  color: #64748b;
}
body.theme-light .carry-haul {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}
body.theme-light #insp-carry-haul-text {
  color: #0f172a !important;
}

/* Inspector 内的家户与婚姻卡片 */
body.theme-light .ledger-household-card,
body.theme-light .ledger-marriage-card {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}
body.theme-light .ledger-card-title {
  color: #0f172a;
}
body.theme-light .ledger-role-badge {
  background: #e2e8f0;
  color: #334155;
}
body.theme-light .ledger-hh-info {
  color: #475569;
}
body.theme-light .ledger-hh-info b {
  color: #0f172a;
}
body.theme-light .ledger-balances-title {
  color: #64748b;
}
body.theme-light .ledger-balance-chip {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
}
body.theme-light .ledger-balance-chip .mono-num {
  color: #0f172a;
}
body.theme-light .ledger-events-title {
  color: #64748b;
}
body.theme-light .ledger-event-item {
  color: #475569;
  border-bottom-color: #e2e8f0;
}
body.theme-light .ledger-mg-row {
  color: #475569;
}
body.theme-light .ledger-mg-row b {
  color: #0f172a;
}
body.theme-light .ledger-mg-history-title {
  color: #64748b;
}
body.theme-light .ledger-mg-history-item {
  color: #64748b;
}

/* 调试卡片与文字描述 */
body.theme-light .debug-mining-card {
  background: #f5f3ff;
  border-color: #ddd6fe;
}
body.theme-light .debug-mining-card .mining-header span:first-child {
  color: #6d28d9;
}
body.theme-light .debug-mining-card .mining-header span:last-child {
  color: #b45309;
}
body.theme-light #insp-detail-text {
  color: #475569 !important;
}

/* 底部操作按钮 */
body.theme-light .insp-btn {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0284c7;
}
body.theme-light .insp-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}
body.theme-light .insp-btn.house-btn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}
body.theme-light .insp-btn.house-btn:hover {
  background: #fde68a;
  border-color: #f59e0b;
  color: #92400e;
}
body.theme-light .insp-btn.detail-btn {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}
body.theme-light .insp-btn.detail-btn:hover {
  background: #ede9fe;
  border-color: #7c3aed;
  color: #5b21b6;
}
body.theme-light .insp-btn.following {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

body.theme-light .poi-info-badge,
body.theme-light .insp-house-card,
body.theme-light .insp-market-trades {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

/* 🏛️ 模态大窗整体浅色适配 */
body.theme-light .rewind-modal-card,
body.theme-light .lineage-modal-card,
body.theme-light .save-modal,
body.theme-light .camp-detail-modal,
body.theme-light .house-auction-modal,
body.theme-light .dag-modal-window {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
body.theme-light .rewind-modal-header,
body.theme-light .lineage-modal-header,
body.theme-light .save-modal-header,
body.theme-light .camp-detail-header,
body.theme-light .house-auction-header,
body.theme-light .dag-modal-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}
body.theme-light .rewind-info-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .rewind-tick-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0369a1;
}
body.theme-light .rewind-chip-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
body.theme-light .rewind-chip-btn:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0284c7;
}
body.theme-light .save-slot-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .save-slot-card.empty {
  border-color: #e2e8f0;
}
body.theme-light .save-slot-name {
  color: #0f172a;
}
body.theme-light .save-slot-desc {
  color: #64748b;
}
body.theme-light .save-slot-time {
  color: #64748b;
}
body.theme-light .save-tab-switcher {
  background: #f1f5f9;
}
body.theme-light .save-tab-btn {
  color: #64748b;
}
body.theme-light .save-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
body.theme-light .lineage-self-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}
body.theme-light .lineage-self-avatar {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.theme-light .lineage-self-name {
  color: #0f172a;
}
body.theme-light .lineage-traits-block,
body.theme-light .lineage-section {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .lineage-trait {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light .lineage-hormone-block {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* 房屋拍卖大盘内部组件 */
body.theme-light .auction-hero-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .auction-hero-title {
  color: #0f172a;
}
body.theme-light .auction-hero-sub {
  color: #64748b;
}
body.theme-light .auction-hero-price {
  color: #d97706;
}
body.theme-light .auction-timeline-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .auction-timeline-title strong {
  color: #0f172a;
}
body.theme-light .auction-timeline-track {
  background: #e2e8f0;
}
body.theme-light .auction-col {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .auction-col-title {
  color: #334155;
  border-bottom-color: #e2e8f0;
}
body.theme-light .auction-buyer-card,
body.theme-light .auction-bid-card,
body.theme-light .auction-deal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}
body.theme-light .auction-empty-hint {
  color: #94a3b8;
}
body.theme-light .auction-strip-card {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}
body.theme-light .auction-footer-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* 营地详情弹窗内部 */
body.theme-light .camp-detail-header {
  background: #fef9c3;
  border-bottom-color: #fde68a;
}
body.theme-light .camp-detail-header span {
  color: #a16207;
}
body.theme-light .camp-detail-section-title {
  color: #b45309;
  border-bottom-color: #fde68a;
}
body.theme-light .camp-detail-content {
  color: #334155;
}

/* 世系图与决策可视化大窗口 */
body.theme-light .dag-modal-header div > div:first-child {
  color: #0284c7 !important;
}
body.theme-light .dag-modal-header div > div:last-child {
  color: #64748b !important;
}
body.theme-light .dag-tool-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
body.theme-light .dag-tool-btn:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0284c7;
}
body.theme-light .dag-modal-close {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}
body.theme-light .dag-modal-close:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
}
body.theme-light .dag-modal-body {
  background: #f1f5f9;
}
body.theme-light .dviz-left,
body.theme-light .dviz-right {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light .dviz-panel-title {
  color: #0f172a;
}
body.theme-light .dviz-legend-item b {
  color: #0f172a;
}
body.theme-light .dviz-legend-item div > span {
  color: #64748b;
}
body.theme-light .dviz-toolbar {
  border-bottom-color: #e2e8f0;
}
body.theme-light .dviz-status {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
body.theme-light .dviz-viewport {
  background: #f8fafc;
}
body.theme-light .dviz-insp-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .dviz-insp-head {
  border-bottom-color: #e2e8f0;
  background: #f1f5f9;
}
body.theme-light .dviz-insp-title b {
  color: #0f172a;
}
body.theme-light .dviz-k {
  color: #64748b;
}
body.theme-light .dviz-v {
  color: #0f172a;
}
body.theme-light .dv-node {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

/* 道路悬浮提示 */
body.theme-light .road-tooltip {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.15);
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body.theme-light .market-summary-card {
  background: rgba(255, 251, 235, 0.85);
  border-color: rgba(217, 119, 6, 0.35);
}
body.theme-light .market-stat-label {
  color: #64748b;
}
body.theme-light .market-stat-val {
  color: #0f172a;
}
body.theme-light .market-stat-sub {
  color: #475569;
}
body.theme-light .market-good-card {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}
body.theme-light .good-price {
  color: #d97706;
}
body.theme-light .market-good-footer {
  color: #64748b;
}

/* ==========================================================================
   ★ M19.4a 决策与行动中枢三栏透视看板 (Motivation & Execution Hub)
   ========================================================================== */
.decision-hub-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 9.5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.2s ease;
}
.decision-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.decision-hub-title {
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}
.decision-hub-badge {
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid #38bdf8;
}
.decision-instant-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(245, 158, 11, 0.18));
  border: 1px solid rgba(236, 72, 153, 0.45);
  color: #f472b6;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse-instant-glow 2s infinite ease-in-out;
}
@keyframes pulse-instant-glow {
  0%, 100% { opacity: 0.9; box-shadow: 0 0 4px rgba(236, 72, 153, 0.2); }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(236, 72, 153, 0.45); }
}
.decision-hub-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin-top: 2px;
}
.decision-col {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.decision-col-title {
  font-weight: 700;
  font-size: 9px;
  margin-bottom: 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 3px;
}
.decision-col-title.col-intent { color: #38bdf8; }
.decision-col-title.col-strategy { color: #a78bfa; }
.decision-col-title.col-primitive { color: #34d399; }
.decision-col-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  color: #94a3b8;
  line-height: 1.25;
}
.decision-col-val {
  color: #e2e8f0;
  font-weight: 600;
  text-align: right;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 浅色主题适配 */
body.theme-light .decision-hub-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}
body.theme-light .decision-hub-title {
  color: #334155;
}
body.theme-light .decision-hub-badge {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
}
body.theme-light .decision-col {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light .decision-col-title {
  border-bottom-color: #e2e8f0;
}
body.theme-light .decision-col-title.col-intent { color: #0284c7; }
body.theme-light .decision-col-title.col-strategy { color: #7c3aed; }
body.theme-light .decision-col-title.col-primitive { color: #059669; }
body.theme-light .decision-col-row {
  color: #64748b;
}
body.theme-light .decision-col-val {
  color: #0f172a;
}
body.theme-light .decision-instant-pill {
  background: rgba(253, 242, 248, 0.9);
  border-color: rgba(236, 72, 153, 0.4);
  color: #db2777;
}

/* ==========================================================================
   🌡️ 宏观气候演化预测悬浮窗 (Climate Forecast Popup)
   ========================================================================== */
.stat-item-interactive {
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.stat-item-interactive:hover {
  background: rgba(56, 189, 248, 0.12);
  border-radius: 6px;
}

.climate-popup {
  position: fixed;
  width: 508px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 12px;
  padding: 12px 14px 10px 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.16);
  z-index: 9500;
  pointer-events: auto;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: climatePopupIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes climatePopupIn {
  0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.climate-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.climate-popup-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.climate-popup-icon {
  font-size: 15px;
}
.climate-popup-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.climate-popup-now {
  font-size: 11px;
  font-family: "SFMono-Regular", Consolas, Menlo, Monaco, monospace;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.climate-chart-container {
  width: 480px;
  height: 200px;
  position: relative;
  background: rgba(10, 15, 30, 0.75);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}
.climate-chart-container canvas {
  width: 480px;
  height: 200px;
  display: block;
}

.climate-popup-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: #94a3b8;
  padding: 0 4px 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-line {
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
}
.legend-line.line-curve { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }
.legend-line.line-frost { background: #fbbf24; border-top: 1px dashed #fbbf24; }
.legend-line.line-freeze { background: #60a5fa; border-top: 1px dashed #60a5fa; }
.legend-line.line-base { background: #64748b; }

.climate-popup-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 8px;
}
.cstat-col {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cstat-lbl {
  font-size: 9.5px;
  color: #94a3b8;
}
.cstat-val {
  font-size: 11px;
  font-weight: 700;
  font-family: "SFMono-Regular", Consolas, Menlo, Monaco, monospace;
  color: #e2e8f0;
}
.cstat-val.val-hot { color: #f87171; }
.cstat-val.val-cold { color: #38bdf8; }

/* 浅色主题适配 */
body.theme-light .climate-popup {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15), 0 0 20px rgba(56, 189, 248, 0.12);
}
body.theme-light .climate-popup-title span:nth-child(2) {
  color: #1e293b !important;
}
body.theme-light .climate-chart-container {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
body.theme-light .cstat-col {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .cstat-lbl {
  color: #64748b;
}
body.theme-light .climate-popup-legend {
  color: #475569;
  border-bottom-color: #e2e8f0;
}

/* ══════════ ★ S4-07 标签边缘兜底提示区与聚合弹窗 ══════════ */
.label-fallback-dock {
  position: absolute;
  top: 62px;
  left: 250px;
  max-width: 340px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
}
.label-fallback-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: #f1f5f9;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.label-fallback-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.label-fallback-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.label-fallback-tag.tag-selected {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.label-fallback-tag.tag-hovered {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
}
.label-fallback-title {
  font-weight: 600;
  color: #f8fafc;
  flex-shrink: 0;
}
.label-fallback-detail {
  color: #94a3b8;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.label-cluster-popup {
  position: absolute;
  z-index: 25;
  min-width: 150px;
  max-width: 240px;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(56, 189, 248, 0.2);
  padding: 6px 8px;
  font-size: 11px;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.label-cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  margin-bottom: 4px;
  font-weight: 700;
  color: #38bdf8;
  font-size: 10.5px;
}
.label-cluster-close {
  cursor: pointer;
  color: #94a3b8;
  font-size: 12px;
  padding: 0 2px;
  border: none;
  background: none;
}
.label-cluster-close:hover {
  color: #ef4444;
}
.label-cluster-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.label-cluster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}
.label-cluster-item:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #ffffff;
}
