/* ============================================================
   财务管理系统 - 深色赛博主题 Cyber Dark Theme
   配色：深空黑 + 霓虹紫 + 青色点缀
   字体：中文 PingFang SC / Noto Sans SC，数字 Inter / Roboto Mono
   ============================================================ */

/* --- CSS Variables / Bootstrap Overrides --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-surface: #12131a;
  --bg-card: #181a24;
  --bg-elevated: #1e2030;
  --border-color: rgba(139, 92, 246, 0.15);
  --border-glow: rgba(139, 92, 246, 0.35);
  --glow-purple: rgba(139, 92, 246, 0.25);
  --glow-cyan: rgba(6, 182, 212, 0.2);
  --text-primary: #e8ecf4;
  --text-secondary: #8a94a8;
  --text-muted: #5a6478;
  --accent-purple: #8b5cf6;
  --accent-violet: #6d28d9;
  --accent-cyan: #06b6d4;
  --accent-pink: #f472b6;
  --accent-green: #34d399;
  --gradient-purple: linear-gradient(135deg, #8b5cf6, #6d28d9);
  --gradient-pink: linear-gradient(135deg, #f472b6, #e11d48);
  --gradient-cyan: linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-green: linear-gradient(135deg, #34d399, #059669);
  --glass-bg: rgba(24, 26, 36, 0.75);
  --glass-border: rgba(139, 92, 246, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font-cn: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei UI', -apple-system, sans-serif;
  --font-num: 'Inter', 'Roboto Mono', 'Poppins', 'SF Mono', monospace;

  /* Bootstrap variable overrides */
  --bs-body-bg: var(--bg-primary);
  --bs-body-color: var(--text-primary);
  --bs-primary: var(--accent-purple);
  --bs-secondary: #4a5568;
  --bs-success: var(--accent-green);
  --bs-danger: #ef4444;
  --bs-warning: #f59e0b;
  --bs-info: var(--accent-cyan);
  --bs-dark: #0a0a0f;
  --bs-font-sans-serif: var(--font-cn);
}

/* --- Base --- */
* { box-sizing: border-box; }

body {
  font-family: var(--font-cn);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

/* Subtle background grid */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.5); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-cn);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }

/* Numbers in financial data use the number font */
.amount, .currency, .stat-value,
td:not(:first-child):not(.month-header),
h2[id$="income"], h2[id$="expense"], h2[id$="profit"],
.pool-card h4, .card-title .amount {
  font-family: var(--font-num);
  letter-spacing: 0.02em;
}

/* --- Navbar --- */
.navbar {
  background: rgba(10, 10, 15, 0.85) !important;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  padding: 0.6rem 1rem;
}

.navbar-brand {
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 1.2rem;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.08em;
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.nav-link {
  padding: 0.5rem 1rem !important;
  margin: 0 2px;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.25s ease;
  color: var(--text-secondary) !important;
  letter-spacing: 0.03em;
}

.nav-link:hover {
  color: var(--text-primary) !important;
  background: rgba(139, 92, 246, 0.1);
}

.nav-link.active {
  color: #fff !important;
  background: rgba(139, 92, 246, 0.2) !important;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
  font-weight: 600;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 30px rgba(139, 92, 246, 0.1);
}

.card-header {
  background: rgba(139, 92, 246, 0.06);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.card-header h4, .card-header h5 {
  margin-bottom: 0;
  font-size: 1rem;
}

.card-body { padding: 1.25rem; }

/* --- Stat Cards (overview income/expense/profit) --- */
.stat-card {
  border: none;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.stat-card h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-bottom: 0.5rem;
  color: rgba(255,255,255,0.85);
}

.stat-card h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0;
  font-family: var(--font-num);
  letter-spacing: 0.01em;
  text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.income-card {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
}

.expense-card {
  background: linear-gradient(135deg, #ec4899 0%, #dc2626 100%);
}

.profit-card {
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
}

/* --- Glassmorphism utility --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* --- Tables --- */
.table {
  color: var(--text-primary);
  margin-bottom: 0;
  font-size: 0.875rem;
  border-color: var(--border-color);
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--border-color);
  padding: 0.75rem 0.75rem;
  background: transparent;
  color: var(--text-primary);
}

.table thead th {
  background: rgba(139, 92, 246, 0.08);
  border-bottom: 2px solid rgba(139, 92, 246, 0.2);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border-top: none;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background: rgba(139, 92, 246, 0.03);
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover > * {
  background: rgba(139, 92, 246, 0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.1);
}

.table-responsive {
  border-radius: 10px;
}

/* Force light text in projects table to fix dark text on dark bg */
#projects-table td {
  color: var(--text-primary) !important;
}

/* Cashflow table specific */
.cashflow-table td.month-header {
  background: rgba(139, 92, 246, 0.12) !important;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.income-cell { background: rgba(52, 211, 153, 0.06) !important; }
.expense-cell { background: rgba(239, 68, 68, 0.06) !important; }
.balance-cell { background: rgba(139, 92, 246, 0.06) !important; font-weight: 600; }
.supplemental-income-cell { background: rgba(245, 158, 11, 0.06) !important; }

.cashflow-table input.form-control-sm {
  min-width: 70px;
  text-align: right;
  font-family: var(--font-num);
  font-size: 0.8rem;
}

/* --- Forms --- */
.form-control, .form-select {
  background: rgba(18, 19, 26, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-cn);
  font-size: 0.875rem;
  transition: all 0.25s ease;
}

.form-control:hover, .form-select:hover {
  border-color: rgba(139, 92, 246, 0.45);
}

.form-control:focus, .form-select:focus {
  background: rgba(18, 19, 26, 0.95);
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  color: var(--text-primary);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 30px var(--bg-surface) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 18px;
  background-position: right 10px center;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

textarea.form-control {
  background: rgba(18, 19, 26, 0.6);
  min-height: 80px;
}

/* --- Buttons --- */
.btn {
  border-radius: 10px;
  padding: 0.55rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.25s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-purple);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.25);
}

.btn-success:hover {
  box-shadow: 0 6px 25px rgba(52, 211, 153, 0.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-warning {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0a0a0f;
}

.btn-warning:hover {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
  color: #0a0a0f;
}

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

.btn-outline-secondary:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

/* --- Modals --- */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.1rem 1.25rem;
  background: rgba(139, 92, 246, 0.04);
  border-radius: 16px 16px 0 0;
}

.modal-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.modal-body { padding: 1.25rem; }

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
}

.btn-close {
  filter: invert(0.7) brightness(1.5);
  opacity: 0.7;
}

.btn-close:hover { opacity: 1; }

.modal-backdrop.show { opacity: 0.6; }

/* --- Custom Notification Toast --- */
.notification-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.notification {
  pointer-events: auto;
  min-width: 320px;
  max-width: 480px;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid;
  animation: notifIn 0.35s cubic-bezier(0.16, 1, 0.3, 1), notifOut 0.3s ease forwards;
  animation-fill-mode: forwards;
}

.notification.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.notification.error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.notification.warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.notification .notif-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.notification .notif-text {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.notification .notif-close {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  font-size: 1.1rem;
  line-height: 1;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

.notification .notif-close:hover { opacity: 1; }

@keyframes notifIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes notifOut {
  0%, 70% { opacity: 1; transform: translateY(0) scale(1); max-height: 200px; margin-bottom: 0; padding: 1rem 1.5rem; }
  100% { opacity: 0; transform: translateY(-10px) scale(0.95); max-height: 0; margin-bottom: -60px; padding: 0 1.5rem; }
}

/* --- Chart Containers --- */
.chart-container {
  background: linear-gradient(135deg, rgba(24, 26, 36, 0.9), rgba(30, 32, 48, 0.9));
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(139, 92, 246, 0.06);
  position: relative;
  transition: all 0.3s ease;
}

.chart-container:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25), 0 0 40px rgba(139, 92, 246, 0.04), inset 0 1px 0 rgba(139, 92, 246, 0.1);
}

.chart-container canvas {
  max-height: 350px;
}

/* Chart container inside a card (overview trends) */
.card .chart-container {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0 0 0;
  margin-bottom: 0;
  box-shadow: none;
}

.card .chart-container:hover {
  box-shadow: none;
  border: none;
}

/* --- List Group --- */
.list-group-item {
  background: rgba(24, 26, 36, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px !important;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.list-group-item:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--border-glow);
}

/* --- Badge --- */
.badge {
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.3em 0.7em;
  border-radius: 6px;
}

.badge.bg-success { background: linear-gradient(135deg, #34d399, #059669) !important; }
.badge.bg-primary { background: var(--gradient-purple) !important; }

/* --- Nav Tabs (admin panel) --- */
.nav-tabs {
  border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link {
  border: none;
  color: var(--text-secondary) !important;
  margin-right: 4px;
  padding: 0.6rem 1.2rem !important;
  border-radius: 10px 10px 0 0;
}

.nav-tabs .nav-link:hover {
  background: rgba(139, 92, 246, 0.06);
  color: var(--text-primary) !important;
  border: none;
}

.nav-tabs .nav-link.active {
  background: var(--bg-card) !important;
  color: var(--accent-purple) !important;
  border: 1px solid var(--border-color);
  border-bottom-color: var(--bg-card);
  font-weight: 600;
}

/* --- Tab content --- */
.tab-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 14px 14px;
  padding: 1.25rem;
}

.tab-pane h4 {
  margin-bottom: 1rem;
}

/* --- Pool Cards (cashflow page) --- */
.pool-card {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pool-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.12);
}

.pool-card.active {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.06);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

.pool-card .text-primary {
  color: var(--accent-purple) !important;
  font-family: var(--font-num);
}

.pool-card .text-success {
  color: var(--accent-green) !important;
  font-family: var(--font-num);
}

/* --- Login Page --- */
.login-container {
  max-width: 420px;
  margin: 120px auto;
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(139, 92, 246, 0.05);
  backdrop-filter: blur(20px);
}

.login-header h2 {
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* --- Animations --- */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.2); }
  50% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.4); }
}

.glow-pulse {
  animation: glow-pulse 3s ease-in-out infinite;
}

/* --- Alerts --- */
.alert {
  border-radius: 12px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
}

/* --- Section visibility --- */
.section { display: none; }
.section.active { display: block; }

/* Chart.js label color overrides */
.chart-container canvas {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* Tooltip overrides */
.tooltip-inner {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  font-family: var(--font-num);
}

/* --- Checkbox styling --- */
input[type="checkbox"] {
  accent-color: var(--accent-purple);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* --- Export PDF Button --- */
.btn-export-pdf {
    background: var(--gradient-purple);
    color: #fff;
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.35);
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.btn-export-pdf:hover {
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    color: #fff;
}

.btn-export-pdf:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

/* --- Print / PDF 打印样式 --- */
@media print {
    /* 隐藏导航栏、按钮、表单、模态框等交互元素 */
    .navbar,
    .btn-export-pdf,
    .btn:not(.btn-export-pdf),
    form,
    .modal,
    .modal-backdrop,
    .notification-container,
    .nav-tabs .nav-link:not(.active),
    #adminTabs {
        display: none !important;
    }

    /* 确保所有 section 内容在打印时可见 */
    .section {
        display: block !important;
        animation: none !important;
        opacity: 1 !important;
        page-break-inside: avoid;
    }

    /* 标签页内容全部展开 */
    .tab-pane {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .tab-content {
        border: none;
        padding: 0;
        background: transparent;
    }

    /* 去掉卡片悬停效果，使用纯色背景 */
    .card,
    .stat-card,
    .chart-container {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #333;
    }

    .card:hover,
    .stat-card:hover,
    .chart-container:hover {
        transform: none !important;
    }

    body {
        background: #0a0a0f !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 0.5in !important;
    }

    /* 图表容器展开 */
    .chart-container canvas,
    .chart-container img.chart-print-img {
        max-height: 300px;
        max-width: 100%;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .stat-card h2 { font-size: 1.6rem; }
  .navbar { padding: 0.4rem 0.75rem; }
  .navbar-brand { font-size: 1rem; }
  .login-container { margin: 60px 16px; padding: 1.75rem; }
  .chart-container { height: 280px !important; }
  .card-body { padding: 1rem; }
  .table { font-size: 0.8rem; }
}

@media (max-width: 576px) {
  .stat-card h2 { font-size: 1.3rem; }
  .navbar .container-fluid { padding: 0; }
}

/* --- Smooth section transitions --- */
.section {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Misc --- */
.container { max-width: 1400px; }

.text-muted { color: var(--text-muted) !important; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
