/* ===== Dashboard Layout ===== */
.dashboard-body {
  margin: 0;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar-logo {
  padding: 20px 24px;
  font-size: 1.15em;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85em;
}
.sidebar-user {
  padding: 12px 24px;
  font-size: 0.82em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.sidebar-user strong { color: var(--text); }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.9em;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.sidebar-nav a:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav a.active {
  background: #dbeafe;
  color: var(--primary);
  font-weight: 600;
  border-right: 3px solid var(--primary);
}
.sidebar-nav a .nav-icon { font-size: 1.2em; width: 24px; text-align: center; }
.sidebar-nav a .badge-soon {
  margin-left: auto;
  font-size: 0.7em;
  background: var(--surface2);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}
.sidebar-nav a .badge-ext {
  margin-left: auto;
  font-size: 0.65em;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.sidebar-nav a.ext-link { text-decoration: none; }
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.78em;
  color: var(--text-dim);
}
.sidebar-footer a { color: var(--text-dim); text-decoration: none; }

/* ===== Sidebar Global Save/Exit Actions ===== */
.sidebar-global-actions {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: rgba(248, 250, 252, 0.6);
}
.sidebar-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  font-size: 0.85em;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.sidebar-action-btn:hover { transform: translateY(-1px); }
.sidebar-action-btn:active { transform: translateY(0); }
.sidebar-save-btn {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.sidebar-save-btn:hover { box-shadow: 0 6px 16px rgba(37, 99, 235, 0.36); }
.sidebar-save-btn.dirty {
  animation: dirtyPulse 1.6s infinite ease-in-out;
}
@keyframes dirtyPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28); }
  50% { box-shadow: 0 4px 16px rgba(37, 99, 235, 0.55), 0 0 8px rgba(124, 58, 237, 0.35); }
}
.sidebar-exit-btn {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22);
}
.sidebar-exit-btn:hover { box-shadow: 0 6px 16px rgba(239, 68, 68, 0.32); }
.sidebar-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.sidebar-action-btn .sga-icon { font-size: 1.1em; line-height: 1; }

/* ===== 移动端顶栏响应式保存/退出入口（2026-08-18c） =====
   桌面/平板（>768px）隐藏；≤768px 顶栏显示，与抽屉内总控完全联动 */
.topbar-mobile-actions { display: none; }
.topbar-action-btn {
  flex: 0 0 auto;
  padding: 7px 12px;
  font-size: 0.8em;
}
@media (max-width: 768px) {
  .topbar-mobile-actions { display: flex; align-items: center; gap: 8px; }
  .topbar-action-btn .sga-icon { font-size: 1.05em; }
}
@media (max-width: 400px) {
  .topbar-action-btn { padding: 7px 9px; font-size: 0.75em; }
  .topbar-mobile-actions { gap: 6px; }
  .topbar-action-btn .sga-text { display: inline; }
}

/* ===== Global Toast ===== */
.acc-global-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9em;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.acc-global-toast.error {
  background: linear-gradient(135deg, #991b1b, #ef4444);
}
@media (max-width: 768px) {
  .acc-global-toast {
    top: auto;
    bottom: 24px;
    white-space: normal;
    max-width: 80vw;
    text-align: center;
  }
}

/* ===== Main Content ===== */
.main-content { flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 1.1em; margin: 0; font-weight: 700; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-date { font-size: 0.82em; color: var(--text-dim); }
.topbar .trial-badge {
  background: #fef3c7;
  color: #92400e;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.topbar .trial-badge:hover { background: #fde68a; transform: translateY(-1px); }
.content-area { flex: 1; padding: 32px; overflow-y: auto; min-width: 0; }

/* ===== AI Chat（V3 加宽 + 玻璃质感） ===== */
.chat-container {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column;
  height: calc(100vh - 140px);
}
.chat-header { text-align: center; margin-bottom: 20px; }
.chat-header h2 { font-size: 1.3em; margin-bottom: 6px; }
.chat-header p { color: var(--text-dim); font-size: 0.88em; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 0; }
.chat-msg { margin-bottom: 16px; display: flex; gap: 12px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1em; flex-shrink: 0;
}
.chat-msg.bot .chat-avatar { background: #dbeafe; }
.chat-msg.user .chat-avatar { background: var(--surface2); }
.chat-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9em;
  line-height: 1.6;
}
.chat-msg.bot .chat-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-top-right-radius: 4px;
}
.chat-welcome { text-align: center; padding: 40px 20px; }
.chat-welcome .icon { font-size: 3em; margin-bottom: 12px; }
.chat-welcome h3 { font-size: 1.15em; margin-bottom: 8px; }
.chat-welcome p { color: var(--text-dim); font-size: 0.88em; margin-bottom: 20px; }
.chat-suggestions { display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 0 auto; }
.chat-suggestion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 0.88em;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-suggestion:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,0.1); }
.chat-suggestion .suggestion-tag {
  display: inline-block;
  font-size: 0.75em;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.chat-input-area { padding: 16px 0; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.chat-input {
  flex: 1; padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9em; font-family: inherit;
  outline: none; transition: border-color 0.2s;
  box-sizing: border-box;
}
.chat-input:focus { border-color: var(--primary); }
.chat-send {
  padding: 12px 24px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  font-size: 0.9em; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
  white-space: nowrap;
}
.chat-send:hover { background: var(--primary-dark); }
.chat-send:disabled { background: var(--text-dim); cursor: not-allowed; }
.chat-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.chat-typing span {
  width: 8px; height: 8px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== Subscribe Modal ===== */
.subscribe-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.subscribe-modal.active { opacity: 1; visibility: visible; }
.subscribe-modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%; max-width: 420px; max-height: 90vh;
  overflow-y: auto;
  margin: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s;
}
.subscribe-modal.active .subscribe-modal-content { transform: translateY(0); }
.subscribe-modal-header { padding: 20px 24px 0; text-align: center; position: relative; }
.subscribe-modal-header h2 { font-size: 1.25em; margin: 0 0 4px; color: var(--text); }
.subscribe-modal-header .subtitle { color: var(--text-dim); font-size: 0.85em; }
.subscribe-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none;
  font-size: 1.5em; color: var(--text-dim);
  cursor: pointer; line-height: 1; padding: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.15s;
}
.subscribe-modal-close:hover { background: var(--surface2); color: var(--text); }
.subscribe-modal-body { padding: 20px 24px; }
.subscribe-price {
  text-align: center; margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.subscribe-price .amount {
  font-size: 2.6em; font-weight: 800;
  color: var(--text); line-height: 1;
}
.subscribe-price .amount .currency { font-size: 0.45em; vertical-align: top; margin-right: 2px; }
.subscribe-price .amount .unit { font-size: 0.35em; color: var(--text-dim); font-weight: 500; }
.subscribe-price .original { color: var(--text-dim); font-size: 0.85em; margin-top: 6px; }
.subscribe-price .original span { text-decoration: line-through; }
.subscribe-benefits { list-style: none; margin: 0 0 20px; padding: 0; }
.subscribe-benefits li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 0.9em; color: var(--text);
}
.subscribe-benefits li .check { color: var(--success); font-weight: 700; flex-shrink: 0; }
.subscribe-qrcode { text-align: center; margin-bottom: 16px; }
.subscribe-qrcode img {
  max-width: 220px; width: 100%; height: auto;
  border-radius: 8px; border: 1px solid var(--border);
}
.subscribe-qrcode .hint { margin-top: 8px; font-size: 0.85em; color: var(--text-dim); }
.subscribe-steps {
  background: var(--surface2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.85em;
  color: var(--text-dim);
  line-height: 1.8;
}
.subscribe-steps strong { color: var(--text); }
.subscribe-modal-footer { padding: 0 24px 24px; text-align: center; }
.subscribe-btn {
  display: block; width: 100%;
  padding: 12px;
  background: var(--success); color: #fff;
  border: none; border-radius: 10px;
  font-size: 0.95em; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
  margin-bottom: 10px;
}
.subscribe-btn:hover { background: #15803d; }
.subscribe-contact { font-size: 0.8em; color: var(--text-dim); line-height: 1.6; }
.subscribe-contact .time { color: var(--success); font-weight: 600; }

/* ===== Accounting Module（满屏布局 V3） ===== */
.accounting-module { max-width: 100%; margin: 0; width: 100%; }
.acc-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.acc-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.acc-summary-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--primary);
}
.acc-summary-card.income::before { background: var(--success); }
.acc-summary-card.expense::before { background: var(--danger); }
.acc-summary-card.profit::before { background: var(--primary); }
.acc-summary-card.tax::before { background: var(--warn); }
.acc-summary-label { font-size: 0.82em; color: var(--text-dim); }
.acc-summary-value { font-size: 1.75em; font-weight: 800; color: var(--text); margin-top: 4px; line-height: 1.2; }
.acc-summary-sub { font-size: 0.75em; color: var(--text-dim); margin-top: 4px; }

/* Accounting Form */
.acc-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.acc-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.acc-form-header h3 { font-size: 1em; font-weight: 700; color: var(--text); }
.acc-voucher-hint { font-size: 0.82em; color: var(--text-dim); }
.acc-voucher-hint strong { color: var(--primary); }
.acc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.acc-form-field { display: flex; flex-direction: column; gap: 4px; }
.acc-form-field-wide { grid-column: span 4; }
.acc-form-field label {
  font-size: 0.8em; color: var(--text-dim); font-weight: 600;
}
.acc-form-field label .req { color: var(--danger); }
.acc-input, .acc-select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9em; font-family: inherit;
  outline: none; transition: border-color 0.2s;
  box-sizing: border-box;
}
.acc-input:focus, .acc-select:focus { border-color: var(--primary); }
.acc-form-actions { display: flex; gap: 12px; }
.acc-submit-btn {
  padding: 12px 32px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  font-size: 0.9em; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.acc-submit-btn:hover { background: var(--primary-dark); }
.acc-reset-btn {
  padding: 12px 24px;
  background: var(--surface2); color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9em; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.acc-reset-btn:hover { background: var(--border); color: var(--text); }

/* Filter Bar */
.acc-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.acc-filter-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-filter-left label { font-size: 0.82em; color: var(--text-dim); font-weight: 600; }
.acc-filter-select, .acc-filter-input {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.85em; font-family: inherit;
  outline: none; transition: border-color 0.2s;
  box-sizing: border-box;
}
.acc-filter-select:focus, .acc-filter-input:focus { border-color: var(--primary); }
.acc-filter-input { min-width: 200px; }
.acc-export-btn {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85em; font-weight: 600;
  color: var(--primary);
  cursor: pointer; transition: all 0.15s;
}
.acc-export-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Records Table */
.acc-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.acc-list-card h3 {
  font-size: 1em; font-weight: 700; color: var(--text);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.acc-table-wrap { overflow-x: auto; }
.acc-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.acc-table th {
  background: var(--surface2);
  color: var(--text-dim);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  font-size: 0.85em;
  white-space: nowrap;
}
.acc-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.acc-table tr:hover td { background: var(--surface2); }
.acc-table-pro th:nth-child(7),
.acc-table-pro td:nth-child(7) { text-align: right; }
.acc-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.78em; font-weight: 600;
}
.acc-type-badge.income { background: #dcfce7; color: #166534; }
.acc-type-badge.expense { background: #fee2e2; color: #991b1b; }
.acc-type-badge.transfer { background: #e0e7ff; color: #3730a3; }
.acc-inv-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72em; font-weight: 600;
}
.acc-inv-badge.special { background: #dbeafe; color: #1e40af; }
.acc-inv-badge.normal { background: #f1f5f9; color: #475569; }
.acc-inv-badge.electronic { background: #dcfce7; color: #166534; }
.acc-delete-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8em; color: var(--danger);
  cursor: pointer; transition: all 0.15s;
}
.acc-delete-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.acc-empty-hint { text-align: center; color: var(--text-dim); font-size: 0.88em; padding: 32px 0; }

/* ===== Report Module（满屏布局 V3） ===== */
.report-module { max-width: 100%; margin: 0; width: 100%; }
.report-month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.report-month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}
.report-month-picker label {
  font-size: 0.85em;
  color: var(--text-dim);
  font-weight: 500;
}
.report-month-input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95em;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 6px;
  outline: none;
  cursor: pointer;
}
.report-month-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 0.85em;
}
.report-month-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}
.report-month-btn.report-month-today {
  width: auto;
  padding: 0 10px;
  font-size: 0.8em;
}
.report-month-note {
  font-size: 0.8em;
  color: var(--text-dim);
}
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.report-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.report-kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--primary);
}
.report-kpi-card.purple::before { background: var(--accent); }
.report-kpi-card.green::before { background: var(--success); }
.report-kpi-card.orange::before { background: var(--warn); }
.report-kpi-card.cyan::before { background: #0891b2; }
.report-kpi-label { font-size: 0.82em; color: var(--text-dim); }
.report-kpi-value { font-size: 1.75em; font-weight: 800; color: var(--text); margin-top: 4px; line-height: 1.2; }
.report-kpi-sub { font-size: 0.75em; color: var(--text-dim); margin-top: 4px; }
.report-kpi-trend { font-size: 0.78em; font-weight: 600; margin-top: 6px; }
.report-kpi-trend.up { color: var(--success); }
.report-kpi-trend.down { color: var(--danger); }
.report-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 20px;
}
.report-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.report-chart-wrap h3 {
  font-size: 1em; font-weight: 700; color: var(--text);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.report-chart-box { position: relative; width: 100%; height: 280px; }
.report-fin-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.88em; margin-top: 8px;
}
.report-fin-table th {
  background: var(--surface2);
  color: var(--text-dim);
  padding: 10px 14px; text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  font-size: 0.85em;
}
.report-fin-table th:nth-child(2),
.report-fin-table td:nth-child(2),
.report-fin-table th:nth-child(3),
.report-fin-table td:nth-child(3) { text-align: right; }
.report-fin-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.report-row-highlight td { background: var(--primary-light); font-weight: 700; }
.report-note {
  font-size: 0.78em; color: var(--text-dim);
  margin-top: 12px; padding: 8px 12px;
  background: var(--surface2); border-radius: 8px;
}
.report-note a { color: var(--primary); text-decoration: underline; }

/* ===== Tax Management Module（满屏布局 V3） ===== */
.tax-module { max-width: 100%; margin: 0; width: 100%; }
.tax-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.tax-overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
}
.tax-overview-icon { font-size: 2.2em; }
.tax-overview-label { font-size: 0.82em; color: var(--text-dim); }
.tax-overview-value { font-size: 1.5em; font-weight: 800; color: var(--text); }
.tax-overview-sub { font-size: 0.75em; color: var(--text-dim); }

/* Tax Calculator */
.tax-calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.tax-calc-card h3 {
  font-size: 1em; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tax-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tax-calc-item {
  background: var(--surface2);
  border-radius: 10px;
  padding: 16px;
}
.tax-calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.tax-calc-header h4 { font-size: 0.95em; font-weight: 700; color: var(--text); }
.tax-calc-select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.8em; font-family: inherit;
  outline: none;
}
.tax-calc-body label {
  display: block; font-size: 0.8em;
  color: var(--text-dim); margin-bottom: 4px; font-weight: 600;
}
.tax-calc-input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9em; font-family: inherit;
  outline: none; transition: border-color 0.2s;
  box-sizing: border-box;
}
.tax-calc-input:focus { border-color: var(--primary); }
.tax-calc-result {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 700;
}

/* Tax Calendar */
.tax-calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.tax-calendar-card h3 {
  font-size: 1em; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tax-cal-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.tax-cal-table th {
  background: var(--surface2);
  color: var(--text-dim);
  padding: 10px 14px; text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  font-size: 0.85em;
}
.tax-cal-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.tax-cal-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.78em; font-weight: 600;
}
.tax-cal-status.filed { background: #dcfce7; color: #166534; }
.tax-cal-status.pending { background: #fef3c7; color: #92400e; }
.tax-cal-status.overdue { background: #fee2e2; color: #991b1b; }
.tax-cal-action {
  padding: 4px 12px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: none;
  font-size: 0.8em; color: var(--primary);
  cursor: pointer; transition: all 0.15s;
}
.tax-cal-action:hover { background: var(--primary); color: #fff; }

/* Tax Steps */
.tax-steps-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.tax-steps-card h3 {
  font-size: 1em; font-weight: 700;
  margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tax-steps { display: flex; flex-direction: column; gap: 16px; }
.tax-step { display: flex; gap: 16px; align-items: flex-start; }
.tax-step-num {
  width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1em; font-weight: 700;
  flex-shrink: 0;
}
.tax-step-content strong { display: block; font-size: 0.92em; margin-bottom: 4px; }
.tax-step-content p { font-size: 0.82em; color: var(--text-dim); margin: 0; }

/* ===== Invoice Management Module（满屏布局 V3） ===== */
.invoice-module { max-width: 100%; margin: 0; width: 100%; }
.inv-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.inv-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.inv-summary-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--primary);
}
.inv-summary-card:nth-child(2)::before { background: var(--accent); }
.inv-summary-card:nth-child(3)::before { background: var(--warn); }
.inv-summary-card:nth-child(4)::before { background: var(--success); }
.inv-summary-label { font-size: 0.82em; color: var(--text-dim); }
.inv-summary-value { font-size: 1.5em; font-weight: 800; color: var(--text); margin-top: 4px; }
.inv-summary-sub { font-size: 0.75em; color: var(--text-dim); margin-top: 4px; }
.inv-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.inv-tab {
  padding: 10px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  font-size: 0.9em; font-weight: 600;
  color: var(--text-dim);
  cursor: pointer; transition: all 0.15s;
}
.inv-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.inv-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.inv-form-card h3 {
  font-size: 1em; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.inv-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.inv-list-card h3 {
  font-size: 1em; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ===== Risk Management Module（满屏布局 V3） ===== */
.risk-module { max-width: 100%; margin: 0; width: 100%; }
.risk-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
  display: flex; gap: 32px; align-items: center;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.risk-score-left { display: flex; gap: 20px; align-items: center; }
.risk-score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--success) 0% 85%, var(--surface2) 85% 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.risk-score-circle::after {
  content: ''; position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--surface);
}
.risk-score-num {
  position: relative; z-index: 1;
  font-size: 1.8em; font-weight: 800;
  color: var(--success);
}
.risk-score-label {
  position: relative; z-index: 1;
  font-size: 0.7em; color: var(--text-dim);
}
.risk-score-info h3 { font-size: 1.1em; margin-bottom: 6px; }
.risk-score-info p { font-size: 0.82em; color: var(--text-dim); margin: 0; }
.risk-score-grade {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  background: #dcfce7;
  color: #166534;
  border-radius: 20px;
  font-size: 0.82em; font-weight: 700;
}
.risk-score-right { flex: 1; min-width: 280px; }
.risk-dim-item {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.risk-dim-name { font-size: 0.82em; color: var(--text-dim); width: 70px; text-align: right; }
.risk-dim-bar {
  flex: 1; height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}
.risk-dim-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--success), #4ade80);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.risk-dim-val { font-size: 0.82em; font-weight: 700; color: var(--text); width: 30px; }

.risk-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.risk-list-card h3 {
  font-size: 1em; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.risk-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.risk-table th {
  background: var(--surface2);
  color: var(--text-dim);
  padding: 10px 14px; text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  font-size: 0.85em;
}
.risk-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.risk-level {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.78em; font-weight: 600;
}
.risk-level.high { background: #fee2e2; color: #991b1b; }
.risk-level.medium { background: #fef3c7; color: #92400e; }
.risk-level.low { background: #dbeafe; color: #1e40af; }
.risk-status-ok {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.78em; font-weight: 600;
  background: #dcfce7; color: #166534;
}
.risk-status-warn {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.78em; font-weight: 600;
  background: #fef3c7; color: #92400e;
}

.risk-rules-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.risk-rules-card h3 {
  font-size: 1em; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.risk-rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.risk-rule-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface2);
  border-radius: 10px;
  padding: 14px;
}
.risk-rule-icon { font-size: 1.6em; flex-shrink: 0; }
.risk-rule-content strong { display: block; font-size: 0.88em; margin-bottom: 4px; }
.risk-rule-content p { font-size: 0.78em; color: var(--text-dim); margin: 0; }

/* ===== Month Selector ===== */
.acc-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.acc-month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}
.acc-month-picker label {
  font-size: 0.85em;
  color: var(--text-dim);
  font-weight: 500;
}
.acc-month-input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95em;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 6px;
  outline: none;
  cursor: pointer;
}
.acc-month-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 0.85em;
}
.acc-month-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}
.acc-month-btn.acc-month-today {
  width: auto;
  padding: 0 10px;
  font-size: 0.8em;
}
.acc-month-note {
  font-size: 0.8em;
  color: var(--text-dim);
}

/* ===== Invoice Recognition ===== */
.inv-recognize-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.inv-recognize-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.inv-recognize-icon {
  font-size: 1.8em;
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37,99,235,0.08);
}
.inv-recognize-title { flex: 1; }
.inv-recognize-title h4 {
  margin: 0 0 4px 0;
  font-size: 1.05em;
  color: var(--text);
}
.inv-recognize-title p {
  margin: 0;
  font-size: 0.82em;
  color: var(--text-dim);
}
.inv-recognize-tag {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 0.7em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}
.inv-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-upload-zone:hover, .inv-upload-zone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}
.inv-upload-icon { font-size: 2em; margin-bottom: 8px; }
.inv-upload-text {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}
.inv-upload-hint {
  font-size: 0.78em;
  color: var(--text-dim);
}
.inv-upload-preview {
  position: relative;
  width: 100%;
}
.inv-upload-preview img {
  max-height: 180px;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.inv-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 1.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-recognize-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.inv-recognize-actions button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.88em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inv-scan-btn {
  background: var(--primary);
  color: #fff;
}
.inv-scan-btn:hover { background: #1d4ed8; }
.inv-upload-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border) !important;
}
.inv-upload-btn:hover { border-color: var(--primary) !important; color: var(--primary); }
.inv-verify-btn {
  background: #10b981;
  color: #fff;
}
.inv-verify-btn:hover:not(:disabled) { background: #059669; }
.inv-verify-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}
.inv-fill-btn {
  background: #f59e0b;
  color: #fff;
}
.inv-fill-btn:hover:not(:disabled) { background: #d97706; }
.inv-fill-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}
.inv-recognize-result {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.inv-recognize-result.recognizing {
  opacity: 0.7;
  pointer-events: none;
}
.inv-result-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 0.95em;
}
.inv-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.inv-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inv-result-item.wide { grid-column: span 2; }
.inv-result-item span {
  font-size: 0.75em;
  color: var(--text-dim);
}
.inv-result-item strong {
  font-size: 0.9em;
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}
.inv-verify-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88em;
}
.inv-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.inv-status-dot.pending { background: #94a3b8; }
.inv-status-dot.success { background: #10b981; }
.inv-status-dot.error { background: #ef4444; }
.inv-disclaimer {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.78em;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* ===== Demo Label ===== */
.inv-demo-label {
  margin-top: 8px;
  padding: 4px 10px;
  background: #fff3cd;
  color: #856404;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

/* ===== Responsive V3（三端自适应：桌面满屏 / 平板图标栏 / 手机抽屉） ===== */

/* ---- 移动端菜单按钮（仅小屏显示，默认隐藏） ---- */
.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--primary); }
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
/* 抽屉遮罩（仅手机端） */
.sidebar-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-overlay.active { opacity: 1; }

/* ---- 平板断点（769px ~ 1024px）：侧边栏收缩为图标栏 ---- */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 68px; }
  .sidebar-logo { padding: 18px 0; justify-content: center; font-size: 0; }
  .sidebar-user { display: none; }
  .sidebar-nav a {
    justify-content: center;
    padding: 14px 0;
    font-size: 0;
    position: relative;
  }
  .sidebar-nav a .nav-icon { font-size: 19px; width: auto; }
  .sidebar-nav a .badge-soon,
  .sidebar-nav a .badge-ext { display: none; }
  .sidebar-nav a.active { border-right: none; border-left: 3px solid var(--primary); }
  /* 悬停气泡提示 */
  .sidebar-nav a[data-module]::after,
  .sidebar-nav a.ext-link::after {
    content: attr(data-tip);
    position: absolute;
    left: 76px; top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
  }
  .sidebar-nav a:hover::after { opacity: 1; }
  .sidebar-footer { padding: 14px 0; text-align: center; font-size: 0; }
  .sidebar-global-actions { flex-direction: column; padding: 10px 8px; gap: 8px; }
  .sidebar-action-btn { padding: 10px 4px; }
  .sidebar-action-btn .sga-text { display: none; }
  .sidebar-action-btn .sga-icon { font-size: 1.3em; }
  .content-area { padding: 20px; }
  .topbar { padding: 14px 20px; }
  .acc-form-grid { grid-template-columns: 1fr 1fr; }
  .acc-form-field-wide { grid-column: span 2; }
  .inv-result-grid { grid-template-columns: repeat(2, 1fr); }
  .risk-rules-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- 手机断点（≤768px）：侧边栏变抽屉 ---- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 250px;
    min-height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.18); }
  .sidebar-overlay.active { display: block; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar h1 { font-size: 1em; }
  .topbar-right { gap: 10px; }
  .topbar-date { display: none; }
  .content-area { padding: 16px; }
  .chat-container { height: calc(100vh - 118px); max-width: 100%; }
  .chat-bubble { max-width: 85%; }
  .subscribe-modal-content { margin: 12px; }
  .report-grid-2 { grid-template-columns: 1fr; }
  .report-chart-box { height: 220px; }
  .report-kpi-grid { grid-template-columns: 1fr 1fr; }
  .report-month-bar { flex-direction: column; align-items: flex-start; }
  .report-month-picker { width: 100%; }
  .acc-form-grid { grid-template-columns: 1fr 1fr; }
  .acc-form-field-wide { grid-column: span 2; }
  .acc-summary-grid { grid-template-columns: 1fr 1fr; }
  .acc-table { font-size: 0.82em; }
  .acc-table th, .acc-table td { padding: 6px 8px; }
  .tax-calc-grid { grid-template-columns: 1fr; }
  .risk-score-card { flex-direction: column; align-items: flex-start; }
  .risk-rules-grid { grid-template-columns: 1fr; }
  .inv-tabs { flex-wrap: wrap; }
  .acc-summary-header { flex-direction: column; align-items: flex-start; }
  .inv-result-grid { grid-template-columns: 1fr 1fr; }
  .inv-result-item.wide { grid-column: span 2; }
  .inv-recognize-actions button { flex: 1; justify-content: center; }
  .sidebar-global-actions { padding: 14px 16px; }
  .sidebar-action-btn { padding: 12px 10px; font-size: 0.9em; }
}


/* ===== 产品矩阵返回入口（白底顶栏场景，深色样式）） */
.portal-link {
  display: inline-block;
  margin-right: 12px;
  padding: 6px 14px;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 8px;
  color: #1e293b !important;
  background: rgba(15, 23, 42, 0.04);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  vertical-align: middle;
  transition: background 0.2s, border-color 0.2s;
}
.portal-link:hover {
  background: rgba(15, 23, 42, 0.1);
  border-color: rgba(15, 23, 42, 0.4);
  color: #0f172a !important;
}

/* ============================================================
   V3 AI 高科技视觉层（2026-08-18 星途重塑）
   极光背景 · 玻璃拟态 · 渐变辉光 · 平滑动效
   ============================================================ */

/* ---- 极光渐变背景 ---- */
.dashboard-body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 30%, rgba(37, 99, 235, 0.10), transparent 55%),
    radial-gradient(900px 500px at 50% 110%, rgba(14, 165, 233, 0.08), transparent 60%),
    linear-gradient(180deg, #f6f8fd 0%, #eef2fb 100%);
  background-attachment: fixed;
}

/* ---- 侧边栏：玻璃拟态 + 渐变品牌光带（仅桌面/平板，避免覆盖手机抽屉） ---- */
@media (min-width: 769px) {
  .sidebar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-right: 1px solid rgba(148, 163, 184, 0.25);
    position: relative;
  }
  .sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #2563eb 0%, #7c3aed 45%, #0ea5e9 100%);
    opacity: 0.85;
  }
  .sidebar-logo {
    background: linear-gradient(120deg, #2563eb, #7c3aed, #0ea5e9);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brandFlow 6s linear infinite;
  }
  .sidebar-nav a { border-radius: 10px; margin: 2px 10px; padding-left: 14px; }
  .sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.08));
    border-right: none;
    border-left: 3px solid var(--primary);
    padding-left: 11px;
  }
}

/* ---- 品牌流动动画 ---- */
@keyframes brandFlow {
  to { background-position: 200% center; }
}

/* ---- Logo 图标辉光（全平台） ---- */
.sidebar-logo .logo-icon {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  -webkit-text-fill-color: #fff;
}

/* ---- 导航交互 ---- */
.sidebar-nav a { transition: background 0.15s, color 0.15s, transform 0.15s; }
.sidebar-nav a:hover { transform: translateX(2px); }

/* ---- 顶栏：玻璃拟态吸顶 ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
.topbar h1 {
  background: linear-gradient(120deg, #0f172a 30%, #2563eb 60%, #7c3aed 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar .trial-badge {
  background: linear-gradient(120deg, #fef3c7, #fde68a);
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.18);
}

/* ---- 卡片：玻璃质感 + 辉光悬浮 ---- */
.acc-summary-card, .report-kpi-card, .inv-summary-card,
.acc-form-card, .acc-list-card, .report-chart-wrap,
.tax-calc-card, .tax-calendar-card, .tax-steps-card,
.inv-form-card, .inv-list-card, .risk-list-card, .risk-rules-card, .risk-score-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.acc-summary-card:hover, .report-kpi-card:hover, .inv-summary-card:hover, .tax-overview-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.14), 0 2px 8px rgba(124, 58, 237, 0.08);
}
.acc-summary-value, .report-kpi-value, .inv-summary-value, .tax-overview-value {
  background: linear-gradient(120deg, #0f172a 20%, #2563eb 65%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- 主操作按钮：渐变辉光 ---- */
.chat-send, .acc-submit-btn, .subscribe-btn {
  background: linear-gradient(120deg, #2563eb 0%, #4f46e5 55%, #7c3aed 100%);
  background-size: 180% auto;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: background-position 0.4s ease, transform 0.15s ease, box-shadow 0.25s ease;
}
.chat-send:hover, .acc-submit-btn:hover, .subscribe-btn:hover {
  background-position: right center;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}

/* ---- 聊天区科技感 ---- */
.chat-msg.bot .chat-bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.chat-msg.bot .chat-avatar {
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}
.chat-suggestion {
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.chat-suggestion:hover {
  transform: translateX(3px);
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.14);
}
.chat-input { background: rgba(255, 255, 255, 0.92); }
.chat-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.acc-input:focus, .acc-select:focus, .tax-calc-input:focus,
.acc-filter-select:focus, .acc-filter-input:focus {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* ---- 风险分数环辉光 ---- */
.risk-score-circle { box-shadow: 0 0 24px rgba(22, 163, 74, 0.18); }

/* ---- 模块入场动画 ---- */
.module-enter { animation: moduleFadeUp 0.4s ease both; }
@keyframes moduleFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- 自定义滚动条 ---- */
.chat-messages::-webkit-scrollbar, .content-area::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-thumb, .content-area::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.35), rgba(124, 58, 237, 0.35));
  border-radius: 8px;
}
.chat-messages::-webkit-scrollbar-track, .content-area::-webkit-scrollbar-track {
  background: transparent;
}

/* ---- 修复：备案条/弹窗等 body 级元素不得参与 flex 布局（否则抢占主内容宽度） ---- */
.dashboard-body > .cg-beian-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  z-index: 600;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dashboard-body .content-area { padding-bottom: 64px; }

/* ---- 小屏性能与可读性降级 ---- */
@media (max-width: 1024px) {
  .sidebar::before { width: 2px; }
}
@media (max-width: 768px) {
  .sidebar { background: rgba(255, 255, 255, 0.97); }
  .dashboard-body { background-attachment: scroll; }
}
