/* ================================
   WealthWise - 家庭资产诊断系统
   现代简约设计系统
   ================================ */

/* CSS Reset & Variables */
:root {
  /* Primary Colors */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* Semantic Colors */
  --success-50: #f0fdf4;
  --success-500: #22c55e;
  --success-600: #16a34a;

  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
  min-height: 100vh;
  line-height: 1.6;
}

/* Redbook Creator Specifics */
#redbook-creator .card {
  height: 100%;
}

#redbook-creator hr {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: 1.5rem 0;
}

#imagePreviewContainer img {
  object-fit: contain;
  background-color: var(--gray-50);
}

.w-full {
  width: 100%;
}

.my-6 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

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

/* Stepper or Step Indicators could be added here if needed */

/* Page Layout */
.page {
  padding: var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-900);
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.875rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--space-4);
  color: var(--gray-600);
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page {
  padding: var(--space-8) 0;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  height: 56px;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: 100%;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 100%;
}

.navbar-divider {
  width: 1px;
  height: 24px;
  background: var(--gray-200);
  margin: 0 var(--space-2);
  flex-shrink: 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-600);
  text-decoration: none;
  padding: 0 var(--space-2);
  white-space: nowrap;
}

.navbar-brand svg {
  width: 26px;
  height: 26px;
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 2px;
  height: 100%;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  color: var(--gray-500);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.nav-link.active {
  color: var(--primary-600);
  background: var(--primary-100);
  font-weight: 600;
}

/* Sub Navigation */
.subnav {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-2) 0;
}

.subnav .container {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.subnav-tabs {
  display: flex;
  list-style: none;
  gap: var(--space-1);
}

.subnav-link {
  padding: var(--space-2) var(--space-4);
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.subnav-link:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.subnav-link.active {
  color: var(--primary-600);
  background: var(--primary-100);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.8125rem;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {

  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.stat-card .stat-icon.primary {
  background: var(--primary-100);
  color: var(--primary-600);
}

.stat-card .stat-icon.success {
  background: var(--success-50);
  color: var(--success-600);
}

.stat-card .stat-icon.warning {
  background: var(--warning-50);
  color: var(--warning-600);
}

.stat-card .stat-icon.danger {
  background: var(--danger-50);
  color: var(--danger-600);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: var(--space-1);
}

.stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.stat-card .stat-change.positive {
  background: var(--success-50);
  color: var(--success-600);
}

.stat-card .stat-change.negative {
  background: var(--danger-50);
  color: var(--danger-600);
}

/* Health Score Gauge */
.health-gauge {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.health-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.health-gauge .gauge-bg {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 12;
}

.health-gauge .gauge-value {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease-in-out;
}

.health-gauge .gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.health-gauge .gauge-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--gray-900);
}

.health-gauge .gauge-label {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--gray-50);
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--gray-50);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-success {
  background: var(--success-500);
  color: white;
}

.btn-danger {
  background: var(--danger-500);
  color: white;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-success {
  background: var(--success-50);
  color: var(--success-600);
}

.badge-warning {
  background: var(--warning-50);
  color: var(--warning-600);
}

.badge-danger {
  background: var(--danger-50);
  color: var(--danger-600);
}

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-bar.primary {
  background: var(--primary-500);
}

.progress-bar.success {
  background: var(--success-500);
}

.progress-bar.warning {
  background: var(--warning-500);
}

.progress-bar.danger {
  background: var(--danger-500);
}

/* Charts Container */
.chart-container {
  position: relative;
  height: 300px;
}

/* Issues List */
.issue-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
}

.issue-item.high {
  background: var(--danger-50);
  border-left: 3px solid var(--danger-500);
}

.issue-item.medium {
  background: var(--warning-50);
  border-left: 3px solid var(--warning-500);
}

.issue-item.low {
  background: var(--primary-50);
  border-left: 3px solid var(--primary-500);
}

.issue-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.issue-content {
  flex: 1;
}

.issue-title {
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: var(--space-1);
}

.issue-description {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Loading States */
.skeleton {
  background: linear-gradient(90deg,
      var(--gray-200) 25%,
      var(--gray-100) 50%,
      var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}

.modal-backdrop.active .modal {
  transform: scale(1);
}

/* Family Selector */
.family-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  max-width: 320px;
}

.family-selector:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.family-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.family-info {
  flex: 1;
  min-width: 0;
}

.family-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-900);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-desc {
  font-size: 0.7rem;
  color: var(--gray-400);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary-600);
}

.text-success {
  color: var(--success-600);
}

.text-warning {
  color: var(--warning-600);
}

.text-danger {
  color: var(--danger-600);
}

.text-muted {
  color: var(--gray-500);
}

.font-mono {
  font-family: var(--font-mono);
}

.font-bold {
  font-weight: 700;
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .navbar-nav {
    display: none;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .card {
    padding: var(--space-4);
  }
}

/* Print Styles */
@media print {

  .navbar,
  .subnav,
  .btn,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--gray-200);
    break-inside: avoid;
  }

  .page {
    padding: 0;
  }

  .grid {
    break-inside: avoid;
  }
}

/* Professional PDF Report Styles */
#fullReportTemplate {
  width: 210mm;
}

.report-page {
  background: white;
  position: relative;
  overflow: hidden;
}

.report-page table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
}

.report-page th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
}

.report-page td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-size: 0.8125rem;
}

.report-page .font-mono {
  font-family: var(--font-mono);
}

.report-page .badge {
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 9999px;
  display: inline-block;
}

.report-page .text-right {
  text-align: right;
}

.report-page .text-muted {
  color: #64748b;
}

.report-page .text-success {
  color: #16a34a;
}

.report-page .text-danger {
  color: #dc2626;
}

/* Page break and layout hacks for html2pdf */
.report-page h2,
.report-page .grid {
  break-inside: avoid;
}

.pdf-export #exportPdfBtn,
.pdf-export .btn,
.pdf-export .no-print,
.pdf-export .navbar,
.pdf-export .subnav {
  display: none !important;
}

/* Client Status Badges */
.badge-status-new {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-status-following {
  background: #fef3c7;
  color: #92400e;
}

.badge-status-planning {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-status-signed {
  background: var(--success-50);
  color: var(--success-600);
}

.badge-status-completed {
  background: var(--gray-200);
  color: var(--gray-600);
}

/* Action Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  background: transparent;
}

.action-btn:hover {
  background: var(--gray-100);
}

.action-btn.edit {
  color: var(--primary-600);
}

.action-btn.edit:hover {
  background: var(--primary-50);
}

.action-btn.delete {
  color: var(--danger-500);
}

.action-btn.delete:hover {
  background: var(--danger-50);
}

/* Danger Button */
.btn-danger {
  background: var(--danger-500);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Client Name Link */
.client-name-link {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.client-name-link:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
}

/* ===== 资产总览区（饼图 + 列表） ===== */
.asset-overview-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--gray-100);
}

.asset-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.asset-overview-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: 0.01em;
}

.asset-overview-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.asset-overview-subtitle strong {
  color: var(--gray-800);
  font-weight: 600;
}

.asset-overview-body {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 260px;
}

/* 左：甜甜圈图区 */
.asset-overview-chart-wrap {
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  border-right: 1px solid var(--gray-100);
}

.asset-donut-container {
  position: relative;
  width: 200px;
  height: 200px;
}

.asset-donut-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.asset-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.asset-donut-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.asset-donut-label {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* 右：类别列表 + 指标 */
.asset-overview-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-6);
  gap: var(--space-4);
  min-width: 0;
}

.asset-overview-categories {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.asset-overview-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.asset-overview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.asset-overview-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  width: 72px;
  flex-shrink: 0;
}

.asset-overview-bar-wrap {
  flex: 1;
  height: 20px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 0;
}

.asset-overview-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  min-width: 4px;
  transition: width 0.6s ease;
}

.asset-overview-amount {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  font-variant-numeric: tabular-nums;
  width: 64px;
  text-align: right;
  flex-shrink: 0;
}

.asset-overview-pct {
  font-size: 0.8rem;
  font-weight: 600;
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}

.asset-overview-divider {
  height: 1px;
  background: var(--gray-100);
  margin: var(--space-1) 0;
}

/* 底部四项指标 */
.asset-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.asset-metric-item {
  text-align: center;
  padding: var(--space-3) var(--space-2);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
}

.asset-metric-label {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-bottom: var(--space-1);
  letter-spacing: 0.02em;
}

.asset-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.2;
}

/* ===== AI 优化建议区 ===== */
.ai-suggest-section {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--gray-100);
  margin-bottom: var(--space-6);
}

.ai-suggest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border-bottom: 1px solid var(--gray-100);
}

.ai-suggest-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.ai-suggest-title-icon {
  font-size: 1.2rem;
}

/* AI 生成按钮 */
.btn-ai {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-ai:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-ai:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Loading spinner */
.ai-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
}

@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 空态 */
.ai-suggest-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-8);
  gap: var(--space-3);
}

.ai-suggest-empty-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.ai-suggest-empty-text {
  font-size: 0.875rem;
  color: var(--gray-400);
}

/* 建议元信息 */
.ai-suggest-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6) var(--space-2);
  border-bottom: 1px solid var(--gray-50);
}

.ai-suggest-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
}

.ai-suggest-time {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* 建议列表 */
.ai-suggest-list {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* 建议卡片 */
.ai-suggest-card {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  overflow: hidden;
  transition: box-shadow var(--transition-base), opacity 0.3s;
}

.ai-suggest-card:hover {
  box-shadow: var(--shadow-md);
}

.ai-suggest-card.ai-card-adopted {
  opacity: 0.7;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* 左侧色条+图标 */
.ai-suggest-card-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  border-left: 4px solid;
}

.ai-suggest-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* 中间内容区 */
.ai-suggest-card-body {
  flex: 1;
  padding: var(--space-3) var(--space-2);
  min-width: 0;
}

.ai-suggest-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.ai-suggest-category {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.ai-suggest-before {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
}

.ai-suggest-arrow {
  color: var(--gray-400);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.ai-suggest-action {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.ai-suggest-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--gray-500);
}

.ai-suggest-purpose {
  color: var(--gray-500);
  font-style: italic;
}

/* 右侧操作按钮 */
.ai-suggest-card-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  justify-content: center;
  flex-shrink: 0;
}

.ai-adopt-btn {
  padding: var(--space-2) var(--space-3);
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
}

.ai-adopt-btn:hover {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.ai-dismiss-btn {
  padding: var(--space-2) var(--space-3);
  background: transparent;
  color: var(--gray-400);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.ai-dismiss-btn:hover {
  background: var(--danger-50);
  color: var(--danger-500);
  border-color: var(--danger-500);
}

/* 已采纳 badge */
.ai-adopted-badge {
  padding: var(--space-2) var(--space-3);
  background: #dcfce7;
  color: #16a34a;
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  text-align: center;
}

/* ===== 用户菜单 ===== */
.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.2;
}

.user-plan {
  font-size: 0.7rem;
  color: var(--gray-400);
  line-height: 1.2;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.btn-logout:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ================================
   Creator Center Tabs
   ================================ */
.creator-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.creator-tab {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition-base);
}

.creator-tab:hover {
  color: var(--gray-700);
  background: rgba(255, 255, 255, 0.5);
}

.creator-tab.active {
  background: white;
  color: var(--primary-600);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

/* WeChat Article Preview */
.wechat-preview {
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 32px 24px;
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.8;
  color: #333;
  font-size: 15px;
}

.wechat-preview h1 {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
  line-height: 1.4;
  text-align: center;
}

.wechat-preview h2 {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-500);
  display: inline-block;
}

.wechat-preview h3 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 20px 0 8px;
}

.wechat-preview p {
  margin-bottom: 16px;
}

.wechat-preview strong {
  color: var(--primary-600);
}

.wechat-preview em {
  color: #666;
}

.wechat-preview blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: #f7f7f7;
  border-left: 4px solid var(--primary-500);
  color: #555;
  border-radius: 0 8px 8px 0;
}

.wechat-preview blockquote p {
  margin: 0;
}

.wechat-preview ul,
.wechat-preview ol {
  margin: 12px 0;
  padding-left: 24px;
}

.wechat-preview li {
  margin-bottom: 6px;
}

.wechat-preview hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 24px 0;
}

.wechat-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--gray-400);
  font-size: 14px;
}

/* ================================
   Diagnosis Report Styles
   ================================ */
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.report-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-section {
  position: relative;
}

.report-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-100);
}

.report-section-icon {
  font-size: 20px;
}

.report-card {
  padding: 20px;
}

/* Metrics Row */
.report-metrics {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--gray-100);
  padding-top: 12px;
}

.report-metric {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
}

.report-metric+.report-metric {
  border-left: 1px solid var(--gray-100);
}

.report-metric.highlight {
  background: var(--primary-50);
  border-radius: 8px;
  margin: -4px 0;
  padding: 12px 4px;
}

.report-metric-label {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.report-metric-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}

.report-metric-value.negative {
  color: var(--danger);
}

/* Quick Findings */
.report-findings {
  padding: 4px 0;
}

.report-finding-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-700);
}

.report-finding-item+.report-finding-item {
  border-top: 1px solid var(--gray-50);
}

.report-finding-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-top: 2px;
}

.report-finding-icon.good {
  background: #dcfce7;
  color: #16a34a;
}

.report-finding-icon.warn {
  background: #fef3c7;
  color: #d97706;
}

.report-finding-icon.bad {
  background: #fee2e2;
  color: #dc2626;
}

/* Insurance Overview */
.report-insurance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 8px 0;
}

.insurance-member-card {
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: 10px;
}

.insurance-member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.insurance-member-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-800);
}

.insurance-member-role {
  font-size: 12px;
  color: var(--gray-500);
}

.insurance-progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.insurance-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.insurance-progress-bar.complete {
  background: var(--success);
}

.insurance-progress-bar.partial {
  background: var(--warning);
}

.insurance-progress-bar.insufficient {
  background: var(--danger);
}

.insurance-gaps {
  font-size: 12px;
  color: var(--gray-500);
}