/* ================================================================
   YoungStockDaily · 亮色主题样式
   响应式：桌面 / 平板 / 手机自适应
   ================================================================ */

:root {
  --bg: #f7f9fc;
  --bg-card: #ffffff;
  --bg-card-alt: #eef2f8;
  --border: #dbe3ee;
  --text: #1a2332;
  --text-sub: #4a5568;
  --text-muted: #8894a8;

  --red: #e03e3e;     /* 涨 */
  --green: #16a34a;   /* 跌 */
  --orange: #f59e0b;  /* 警告 */
  --fire: #ef4444;    /* 极端 */
  --blue: #2563eb;    /* 强调 */
  --ok: #10b981;      /* 正常 */

  --shadow-sm: 0 1px 2px rgba(26, 35, 50, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 35, 50, 0.06);
  --shadow-lg: 0 8px 30px rgba(26, 35, 50, 0.1);

  --radius: 12px;
  --radius-sm: 8px;

  --max-width: 960px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */
.site-header {
  background: linear-gradient(135deg, #ffffff 0%, #eef2f8 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.brand small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.nav-links a {
  margin-left: 16px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--blue); text-decoration: none; }

/* ---------- 主容器 ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---------- 首页筛选条 ---------- */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.filter-bar input,
.filter-bar select {
  flex: 1;
  min-width: 160px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-bar .count {
  color: var(--text-muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
}

/* ---------- 报告卡片列表 ---------- */
.report-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.report-card .thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.report-card .date {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.report-card .category {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  margin-bottom: 8px;
  font-weight: 500;
}
.report-card .summary {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.report-card .tickers {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.report-card .tickers span {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-card-alt);
  color: var(--text-sub);
  border-radius: 4px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state h3 { color: var(--text-sub); margin: 0 0 6px; }

/* ---------- 报告详情页 ---------- */
.report-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 13px;
}
.report-meta .category {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  font-weight: 500;
}

.report-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
  line-height: 1.3;
}

/* 预览图 */
.preview-image {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  cursor: zoom-in;
  position: relative;
  transition: box-shadow 0.2s;
}
.preview-image:hover { box-shadow: var(--shadow-md); }
.preview-image img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  display: block;
}
.preview-image .preview-tip {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(26, 35, 50, 0.72);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
}

/* 全屏图片查看器 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.88);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
  overflow: auto;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 95vh;
  width: auto;
  height: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-sm);
}
.lightbox .close-tip {
  position: fixed;
  top: 20px;
  right: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  pointer-events: none;
}

/* 文字分析区 */
.report-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}
.report-content h1 { font-size: 24px; margin: 0 0 16px; color: var(--text); }
.report-content h2 {
  font-size: 20px;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg-card-alt);
  color: var(--text);
}
.report-content h3 {
  font-size: 17px;
  margin: 22px 0 10px;
  color: var(--text);
}
.report-content h4 {
  font-size: 15px;
  margin: 18px 0 8px;
  color: var(--text-sub);
}
.report-content p { margin: 10px 0; color: var(--text-sub); }
.report-content ul, .report-content ol { padding-left: 22px; color: var(--text-sub); }
.report-content li { margin: 4px 0; }
.report-content strong { color: var(--text); }
.report-content code {
  background: var(--bg-card-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--red);
}
.report-content blockquote {
  border-left: 4px solid var(--blue);
  background: rgba(37, 99, 235, 0.06);
  padding: 10px 16px;
  margin: 14px 0;
  color: var(--text-sub);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 表格 */
.report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
  overflow-x: auto;
  display: block;
}
.report-content table thead {
  background: var(--bg-card-alt);
}
.report-content table th,
.report-content table td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.report-content table th {
  font-weight: 600;
  color: var(--text);
}
.report-content table tr:nth-child(even) td { background: #fafbfd; }

/* 返回按钮 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 18px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.back-link:hover {
  color: var(--blue);
  border-color: var(--blue);
  text-decoration: none;
}

/* 底部 */
footer {
  max-width: var(--max-width);
  margin: 40px auto 20px;
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- 响应式：手机 ---------- */
@media (max-width: 640px) {
  .site-header { padding: 14px 16px; }
  .brand { font-size: 17px; }
  .brand .logo { width: 32px; height: 32px; font-size: 15px; }
  .nav-links a { margin-left: 10px; font-size: 13px; }

  main { padding: 18px 14px 40px; }

  .report-list { grid-template-columns: 1fr; gap: 12px; }
  .report-card { padding: 14px; }
  .report-card .thumb { height: 120px; }

  .report-title { font-size: 22px; }
  .preview-image { padding: 8px; }
  .preview-image img { max-height: 240px; }

  .report-content { padding: 18px 16px; }
  .report-content h2 { font-size: 18px; }
  .report-content h3 { font-size: 16px; }
  .report-content table { font-size: 12px; }
  .report-content table th,
  .report-content table td { padding: 6px 8px; }

  .filter-bar { padding: 12px; gap: 8px; }
  .filter-bar input, .filter-bar select { min-width: 100%; }
}

/* ---------- Tab 切换栏 ---------- */
.tab-bar {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  flex: 1;
  min-width: max-content;
  padding: 10px 18px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.tab-btn:hover { color: var(--blue); background: rgba(37, 99, 235, 0.05); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}
.tab-panel { display: none; animation: fadeIn 0.25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 报告卡片增强 ---------- */
.report-card .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 8px;
  line-height: 1.4;
}
.report-card.web3 {
  border-left: 4px solid #f7931a;
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 40%);
}
.report-card .web3-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(247, 147, 26, 0.12);
  color: #c76e00;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ---------- 自选股清单 ---------- */
.portfolio-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.portfolio-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.portfolio-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}
.btn-link {
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--blue);
  transition: all 0.15s;
}
.btn-link:hover { background: rgba(37, 99, 235, 0.06); text-decoration: none; }

.portfolio-cat {
  margin-bottom: 18px;
}
.portfolio-cat:last-child { margin-bottom: 0; }
.portfolio-cat h3 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 600;
}
.portfolio-cat h3 small {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 6px;
}
.stock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stock-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  padding: 5px 10px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-sub);
}
.stock-chip b {
  color: var(--blue);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
}

/* 完整 portfolio.html 表格 */
.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.portfolio-table thead { background: var(--bg-card-alt); }
.portfolio-table th,
.portfolio-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.portfolio-table th {
  font-weight: 600;
  color: var(--text);
}
.portfolio-table tr:hover td { background: #fafbfd; }
.portfolio-table .tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  border-radius: 4px;
  margin: 1px 3px 1px 0;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 更新时间 */
.update-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card-alt);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- 响应式补充 ---------- */
@media (max-width: 640px) {
  .tab-btn { padding: 8px 12px; font-size: 13px; }
  .portfolio-summary { padding: 16px; }
  .portfolio-table th, .portfolio-table td { padding: 8px 10px; }
}

/* ================================================================
   今日最新板块
   ================================================================ */
.today-header {
  background: linear-gradient(135deg, #fff 0%, #f0f6ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.today-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.today-title h1 {
  margin: 0; font-size: 22px; color: var(--text); font-weight: 700;
}
.today-chip {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}
.today-anchors {
  display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap;
}
.today-anchors a {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  color: var(--text-sub); font-size: 13.5px; font-weight: 500;
  text-decoration: none; transition: all 0.2s;
}
.today-anchors a:hover {
  color: var(--blue); border-color: var(--blue);
  background: #eff6ff; transform: translateY(-1px);
  text-decoration: none;
}

.today-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 80px;  /* 锚点定位时留出顶部空间 */
}
.today-block-title {
  margin: 0 0 16px 0;
  font-size: 19px;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-card-alt);
}
.today-block-body { font-size: 15px; }
.today-block-body > .report-content { padding: 0; }
.today-block-foot {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--border);
  text-align: right;
}
.today-block-foot .btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 8px;
  background: var(--blue); color: #fff;
  font-size: 13.5px; font-weight: 500;
  text-decoration: none; transition: all 0.2s;
}
.today-block-foot .btn-link:hover {
  background: #1d4ed8; text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

@media (max-width: 640px) {
  .today-header { padding: 16px 18px; }
  .today-title h1 { font-size: 18px; }
  .today-block { padding: 18px 18px; }
  .today-block-title { font-size: 17px; }
}
