@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');
/* ==========================================================================
   Tiamo Design System - Design Tokens & Variables
   ========================================================================== */
:root {
  /* --- 品牌主色系 (Primary Indigo) --- */
  --brand-primary: #4f46e5;          /* 主色：indigo-600 */
  --brand-primary-hover: #4338ca;    /* 悬停态：indigo-700 */
  --brand-primary-light: #eef2ff;    /* 极浅强调底色：indigo-50 */
  --brand-primary-glow: rgba(79, 70, 229, 0.25);

  /* --- 中性灰度色系 (Neutral Slate) --- */
  --bg-base: #f8fafc;                /* 页面整体底色：slate-50 */
  --surface-card: #ffffff;           /* 卡片与浮层：纯白 */
  --surface-glass: rgba(255, 255, 255, 0.85);
  --border-color: #e2e8f0;           /* 核心分隔线：slate-200 */
  --border-subtle: rgba(226, 232, 240, 0.8);

  /* --- 文本色阶 (Text) --- */
  --text-main: #0f172a;              /* 主标题、正文强调：slate-900 */
  --text-regular: #334155;           /* 正文常规：slate-700 */
  --text-muted: #64748b;             /* 辅助说明、占位符：slate-500 */
  --text-disabled: #94a3b8;          /* 禁用态文本：slate-400 */

  /* --- 状态功能色 (Feedback) --- */
  --color-success: #10b981;          /* 成功态：emerald-500 */
  --color-warning: #f59e0b;          /* 警告态：amber-500 */
  --color-danger: #ef4444;           /* 危险/删除：red-500 */
  --color-info: #0284c7;             /* 提示信息：sky-600 */

  /* --- 深度工作台背景 (Dark Workspace) --- */
  --bg-dark-workspace: #09090b;      /* 纯粹暗黑工作区：zinc-950 */

  /* --- 阴影系统 (Elevation Scale) --- */
  --shadow-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-elevation-2: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-elevation-3: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-brand-glow: 0 4px 12px var(--brand-primary-glow);
  --shadow-brand-glow-lg: 0 6px 16px rgba(79, 70, 229, 0.35);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-regular);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

/* ==========================================================================
   Custom Scrollbar (Capsule Minimalist)
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   App Shell & Containers
   ========================================================================== */
.app-wrapper {
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(at 10% 10%, rgba(79, 70, 229, 0.03) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(14, 165, 233, 0.03) 0px, transparent 50%);
}

.app-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ==========================================================================
   Header Component (Linear / Apple Style)
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 0.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.logo-box {
  width: 44px;
  height: 44px;
  background: var(--brand-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px var(--brand-primary-glow);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}

.btn-icon,
.tiamo-icon {
  flex-shrink: 0;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.page-subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Pill Toolbar & Segmented Controls
   ========================================================================== */
.pill-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.pill-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 4px;
  box-shadow: var(--shadow-elevation-1);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.pill-btn:hover {
  color: var(--text-main);
  background: #f8fafc;
}

.pill-btn.active {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.08);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  font-size: 0.7rem;
  border-radius: 9999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-primary);
}

/* ==========================================================================
   Buttons System (42px icon buttons & text buttons)
   ========================================================================== */
.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #475569;
  box-shadow: var(--shadow-elevation-1);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: #f8fafc;
  color: var(--text-main);
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevation-2);
}

.icon-btn:active {
  transform: scale(0.95);
  background: #f1f5f9;
}

.icon-btn.primary {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-brand-glow);
}

.icon-btn.primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: var(--shadow-brand-glow-lg);
}

.icon-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
  transform: none;
}

.btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-brand-glow);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: var(--shadow-brand-glow-lg);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-regular);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-elevation-1);
}

.btn-secondary:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.04);
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fecaca;
}

/* ==========================================================================
   Executive KPI Summary Cards (Apple / Linear Aesthetic)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-elevation-1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevation-2);
  border-color: #cbd5e1;
}

.kpi-card:hover::before {
  background: var(--brand-primary);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-title {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.kpi-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.kpi-unit {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-footer {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-badge-positive {
  color: var(--color-success);
  font-weight: 600;
}

/* ==========================================================================
   Section Card Surfaces
   ========================================================================== */
.card-surface {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-elevation-1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: border-color 0.2s;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-title-indicator {
  width: 4px;
  height: 20px;
  background: var(--brand-primary);
  border-radius: 9999px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.card-subtitle {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Exchange Rate Control Bar
   ========================================================================== */
.exchange-rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-regular);
  box-shadow: var(--shadow-elevation-1);
}

.exchange-rate-value {
  font-weight: 700;
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
}

/* Edit Mode Banner */
.edit-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  color: #166534;
  font-size: 0.825rem;
}

.edit-mode-actions {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   Data Table Styling (Clean Modern Slate)
   ========================================================================== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table th, 
.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid rgba(226, 232, 240, 0.4);
  font-size: 0.825rem;
  white-space: nowrap;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: none;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background: #f8faff;
}

.data-table td {
  color: var(--text-regular);
}

/* Align text column to left */
.data-table td:first-child,
.data-table th:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
}

/* Highlight important columns */
.highlight-cell {
  color: var(--brand-primary) !important;
  font-weight: 700 !important;
  background: rgba(79, 70, 229, 0.04);
}

.data-table tbody tr:hover .highlight-cell {
  background: rgba(79, 70, 229, 0.08);
}

.total-row {
  background: #f8fafc !important;
  font-weight: 700 !important;
}

.total-row td {
  border-top: 2px solid var(--border-color);
  color: var(--text-main) !important;
  font-size: 0.875rem !important;
}

/* Inputs within tables */
.data-table input[type="number"],
.data-table input[type="text"] {
  width: 100%;
  min-width: 80px;
  max-width: 130px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 500;
  text-align: right;
  outline: none;
  transition: all 0.2s;
}

.data-table input[type="number"]:focus,
.data-table input[type="text"]:focus {
  border-color: var(--brand-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.warning-input {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  color: #b45309 !important;
}

.warning-input::placeholder {
  color: #d97706;
}

.readonly-text {
  color: var(--text-disabled);
  font-size: 0.775rem;
  font-style: italic;
}

.input-with-suggestion {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.active-override-tag {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--brand-primary);
  margin-right: 4px;
}

/* ==========================================================================
   Modals (Tiamo Design System Spec 5.5)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 2rem;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-modal);
  position: relative;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-section-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

/* Styled Checkboxes Grid */
.print-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.checkbox-pill-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-regular);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.checkbox-pill-label:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.checkbox-pill-label.selected {
  background: var(--brand-primary-light);
  border-color: rgba(79, 70, 229, 0.3);
  color: var(--brand-primary);
  font-weight: 600;
}

.checkbox-pill-label input[type="checkbox"] {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Styled Layout Radio Cards */
.layout-radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.layout-radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 0.85rem 0.5rem;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.layout-radio-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.layout-radio-card.active {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary);
}

.layout-radio-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
}

.layout-radio-card.active .layout-radio-title {
  color: var(--brand-primary);
}

.layout-radio-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.modal-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

/* ==========================================================================
   Floating Action Button (Print / Export)
   ========================================================================== */
.floating-print-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand-glow);
  cursor: pointer;
  z-index: 99;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-print-btn:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-brand-glow-lg);
}

.floating-print-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Print Framework & Sandbox (Preserving PDF generation compatibility)
   ========================================================================== */
@media screen {
  .print-only {
    display: none !important;
  }
}

@media print {
  body {
    background: white !important;
    color: black !important;
    margin: 0;
    padding: 0;
  }
  
  .screen-only {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
}

/* Pure Print Sandbox Styles */
.print-sandbox {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: black;
  width: 100%;
}

.print-page {
  page-break-after: always;
  padding: 20px 0;
}

.print-page:last-child {
  page-break-after: auto;
}

.print-layout-1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.85em;
}

.print-layout-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  font-size: 0.62em;
}

.print-layout-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 15px;
  font-size: 0.48em;
  align-items: start;
  justify-items: center;
}

.print-section {
  margin-bottom: 0px;
  page-break-inside: avoid;
  width: max-content;
}

.print-title {
  font-size: 1.1em;
  font-weight: bold;
  margin: 10px 0 5px 0;
  color: black;
  border-left: 3px solid var(--brand-primary);
  padding-left: 6px;
}

.print-table {
  border-collapse: collapse;
  width: max-content;
  font-size: 0.8em;
}

.print-table th, .print-table td {
  border: 1px solid #999;
  padding: 0.3em 0.5em;
  text-align: right;
  white-space: nowrap;
  color: black !important;
}

.print-table th {
  background: #e2e8f0 !important;
  font-weight: 600;
  text-align: center;
}

.print-table td:first-child, .print-table th:first-child {
  text-align: left;
  font-weight: 500;
}

.print-highlight {
  font-weight: bold;
  background: rgba(79, 70, 229, 0.1) !important;
}

/* Force Print Visible for PDF Export */
.force-pdf-render {
  display: block !important;
  width: 100% !important;
  background: white !important;
  color: black !important;
}

/* ==========================================================================
   Plan Management & Storage (方案管理与服务器文档)
   ========================================================================== */
/* 顶部操作栏当前方案名胶囊卡片 */
.current-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-elevation-1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.current-plan-chip:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.current-plan-chip-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.current-plan-chip-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.current-plan-chip-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.current-plan-chip-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-plan-chip-dirty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #b45309;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  line-height: 1;
}

.current-plan-chip-dirty:hover {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
  transform: translateY(-0.5px);
}

/* ==========================================================================
   Header Save Button (主页面打印机旁的方案保存按钮)
   ========================================================================== */
.btn-save {
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 方案无修改时：干净的次级浅灰态，提示已保存最新 */
.btn-save-clean {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-disabled);
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-save-clean:hover {
  transform: none;
  box-shadow: none;
  background: #ffffff;
  color: var(--text-disabled);
}

/* 方案有修改时：琥珀金色高饱和高亮、呼吸光晕、白色文字 */
.btn-save-dirty {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 1px solid #b45309;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  font-weight: 700;
  cursor: pointer;
  animation: pulse-save-glow 2.5s infinite ease-in-out;
}

.btn-save-dirty:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
  color: #ffffff;
}

.btn-save-dirty:active {
  transform: scale(0.96);
}

.btn-save:disabled {
  pointer-events: none;
}

/* 呼吸光晕动画 */
@keyframes pulse-save-glow {
  0%, 100% {
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.65);
  }
}

/* 未保存小圆点徽标 */
.save-dot-badge {
  width: 6px;
  height: 6px;
  background-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  margin-left: 2px;
  animation: dot-pulse 1.8s infinite ease-in-out;
}

@keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }
}

/* 旋转加载动画 */
.spin-anim {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.plan-pill-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.8rem;
  box-shadow: var(--shadow-elevation-1);
}

.plan-name-label {
  font-weight: 700;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dirty-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: #fef3c7;
  color: #b45309;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.admin-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* 方案未保存提示横幅 */
.plan-unsaved-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  margin-bottom: 12px;
  color: #92400e;
  font-size: 0.8rem;
}

/* 新增方案卡片容器 */
.plan-create-panel {
  background: #f8fafc;
  border: 1.5px dashed rgba(79, 70, 229, 0.3);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 方案卡片内联编辑 */
.plan-inline-edit-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.plan-inline-edit-input {
  width: 100%;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.825rem;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.plan-inline-edit-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-glow);
}

.plan-inline-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}

/* Plan Modal List Cards */
.plan-list-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.plan-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-card-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevation-1);
}

.plan-card-item.active {
  background: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-glow);
}

.plan-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}

.plan-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.plan-card-desc {
  font-size: 0.785rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.plan-card-meta {
  font-size: 0.7rem;
  color: var(--text-disabled);
  display: flex;
  gap: 12px;
  align-items: center;
}

.plan-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================================================
   Multi-Plan Comparison System (方案多维对比)
   ========================================================================== */
.comparison-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comparison-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-elevation-1);
}

.comparison-pills-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-regular);
  transition: all 0.15s ease;
  user-select: none;
}

.plan-select-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.plan-select-chip.selected {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.plan-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  display: inline-block;
}

.comparison-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.comparison-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-elevation-1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top-width: 4px;
}

/* 多方案核心指标横向对比矩阵表 */
.comparison-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.comparison-matrix-table th,
.comparison-matrix-table td {
  padding: 0.8rem 1rem;
  vertical-align: middle;
}

.comparison-matrix-table td:first-child,
.comparison-matrix-table th:first-child {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

.comparison-matrix-table th:first-child {
  background: #f8fafc;
  z-index: 3;
}

.comparison-matrix-table tbody tr:hover td:first-child {
  background: #f8faff;
}

.comparison-metric-title {
  display: block;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.835rem;
}

.comparison-metric-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.25;
}

.comparison-primary-row td {
  background: rgba(79, 70, 229, 0.02);
  border-bottom: 2px solid rgba(79, 70, 229, 0.12) !important;
}

.comparison-primary-row td:first-child {
  background: #f8faff;
}

.best-val-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}

.chart-card-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow-elevation-1);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

/* Custom Account Tag & Admin Actions */
.custom-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 6px;
  font-size: 0.675rem;
  font-weight: 600;
}

.btn-remove-row {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-remove-row:hover {
  background: #fee2e2;
  color: #ef4444;
}

.btn-edit-row {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-edit-row:hover {
  background: #eef2ff;
  color: #4f46e5;
}

/* Toast Notification */
.toast-bar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  animation: modalFadeIn 0.2s ease;
}

.toast-bar.toast-success {
  border-left: 3px solid #10b981;
}
.toast-bar.toast-warn {
  border-left: 3px solid #f59e0b;
}
.toast-bar.toast-error {
  border-left: 3px solid #ef4444;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .app-container {
    padding: 1rem 1rem 5rem;
    gap: 1.25rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.15rem;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .pill-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pill-group {
    overflow-x: auto;
  }

  .card-surface {
    padding: 1rem;
    border-radius: 16px;
  }

  .print-options-grid {
    grid-template-columns: 1fr;
  }

  .layout-radio-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-anim {
  animation: spin 0.85s linear infinite;
}

/* ==================== 方案对比列顺序拖拽与微调 ==================== */
.comparison-reorder-bar {
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comparison-reorder-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.reorder-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.reorder-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.comparison-reorder-chips-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
}

.plan-order-chip:hover {
  border-color: var(--brand-primary);
  background: #fdfefe;
}

.plan-order-chip:active {
  cursor: grabbing;
}

.plan-order-chip.is-dragging {
  opacity: 0.4;
  border-style: dashed;
}

.plan-order-chip.is-drag-over {
  border-color: var(--brand-primary);
  background: #eef2ff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.15);
}

.drag-handle-icon {
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
}

.order-badge,
.order-col-idx {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.order-plan-name {
  font-weight: 600;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}

.order-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}

.order-step-btn:hover:not(:disabled) {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.order-step-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 表格表头拖拽样式 */
.draggable-compare-th {
  transition: background-color 0.15s ease, outline 0.15s ease, opacity 0.15s ease;
}

.draggable-compare-th:hover {
  background-color: #f1f5f9;
}

.draggable-compare-th.is-dragging {
  opacity: 0.4;
}

.draggable-compare-th.is-drag-over {
  background-color: #e0e7ff !important;
  outline: 2px dashed var(--brand-primary);
  outline-offset: -2px;
}


