* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --bullish: #3fb950;
  --bearish: #f85149;
  --neutral: #8b949e;
  --border: #30363d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 15px 20px;
}

/* Three Column Layout */
.three-column-layout {
  display: grid;
  grid-template-columns: 1.3fr 3fr 1fr;
  gap: 16px;
  margin-top: 16px;
  height: calc(100vh - 140px);
  min-height: 600px;
}

.left-column, .center-column, .right-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.left-column {
  overflow-y: auto;
  padding-right: 8px;
}

.left-column::-webkit-scrollbar {
  width: 6px;
}

.left-column::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.left-column::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.center-column .stock-chart-section {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.center-column .chart-container {
  flex: 1;
  height: 100%;
  min-height: 450px;
}

.center-column #tradingview-widget {
  width: 100%;
  height: 100%;
}

.right-column .news-section {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-section h2 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.news-section .filters {
  margin-bottom: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.articles-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

.articles-scroll::-webkit-scrollbar {
  width: 6px;
}

.articles-scroll::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.articles-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

@media (max-width: 1200px) {
  .three-column-layout {
    grid-template-columns: 1fr 1fr;
    height: auto;
  }
  .center-column {
    grid-column: 1 / -1;
    order: -1;
  }
  .center-column .chart-container {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .three-column-layout {
    grid-template-columns: 1fr;
  }
}

/* Header */
header {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* Top right buttons */
.top-right-btns {
  position: fixed;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
}

.btn-help {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: bold;
  min-width: 80px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-help:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

/* Help Modal */
.help-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10002;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.help-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  max-width: 650px;
  width: 100%;
  padding: 30px;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.help-content::-webkit-scrollbar {
  width: 6px;
}

.help-content::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.help-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.help-content h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.help-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.help-section:last-of-type {
  border-bottom: none;
  margin-bottom: 15px;
}

.help-section h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.help-section p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}

.help-section ul {
  margin-left: 20px;
  color: var(--text-secondary);
}

.help-section li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.help-section strong {
  color: var(--accent);
}

.help-tip {
  background: rgba(88, 166, 255, 0.1);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}

.help-footer {
  text-align: center;
  padding-top: 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.help-footer a {
  color: var(--accent);
  text-decoration: none;
}

.help-footer a:hover {
  text-decoration: underline;
}

/* Globe (left) */
.header-top {
  position: absolute;
  top: 30px;
  left: 200px;
}

.globe-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #1a2332, #0d1117);
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.3), inset 0 0 30px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.globe-container:hover {
  box-shadow: 0 0 25px rgba(88, 166, 255, 0.5), inset 0 0 30px rgba(0,0,0,0.5);
  transform: scale(1.05);
}

/* Globe Modal */
.globe-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.globe-modal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.globe-large {
  width: 80vmin;
  height: 80vmin;
  max-width: 600px;
  max-height: 600px;
  background: transparent;
}

.globe-large canvas {
  width: 100% !important;
  height: 100% !important;
}

.globe-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
}

.globe-visitor-icon {
  font-size: 1.5rem;
}

.globe-visitor-num {
  font-weight: 700;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.globe-visitor-label {
  color: var(--text-secondary);
}

.globe-close {
  position: absolute;
  top: 20px;
  right: 25px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.globe-close:hover {
  color: var(--text-primary);
}

@media (max-width: 500px) {
  .globe-large {
    width: 320px;
    height: 320px;
  }
  .globe-info {
    font-size: 1rem;
  }
  .globe-visitor-num {
    font-size: 1.4rem;
  }
}

.visitor-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(63, 185, 80, 0.1));
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.visitor-icon {
  font-size: 1rem;
}

.visitor-label {
  color: var(--text-secondary);
}

.visitor-number {
  font-weight: 600;
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 50px;
  text-align: center;
}

/* 老虎机滚动计数器 */
.slot-counter {
  display: flex;
  gap: 1px;
  background: transparent;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.slot-column {
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.slot-inner {
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}

.slot-num {
  height: 1.2em;
  line-height: 1.2em;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

header h1 {
  font-size: 1.9rem;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.header-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.btn {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.last-updated {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Stock Chart Section */
.stock-chart-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-header h2 {
  font-size: 1.1rem;
  color: var(--accent);
}

/* Stock Search */
.stock-search {
  display: flex;
  gap: 8px;
}

.stock-search input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 220px;
}

.stock-search input:focus {
  outline: none;
  border-color: var(--accent);
}

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

.btn-search {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-search:hover {
  background: #4393e4;
}

/* Search Dropdown */
.search-box {
  position: relative;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 60px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

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

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

.dropdown-item.no-match {
  color: var(--text-secondary);
  cursor: default;
}

.dropdown-item.no-match:hover {
  background: transparent;
}

.dropdown-symbol {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

.dropdown-name {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Stock Categories */
.stock-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
}

.stock-categories::-webkit-scrollbar {
  width: 6px;
}

.stock-categories::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.stock-categories::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.category-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 70px;
  font-weight: 500;
}

.stock-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.stock-tab {
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.stock-tab:hover, .stock-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.current-stock {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}

.chart-container {
  height: 70vh;
  min-height: 500px;
  max-height: 800px;
  border-radius: 8px;
  overflow: hidden;
}

#tradingview-widget {
  width: 100%;
  height: 100%;
}

#tradingview-widget iframe {
  width: 100% !important;
  height: 100% !important;
}

/* Watch Items */
.watch-items-section {
  background: linear-gradient(135deg, #1a1a2a 0%, #161b22 100%);
  border: 1px solid #6366f1;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.watch-items-section h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: #818cf8;
}

.watch-items-content {
  font-size: 0.9rem;
  line-height: 1.6;
}

.watch-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.watch-items-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  padding-left: 20px;
}

.watch-items-list li:last-child {
  border-bottom: none;
}

.watch-items-list li::before {
  content: '👁';
  position: absolute;
  left: 0;
  font-size: 0.8rem;
}

/* AI Recommendations */
.recommendations-section {
  background: linear-gradient(135deg, #1a2a1a 0%, #161b22 100%);
  border: 1px solid var(--bullish);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.recommendations-section h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--bullish);
}

.recommendations-section .disclaimer {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  padding: 8px;
  background: rgba(248, 81, 73, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--bearish);
}

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

.recommendations-grid .placeholder {
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
  grid-column: 1 / -1;
}

.rec-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: transform 0.2s;
}

.rec-card:hover {
  transform: translateY(-2px);
}

.rec-card.buy { border-left: 4px solid var(--bullish); }
.rec-card.sell { border-left: 4px solid var(--bearish); }
.rec-card.hold { border-left: 4px solid var(--neutral); }

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

.rec-symbol {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-primary);
  cursor: pointer;
}

.rec-symbol:hover {
  color: var(--accent);
}

.rec-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.rec-action {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
}

.rec-action.buy {
  background: rgba(63, 185, 80, 0.2);
  color: var(--bullish);
}

.rec-action.sell {
  background: rgba(248, 81, 73, 0.2);
  color: var(--bearish);
}

.rec-action.hold {
  background: rgba(139, 148, 158, 0.2);
  color: var(--neutral);
}

.rec-reason {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.rec-reason .ref-link {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  padding: 1px 4px;
  border-radius: 3px;
  text-decoration: none;
}

.rec-risk {
  font-size: 0.78rem;
  color: var(--bearish);
  margin-bottom: 8px;
  padding: 6px;
  background: rgba(248, 81, 73, 0.08);
  border-radius: 4px;
}

.rec-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rec-category {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
}

.rec-confidence {
  color: #ffc107;
  font-size: 0.85rem;
}

/* Daily Summary */
.daily-summary {
  background: linear-gradient(135deg, #1a1f2e 0%, #161b22 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.daily-summary h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--accent);
}

.summary-content {
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.85;
}

.summary-content .placeholder {
  color: var(--text-secondary);
  text-align: center;
  padding: 12px;
}

.summary-content strong {
  color: var(--accent);
}

.summary-content .ref-link {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 2px;
  text-decoration: none;
}

.summary-content .ref-link:hover {
  background: var(--accent);
  color: white;
}

/* Summary Bar */
.summary-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 18px;
}

.summary-item {
  text-align: center;
}

.summary-item .count {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
}

.summary-item .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.summary-item.bullish .count { color: var(--bullish); }
.summary-item.bearish .count { color: var(--bearish); }
.summary-item.neutral .count { color: var(--neutral); }
.summary-item.total .count { color: var(--accent); }

/* Filters */
.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 18px;
}

.filter-btn {
  padding: 6px 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Articles */
.articles-grid {
  display: grid;
  gap: 12px;
}

.article-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0,0,0,0.3);
}

.article-card[data-ref] {
  scroll-margin-top: 20px;
}

.article-card.highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

.article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.article-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.source-tag {
  background: var(--bg-tertiary);
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.ref-tag {
  background: var(--accent);
  color: white;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 0.6rem;
  font-weight: bold;
}

.impact-badge {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: bold;
}

.impact-badge.bullish {
  background: rgba(63, 185, 80, 0.2);
  color: var(--bullish);
}

.impact-badge.bearish {
  background: rgba(248, 81, 73, 0.2);
  color: var(--bearish);
}

.impact-badge.neutral {
  background: rgba(139, 148, 158, 0.2);
  color: var(--neutral);
}

.article-title {
  font-size: 0.9rem;
  margin-bottom: 6px;
  line-height: 1.45;
}

.article-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.article-title a:hover {
  color: var(--accent);
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.article-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* Loading & Empty */
.loading, .empty-state {
  text-align: center;
  padding: 35px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

/* Footer */
footer {
  margin-top: 35px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

footer p { margin: 2px 0; }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 12px; }
  header h1 { font-size: 1.5rem; }
  .chart-header { flex-direction: column; align-items: flex-start; }
  .stock-search input { width: 160px; }
  .chart-container { height: 60vh; min-height: 350px; }
  .stock-categories { max-height: 150px; }
  .category-label { min-width: 60px; font-size: 0.7rem; }
  .stock-tab { font-size: 0.7rem; padding: 3px 8px; }
  .summary-bar { gap: 12px; padding: 12px; }
  .summary-item .count { font-size: 1.2rem; }
}

/* Pro Badge & Usage Display */
.pro-badge {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-right: 8px;
}

.usage-display {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-right: 12px;
}

.usage-display.pro {
  color: #ffd700;
}

.usage-display.exhausted {
  color: var(--bearish);
}

/* Paywall Modal */
.paywall-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.paywall-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  padding: 30px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.paywall-content::-webkit-scrollbar {
  width: 6px;
}

.paywall-content::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.paywall-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--text-primary);
}

.paywall-header {
  text-align: center;
  margin-bottom: 25px;
}

.paywall-header h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.paywall-header p {
  color: var(--text-secondary);
}

.paywall-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.plan {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 20px;
  position: relative;
}

.plan.pro {
  border: 2px solid var(--accent);
}

.plan .popular {
  position: absolute;
  top: -10px;
  right: 15px;
  background: var(--accent);
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: bold;
}

.plan h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.plan .price {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 15px;
}

.plan .price span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.plan ul {
  list-style: none;
  padding: 0;
}

.plan ul li {
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.plan.pro ul li {
  color: var(--text-primary);
}

.activation-section {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: 12px;
}

.activation-section > p:first-child {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.activation-input {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.activation-input input {
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 200px;
}

.activation-input input:focus {
  outline: none;
  border-color: var(--accent);
}

.activate-msg {
  margin-top: 10px;
  font-size: 0.85rem;
}

.activate-msg.success {
  color: var(--bullish);
}

.activate-msg.error {
  color: var(--bearish);
}

.purchase-section {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.purchase-section a {
  color: var(--accent);
  text-decoration: none;
}

.purchase-section .contact {
  margin-top: 8px;
}

@media (max-width: 600px) {
  .paywall-plans {
    grid-template-columns: 1fr;
  }
  
  .paywall-content {
    padding: 20px;
  }
}

/* Buy Buttons */
.buy-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  margin-bottom: 10px;
  border-radius: 10px;
}

.buy-btn.yearly {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
}

/* User Area */
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 15px;
}

.login-btn {
  background: var(--bg-tertiary);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.login-btn:hover {
  background: var(--accent);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.plan-badge {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: bold;
}

.logout-btn {
  margin-left: 5px;
  padding: 2px 6px;
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.logout-btn:hover {
  opacity: 1;
  background: var(--bearish);
}

.plan-badge.free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.plan-badge.pro {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
}

.plan-badge.trial {
  background: linear-gradient(135deg, #00d4aa, #00a080);
  color: #fff;
}

/* Google Login Section */
.google-login-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0;
}

.google-login-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: white;
  color: #333;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.google-login-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.google-login-btn svg {
  flex-shrink: 0;
}

.login-hint {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.yearly-option {
  text-align: center;
  margin-top: 15px;
}

.email-section {
  margin-top: 20px;
  padding: 15px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  text-align: center;
}

.email-section > p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.email-section input {
  width: 100%;
  max-width: 300px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
}

.email-section .email-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.activation-section {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.activation-section > p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.activation-input {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.activation-input input {
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  width: 180px;
  text-transform: uppercase;
}

.activation-input input::placeholder {
  text-transform: none;
}

.activation-msg {
  margin-top: 10px;
  font-size: 0.85rem;
}

.activation-msg.success {
  color: var(--bullish);
}

.activation-msg.error {
  color: var(--bearish);
}

.activation-notes {
  margin-top: 15px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  text-align: left;
}

.activation-notes p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 4px 0;
}

.activation-notes strong {
  color: var(--text-primary);
}

/* Language Toggle - Fixed Top Right */
.btn-lang {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: bold;
  min-width: 50px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-lang:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

/* Watchlist */

.watchlist-control {
  margin-right: 10px;
}

.watchlist-content {
  max-width: 500px;
}

.watchlist-search {
  position: relative;
  margin: 20px 0;
}

.watchlist-search input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
}

.watchlist-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.watchlist-dropdown.show {
  display: block;
}

.watchlist-dropdown-item {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

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

.watchlist-dropdown-item .symbol {
  font-weight: bold;
  color: var(--accent);
}

.watchlist-selected {
  margin: 20px 0;
}

.watchlist-selected h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.watchlist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 50px;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.watchlist-items .empty-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  width: 100%;
  text-align: center;
}

.watchlist-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
}

.watchlist-tag .symbol {
  font-weight: bold;
  color: var(--accent);
}

.watchlist-tag .remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 1rem;
}

.watchlist-tag .remove:hover {
  opacity: 1;
  color: var(--bearish);
}

.watchlist-presets {
  margin: 20px 0;
}

.watchlist-presets h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.preset-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.watchlist-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

/* Stock Analysis Button */
.current-stock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.btn-analyze {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-analyze:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-analyze:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Analysis Modal */
.analyze-content {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.analyze-loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.analyze-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.analyze-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.analyze-header .symbol {
  background: #6366f1;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: bold;
}

.analyze-section {
  margin-bottom: 20px;
}

.analyze-section h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #818cf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analyze-section p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-secondary);
}

.analyze-section ul {
  margin: 0;
  padding-left: 20px;
}

.analyze-section li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.technicals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}

.tech-item {
  background: rgba(99, 102, 241, 0.1);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.tech-item .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.tech-item .value {
  font-weight: bold;
  color: var(--text-primary);
}

.rating-box {
  background: linear-gradient(135deg, #1a2a1a 0%, #161b22 100%);
  border: 1px solid var(--bullish);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.rating-box.sell {
  border-color: var(--bearish);
  background: linear-gradient(135deg, #2a1a1a 0%, #161b22 100%);
}

.rating-box.hold {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #2a2a1a 0%, #161b22 100%);
}

.rating-action {
  font-size: 1.5rem;
  font-weight: bold;
  min-width: 60px;
}

.rating-action.buy { color: var(--bullish); }
.rating-action.sell { color: var(--bearish); }
.rating-action.hold { color: #f59e0b; }

.rating-details {
  flex: 1;
}

.rating-target {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.rating-reason {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.confidence-stars {
  color: #fbbf24;
  font-size: 1.1rem;
}

.risks-list {
  background: rgba(248, 81, 73, 0.1);
  border-left: 3px solid var(--bearish);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

.risks-list li {
  color: var(--text-secondary);
}

/* Article Expand/Collapse */
.article-title {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.article-title:hover {
  color: #818cf8;
}

.expand-icon {
  font-size: 0.7rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform 0.2s;
}

.article-card.expanded {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

.article-detail {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.btn-ai-summary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ai-summary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ai-summary {
  margin-top: 12px;
}

.ai-summary p {
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 12px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  border-left: 3px solid #6366f1;
}

.ai-summary .loading {
  color: #818cf8;
  font-style: italic;
}

.ai-summary .error {
  color: var(--bearish);
  background: rgba(248, 81, 73, 0.1);
  border-left-color: var(--bearish);
}

/* ===== 移动端优化 (max-width: 768px) ===== */
@media (max-width: 768px) {
  .container { padding: 10px; }
  
  header { padding: 15px 0; margin-bottom: 15px; }
  header h1 { font-size: 1.4rem; }
  .subtitle { font-size: 0.8rem; }

  /* 地球位置 */
  .header-top {
    position: relative;
    top: 0; left: 0;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }
  .globe-container { width: 80px; height: 80px; }

  /* 右上角按钮 */
  .top-right-btns { top: 10px; right: 10px; gap: 6px; }
  .btn-help, .btn-lang { padding: 6px 10px; font-size: 0.75rem; min-width: auto; }

  /* 头部操作 */
  .header-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }
  .watchlist-control { margin-right: 0; }
  .user-area { margin-right: 0; justify-content: center; }
  .login-btn { padding: 6px 12px; font-size: 0.8rem; }
  .btn { padding: 8px 16px; font-size: 0.85rem; }
  .usage-display { font-size: 0.75rem; margin: 0; }

  /* 三栏改单列 */
  .three-column-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    gap: 12px;
  }
  .left-column, .center-column, .right-column { overflow: visible; }
  .left-column { order: 2; padding-right: 0; }
  .center-column { order: 1; }
  .right-column { order: 3; }

  /* 图表 */
  .stock-chart-section { padding: 12px; }
  .chart-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .chart-header h2 { font-size: 1rem; text-align: center; }
  .stock-search { width: 100%; flex-direction: column; gap: 8px; }
  .stock-search input { width: 100%; font-size: 16px; }
  .btn-search { width: 100%; }
  .chart-container { height: 300px; min-height: 280px; }
  .current-stock-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .current-stock { text-align: center; }
  .btn-analyze { width: 100%; }

  /* AI区块 */
  .daily-summary, .watch-items-section, .recommendations-section {
    padding: 14px; margin-bottom: 12px;
  }
  .daily-summary h2, .watch-items-section h2, .recommendations-section h2 { font-size: 1rem; }
  .summary-content { font-size: 0.85rem; line-height: 1.7; }

  /* 推荐卡片 */
  .rec-card { padding: 12px; }
  .rec-header { flex-wrap: wrap; gap: 6px; }
  .rec-symbol { font-size: 1rem; }
  .rec-reason { font-size: 0.82rem; }

  /* 新闻 */
  .news-section h2 { font-size: 1rem; }
  .filters { gap: 5px; justify-content: flex-start; overflow-x: auto; padding-bottom: 5px; }
  .filter-btn { padding: 5px 10px; font-size: 0.75rem; white-space: nowrap; }
  .articles-scroll { max-height: 400px; }
  .article-card { padding: 12px; }
  .article-title { font-size: 0.85rem; }
  .article-meta { flex-wrap: wrap; gap: 4px; }
  .source-tag, .ref-tag { font-size: 0.65rem; }
  .impact-badge { font-size: 0.65rem; padding: 2px 6px; }
  .article-footer { font-size: 0.7rem; }

  /* 模态框 */
  .paywall-modal { padding: 10px; }
  .paywall-content { padding: 20px 15px; max-height: 95vh; border-radius: 12px; }
  .paywall-header h2 { font-size: 1.2rem; }
  .paywall-plans { grid-template-columns: 1fr; gap: 15px; }
  .plan { padding: 15px; }
  .plan .price { font-size: 1.5rem; }
  .watchlist-content { max-width: 100%; }
  .watchlist-search input { font-size: 16px; }
  .help-content { padding: 20px 15px; }
  .help-content h2 { font-size: 1.2rem; }
  .globe-large { width: 280px; height: 280px; }
  .analyze-content { max-width: 100%; }
  .technicals-grid { grid-template-columns: repeat(2, 1fr); }

  footer { margin-top: 20px; padding: 12px 0; }
  footer p { font-size: 0.7rem; }
}

/* 超小屏幕 */
@media (max-width: 480px) {
  .container { padding: 8px; }
  header h1 { font-size: 1.2rem; }
  .globe-container { width: 60px; height: 60px; }
  .top-right-btns { top: 8px; right: 8px; }
  .btn-help, .btn-lang { padding: 5px 8px; font-size: 0.7rem; }
  .header-actions .btn { width: 100%; }
  .chart-container { height: 250px; min-height: 250px; }
  .technicals-grid { grid-template-columns: 1fr; }
  .paywall-content { padding: 15px 12px; }
}

/* 横屏 */
@media (max-width: 768px) and (orientation: landscape) {
  .three-column-layout { grid-template-columns: 1fr 1fr; }
  .center-column { grid-column: 1 / -1; order: -1; }
  .chart-container { height: 200px; min-height: 200px; }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .btn, .filter-btn, .stock-tab, .preset-tag { min-height: 44px; }
  .dropdown-item { padding: 14px; }
  .article-card:hover, .rec-card:hover { transform: none; }
}

/* ========== AI Chat ========== */
.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(88, 166, 255, 0.4);
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(88, 166, 255, 0.5);
}

.chat-box {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.chat-box.open { display: flex; }

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.chat-header button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}
.chat-header button:hover { color: var(--text-primary); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.chat-welcome {
  text-align: center;
  padding: 20px 0;
}
.chat-welcome p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.chat-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-examples button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}
.chat-examples button:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
}

.chat-msg {
  margin-bottom: 12px;
  max-width: 85%;
}
.chat-msg.user {
  margin-left: auto;
  text-align: right;
}
.chat-msg .bubble {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-msg.user .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.ai .bubble {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-msg.ai .bubble.loading {
  color: var(--text-secondary);
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}
.chat-input input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
}
.chat-input input:focus {
  outline: none;
  border-color: var(--accent);
}
.chat-input button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.chat-input button:hover {
  background: #4090e0;
}

@media (max-width: 480px) {
  .chat-toggle { bottom: 15px; right: 15px; width: 50px; height: 50px; font-size: 22px; }
  .chat-box { bottom: 80px; right: 10px; left: 10px; width: auto; height: 60vh; }
}
