/* =============================================
   SHOW YES · 全球会展物流风险雷达 — Premium Chat UI v2
   Design: Deep Trace Sci-Fi, matching index page
   Colors: Dark navy + cyan/gold accents
   Font: Rajdhani + Noto Sans SC + Inter
   ============================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Color Primitives */
  --white: #ffffff;
  --black: #000000;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-150: #ebedf0;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #0b0f1a;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  /* Sci-fi accent colors matching index page */
  --accent-blue: #73dcff;
  --accent-gold: #f2e0bd;
  --accent-cyan: rgba(115, 220, 255, 1);

  /* Semantic Tokens — Light (fallback) */
  --bg-app: #0c1620;
  --bg-sidebar: linear-gradient(180deg, rgba(11, 19, 29, 0.78), rgba(5, 9, 15, 0.9));
  --bg-main: linear-gradient(180deg, rgba(8, 14, 22, 0.86), rgba(4, 8, 13, 0.96));
  --bg-input: linear-gradient(180deg, rgba(241, 245, 249, 0.94), rgba(212, 220, 229, 0.86));
  --bg-input-focus: linear-gradient(180deg, rgba(245, 249, 253, 0.96), rgba(220, 228, 237, 0.9));
  --bg-hover: rgba(115, 220, 255, 0.08);
  --bg-active: rgba(115, 220, 255, 0.12);
  --bg-user-bubble: linear-gradient(180deg, rgba(236, 241, 247, 0.96), rgba(210, 219, 228, 0.92));
  --bg-assistant-bubble: linear-gradient(180deg, rgba(13, 23, 35, 0.92), rgba(8, 14, 21, 0.94));
  --bg-suggestion: linear-gradient(180deg, rgba(16, 24, 35, 0.82), rgba(8, 12, 18, 0.94));
  --bg-suggestion-hover: linear-gradient(180deg, rgba(20, 31, 45, 0.9), rgba(9, 14, 21, 0.98));
  --bg-send: linear-gradient(180deg, rgba(64, 48, 33, 0.96), rgba(27, 20, 14, 0.98));
  --bg-send-hover: linear-gradient(180deg, rgba(86, 64, 43, 0.98), rgba(33, 24, 15, 1));
  --bg-send-disabled: linear-gradient(180deg, rgba(80, 88, 97, 0.84), rgba(58, 64, 71, 0.92));
  --bg-model-dropdown: rgba(11, 19, 29, 0.95);
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --bg-code: rgba(13, 23, 35, 0.88);
  --bg-header: rgba(8, 14, 22, 0.85);

  --text-primary: #f4f7fb;
  --text-secondary: #bfbfbf;
  --text-tertiary: #8c8c8c;
  --text-on-accent: var(--white);
  --text-user-bubble: #132133;
  --text-assistant-bubble: #f4f7fb;
  --text-suggestion-title: #132132;
  --text-suggestion-desc: #132132;
  --text-link: var(--accent-blue);
  --text-placeholder: rgba(18, 32, 47, 0.62);
  --text-disclaimer: var(--text-tertiary);

  --border-default: rgba(115, 220, 255, 0.14);
  --border-light: rgba(229, 236, 245, 0.08);
  --border-input: rgba(255, 255, 255, 0.42);
  --border-input-focus: rgba(115, 220, 255, 0.44);
  --border-suggestion: rgba(212, 177, 123, 0.26);
  --border-suggestion-hover: rgba(115, 220, 255, 0.42);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-input: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 22px 48px rgba(0, 0, 0, 0.28);
  --shadow-input-focus: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 0 0 4px rgba(115, 220, 255, 0.12), 0 24px 56px rgba(0, 0, 0, 0.32);
  --shadow-dropdown: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-suggestion: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-suggestion-hover: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px rgba(0, 0, 0, 0.22);
  --shadow-expand-btn: 0 2px 8px rgba(0, 0, 0, 0.3);

  /* Sizing */
  --sidebar-width: 220px;
  --header-height: 52px;
  --input-min-height: 52px;
  --input-max-height: 200px;
  --message-max-width: 720px;
  --content-max-width: 1100px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-sidebar: 280ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-display: 'Rajdhani', 'Noto Sans SC', sans-serif;
  --font-size-xs: 13px;
  --font-size-sm: 15px;
  --font-size-base: 16px;
  --font-size-md: 17px;
  --font-size-lg: 18px;
  --font-size-xl: 21px;
  --font-size-2xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-snug: 1.4;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.75;

  /* Scrollbar */
  --scrollbar-width: 5px;
  --scrollbar-thumb: rgba(115, 220, 255, 0.18);
  --scrollbar-thumb-hover: rgba(115, 220, 255, 0.32);

  /* Z-index */
  --z-sidebar: 40;
  --z-header: 30;
  --z-dropdown: 50;
  --z-expand-btn: 35;
  --z-overlay: 39;
}

/* ---------- Dark Theme ---------- */
[data-theme="dark"] {
  --bg-app: #0c1620;
  --text-primary: #f4f7fb;
  --text-secondary: #bfbfbf;
  --text-tertiary: #8c8c8c;
  --text-placeholder: rgba(18, 32, 47, 0.62);

  --scrollbar-thumb: rgba(115, 220, 255, 0.18);
  --scrollbar-thumb-hover: rgba(115, 220, 255, 0.32);
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
  --bg-app: #0e1a26;
  --text-primary: #f4f7fb;
  --text-secondary: #c0c8d2;
  --text-tertiary: #7a8694;
  --text-placeholder: rgba(18, 32, 47, 0.62);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background: var(--bg-app);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: var(--scrollbar-width);
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ========================================
   Layout
   ======================================== */

.app-layout {
  display: flex;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  padding: 18px;
  gap: 14px;
  background: transparent;
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
  position: relative;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  padding: 18px 14px 16px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(11, 19, 29, 0.78), rgba(5, 9, 15, 0.9));
  border: 1px solid var(--border-default);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  transition: width var(--transition-sidebar), min-width var(--transition-sidebar), opacity var(--transition-sidebar);
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
  padding: 0;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 8px;
  flex-shrink: 0;
}

.sidebar-header::before {
  content: "SHOW YES";
  display: block;
  padding: 0 6px;
  color: var(--accent-blue);
  font-family: var(--font-family-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(115, 220, 255, 0.14);
  background: rgba(13, 24, 37, 0.88);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(20, 34, 49, 0.94);
  color: var(--text-primary);
  border-color: rgba(115, 220, 255, 0.32);
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: auto;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(16, 28, 41, 0.9), rgba(9, 16, 24, 0.96));
  border: 1px solid rgba(115, 220, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.new-chat-btn:hover {
  background: linear-gradient(180deg, rgba(22, 36, 53, 0.94), rgba(11, 18, 27, 0.98));
  border-color: rgba(115, 220, 255, 0.34);
}

/* Sidebar Search */
.sidebar-search {
  padding: 4px 0 8px;
  flex-shrink: 0;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 32px;
  border-radius: var(--radius-sm);
  background: rgba(13, 24, 37, 0.88);
  border: 1px solid rgba(115, 220, 255, 0.14);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  background: rgba(20, 34, 49, 0.94);
  border-color: rgba(115, 220, 255, 0.32);
}

/* Conversation List */
.sidebar-conversations {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  margin-top: 14px;
}

.sidebar-conversations::before {
  content: "会话中枢";
  display: block;
  margin-bottom: 10px;
  padding: 0 6px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.conversation-group {
  margin-bottom: 4px;
}

.conversation-group-label {
  padding: 8px 8px 4px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}

.conversation-item:hover {
  background: rgba(115, 220, 255, 0.08);
  color: var(--text-primary);
}

.conversation-item.active {
  background: rgba(115, 220, 255, 0.12);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.conversation-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0 0;
  margin-top: 14px;
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.sidebar-footer-btn:hover {
  background: rgba(20, 34, 49, 0.94);
  color: var(--text-primary);
  border-color: rgba(115, 220, 255, 0.18);
}

.footer-btn-text {
  white-space: nowrap;
}

/* Theme Toggle Icons */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Sidebar Expand Button */
.sidebar-expand-btn {
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: var(--z-expand-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(13, 24, 37, 0.88);
  border: 1px solid rgba(115, 220, 255, 0.14);
  color: var(--text-secondary);
  box-shadow: var(--shadow-expand-btn);
  backdrop-filter: blur(24px);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.sidebar-expand-btn:hover {
  background: rgba(20, 34, 49, 0.94);
  color: var(--text-primary);
  border-color: rgba(115, 220, 255, 0.32);
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.55), rgba(4, 8, 13, 0.65));
  border: 1px solid var(--border-default);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.main-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 8, 13, 0.15), rgba(4, 8, 13, 0.35)),
    radial-gradient(circle at 79% 20%, rgba(125, 225, 255, 0.24), transparent 26%),
    url("/assets/background.png") center center / cover no-repeat;
  opacity: 0.88;
  pointer-events: none;
  z-index: 0;
}

.main-content::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 26px;
  border: 1px solid rgba(229, 236, 245, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 0 60px rgba(135, 198, 255, 0.05);
  pointer-events: none;
  z-index: 0;
}

.main-content > * {
  position: relative;
  z-index: 1;
}

/* ========================================
   Page Slider (Home ↔ News)
   ======================================== */

.page-slider {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.page-home {
  transform: translateY(0);
}

.page-news {
  transform: translateY(100%);
  background: rgba(8, 14, 22, 0.96);
}

/* When news page is active */
.page-slider.show-news .page-home {
  transform: translateY(-100%);
}

.page-slider.show-news .page-news {
  transform: translateY(0);
}

/* Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: rgba(8, 14, 22, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(229, 236, 245, 0.08);
  flex-shrink: 0;
}

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

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

/* Header Brand */
.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}

.header-brand-sub {
  font-family: var(--font-family-display);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.header-brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background: rgba(115, 220, 255, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(115, 220, 255, 0.18);
}

/* Decorative Star */
.deco-star {
  color: var(--text-tertiary);
}

/* Model Selector */
.model-selector {
  position: relative;
}

.model-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.model-selector-btn:hover {
  background: var(--bg-hover);
}

.model-name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family-display);
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.model-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  padding: 4px;
  background: rgba(11, 19, 29, 0.95);
  border: 1px solid rgba(115, 220, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  backdrop-filter: blur(24px);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.model-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background var(--transition-fast);
}

.model-option:hover {
  background: var(--bg-hover);
}

.model-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(115, 220, 255, 0.1);
  color: var(--accent-blue);
  flex-shrink: 0;
}

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

.model-option-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.model-option-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.model-check {
  color: var(--accent-blue);
  opacity: 0;
  flex-shrink: 0;
}

.model-option.active .model-check {
  opacity: 1;
}

/* ========================================
   Messages Viewport
   ======================================== */

.messages-viewport {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  position: relative;
}

/* Light overlay only on the messages/reply area, not the welcome input page */
.messages-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 10%, rgba(70, 130, 220, 0.14), transparent 50%),
    radial-gradient(ellipse at 70% 90%, rgba(50, 100, 200, 0.10), transparent 45%),
    linear-gradient(180deg, rgba(35, 65, 140, 0.22) 0%, rgba(45, 80, 160, 0.16) 50%, rgba(30, 60, 135, 0.20) 100%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Overlay disabled — keep background clean */
/* .main-content:has(.welcome-screen.hidden) .messages-viewport::before {
  opacity: 1;
} */

.messages-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Welcome Screen
   ======================================== */

.welcome-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 0;
}

.welcome-screen.hidden {
  display: none;
}

.welcome-content {
  text-align: center;
  max-width: 1060px;
  width: 100%;
  animation: fadeInUp 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.welcome-logo {
  margin-bottom: 16px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 20%, rgba(126, 224, 255, 0.2), rgba(22, 31, 43, 0.78));
  border: 1px solid rgba(115, 220, 255, 0.22);
  color: var(--accent-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.welcome-title {
  font-family: var(--font-family-display);
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  font-weight: var(--font-weight-bold);
  color: #f4f7fb;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  line-height: 1.05;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.welcome-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.8;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Suggestion Grid */
.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  text-align: left;
}

.suggestion-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 118px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.96), rgba(230, 236, 243, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 26px 56px rgba(0, 0, 0, 0.32);
  color: #132132;
  text-align: left;
  overflow: hidden;
  transition: all var(--transition-base);
}

.suggestion-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(19, 33, 50, 0.06), transparent);
  opacity: 0;
  transform: translateX(-24%);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.suggestion-card:hover {
  border-color: rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(238, 243, 249, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 28px 58px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.suggestion-card:hover::after {
  opacity: 1;
  transform: translateX(10%);
}

.suggestion-card:active {
  transform: translateY(0);
}

.suggestion-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 20%, rgba(19, 33, 50, 0.12), rgba(19, 33, 50, 0.06));
  border: 1px solid rgba(19, 33, 50, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  color: #132132;
  flex-shrink: 0;
}

.suggestion-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.suggestion-title {
  font-family: var(--font-family-display);
  font-size: 1.42rem;
  font-weight: var(--font-weight-bold);
  color: #132132;
  letter-spacing: 0.04em;
}

.suggestion-desc {
  font-size: 0.92rem;
  color: #132132;
  line-height: 1.7;
}

/* ========================================
   Welcome Input Box (centered on home)
   ======================================== */

.welcome-input-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 22px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.94), rgba(212, 220, 229, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 22px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  margin-bottom: 20px;
}

.welcome-input-box::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 86px;
  width: 82px;
  height: 18px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(104, 243, 255, 0.16) 12%,
    rgba(104, 243, 255, 0.95) 50%,
    rgba(104, 243, 255, 0.16) 88%,
    transparent 100%
  );
  clip-path: polygon(0 55%, 12% 55%, 18% 18%, 28% 86%, 38% 24%, 48% 72%, 58% 16%, 68% 80%, 78% 42%, 88% 58%, 100% 58%, 100% 68%, 0 68%);
  opacity: 0.82;
  pointer-events: none;
}

.welcome-input-box:focus-within {
  border-color: rgba(115, 220, 255, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 0 0 4px rgba(115, 220, 255, 0.12), 0 24px 56px rgba(0, 0, 0, 0.32);
}

.welcome-input-box .chat-textarea {
  color: #13202f;
  font-size: 1.1rem;
  font-weight: 500;
}

.welcome-input-box .chat-textarea::placeholder {
  color: rgba(18, 32, 47, 0.62);
}

.welcome-input-box .send-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(112, 88, 58, 0.45);
  background: linear-gradient(180deg, rgba(64, 48, 33, 0.96), rgba(27, 20, 14, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 22px rgba(0, 0, 0, 0.22);
  color: #efd3a8;
}

.welcome-input-box .send-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(86, 64, 43, 0.98), rgba(33, 24, 15, 1));
  border-color: rgba(212, 177, 123, 0.72);
  transform: translateY(-1px) scale(1);
}

.welcome-input-box .send-btn:disabled {
  opacity: 0.56;
  background: linear-gradient(180deg, rgba(80, 88, 97, 0.84), rgba(58, 64, 71, 0.92));
  border-color: transparent;
  color: rgba(255, 255, 255, 0.4);
}

/* Hide bottom input region when welcome screen is visible */
.main-content:has(.welcome-screen:not(.hidden)) .input-region {
  display: none;
}

/* ========================================
   News Ticker
   ======================================== */

.news-ticker {
  margin-top: 8px;
  padding: 22px 22px 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.96), rgba(230, 236, 243, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 26px 56px rgba(0, 0, 0, 0.32);
  color: #132132;
  overflow: hidden;
}

.news-ticker-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 12px;
  font-size: 0.86rem;
  font-weight: var(--font-weight-bold);
  color: #953f3f;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(19, 33, 50, 0.12);
  user-select: none;
}

.news-ticker-header span:nth-child(2) {
  font-family: var(--font-family-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #172436;
  letter-spacing: 0.03em;
}

.news-ticker-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7f80, #d64b4d);
  color: #fff;
  font-family: var(--font-family-display);
  font-size: 0.88rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.14em;
}

.news-ticker-live::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18);
  animation: tickerPulse 1.8s ease-in-out infinite;
}

[data-theme="dark"] .news-ticker-live {
  background: linear-gradient(180deg, #ff7f80, #d64b4d);
  color: #fff;
}

[data-theme="dark"] .news-ticker-live::before {
  background: #fff;
}

.news-ticker-updated {
  margin-left: 6px;
  font-size: 0.92rem;
  font-weight: var(--font-weight-normal);
  color: #627182;
  opacity: 0.7;
}
/* Viewport & track */
.news-ticker-viewport {
  height: 400px;
  overflow: hidden;
  position: relative;
  margin-top: 12px;
}

.news-ticker-viewport::before,
.news-ticker-viewport::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  z-index: 2;
  pointer-events: none;
}

.news-ticker-viewport::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(247, 249, 252, 0.96), transparent);
}

.news-ticker-viewport::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(230, 236, 243, 0.96), transparent);
}

.news-ticker-track {
  display: flex;
  flex-direction: column;
  animation: tickerScroll var(--ticker-duration, 40s) linear infinite;
}

/* Individual news item */
.news-ticker-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(19, 33, 50, 0.08);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.news-ticker-item:last-child {
  border-bottom: none;
}

.news-ticker-item:hover {
  background: rgba(19, 33, 50, 0.04);
}

.news-ticker-severity {
  border-radius: 999px;
  flex-shrink: 0;
  align-self: stretch;
}

.news-ticker-severity.sev-low { background: linear-gradient(180deg, rgba(96, 204, 162, 0.88), rgba(146, 238, 201, 0.5)); }
.news-ticker-severity.sev-medium { background: linear-gradient(180deg, rgba(105, 193, 255, 0.9), rgba(137, 228, 255, 0.52)); }
.news-ticker-severity.sev-high { background: linear-gradient(180deg, rgba(242, 157, 74, 0.94), rgba(250, 214, 126, 0.54)); }
.news-ticker-severity.sev-critical { background: linear-gradient(180deg, rgba(224, 104, 104, 0.9), rgba(255, 171, 100, 0.48)); }

.news-ticker-body {
  flex: 1;
  min-width: 0;
}

.news-ticker-title {
  font-size: 1.06rem;
  font-weight: var(--font-weight-bold);
  color: #142031;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-ticker-summary {
  font-size: 0.94rem;
  color: #4a5a6d;
  line-height: 1.7;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-ticker-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: #6c7989;
}

.news-ticker-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(19, 33, 50, 0.06);
  color: #556476;
  font-size: 0.82rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.6;
}

.news-ticker-tag.tag-weather { background: rgba(91, 182, 241, 0.14); color: #266b95; }
.news-ticker-tag.tag-port { background: rgba(242, 157, 74, 0.16); color: #b96a10; }
.news-ticker-tag.tag-geopolitical { background: rgba(236, 97, 97, 0.14); color: #b64143; }
.news-ticker-tag.tag-security { background: rgba(236, 97, 97, 0.14); color: #b64143; }
.news-ticker-tag.tag-regulation { background: rgba(91, 182, 241, 0.14); color: #266b95; }
.news-ticker-tag.tag-market { background: rgba(96, 204, 162, 0.14); color: #247557; }

[data-theme="dark"] .news-ticker-tag.tag-weather { background: rgba(91, 182, 241, 0.14); color: #266b95; }
[data-theme="dark"] .news-ticker-tag.tag-port { background: rgba(242, 157, 74, 0.16); color: #b96a10; }
[data-theme="dark"] .news-ticker-tag.tag-geopolitical { background: rgba(236, 97, 97, 0.14); color: #b64143; }
[data-theme="dark"] .news-ticker-tag.tag-security { background: rgba(236, 97, 97, 0.14); color: #b64143; }
[data-theme="dark"] .news-ticker-tag.tag-regulation { background: rgba(91, 182, 241, 0.14); color: #266b95; }
[data-theme="dark"] .news-ticker-tag.tag-market { background: rgba(96, 204, 162, 0.14); color: #247557; }

@keyframes tickerScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@keyframes tickerPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* "查看更多动态" button at ticker bottom */
.news-ticker-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 0;
  margin-top: 8px;
  font-size: 0.94rem;
  font-weight: var(--font-weight-semibold);
  color: #24384f;
  border-top: 1px solid rgba(19, 33, 50, 0.1);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.news-ticker-more:hover {
  color: #122239;
  background: rgba(19, 33, 50, 0.04);
}

.news-ticker-more svg {
  animation: bounceDown 1.8s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ========================================
   News Feed Full Page
   ======================================== */

.news-page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(229, 236, 245, 0.08);
  flex-shrink: 0;
  background: rgba(8, 14, 22, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
}

.news-page-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--accent-blue);
  border: 1px solid rgba(115, 220, 255, 0.18);
  background: rgba(13, 24, 37, 0.88);
  transition: background var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.news-page-back-btn:hover {
  background: rgba(20, 34, 49, 0.94);
  border-color: rgba(115, 220, 255, 0.34);
}

.news-page-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  position: absolute;
  right: 24px;
}

.news-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* News feed card */
.news-feed-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(115, 220, 255, 0.14);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 24, 35, 0.82), rgba(8, 12, 18, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.news-feed-card:hover {
  border-color: rgba(115, 220, 255, 0.32);
  background: linear-gradient(180deg, rgba(20, 31, 45, 0.9), rgba(9, 14, 21, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px rgba(0, 0, 0, 0.22);
}

.news-feed-severity {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}

.news-feed-severity.sev-low { background: linear-gradient(180deg, rgba(96, 204, 162, 0.88), rgba(146, 238, 201, 0.5)); }
.news-feed-severity.sev-medium { background: linear-gradient(180deg, rgba(105, 193, 255, 0.9), rgba(137, 228, 255, 0.52)); }
.news-feed-severity.sev-high { background: linear-gradient(180deg, rgba(242, 157, 74, 0.94), rgba(250, 214, 126, 0.54)); }
.news-feed-severity.sev-critical { background: linear-gradient(180deg, rgba(224, 104, 104, 0.9), rgba(255, 171, 100, 0.48)); }

.news-feed-content {
  flex: 1;
  min-width: 0;
}

.news-feed-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.news-feed-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: 1.4;
}

.news-feed-summary {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: 8px;
}

.news-feed-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.news-feed-region {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.news-feed-source {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-tertiary);
}

.news-ticker-source {
  color: #627182;
  font-style: italic;
}

/* Reuse ticker tag styles for feed tags */
.news-feed-meta .news-ticker-tag {
  font-size: 10px;
}

/* ========================================
   Messages
   ======================================== */

.messages-list {
  padding: 24px 0 16px;
}

.messages-list:empty {
  display: none;
}

.message {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  animation: messageIn 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.message + .message {
  border-top: 1px solid rgba(190, 165, 110, 0.06);
}

/* Avatar */
.message-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-top: 2px;
}

.message.user .message-avatar {
  background: linear-gradient(180deg, rgba(237, 242, 247, 0.96), rgba(209, 218, 227, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.48);
  color: #162536;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, rgba(30, 48, 72, 0.95), rgba(18, 32, 52, 0.92));
  border: 1px solid rgba(115, 220, 255, 0.22);
  color: var(--accent-blue);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(115, 220, 255, 0.06);
}

/* ---------- Message Card Wrappers ---------- */

/* User message: light frosted pearl card */
.message.user .message-body {
  background: linear-gradient(135deg, rgba(220, 228, 240, 0.92), rgba(200, 212, 228, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Assistant message: cool frosted glass card */
.message.assistant .message-body {
  background: linear-gradient(135deg, rgba(195, 210, 230, 0.88), rgba(180, 198, 222, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 24px rgba(0, 0, 0, 0.14);
}

/* Message Body */
.message-body {
  flex: 1;
  min-width: 0;
}

.message-role {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* User role label */
.message.user .message-role {
  color: #3a4a5c;
}

/* Assistant role label */
.message.assistant .message-role {
  color: #1a2e46;
}

.message-content {
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: #f0f4fa;
  word-break: break-word;
}

/* Dark text on light card for user messages */
.message.user .message-content {
  color: #122030;
}

.message.user .message-content p,
.message.user .message-content li {
  color: #1a2e42;
}

.message.user .message-content strong {
  color: #0a1520;
}

/* Dark text on light card for assistant responses */
.message.assistant .message-content {
  color: #0a1824;
}

.message.assistant .message-content p,
.message.assistant .message-content li {
  color: #102030;
}

.message.assistant .message-content strong {
  color: #061018;
}

.message-content p {
  margin-bottom: 12px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: var(--font-weight-semibold);
}

.message-content code {
  display: inline;
  padding: 2px 6px;
  background: rgba(15, 25, 40, 0.08);
  border: 1px solid rgba(15, 25, 40, 0.12);
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9em;
  color: #0e4466;
}

.message-content pre {
  margin: 12px 0;
  padding: 16px;
  background: rgba(12, 18, 30, 0.9);
  border: 1px solid rgba(50, 65, 85, 0.3);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

.message-content pre code {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  color: #d0e8f8;
}

.message-content ul, .message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content a {
  color: #0e5a8a;
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
  color: #0a4570;
}

/* Tables inside messages */
.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-base);
}

.message-content thead th {
  text-align: left;
  padding: 8px 12px;
  background: rgba(15, 25, 40, 0.08);
  border-bottom: 2px solid rgba(15, 30, 50, 0.15);
  font-weight: var(--font-weight-semibold);
  color: #1a2e44;
  white-space: nowrap;
}

.message-content tbody td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(15, 30, 50, 0.08);
  color: #1e3248;
  vertical-align: top;
}

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

.message-content tbody tr:hover {
  background: rgba(15, 30, 50, 0.05);
}

/* Horizontal rule */
.message-content hr {
  border: none;
  border-top: 1px solid rgba(15, 30, 50, 0.12);
  margin: 16px 0;
}

/* ---------- Light Message Card — Variable Overrides ---------- */
/* Remap design tokens for vessel-report / exhibition-report / thinking
   so they render correctly on the pearl frosted glass backgrounds */
.message.assistant .message-body,
.message.user .message-body {
  --text-primary: #0e1a2a;
  --text-secondary: #24364a;
  --text-tertiary: #3e5268;
  --text-link: #0e5080;
  --accent-blue: #0e5080;
  --accent-gold: #6a5018;
  --border-default: rgba(15, 30, 50, 0.18);
  --border-light: rgba(15, 30, 50, 0.12);
  --bg-hover: rgba(15, 30, 50, 0.09);
  --bg-code: rgba(15, 25, 40, 0.10);
}

/* ========================================
   Vessel Report — Structured HTML
   ======================================== */

.vessel-report {
  margin: -4px 0 0;
}

/* --- Conclusion Area --- */
.vr-conclusion {
  background: rgba(15, 25, 40, 0.05);
  border-left: 3px solid var(--blue-500, #3b82f6);
  border-radius: 0;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.vr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.vr-header-left {
  flex: 1;
  min-width: 0;
}

.vr-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.vr-vessel-id {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: var(--line-height-snug);
}

.vr-imo {
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.vr-ship-type {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  background: rgba(15, 25, 40, 0.08);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-left: 4px;
}

/* Risk Badge */
.vr-risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  flex-shrink: 0;
}

.vr-risk-badge.risk-low { background: rgba(34,197,94,0.10); color: #15803d; }
.vr-risk-badge.risk-medium { background: rgba(234,179,8,0.10); color: #a16207; }
.vr-risk-badge.risk-high { background: rgba(239,68,68,0.10); color: #b91c1c; }
.vr-risk-badge.risk-critical { background: rgba(239,68,68,0.15); color: #991b1b; }

[data-theme="dark"] .vr-risk-badge.risk-low { background: rgba(34,197,94,0.10); color: #4ade80; }
[data-theme="dark"] .vr-risk-badge.risk-medium { background: rgba(234,179,8,0.10); color: #fbbf24; }
[data-theme="dark"] .vr-risk-badge.risk-high { background: rgba(239,68,68,0.10); color: #f87171; }
[data-theme="dark"] .vr-risk-badge.risk-critical { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* Decision Summary */
.vr-decision-summary {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: var(--line-height-relaxed);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

/* Metrics Row */
.vr-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 12px;
}

.vr-metric {
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border-light);
}

.vr-metric:last-child {
  border-right: none;
}

.vr-metric-val {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.vr-metric-lbl {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Recommendations */
.vr-recs {
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.vr-section-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.vr-recs ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-primary);
  line-height: var(--line-height-relaxed);
}

.vr-recs li {
  margin-bottom: 4px;
}

/* --- Toggle Button --- */
.vr-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 8px 0;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: color var(--transition-fast);
}

.vr-toggle:hover {
  color: var(--text-link);
  background: transparent;
}

.vr-toggle-icon {
  transition: transform var(--transition-base);
}

.vr-expanded .vr-toggle .vr-toggle-icon {
  transform: rotate(180deg);
}

/* --- Detail Cards Area (collapsed by default) --- */
.vr-details {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.vr-expanded .vr-details {
  display: flex;
  animation: fadeInUp 250ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.vr-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vr-card {
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.10);
  border-radius: var(--radius-sm);
  padding: 14px;
  overflow: hidden;
}

.vr-card-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.vr-sub {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* KV Table (船舶信息, 航行状态) */
.vr-kv {
  width: 100%;
  border-collapse: collapse;
}

.vr-kv td {
  padding: 4px 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-base);
  vertical-align: top;
  color: var(--text-primary);
}

.vr-kv-k {
  color: var(--text-secondary);
  white-space: nowrap;
  padding-right: 16px;
  width: 1%;
}

.vr-hint {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
}

/* Data Table (延误, 航线, 天气) */
.vr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.vr-table th {
  text-align: left;
  padding: 5px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  background: transparent;
}

.vr-table td {
  padding: 6px 10px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

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

.vr-table tr.vr-hl td {
  font-weight: var(--font-weight-medium);
}

.vr-card-footer {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* Risk Tags */
.vr-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.vr-tag.risk-low { background: rgba(34,197,94,0.08); color: #15803d; }
.vr-tag.risk-medium { background: rgba(234,179,8,0.08); color: #a16207; }
.vr-tag.risk-high { background: rgba(239,68,68,0.08); color: #b91c1c; }
.vr-tag.risk-critical { background: rgba(239,68,68,0.12); color: #991b1b; }

[data-theme="dark"] .vr-tag.risk-low { background: rgba(34,197,94,0.10); color: #4ade80; }
[data-theme="dark"] .vr-tag.risk-medium { background: rgba(234,179,8,0.10); color: #fbbf24; }
[data-theme="dark"] .vr-tag.risk-high { background: rgba(239,68,68,0.10); color: #f87171; }
[data-theme="dark"] .vr-tag.risk-critical { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* Warning note */
.vr-warn {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fef9c3;
  color: #854d0e;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-base);
}

[data-theme="dark"] .vr-warn {
  background: rgba(234,179,8,0.1);
  color: #fbbf24;
}

/* News items */
.vr-news-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--font-size-sm);
}

.vr-news-item:last-child { border-bottom: none; }

.vr-news-desc {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  margin-top: 2px;
}

.vr-news-delay {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
}

/* Footer — always visible */
.vr-footer {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: right;
  padding-top: 4px;
  margin-top: 4px;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
  .vr-row {
    grid-template-columns: 1fr;
  }
  .vr-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .vr-metric:nth-child(2) {
    border-right: none;
  }
  .vr-conclusion {
    padding: 10px 12px;
  }
  .vr-card {
    padding: 10px;
  }
  .vr-table {
    font-size: var(--font-size-xs);
  }
  .vr-table th, .vr-table td {
    padding: 4px 6px;
  }
}

/* Message Actions */
.message-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.message:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: #556575;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.message-action-btn:hover {
  background: rgba(15, 30, 50, 0.08);
  color: #2e3e50;
}

/* Typing Indicator */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation: typingPulse 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* ========================================
   Input Region
   ======================================== */

.input-region {
  flex-shrink: 0;
  padding: 0 24px 16px;
  background: transparent;
}

.input-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.input-box {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 10px 22px;
  background: linear-gradient(180deg, rgba(234, 239, 245, 0.94), rgba(210, 218, 227, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 22px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.input-box::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 86px;
  width: 82px;
  height: 18px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(104, 243, 255, 0.16) 12%,
    rgba(104, 243, 255, 0.95) 50%,
    rgba(104, 243, 255, 0.16) 88%,
    transparent 100%
  );
  clip-path: polygon(0 55%, 12% 55%, 18% 18%, 28% 86%, 38% 24%, 48% 72%, 58% 16%, 68% 80%, 78% 42%, 88% 58%, 100% 58%, 100% 68%, 0 68%);
  opacity: 0.82;
  pointer-events: none;
}

.input-box:focus-within {
  border-color: rgba(115, 220, 255, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 0 0 4px rgba(115, 220, 255, 0.12), 0 24px 56px rgba(0, 0, 0, 0.32);
}

.chat-textarea {
  flex: 1;
  min-height: 24px;
  max-height: var(--input-max-height);
  padding: 12px 12px 12px 0;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.55;
  color: #13202f;
  resize: none;
  overflow-y: auto;
}

.chat-textarea::placeholder {
  color: rgba(18, 32, 47, 0.62);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: rgba(18, 32, 47, 0.5);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.attach-btn:hover {
  background: rgba(19, 33, 50, 0.08);
  color: rgba(18, 32, 47, 0.8);
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(112, 88, 58, 0.45);
  background: linear-gradient(180deg, rgba(64, 48, 33, 0.96), rgba(27, 20, 14, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 22px rgba(0, 0, 0, 0.22);
  color: #efd3a8;
  transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast), border-color var(--transition-fast);
}

.send-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(86, 64, 43, 0.98), rgba(33, 24, 15, 1));
  border-color: rgba(212, 177, 123, 0.72);
  transform: translateY(-1px);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.56;
  background: linear-gradient(180deg, rgba(80, 88, 97, 0.84), rgba(58, 64, 71, 0.92));
  border-color: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: default;
}

.input-disclaimer {
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 8px;
  user-select: none;
}

/* ========================================
   Animations
   ======================================== */

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

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

@keyframes typingPulse {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   Thinking Panel — Agent Workflow Progress
   ======================================== */

.thinking-panel {
  margin: 4px 0 6px;
  border: 1px solid rgba(15, 30, 50, 0.14);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(15, 25, 40, 0.07);
  font-size: 13px;
}

/* Toggle header */
.thinking-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: background var(--transition-fast);
}

.thinking-toggle:hover {
  background: var(--bg-hover);
}

/* Animated spinner icon */
.thinking-spinner {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 1.5px solid var(--border-default);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: thinkingSpin 0.8s linear infinite;
}

.thinking-panel.done .thinking-spinner {
  animation: none;
  border: none;
  background: none;
}

/* Checkmark replaces spinner when done */
.thinking-done-icon {
  display: none;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: #22c55e;
}

.thinking-panel.done .thinking-spinner {
  display: none;
}

.thinking-panel.done .thinking-done-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Title text */
.thinking-title {
  flex: 1;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thinking-panel.running .thinking-title {
  color: var(--text-primary);
}

/* Duration badge */
.thinking-duration {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Chevron */
.thinking-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform var(--transition-base);
}

.thinking-panel.expanded .thinking-chevron {
  transform: rotate(180deg);
}

/* Collapsible body */
.thinking-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thinking-panel.expanded .thinking-body {
  max-height: 600px;
  overflow-y: auto;
}

.thinking-steps {
  padding: 0 10px 8px;
}

/* Individual step */
.thinking-step {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
  position: relative;
}

.thinking-step + .thinking-step {
  border-top: 1px solid rgba(15, 30, 50, 0.08);
}

/* Step status icon column */
.thinking-step-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Pending dot */
.thinking-step.pending .thinking-step-icon::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gray-300);
}

[data-theme="dark"] .thinking-step.pending .thinking-step-icon::after {
  background: var(--gray-600);
}

/* Running mini-spinner */
.thinking-step.running .thinking-step-icon::after {
  content: '';
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--border-default);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: thinkingSpin 0.8s linear infinite;
}

/* Completed checkmark */
.thinking-step.completed .thinking-step-icon {
  color: #22c55e;
}

/* Failed X */
.thinking-step.failed .thinking-step-icon {
  color: #ef4444;
}

/* Step content */
.thinking-step-content {
  flex: 1;
  min-width: 0;
}

.thinking-step-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.4;
}

.thinking-step.pending .thinking-step-title {
  color: var(--text-tertiary);
}

.thinking-step-message {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
  line-height: 1.3;
}

.thinking-step-time {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Pulsing glow on running step title */
.thinking-step.running .thinking-step-title {
  animation: thinkingPulseText 2s ease-in-out infinite;
}

@keyframes thinkingSpin {
  to { transform: rotate(360deg); }
}

@keyframes thinkingPulseText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Responsive — Tablet
   ======================================== */

@media (max-width: 1080px) {
  .sidebar {
    display: none;
  }

  .app-layout {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .app-layout {
    padding: 12px;
  }

  .main-content {
    border-radius: var(--radius-xl);
  }

  .main-content::after {
    inset: 10px;
    border-radius: 22px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    z-index: var(--z-sidebar);
    box-shadow: var(--shadow-lg);
    border-radius: 0;
  }

  .sidebar.collapsed {
    box-shadow: none;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
  }

  .sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .sidebar-expand-btn {
    display: flex !important;
  }

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

/* ========================================
   Responsive — Mobile
   ======================================== */

@media (max-width: 480px) {
  .messages-container {
    padding: 0 16px;
  }

  .input-region {
    padding: 0 12px 12px;
  }

  .welcome-title {
    font-size: 1.8rem;
  }

  .welcome-subtitle {
    font-size: var(--font-size-base);
  }

  .suggestion-card {
    padding: 16px;
    min-height: 104px;
  }

  .suggestion-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .suggestion-title {
    font-size: 1.26rem;
  }

  .welcome-input-box {
    padding: 8px 10px 8px 18px;
    border-radius: var(--radius-lg);
  }

  .welcome-input-box::after {
    display: none;
  }

  .welcome-input-box .send-btn {
    width: 48px;
    height: 48px;
  }

  .news-ticker-viewport {
    height: 240px;
  }

  .news-ticker {
    padding: 18px 16px 14px;
  }

  .message {
    gap: 10px;
    padding: 16px 0;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
  }

  .message-content {
    font-size: var(--font-size-base);
  }

  .input-box {
    padding: 10px 10px 10px 18px;
    border-radius: var(--radius-lg);
  }

  .input-box::after {
    display: none;
  }

  .send-btn {
    width: 48px;
    height: 48px;
  }

  .attach-btn {
    width: 32px;
    height: 32px;
  }
}

/* ========================================
   Exhibition Selection Cards
   ======================================== */

.exhibition-select {
  margin: 4px 0;
}

.exhibition-select-prompt {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: var(--line-height-relaxed);
}

.exhibition-select-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exhibition-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.10);
  border-radius: var(--radius-sm);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.exhibition-option:hover {
  border-color: rgba(15, 30, 50, 0.22);
  background: rgba(15, 25, 40, 0.10);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.exhibition-option:active {
  transform: translateY(0);
}

.exhibition-option-content {
  flex: 1;
  min-width: 0;
}

.exhibition-option-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.exhibition-option-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.exhibition-option-location,
.exhibition-option-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.exhibition-option-location svg,
.exhibition-option-date svg {
  flex-shrink: 0;
}

.exhibition-option-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: var(--line-height-base);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exhibition-option-arrow {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.exhibition-option:hover .exhibition-option-arrow {
  color: var(--accent-blue);
  transform: translateX(2px);
}

/* Highlight the currently chosen card before confirm */
.exhibition-option.chosen {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.2);
}

/* Disable selection cards after user has confirmed */
.exhibition-select.selected .exhibition-option {
  pointer-events: none;
  opacity: 0.5;
}

.exhibition-select.selected .exhibition-option.chosen {
  opacity: 1;
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
}

/* Custom Input Card */
.exhibition-custom-input {
  padding: 10px 12px;
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.10);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-base);
}

.exhibition-custom-input.active {
  border-color: rgba(15, 30, 50, 0.25);
}

.exhibition-custom-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.exhibition-custom-fields {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== Date Picker Component ========== */
.ex-datepicker {
  position: relative;
  flex: 1;
  min-width: 0;
}

.ex-datepicker-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.12);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.ex-datepicker-trigger:hover {
  border-color: rgba(15, 30, 50, 0.25);
}

.ex-datepicker-trigger.has-value {
  color: var(--text-primary);
}

.ex-datepicker-trigger.has-value .ex-datepicker-text {
  color: var(--text-primary);
}

.ex-datepicker-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-datepicker-popup {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  width: 280px;
  padding: 12px;
  background: rgba(11, 19, 29, 0.95);
  border: 1px solid rgba(115, 220, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  backdrop-filter: blur(24px);
  /* Reset tokens for dark popup inside light message card */
  --text-primary: #eef5ff;
  --text-secondary: #94a0ae;
  --text-tertiary: #6e7e90;
  --accent-blue: #73dcff;
  --bg-hover: rgba(115, 220, 255, 0.08);
}

.ex-datepicker-popup.open {
  display: block;
}

.ex-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ex-cal-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.ex-cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.ex-cal-nav:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ex-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 4px;
}

.ex-cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  padding: 4px 0;
}

.ex-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.ex-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  padding: 0;
}

.ex-cal-day:hover:not(:disabled) {
  background: var(--bg-hover);
}

.ex-cal-day-other {
  color: var(--text-tertiary);
  cursor: default;
  opacity: 0.4;
}

.ex-cal-day-today {
  font-weight: var(--font-weight-semibold);
  color: var(--accent-blue);
  background: rgba(115, 220, 255, 0.1);
}

.ex-cal-day-selected {
  background: rgba(115, 220, 255, 0.25) !important;
  color: var(--white) !important;
  font-weight: var(--font-weight-semibold);
}

[data-theme="dark"] .ex-cal-day-today {
  color: var(--accent-blue);
  background: rgba(115, 220, 255, 0.1);
}

[data-theme="dark"] .ex-cal-day-selected {
  background: rgba(115, 220, 255, 0.25) !important;
}

/* ========== Dropdown Component ========== */
.ex-location-picker {
  display: flex;
  gap: 8px;
  width: 100%;
}

.ex-dropdown {
  position: relative;
  flex: 1;
  min-width: 0;
}

.ex-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.12);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.ex-dropdown-trigger:hover:not(:disabled) {
  border-color: rgba(15, 30, 50, 0.25);
}

.ex-dropdown-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ex-dropdown-trigger.has-value {
  color: var(--text-primary);
}

.ex-dropdown-trigger.has-value .ex-dropdown-text {
  color: var(--text-primary);
}

.ex-dropdown-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-dropdown-arrow {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.ex-dropdown-popup.open ~ .ex-dropdown-trigger .ex-dropdown-arrow,
.ex-dropdown-trigger[aria-expanded="true"] .ex-dropdown-arrow {
  transform: rotate(180deg);
}

.ex-dropdown-popup {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  width: 100%;
  min-width: 160px;
  max-height: 240px;
  background: rgba(11, 19, 29, 0.95);
  border: 1px solid rgba(115, 220, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  backdrop-filter: blur(24px);
  overflow: hidden;
  /* Reset tokens for dark popup inside light message card */
  --text-primary: #eef5ff;
  --text-secondary: #94a0ae;
  --text-tertiary: #6e7e90;
  --accent-blue: #73dcff;
  --bg-hover: rgba(115, 220, 255, 0.08);
}

.ex-dropdown-popup.open {
  display: flex;
  flex-direction: column;
}

.ex-dropdown-search {
  padding: 8px 8px 4px;
  flex-shrink: 0;
}

.ex-dropdown-search-input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: rgba(13, 24, 37, 0.88);
  border: 1px solid rgba(115, 220, 255, 0.14);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.ex-dropdown-search-input:focus {
  border-color: rgba(115, 220, 255, 0.32);
}

.ex-dropdown-search-input::placeholder {
  color: var(--text-tertiary);
}

.ex-dropdown-list {
  overflow-y: auto;
  padding: 4px;
  flex: 1;
}

.ex-dropdown-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  text-align: left;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ex-dropdown-item:hover {
  background: var(--bg-hover);
}

.ex-dropdown-item.selected {
  background: rgba(115, 220, 255, 0.12);
  color: var(--accent-blue);
  font-weight: var(--font-weight-medium);
}

.ex-dropdown-empty {
  padding: 12px 10px;
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

/* Confirm Button */
.exhibition-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 0;
  background: linear-gradient(180deg, #2a4060, #1e3048);
  border: 1px solid rgba(42, 64, 96, 0.4);
  color: #d0e0f0;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.exhibition-confirm-btn:hover {
  background: linear-gradient(180deg, #344e72, #263c58);
  border-color: rgba(52, 78, 114, 0.6);
  transform: translateY(-1px);
}

.exhibition-confirm-btn:active {
  transform: translateY(0);
}

.exhibition-confirm-btn:disabled {
  opacity: 0.56;
  background: linear-gradient(180deg, rgba(80, 88, 97, 0.84), rgba(58, 64, 71, 0.92));
  border-color: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: default;
  transform: none;
}

/* Hide confirm/custom input after selection */
.exhibition-select.selected .exhibition-custom-input,
.exhibition-select.selected .exhibition-confirm-btn,
.exhibition-select.selected .exhibition-cargo-ready {
  display: none;
}

/* Cargo Ready Date Input */
.exhibition-cargo-ready {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.10);
  border-radius: var(--radius-sm);
}

.exhibition-cargo-ready-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.exhibition-cargo-ready-hint {
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
}

/* ========================================
   Exhibition Report — HTML Preview Panel
   ======================================== */

.exhibition-report {
  margin: 12px 0 0;
  border: 1px solid rgba(15, 30, 50, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(15, 25, 40, 0.04);
}

/* --- Header Bar --- */
.er-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(15, 25, 40, 0.06);
  border-bottom: 1px solid rgba(15, 30, 50, 0.10);
}

.er-header-left {
  flex: 1;
  min-width: 0;
}

.er-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  margin-bottom: 6px;
}

.er-badge.er-level-green { background: rgba(34,197,94,0.10); color: #15803d; }
.er-badge.er-level-yellow { background: rgba(234,179,8,0.10); color: #a16207; }
.er-badge.er-level-red { background: rgba(239,68,68,0.10); color: #b91c1c; }

[data-theme="dark"] .er-badge.er-level-green { background: rgba(34,197,94,0.10); color: #4ade80; }
[data-theme="dark"] .er-badge.er-level-yellow { background: rgba(234,179,8,0.10); color: #fbbf24; }
[data-theme="dark"] .er-badge.er-level-red { background: rgba(239,68,68,0.10); color: #f87171; }

.er-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: var(--line-height-snug);
}

.er-summary {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-top: 4px;
}

.er-header-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.er-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(15, 30, 50, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(15, 25, 40, 0.06);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.er-download-btn:hover {
  background: rgba(15, 25, 40, 0.10);
  border-color: rgba(15, 30, 50, 0.25);
  color: #1a6ba0;
}

.er-download-btn svg {
  flex-shrink: 0;
}

/* --- Report Body / Preview Area --- */
.er-body {
  max-height: 620px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.er-content {
  padding: 18px 20px;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
}

/* --- Report Headings --- */
.er-h1 {
  font-size: 1.15em;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0 0 6px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
  line-height: var(--line-height-snug);
}

.er-h2 {
  font-size: 1em;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.er-h2-sub {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
}

.er-project-summary {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  line-height: var(--line-height-relaxed);
}

/* --- Sections --- */
.er-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.er-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* --- Inline badges (in headings) --- */
.er-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  vertical-align: middle;
}

.er-inline-badge.er-alert-green { background: rgba(34,197,94,0.08); color: #15803d; }
.er-inline-badge.er-alert-yellow { background: rgba(234,179,8,0.08); color: #a16207; }
.er-inline-badge.er-alert-red { background: rgba(239,68,68,0.08); color: #b91c1c; }

[data-theme="dark"] .er-inline-badge.er-alert-green { background: rgba(34,197,94,0.10); color: #4ade80; }
[data-theme="dark"] .er-inline-badge.er-alert-yellow { background: rgba(234,179,8,0.10); color: #fbbf24; }
[data-theme="dark"] .er-inline-badge.er-alert-red { background: rgba(239,68,68,0.10); color: #f87171; }

/* --- Key-Value Lists --- */
.er-kv-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.er-kv-list li {
  padding: 4px 0;
  line-height: var(--line-height-relaxed);
  font-size: var(--font-size-sm);
}

.er-kv-list li strong {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

/* --- Tables --- */
.er-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.er-table thead th {
  text-align: left;
  padding: 7px 12px;
  background: transparent;
  border-bottom: 1px solid var(--border-default);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: var(--font-size-xs);
  letter-spacing: 0.02em;
}

.er-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: top;
}

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

.er-table tbody tr:hover {
  background: var(--bg-hover);
}

/* Timeline table risk cells */
.er-risk-cell {
  color: #dc2626;
  font-weight: var(--font-weight-medium);
}

[data-theme="dark"] .er-risk-cell {
  color: #f87171;
}

.er-factor-cell {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  max-width: 220px;
}

/* --- Metrics Row (for channel analysis) --- */
.er-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.er-metric-card {
  text-align: center;
  padding: 10px 6px;
  background: rgba(15, 25, 40, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 30, 50, 0.08);
}

.er-metric-val {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.er-metric-val.er-metric-val-red {
  color: #dc2626;
}

[data-theme="dark"] .er-metric-val.er-metric-val-red {
  color: #f87171;
}

.er-metric-lbl {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Risk factor / deduction lists --- */
.er-sub-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin: 12px 0 4px 0;
}

.er-factor-list {
  margin: 4px 0 8px 0;
  padding-left: 18px;
}

.er-factor-list li {
  font-size: var(--font-size-sm);
  margin-bottom: 3px;
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
}

.er-deduct {
  color: #dc2626;
  font-weight: var(--font-weight-semibold);
}

[data-theme="dark"] .er-deduct {
  color: #f87171;
}

.er-total-deduct {
  font-size: var(--font-size-sm);
  margin: 8px 0 4px 0;
  color: var(--text-primary);
}

/* --- Veto / Fatal alerts --- */
.er-veto, .er-fatal {
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.er-veto {
  background: #fef9c3;
  color: #854d0e;
  border-left: 3px solid #eab308;
}

.er-fatal {
  background: #fee2e2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

[data-theme="dark"] .er-veto {
  background: rgba(234,179,8,0.1);
  color: #fbbf24;
  border-left-color: #fbbf24;
}

[data-theme="dark"] .er-fatal {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border-left-color: #f87171;
}

/* --- Highlight (probability etc.) --- */
.er-highlight {
  color: #dc2626;
  font-weight: var(--font-weight-semibold);
}

[data-theme="dark"] .er-highlight {
  color: #f87171;
}

/* --- Probability Model Cards --- */
.er-prob-card {
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.er-prob-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.er-prob-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.er-prob-val {
  font-size: 1em;
  font-weight: 600;
  color: #dc2626;
}

[data-theme="dark"] .er-prob-val {
  color: #f87171;
}

.er-prob-logic, .er-prob-warn {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 3px 0 0 0;
  line-height: var(--line-height-relaxed);
}

.er-prob-warn {
  color: #b45309;
}

[data-theme="dark"] .er-prob-warn {
  color: #fbbf24;
}

/* --- News Event Cards --- */
.er-news-card {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.08);
  border-radius: var(--radius-sm);
}

.er-news-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.er-tag {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(15, 25, 40, 0.08);
  color: var(--text-secondary);
  vertical-align: middle;
  margin-left: 4px;
}

.er-news-meta {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.er-news-detail {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

/* --- Scenario Comparison --- */
.er-scenario-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.er-scenario-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.er-scenario-card p {
  font-size: var(--font-size-sm);
  margin: 4px 0;
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
}

.er-scenario-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  margin-bottom: 8px;
}

.er-scenario-best {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.25);
}

.er-scenario-best .er-scenario-title { color: #166534; }

.er-scenario-worst {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.25);
}

.er-scenario-worst .er-scenario-title { color: #991b1b; }

[data-theme="dark"] .er-scenario-best {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.2);
}

[data-theme="dark"] .er-scenario-best .er-scenario-title { color: #4ade80; }

[data-theme="dark"] .er-scenario-worst {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
}

[data-theme="dark"] .er-scenario-worst .er-scenario-title { color: #f87171; }

/* --- SOP Cards --- */
.er-sop-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.er-sop-card {
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.er-sop-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.er-sop-card ul {
  margin: 0;
  padding-left: 16px;
}

.er-sop-card li {
  font-size: var(--font-size-xs);
  margin-bottom: 3px;
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

/* --- Recommendation --- */
.er-recommendation {
  background: rgba(15, 25, 40, 0.06);
  border: 1px solid rgba(15, 30, 50, 0.10);
  border-radius: var(--radius-sm);
  padding: 16px 18px !important;
  margin-bottom: 0 !important;
  border-bottom: none !important;
}

.er-recommendation p {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  margin: 6px 0 0 0;
}

/* --- Scrollbar --- */
.er-body::-webkit-scrollbar {
  width: 6px;
}

.er-body::-webkit-scrollbar-track {
  background: transparent;
}

.er-body::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

.er-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .er-header {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  .er-header-actions { align-self: flex-start; }

  .er-content { padding: 16px; }

  .er-body { max-height: 500px; }

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

  .er-scenario-row { grid-template-columns: 1fr; }

  .er-sop-row { grid-template-columns: 1fr; }

  .er-table { font-size: 12px; }

  .er-table thead th,
  .er-table tbody td { padding: 6px 8px; }
}

/* ========================================
   Dark Atmospheric Background Override
   (matches 首页 DEEP TRACE visual style)
   ======================================== */

body {
  background:
    radial-gradient(circle at 78% 20%, rgba(105, 201, 255, 0.16), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(224, 190, 126, 0.12), transparent 26%),
    linear-gradient(180deg, #060b12 0%, #03060b 100%);
  color: #eef5ff;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 8, 13, 0.18), rgba(3, 8, 13, 0.72)),
    repeating-linear-gradient(90deg, rgba(115, 220, 255, 0.03) 0 1px, transparent 1px 140px),
    repeating-linear-gradient(0deg, rgba(115, 220, 255, 0.02) 0 1px, transparent 1px 120px);
  pointer-events: none;
  z-index: 0;
}

/* --- Sidebar dark glass style --- */
.sidebar {
  background: linear-gradient(180deg, rgba(11, 19, 29, 0.92), rgba(5, 9, 15, 0.96));
  border-right: 1px solid rgba(124, 155, 183, 0.16);
  backdrop-filter: blur(24px);
}

/* --- Header dark glass style --- */
.main-header {
  background: rgba(8, 14, 22, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(124, 155, 183, 0.12);
}

/* --- Input region transparent --- */
.input-region {
  background: transparent;
}

/* --- Welcome input box --- */
.welcome-input-box {
  background: linear-gradient(160deg, #c9cdd4 0%, #b8bcc5 18%, #d5d9e0 38%, #a8adb8 55%, #c0c5ce 72%, #d8dce3 88%, #bec3cc 100%);
  border: 1px solid rgba(220, 224, 232, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.welcome-input-box:focus-within {
  border-color: rgba(200, 210, 225, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 4px 28px rgba(0, 0, 0, 0.24),
    0 0 0 3px rgba(200, 210, 225, 0.2);
}

/* --- Bottom input box --- */
.input-box {
  background: linear-gradient(160deg, #c9cdd4 0%, #b8bcc5 18%, #d5d9e0 38%, #a8adb8 55%, #c0c5ce 72%, #d8dce3 88%, #bec3cc 100%);
  border: 1px solid rgba(220, 224, 232, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.input-box:focus-within {
  border-color: rgba(200, 210, 225, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 4px 28px rgba(0, 0, 0, 0.24),
    0 0 0 3px rgba(200, 210, 225, 0.2);
}

/* --- Suggestion cards: match news-ticker light style --- */
.suggestion-card {
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.96), rgba(230, 236, 243, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 26px 56px rgba(0, 0, 0, 0.32);
  color: #132132;
}

.suggestion-card:hover {
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(238, 243, 249, 0.95));
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 28px 58px rgba(0, 0, 0, 0.35);
}

.suggestion-card .suggestion-icon {
  background: radial-gradient(circle at 50% 20%, rgba(19, 33, 50, 0.12), rgba(19, 33, 50, 0.06));
  border: 1px solid rgba(19, 33, 50, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  color: #132132;
}

.suggestion-card .suggestion-title {
  color: #132132;
}

.suggestion-card .suggestion-desc {
  color: #132132;
}

/* --- News ticker light style --- */
.news-ticker {
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.96), rgba(230, 236, 243, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 26px 56px rgba(0, 0, 0, 0.32);
  color: #132132;
}

.news-ticker-header {
  border-bottom-color: rgba(19, 33, 50, 0.12);
  color: #953f3f;
}

.news-ticker-header span:nth-child(2) {
  color: #172436;
}

.news-ticker-viewport::before {
  background: linear-gradient(to bottom, rgba(247, 249, 252, 0.96), transparent);
}

.news-ticker-viewport::after {
  background: linear-gradient(to top, rgba(230, 236, 243, 0.96), transparent);
}

.news-ticker-item {
  border-bottom-color: rgba(19, 33, 50, 0.08);
  color: #132132;
}

.news-ticker-item:hover {
  background: rgba(19, 33, 50, 0.04);
}

.news-ticker-title {
  color: #142031;
}

.news-ticker-summary {
  color: #4a5a6d;
}

.news-ticker-meta {
  color: #6c7989;
}

.news-ticker-more {
  border-top-color: rgba(19, 33, 50, 0.1);
  color: #24384f;
}

.news-ticker-more:hover {
  color: #122239;
  background: rgba(19, 33, 50, 0.04);
}

/* --- Messages dark glass bubbles --- */
.message + .message {
  border-top-color: rgba(124, 155, 183, 0.1);
}

/* Assistant message card: cool pearl frosted glass */
.message.assistant .message-body {
  background: linear-gradient(135deg, rgba(210, 222, 240, 0.94), rgba(195, 210, 230, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 4px 24px rgba(0, 0, 0, 0.12);
}

/* User message card: warm pearl frosted glass */
.message.user .message-body {
  background: linear-gradient(135deg, rgba(228, 234, 244, 0.96), rgba(212, 222, 236, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 4px 20px rgba(0, 0, 0, 0.10);
}

/* --- Sidebar items --- */
.sidebar-expand-btn {
  background: rgba(11, 19, 29, 0.92);
  border-color: rgba(124, 155, 183, 0.2);
}

.sidebar-expand-btn:hover {
  background: rgba(20, 31, 45, 0.94);
}

/* --- Disclaimer text --- */
.input-disclaimer {
  color: rgba(124, 155, 183, 0.5);
}

/* --- Page news light background --- */
.page-news {
  background: linear-gradient(180deg, #f5f7fa 0%, #e8ecf1 100%);
}

.news-page-header {
  background: rgba(245, 247, 250, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(19, 33, 50, 0.1);
}

.news-page-back-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(19, 33, 50, 0.15);
  color: #2563eb;
}

.news-page-back-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(37, 99, 235, 0.3);
}

.news-page-title {
  color: #1a2a3a;
}

.news-page-body {
  background: transparent;
}

.news-feed-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(19, 33, 50, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.news-feed-card:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.news-feed-title {
  color: #1a2a3a;
}

.news-feed-summary {
  color: #4a5a6d;
}

.news-feed-meta {
  color: #6c7989;
}

.news-feed-source {
  color: #6c7989;
}

/* ========================================
   Force dark semantic tokens for light theme
   (both themes use dark atmospheric background)
   ======================================== */

:root {
  --bg-app: #04080f;
  --bg-sidebar: #0b131d;
  --bg-main: #0a1018;
  --bg-input: rgba(18, 28, 40, 0.88);
  --bg-input-focus: rgba(22, 34, 48, 0.92);
  --bg-hover: rgba(20, 31, 45, 0.7);
  --bg-active: rgba(37, 99, 235, 0.15);
  --bg-user-bubble: var(--blue-600);
  --bg-assistant-bubble: rgba(18, 28, 40, 0.88);
  --bg-suggestion: linear-gradient(180deg, rgba(247, 249, 252, 0.96), rgba(230, 236, 243, 0.9));
  --bg-suggestion-hover: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(238, 243, 249, 0.95));
  --bg-send: var(--blue-600);
  --bg-send-hover: var(--blue-500);
  --bg-send-disabled: rgba(42, 42, 54, 0.8);
  --bg-model-dropdown: rgba(14, 22, 34, 0.96);
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --bg-code: rgba(18, 28, 40, 0.88);
  --bg-header: rgba(8, 14, 22, 0.72);

  --text-primary: #eef5ff;
  --text-secondary: #8f9baa;
  --text-tertiary: #5a6a7e;
  --text-on-accent: var(--white);
  --text-user-bubble: var(--white);
  --text-assistant-bubble: #eef5ff;
  --text-suggestion-title: #132132;
  --text-suggestion-desc: #132132;
  --text-link: #78daff;
  --text-placeholder: #4a5a6e;
  --text-disclaimer: #4a5a6e;

  --border-default: rgba(124, 155, 183, 0.2);
  --border-light: rgba(124, 155, 183, 0.12);
  --border-input: rgba(124, 155, 183, 0.22);
  --border-input-focus: rgba(115, 220, 255, 0.44);
  --border-suggestion: rgba(255, 255, 255, 0.58);
  --border-suggestion-hover: rgba(255, 255, 255, 0.78);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-input: 0 2px 16px rgba(0, 0, 0, 0.3);
  --shadow-input-focus: 0 2px 24px rgba(0, 0, 0, 0.36), 0 0 0 3px rgba(115, 220, 255, 0.1);
  --shadow-dropdown: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-suggestion: none;
  --shadow-suggestion-hover: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-expand-btn: 0 2px 8px rgba(0, 0, 0, 0.3);

  --scrollbar-thumb: rgba(124, 155, 183, 0.2);
  --scrollbar-thumb-hover: rgba(124, 155, 183, 0.35);
}
