/* === StockWall Components — UX 3.0 === */
/* === T03: 快讯滚动条+新闻中心+热力图+日历+个股详情+BottomSheet+搜索下拉 === */
/* === 依赖: styles.css 变量 + layout.css 布局 === */

/* ============================================================
   Flash Ticker Components (快讯滚动条)
   ============================================================ */
.flash-ticker {
  height: var(--ticker-h);
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  position: relative;
}

.flash-ticker-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-lg);
  height: 100%;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-up);
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  white-space: nowrap;
}

.flash-ticker-label .live-dot {
  width: 6px;
  height: 6px;
  background: var(--color-up);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.flash-ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.flash-ticker-content {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  white-space: nowrap;
  animation: ticker-scroll var(--ticker-scroll-duration) linear infinite;
  padding-left: 100%;
}

.flash-ticker:hover .flash-ticker-content {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.flash-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast);
}

.flash-ticker-item:hover {
  color: var(--color-text);
}

.flash-ticker-time {
  color: var(--color-text-disabled);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
}

.flash-ticker-tag {
  display: inline-flex;
  padding: 1px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.flash-ticker-tag-news { background: rgba(59, 130, 246, 0.15); color: var(--flash-type-news); }
.flash-ticker-tag-announce { background: rgba(245, 158, 11, 0.15); color: var(--flash-type-announce); }
.flash-ticker-tag-macro { background: rgba(6, 182, 212, 0.15); color: var(--flash-type-macro); }
.flash-ticker-tag-move { background: rgba(239, 68, 68, 0.15); color: var(--flash-type-move); }
.flash-ticker-tag-industry { background: rgba(139, 92, 246, 0.15); color: var(--flash-type-industry); }

.flash-ticker-item.watchlist {
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-sm);
  padding: 1px var(--space-sm);
  background: var(--color-warning-bg);
}

.flash-ticker-more {
  flex-shrink: 0;
  padding: 0 var(--space-lg);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  border-left: 1px solid var(--color-border);
  background: var(--color-surface);
  white-space: nowrap;
  transition: color var(--duration-fast);
}

.flash-ticker-more:hover {
  color: var(--color-accent);
}

/* Flash Detail Modal */
.flash-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.flash-detail-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.flash-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.flash-detail-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.flash-detail-close {
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-xl);
  background: none;
  border: none;
  padding: var(--space-sm);
}

.flash-detail-body {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-muted);
}

.flash-detail-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-disabled);
}

.flash-detail-stock-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 2px var(--space-md);
  background: var(--color-input);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-accent);
  cursor: pointer;
}

/* ============================================================
   News Center Components (新闻中心)
   ============================================================ */
.news-center {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.news-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.news-tab {
  padding: var(--space-sm) var(--space-lg);
  font: 500 var(--text-sm) var(--font-sans);
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
}

.news-tab:hover { color: var(--color-text); }
.news-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.news-featured {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.news-featured:hover { border-color: var(--color-border-hover); }

.news-featured-image {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  overflow: hidden;
}

.news-featured-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.news-featured-title {
  font: 600 var(--text-lg)/1.4 var(--font-sans);
  color: var(--color-text);
}

.news-featured-summary {
  font: 400 var(--text-sm)/1.5 var(--font-sans);
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-featured-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-disabled);
  margin-top: auto;
}

.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.news-item:hover { background: var(--color-card-hover); }
.news-item:last-child { border-bottom: none; }

.news-item-title {
  font: 500 var(--text-sm)/1.4 var(--font-sans);
  color: var(--color-text);
  transition: color var(--duration-fast);
}

.news-item:hover .news-item-title { color: var(--color-accent); }

.news-item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-disabled);
}

.news-item-source { font-weight: 500; }

.news-item-time { color: var(--color-text-disabled); }

.news-item-stock-tags {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.news-stock-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 1px var(--space-sm);
  background: var(--color-input);
  border-radius: var(--radius-sm);
  font-size: var(--text-2xs);
  color: var(--color-accent);
  cursor: pointer;
}

.news-stock-tag:hover { background: var(--color-accent); color: #fff; }

.news-item-watchlist {
  border-left: 3px solid var(--color-warning);
  padding-left: var(--space-md);
}

.news-more {
  text-align: center;
  padding: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast);
}

.news-more:hover { color: var(--color-accent); }

.news-new-badge {
  position: sticky;
  top: 0;
  z-index: 5;
  text-align: center;
  padding: var(--space-sm);
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
  cursor: pointer;
  animation: fadeInUp var(--duration-normal) var(--ease-out);
}

.news-empty {
  padding: var(--space-3xl);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ============================================================
   Heatmap Components (板块热力图)
   ============================================================ */
.heatmap-container {
  position: relative;
  width: 100%;
}

.heatmap-canvas {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
}

.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.heatmap-title {
  font: 600 var(--text-lg) var(--font-sans);
  color: var(--color-text);
}

.heatmap-toggle {
  display: flex;
  gap: var(--space-sm);
}

.heatmap-toggle-btn {
  padding: 2px var(--space-md);
  font: 500 var(--text-xs) var(--font-sans);
  color: var(--color-text-muted);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.heatmap-toggle-btn:hover { color: var(--color-text); }
.heatmap-toggle-btn.active { color: var(--color-accent); border-color: var(--color-accent); }

.heatmap-tooltip {
  position: absolute;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  pointer-events: none;
  z-index: var(--z-tooltip);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  display: none;
}

.heatmap-tooltip.visible { display: block; }

.heatmap-tooltip-name {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.heatmap-tooltip-change {
  font-family: var(--font-mono);
  font-weight: 700;
}

.heatmap-tooltip-detail {
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  font-size: var(--text-2xs);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  font-size: var(--text-2xs);
  color: var(--color-text-muted);
}

.heatmap-legend-bar {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-sm);
  background: linear-gradient(to right,
    var(--heatmap-down-5) 0%,
    var(--heatmap-down-3) 25%,
    var(--color-flat) 50%,
    var(--heatmap-up-3) 75%,
    var(--heatmap-up-5) 100%
  );
}

.heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast);
  overflow: hidden;
  position: relative;
}

.heatmap-cell:hover { transform: scale(1.05); z-index: 2; }

.heatmap-cell-name {
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  padding: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.heatmap-cell-change {
  font-size: var(--text-2xs);
  font-family: var(--font-mono);
  padding: 0 2px 2px;
}

/* ============================================================
   Calendar Components (财经日历)
   ============================================================ */
.calendar-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.calendar-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-widget-title {
  font: 600 var(--text-lg) var(--font-sans);
  color: var(--color-text);
}

.calendar-widget-link {
  font-size: var(--text-xs);
  color: var(--color-accent);
  cursor: pointer;
}

.calendar-widget-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.calendar-event {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.calendar-event:hover { background: var(--color-card-hover); }

.calendar-event-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
}

.calendar-event-dot.earnings { background: var(--calendar-earnings); }
.calendar-event-dot.dividend { background: var(--calendar-dividend); }
.calendar-event-dot.ipo { background: var(--calendar-ipo); }
.calendar-event-dot.lockup { background: var(--calendar-lockup); }
.calendar-event-dot.announce { background: var(--calendar-announce); }
.calendar-event-dot.economic { background: var(--calendar-economic); }
.calendar-event-dot.watchlist { background: var(--color-warning); box-shadow: 0 0 4px var(--color-warning); }

.calendar-event-date {
  flex-shrink: 0;
  font: 600 var(--text-xs) var(--font-mono);
  color: var(--color-text-muted);
  min-width: 48px;
}

.calendar-event-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-event-title {
  font-size: var(--text-xs);
  color: var(--color-text);
}

.calendar-event-detail {
  font-size: var(--text-2xs);
  color: var(--color-text-disabled);
}

.calendar-event-watchlist {
  background: var(--color-warning-bg);
  border-left: 3px solid var(--color-warning);
}

/* Calendar Page Views */
.calendar-month-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-day-header {
  padding: var(--space-sm);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
}

.calendar-day {
  min-height: 80px;
  padding: var(--space-sm);
  background: var(--color-card);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.calendar-day:hover { background: var(--color-card-hover); }
.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today { border: 1px solid var(--color-accent); }

.calendar-day-number {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.calendar-day-events {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.calendar-day-event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.calendar-list-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.calendar-week-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-sm);
}

.calendar-filters {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.calendar-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: all var(--duration-fast);
}

.calendar-filter.active { border-color: var(--color-accent); color: var(--color-accent); }
.calendar-filter-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ============================================================
   Stock Detail Components (个股详情)
   ============================================================ */
.stock-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

.stock-detail-back {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast);
}

.stock-detail-back:hover { color: var(--color-accent); }

.stock-detail-name {
  font: 700 var(--text-2xl) var(--font-sans);
  color: var(--color-text);
}

.stock-detail-code {
  font: 500 var(--text-sm) var(--font-mono);
  color: var(--color-text-muted);
}

.stock-detail-actions {
  display: flex;
  gap: var(--space-sm);
  margin-left: auto;
}

.stock-detail-quote {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.stock-detail-price-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stock-detail-price-value {
  font: 700 var(--text-4xl)/1.2 var(--font-mono);
}

.stock-detail-price-change {
  font: 600 var(--text-lg)/1.2 var(--font-mono);
}

.stock-detail-quote-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stock-detail-quote-label {
  font-size: var(--text-2xs);
  color: var(--color-text-disabled);
}

.stock-detail-quote-value {
  font: 500 var(--text-sm) var(--font-mono);
}

.stock-detail-chart-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Order Book (盘口) */
.stock-detail-orderbook {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.orderbook-asks, .orderbook-bids {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.orderbook-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 2px var(--space-sm);
  font: 400 var(--text-xs) var(--font-mono);
  border-radius: var(--radius-sm);
  position: relative;
}

.orderbook-row.ask { color: var(--color-down); }
.orderbook-row.bid { color: var(--color-up); }

.orderbook-row-volume-bar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--radius-sm);
  opacity: 0.15;
}

.orderbook-current {
  text-align: center;
  padding: var(--space-sm) 0;
  font: 700 var(--text-xl) var(--font-mono);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: var(--space-sm) 0;
}

/* Tick Data (成交明细) */
.stock-detail-ticks {
  max-height: 300px;
  overflow-y: auto;
}

.tick-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 2px var(--space-sm);
  font: 400 var(--text-xs) var(--font-mono);
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.tick-time { color: var(--color-text-muted); }
.tick-price.up { color: var(--color-up); }
.tick-price.down { color: var(--color-down); }
.tick-volume { text-align: right; }
.tick-direction { text-align: right; }
.tick-direction.buy { color: var(--color-up); }
.tick-direction.sell { color: var(--color-down); }

.tick-row.large { background: var(--color-warning-bg); }

/* Sidebar (个股详情侧边栏) */
.stock-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.stock-detail-sidebar-section {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.stock-detail-sidebar-title {
  font: 600 var(--text-sm) var(--font-sans);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stock-detail-sidebar-link {
  font-size: var(--text-xs);
  color: var(--color-accent);
  cursor: pointer;
}

.stock-detail-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.stock-detail-sidebar-item {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast);
}

.stock-detail-sidebar-item:hover { color: var(--color-text); }

.stock-detail-sidebar-item-meta {
  font-size: var(--text-2xs);
  color: var(--color-text-disabled);
  margin-top: 2px;
}

/* Bottom Tab Panel (个股详情底部Tab) */
.stock-detail-bottom-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.stock-detail-bottom-tab {
  padding: var(--space-sm) var(--space-lg);
  font: 500 var(--text-sm) var(--font-sans);
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
}

.stock-detail-bottom-tab:hover { color: var(--color-text); }
.stock-detail-bottom-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.stock-detail-bottom-content {
  padding: var(--space-lg);
  min-height: 200px;
}

/* ============================================================
   Bottom Sheet Components (移动端BottomSheet)
   ============================================================ */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: var(--z-bottom-sheet);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out), visibility var(--duration-normal);
}

.bottom-sheet-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top-left-radius: var(--radius-2xl);
  border-top-right-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-bottom-sheet);
  max-height: var(--sheet-max-h);
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-spring);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-sheet.visible {
  transform: translateY(0);
}

.bottom-sheet.handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border-hover);
  margin: var(--space-sm) auto;
  cursor: grab;
  flex-shrink: 0;
}

.bottom-sheet.handle:active { cursor: grabbing; }

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg) var(--space-md);
  flex-shrink: 0;
}

.bottom-sheet-title {
  font: 600 var(--text-lg) var(--font-sans);
  color: var(--color-text);
}

.bottom-sheet-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-input);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: var(--text-lg);
  border: none;
  transition: all var(--duration-fast);
}

.bottom-sheet-close:hover { color: var(--color-text); background: var(--color-surface-alt); }

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-lg) var(--space-lg);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.bottom-sheet-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  flex-shrink: 0;
}

.bottom-sheet-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-input);
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: var(--text-base);
  transition: all var(--duration-fast);
}

.bottom-sheet-nav-btn:hover { color: var(--color-text); }
.bottom-sheet-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* === BottomSheet 扩展样式 (T20 bottom-sheet.js 动态生成的子元素) === */
.bottom-sheet-handle-wrap {
  padding-top: var(--space-sm);
  touch-action: none;
}

.bottom-sheet .bottom-sheet-handle-wrap > .handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border-hover);
  margin: var(--space-sm) auto;
  cursor: grab;
}

.bottom-sheet.landscape-fullscreen {
  max-height: 100vh;
  height: 100vh !important;
  border-radius: 0;
}

.bs-quote-region { padding: var(--space-md) 0; }

.bs-quote-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.bs-quote-name { font-weight: 600; font-size: var(--text-lg); color: var(--color-text); }
.bs-quote-code { font-size: var(--text-xs); color: var(--color-text-muted); }
.bs-watch-toggle {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--color-accent);
  padding: var(--space-xs);
}

.bs-quote-price-row { display: flex; gap: var(--space-lg); margin: var(--space-sm) 0; }
.bs-quote-price { font-size: var(--text-2xl, 20px); font-weight: 700; }
.bs-quote-change { font-size: var(--text-lg); font-weight: 500; }
.bs-quote-price.up, .bs-quote-change.up { color: var(--color-up, #EF4444); }
.bs-quote-price.down, .bs-quote-change.down { color: var(--color-down, #22C55E); }

.bs-quote-ohlcv {
  display: flex; flex-wrap: wrap; gap: var(--space-md);
  font-size: var(--text-xs); color: var(--color-text-muted);
}

.bs-chart-region { margin: var(--space-lg) 0; }

.bs-chart-tabs {
  display: flex; gap: var(--space-xs); margin-bottom: var(--space-sm);
}

.bs-chart-tab {
  padding: var(--space-xs) var(--space-lg);
  background: var(--color-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 4px);
  color: var(--color-text-muted);
  cursor: pointer; font-size: var(--text-xs);
  transition: all var(--duration-fast);
}

.bs-chart-tab.active {
  background: var(--color-accent);
  color: var(--color-text-inverse, #fff);
  border-color: var(--color-accent);
}

.bs-chart-container { position: relative; height: 200px; }
.bs-chart-container canvas { width: 100%; height: 100%; display: block; }

.bs-orderbook-region { margin: var(--space-lg) 0; }
.bs-orderbook-empty { color: var(--color-text-muted); font-size: var(--text-xs); padding: var(--space-md) 0; }

.bs-ob-table { width: 100%; font-size: var(--text-xs); border-collapse: collapse; }
.bs-ob-table td { padding: 2px var(--space-sm); }
.bs-ob-row.sell { color: var(--color-down, #22C55E); }
.bs-ob-row.buy { color: var(--color-up, #EF4444); }
.bs-ob-current td { text-align: center; font-weight: 600; color: var(--color-text); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

.bs-bottom-tabs {
  display: flex; gap: var(--space-sm); overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.bs-bottom-tab {
  white-space: nowrap;
  padding: var(--space-xs) var(--space-lg);
  background: var(--color-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 4px);
  color: var(--color-text-muted);
  cursor: pointer; font-size: var(--text-xs);
  transition: all var(--duration-fast);
}

.bs-bottom-tab.active {
  background: var(--color-accent);
  color: var(--color-text-inverse, #fff);
  border-color: var(--color-accent);
}

.bs-tab-content { min-height: 120px; }
.bs-tab-loading { color: var(--color-text-muted); text-align: center; padding: var(--space-xl); font-size: var(--text-xs); }
.bs-tab-empty { color: var(--color-text-muted); text-align: center; padding: var(--space-xl); font-size: var(--text-xs); }

.bs-tab-list { display: flex; flex-direction: column; gap: var(--space-md); }
.bs-tab-item { padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-border); }
.bs-tab-item-title { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); margin-bottom: 2px; }
.bs-tab-item-summary { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.4; }
.bs-tab-item-date { font-size: 10px; color: var(--color-text-muted); margin-top: 2px; }

/* ============================================================
   Search Dropdown Components (搜索下拉)
   ============================================================ */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  display: none;
}

.search-dropdown.visible { display: block; }

.search-dropdown-section {
  padding: var(--space-sm) 0;
}

.search-dropdown-section-title {
  font: 600 var(--text-2xs) var(--font-sans);
  color: var(--color-text-disabled);
  text-transform: uppercase;
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-xs);
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.search-dropdown-item:hover,
.search-dropdown-item.selected {
  background: var(--color-card-hover);
}

.search-dropdown-item-code {
  font: 500 var(--text-xs) var(--font-mono);
  color: var(--color-text-muted);
  min-width: 60px;
}

.search-dropdown-item-name {
  font: 500 var(--text-sm) var(--font-sans);
  color: var(--color-text);
}

.search-dropdown-item-market {
  margin-left: auto;
  font-size: var(--text-2xs);
  color: var(--color-text-disabled);
}

.search-dropdown-empty {
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.search-dropdown-footer {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-disabled);
}

/* Search Box — T18 补充样式 */
.search-dropdown-hot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: 0 var(--space-lg);
}

.search-dropdown-hot-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font: 500 var(--text-xs) var(--font-sans);
  color: var(--color-text-muted);
  background: var(--color-input);
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.search-dropdown-hot-tag:hover {
  color: var(--color-accent);
  background: var(--color-surface-alt);
}

.search-dropdown-item-price {
  font: 500 var(--text-xs) var(--font-mono);
  min-width: 60px;
  text-align: right;
}

.search-dropdown-item-change {
  font: 500 var(--text-2xs) var(--font-mono);
  min-width: 50px;
  text-align: right;
}

.search-dropdown-item-change.up { color: var(--color-up); }
.search-dropdown-item-change.down { color: var(--color-down); }
.search-dropdown-item-price.up { color: var(--color-up); }
.search-dropdown-item-price.down { color: var(--color-down); }

.search-dropdown-clear {
  padding: var(--space-xs) var(--space-lg);
  font-size: var(--text-2xs);
  color: var(--color-text-disabled);
  cursor: pointer;
  text-align: center;
  transition: color var(--duration-fast);
}

.search-dropdown-clear:hover { color: var(--color-accent); }

/* ============================================================
   Board Widget Components (涨停板组件)
   ============================================================ */
.board-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.board-tabs {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.board-tab {
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--radius-full);
  font: 500 var(--text-xs) var(--font-sans);
  color: var(--color-text-muted);
  background: var(--color-input);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.board-tab:hover { color: var(--color-text); }
.board-tab.active { color: #fff; background: var(--color-accent); border-color: var(--color-accent); }

.board-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 var(--text-sm) var(--font-sans);
}

/* LCP 优化: 表格容器跳过布局计算 */
.board-table tbody {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

.board-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.board-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  white-space: nowrap;
}

.board-table tbody tr { cursor: pointer; transition: background var(--duration-fast); }
.board-table tbody tr:hover td { background: var(--color-card-hover); }

.board-strength-bar {
  display: inline-block;
  height: 4px;
  border-radius: var(--radius-sm);
  background: var(--color-up);
  vertical-align: middle;
  margin-right: var(--space-sm);
}

.board-consecutive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: var(--color-up-bg);
  color: var(--color-up);
  font: 700 var(--text-xs) var(--font-mono);
}

/* ============================================================
   Capital Flow Components (资金流组件)
   ============================================================ */
.capital-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.capital-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 20px;
}

.capital-bar-in {
  background: var(--color-up);
  border-radius: var(--radius-sm);
  height: 100%;
  transition: width var(--duration-slow) var(--ease-out);
}

.capital-bar-out {
  background: var(--color-down);
  border-radius: var(--radius-sm);
  height: 100%;
  transition: width var(--duration-slow) var(--ease-out);
}

/* ============================================================
   Sparkline Components (行内迷你走势图)
   ============================================================ */
.sparkline-canvas {
  display: inline-block;
  vertical-align: middle;
}

/* ============================================================
   Quote List Components (行情列表)
   ============================================================ */
.quote-list-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.quote-list-card:hover { border-color: var(--color-border-hover); }

.quote-list-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quote-list-card-name {
  font: 600 var(--text-sm) var(--font-sans);
}

.quote-list-card-code {
  font: 400 var(--text-xs) var(--font-mono);
  color: var(--color-text-muted);
}

.quote-list-card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.quote-list-card-value {
  font: 700 var(--text-xl) var(--font-mono);
}

.quote-list-card-change {
  font: 500 var(--text-sm) var(--font-mono);
}

.quote-list-card-extra {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-2xs);
  color: var(--color-text-disabled);
}

/* ============================================================
   Quote List Widget (行情列表组件 T15)
   ============================================================ */
.quote-list-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quote-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
}

.quote-list-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.quote-list-tab {
  padding: var(--space-xs) var(--space-md);
  font: 500 var(--text-xs) var(--font-sans);
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
}

.quote-list-tab:hover { color: var(--color-text); }
.quote-list-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.quote-list-mode-toggle {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.quote-list-mode-btn {
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: var(--color-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.quote-list-mode-btn:hover { color: var(--color-text); }
.quote-list-mode-btn.active { color: var(--color-accent); border-color: var(--color-accent); }

.quote-list-body {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}

.quote-list-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 var(--text-xs) var(--font-sans);
}

/* LCP 优化: 表格容器用 content-visibility 跳过布局计算, 不作为 LCP 候选 */
.quote-list-table tbody {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* 快讯条内容也用 content-visibility (50条快讯很长, 避免成为LCP) */
.flash-ticker-content {
  content-visibility: auto;
  contain-intrinsic-size: auto 32px;
}

.quote-list-table th {
  text-align: left;
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--text-2xs);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.quote-list-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  white-space: nowrap;
}

.quote-list-row {
  cursor: pointer;
  transition: background var(--duration-fast);
}

.quote-list-row:hover td { background: var(--color-card-hover); }
.quote-list-row.selected td { background: var(--color-accent-bg, rgba(59, 130, 246, 0.08)); }
.quote-list-row.watched .quote-list-watch-icon { color: var(--color-warning); }

.quote-list-cell-name {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.quote-list-code {
  font: 400 var(--text-2xs) var(--font-mono);
  color: var(--color-text-muted);
}

.quote-list-name {
  font: 500 var(--text-xs) var(--font-sans);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.quote-list-watch-icon {
  font-size: var(--text-xs);
  color: var(--color-warning);
}

.quote-list-spark {
  vertical-align: middle;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.up { color: var(--color-up); }
.down { color: var(--color-down); }

.quote-list-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quote-list-card.selected {
  border-color: var(--color-accent);
}

.quote-list-card.watched .quote-list-watch-icon {
  color: var(--color-warning);
}

.quote-list-empty {
  padding: var(--space-2xl);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.quote-list-swipe-actions {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.quote-list-swipe-btn {
  flex: 1;
  padding: var(--space-sm);
  font: 500 var(--text-xs) var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.quote-list-swipe-btn.watch { color: var(--color-warning); border-color: var(--color-warning); }
.quote-list-swipe-btn.compare { color: var(--color-accent); border-color: var(--color-accent); }
.quote-list-swipe-btn:hover { opacity: 0.8; }

/* ============================================================
   Sector Heatmap Widget (板块热力图组件 T13 补充)
   ============================================================ */
.heatmap-canvas-wrap {
  position: relative;
  width: 100%;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

.pagination-btn {
  padding: 2px var(--space-md);
  font: 500 var(--text-xs) var(--font-sans);
  color: var(--color-text-muted);
  background: var(--color-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.pagination-btn:hover { color: var(--color-text); }
.pagination-btn.active { color: #fff; background: var(--color-accent); border-color: var(--color-accent); }
.pagination-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.pagination-info {
  font-size: var(--text-xs);
  color: var(--color-text-disabled);
}

/* ============================================================
   Capital Widget Items (资金流列表项)
   ============================================================ */
.capital-widget-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.capital-item {
  padding: var(--space-sm) 0;
  cursor: pointer;
  transition: background var(--duration-fast);
  border-radius: var(--radius-sm);
}

.capital-item:hover {
  background: var(--color-card-hover);
}

.capital-item-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-sm);
}

.capital-rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font: 700 var(--text-xs) var(--font-mono);
  color: var(--color-text-muted);
  background: var(--color-input);
}

.capital-rank.rank-top {
  color: #fff;
  background: var(--color-accent);
}

.capital-item-name {
  font: 500 var(--text-sm) var(--font-sans);
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capital-item-code {
  font: 400 var(--text-xs) var(--font-mono);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.capital-item-flow {
  font: 700 var(--text-sm) var(--font-mono);
  margin-left: auto;
}

.capital-item-flow.up { color: var(--color-up); }
.capital-item-flow.down { color: var(--color-down); }

/* Board table wrapper */
.board-table-wrap {
  overflow-x: auto;
}

/* Calendar empty state */
.calendar-empty {
  padding: var(--space-lg);
  text-align: center;
}
