/* ===== CSS Variables ===== */
:root {
  --bg-deep: #070b14;
  --bg-panel: rgba(18, 24, 38, 0.72);
  --bg-panel-hover: rgba(24, 32, 52, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f2f7;
  --text-secondary: #8b95a8;
  --accent-cyan: #00e5ff;
  --accent-blue: #3b82f6;
  --accent-orange: #ff9f43;
  --accent-green: #2ecc71;
  --accent-red: #ff6b6b;
  --accent-purple: #a259ff;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --sidebar-width: 240px;
  --header-height: 70px;
  --font-display: "DIN Alternate", "Bahnschrift", "Arial Narrow", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html,
body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.18) 0%, transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(0, 229, 255, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(162, 89, 255, 0.08) 0%, transparent 45%),
    var(--bg-deep);
}

/* subtle noise overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

/* ===== Layout ===== */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  background: var(--bg-panel);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: margin-left 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 桌面端折叠 */
.app.sidebar-hidden .sidebar {
  margin-left: calc(-1 * var(--sidebar-width));
}

/* 移动端遮罩 */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.app.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 19px;
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.28);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.6px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.nav-section {
  margin-bottom: 22px;
}

.nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-left: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 4px;
  font-size: 15px;
  text-decoration: none;
}

a.nav-item:hover,
.nav-item:hover,
.nav-item.active {
  background: var(--bg-panel-hover);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), transparent);
  border-left: 3px solid var(--accent-blue);
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

/* Collapsible submenu */
.nav-section.collapsible .nav-title-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.nav-arrow {
  font-size: 10px;
  transition: transform 0.25s ease;
  color: var(--text-secondary);
}

.nav-section.collapsible:not(.open) .nav-arrow {
  transform: rotate(-90deg);
}

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  padding-left: 8px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 0;
}

.nav-section.open .nav-submenu {
  max-height: 200px;
  opacity: 1;
}

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== Header ===== */
.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(10, 15, 26, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.25s ease;
}

.sidebar-toggle:hover {
  background: var(--bg-panel-hover);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1);
}

.toggle-line {
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--text-secondary);
  transition: all 0.25s ease;
}

.sidebar-toggle:hover .toggle-line {
  background: var(--accent-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.filter-item.filter-search {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  min-width: auto;
  margin-left: 0;
}

.filter-item.filter-search .search-box {
  min-width: 180px;
  width: 220px;
  padding: 7px 12px;
}

.filter-item.filter-search .search-btn {
  padding: 7px 16px;
  font-size: 14px;
}

.filter-item label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-item select,
.filter-item input {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  min-width: 120px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-item select:focus,
.filter-item input:focus {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1);
}

.filter-item select option {
  background: var(--bg-panel);
  color: var(--text-primary);
}

.search-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  min-width: 320px;
  transition: box-shadow 0.2s ease;
}

.search-box:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.18);
  border-color: rgba(0, 229, 255, 0.35);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
}

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

.search-btn {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none;
  color: #fff;
  padding: 9px 22px;
  border-radius: 9px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.38);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(162, 89, 255, 0.25);
}

/* ===== Content ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 26px 28px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Glass Card ===== */
.glass-card {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.card-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ===== KPI Grid ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.kpi-icon.cyan { background: rgba(0, 229, 255, 0.12); color: var(--accent-cyan); }
.kpi-icon.orange { background: rgba(255, 159, 67, 0.12); color: var(--accent-orange); }
.kpi-icon.blue { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); }
.kpi-icon.purple { background: rgba(162, 89, 255, 0.12); color: var(--accent-purple); }

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-trend.up { color: var(--accent-green); }
.kpi-trend.down { color: var(--accent-red); }

.sparkline {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 90px;
  height: 34px;
  opacity: 0.55;
}

/* ===== Section Layout ===== */
.section-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .section-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Chart ===== */
.chart-placeholder {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 15px;
}

.chart-svg {
  width: 100%;
  height: 260px;
}

.chart-area {
  fill: url(#areaGradient);
  opacity: 0.35;
}

.chart-line {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--accent-cyan);
  stroke: var(--bg-deep);
  stroke-width: 2;
}

.radar-card {
  display: flex;
  flex-direction: column;
}

.radar-chart {
  flex: 1;
  min-height: 440px;
  width: 100%;
  display: block;
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.4px;
}

.data-table td {
  color: var(--text-primary);
}

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

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.tag.good { color: var(--accent-green); border-color: rgba(46, 204, 113, 0.25); }
.tag.warn { color: var(--accent-orange); border-color: rgba(255, 159, 67, 0.25); }

/* ===== Right Panel Modules ===== */
.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.module-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.module-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.module-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.module-body h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.module-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Progress ===== */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transition: width 0.8s ease;
}

/* ===== Loading / Empty ===== */
.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.loading-mask.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  animation: spin 0.9s linear infinite;
}

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

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 200;
  transform: translateX(140%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  border-left: 4px solid var(--accent-red);
}

/* ===== Form ===== */
.form-label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
}

.form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea:focus {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1);
}

.form-textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  opacity: 0.8;
}

/* ===== ETF Screen ===== */
.screen-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 140px);
}

.screen-card .card-header {
  flex-shrink: 0;
}

.screen-card .search-section {
  margin-bottom: 18px;
  flex-shrink: 0;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.screen-table {
  min-width: 2100px;
  border-collapse: collapse;
  font-size: 14px;
}

.screen-table th,
.screen-table td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.screen-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(18, 24, 38, 0.98);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.screen-table th:hover {
  color: var(--text-primary);
  background: rgba(24, 32, 52, 0.98);
}

.screen-table th.sortable::after {
  content: "⇅";
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.5;
}

.screen-table th.sort-asc::after {
  content: "▲";
  opacity: 1;
  color: var(--accent-cyan);
}

.screen-table th.sort-desc::after {
  content: "▼";
  opacity: 1;
  color: var(--accent-cyan);
}

.screen-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.screen-table td strong {
  color: var(--accent-cyan);
}

.screen-table .name-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

/* ETF 轮动表：只有 7 列，宽度自适应 */
#rotationTable {
  min-width: auto;
  width: 100%;
  table-layout: auto;
}

#rotationTable th,
#rotationTable td {
  white-space: nowrap;
  padding: 12px 10px;
}

#rotationTable .name-cell {
  max-width: 140px;
}

.empty-cell {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
}

.action-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.action-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.08);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  flex-shrink: 0;
}

.page-btn {
  padding: 8px 18px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  border-color: rgba(0, 229, 255, 0.35);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 160px;
  text-align: center;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  z-index: 101;
  width: 90vw;
  max-width: 1100px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.5px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.modal-date {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 107, 107, 0.15);
  color: var(--accent-red);
  border-color: rgba(255, 107, 107, 0.3);
}

.modal-copy-btn {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.modal-copy-btn:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.4);
  color: #fff;
}

.modal-body {
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-table-wrap {
  max-height: calc(85vh - 110px);
  border-radius: 12px;
}

.holdings-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  font-size: 14px;
}

.holdings-table th,
.holdings-table td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.holdings-table th {
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(18, 24, 38, 0.98);
  color: var(--text-secondary);
  font-weight: 500;
}

.holdings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.holdings-table .name-cell {
  text-align: left;
}

.kline-trigger,
.trend-trigger {
  cursor: pointer;
  color: var(--accent-cyan);
  transition: color 0.2s ease;
}

.kline-trigger:hover,
.trend-trigger:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.kline-modal-content {
  width: 98vw;
  max-width: 1600px;
  max-height: 98vh;
}

.kline-modal-body {
  padding: 16px 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kline-chart {
  width: 100%;
  height: 100%;
  min-height: 720px;
}

.report-modal-content {
  width: 92vw;
  max-width: 960px;
  max-height: 90vh;
}

.report-modal-body {
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.report-text {
  width: 100%;
  height: 100%;
  max-height: calc(90vh - 110px);
  margin: 0;
  padding: 18px 20px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: "Consolas", "Courier New", "Microsoft YaHei", monospace;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== Responsive Sidebar ===== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .header {
    padding: 0 18px;
  }

  .page-title {
    font-size: 17px;
  }

  .search-box {
    min-width: auto;
    width: 180px;
  }

  .search-box input:nth-of-type(2) {
    display: none;
  }
}

@media (max-width: 520px) {
  .page-title {
    display: none;
  }

  .search-box {
    width: 140px;
  }
}
