/* ============ 金十财经视图样式 ============ */
/* 注：[hidden] 兜底与 .btn-ghost 统一在 style.css 里定义，
   两份 CSS 现在总是一起加载，不再重复声明（审查项 L-08）。 */

.btn-sm { font-size: 12.5px; padding: 6px 13px; }

/* ---------- 区块 ---------- */
.j-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  transition: background 0.3s, border-color 0.3s;
}
.j-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.j-section-head h2 { font-size: 16.5px; font-weight: 800; }
.j-section-head h2 small { font-size: 12px; color: var(--text-faint); font-weight: 400; margin-left: 6px; }
.j-muted { font-size: 12px; color: var(--text-faint); }

/* ---------- 行情卡片 ---------- */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.quote-card {
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  transition: transform 0.18s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.quote-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.quote-card .q-name { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.quote-card .q-code {
  font-size: 10.5px;
  color: var(--text-faint);
  background: var(--chip-bg);
  border-radius: 5px;
  padding: 1px 6px;
  letter-spacing: 0.5px;
}
.quote-card .q-price {
  font-size: 23px;
  font-weight: 800;
  margin: 6px 0 3px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.quote-card .q-change {
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.quote-card .q-range { font-size: 11px; color: var(--text-faint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.quote-card .q-err { font-size: 12px; color: var(--accent); }
/* 红涨绿跌（中国市场习惯）——颜色按主题取值，保证小字也达 AA（审查项 M-03） */
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-dim); }

/* ---------- 快讯 / 资讯 ---------- */
.j-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.j-tab {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: all 0.18s;
}
.j-tab:hover { color: var(--text); background: var(--card); }
.j-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px var(--glow);
}
.j-search {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.j-search input {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  outline: none;
  width: 240px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.j-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.j-search input::placeholder { color: var(--text-faint); }

.j-feed { display: flex; flex-direction: column; gap: 0; }

.flash-item, .news-item {
  display: flex;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--border);
  animation: fadeUp 0.3s ease both;
}
.flash-item:last-child, .news-item:last-child { border-bottom: none; }
.flash-item .f-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  width: 92px;
}
.news-item .f-time { width: 92px; flex-shrink: 0; font-size: 12px; color: var(--text-faint); padding-top: 2px; }
.flash-item .f-content { font-size: 13.5px; color: var(--text); line-height: 1.7; }
.flash-item .f-content a { color: inherit; }
.flash-item .f-content a:hover { color: var(--accent-2); }

.news-item .n-title {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1.5;
}
.news-item .n-title:hover { color: var(--accent-2); }
.news-item .n-intro {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.j-feed-foot { text-align: center; padding-top: 12px; }
.j-feed-empty { text-align: center; color: var(--text-faint); padding: 26px 0; font-size: 13px; }

/* ---------- 财经日历 ---------- */
/* 审查项 M-09：以前把滚动条彻底隐藏了，桌面鼠标用户既看不到也拖不动，
   而"实际值/影响"两列正好在最右边。改回细滚动条并允许键盘聚焦滚动。 */
.cal-wrap {
  overflow-x: auto;
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
.cal-wrap:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cal-empty { text-align: center; color: var(--text-faint); }
.cal-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.cal-table th {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cal-table td {
  font-size: 13px;
  padding: 9px 10px;
  border-bottom: 1px dashed var(--border);
  vertical-align: middle;
}
.cal-table tr:hover td { background: var(--card-hover); }
.cal-table .c-title { font-weight: 600; min-width: 220px; }
.cal-table .c-num { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.stars { color: var(--gold); letter-spacing: 2px; font-size: 11px; white-space: nowrap; }
.affect {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 9px;
}
/* 审查项 M-02：以前用 .affect.利多 这类中文类名，而上游实际返回的是
   "利多金银""利空美元"这类带品种后缀的值，一条规则都匹配不上。
   现在由 JS 映射成固定枚举再套样式。 */
.affect.down { color: var(--down); background: rgba(22, 179, 100, 0.12); border: 1px solid rgba(22, 179, 100, 0.3); }
.affect.up { color: var(--up); background: rgba(240, 57, 76, 0.1); border: 1px solid rgba(240, 57, 76, 0.3); }
.affect.flat { color: var(--text-dim); background: var(--chip-bg); border: 1px solid var(--border); }
.affect.unknown { color: var(--text-faint); background: var(--chip-bg); border: 1px solid var(--border); }

/* ---------- 资讯详情模态 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 760px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 26px 28px;
  position: relative;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease;
}
.modal h2 { font-size: 19px; line-height: 1.5; padding-right: 30px; }
.modal-meta { font-size: 12.5px; color: var(--text-faint); margin: 8px 0 14px; }
.modal-body {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.modal-close:hover { color: var(--text); border-color: var(--accent); transform: rotate(90deg); }

/* ---------- 响应式（手机 / 平板 / 大屏三档） ---------- */
/* 平板：行情 2 列 */
@media (max-width: 1099px) {
  .quote-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 手机：行情 1 列 + 大触摸目标 + 模态全屏 */
@media (max-width: 760px) {
  .quote-grid { grid-template-columns: 1fr; }
  .j-search { margin-left: 0; width: 100%; }
  .j-search input { flex: 1; width: auto; min-height: 44px; }
  .j-search .btn { min-height: 44px; }
  .j-section { padding: 14px; }
  .j-tab { min-height: 44px; padding: 8px 16px; }
  .flash-item .f-time, .news-item .f-time { width: 74px; font-size: 11px; }
  .news-item .n-title { min-height: 40px; }

  /* 模态框手机全屏 */
  .modal-mask { padding: 0; }
  .modal {
    max-width: 100%;
    width: 100%;
    /* 审查项 M-08：100vh 含移动浏览器可收起的地址栏高度，底部会被裁掉 */
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    padding: 22px 18px 90px;
  }
  .modal-close { width: 40px; height: 40px; top: 12px; right: 12px; }
}
