/* 天天财经 - 样式 */
:root {
  --red: #c0392b;
  --red-dark: #96281b;
  --gold: #d9a441;
  --ink: #2b2b2b;
  --ink-light: #6b6b6b;
  --bg: #f5f4f0;
  --card: #ffffff;
  --line: #e8e4dc;
  --radius: 14px;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 顶部 */
.site-header {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
  padding: 26px 0 18px;
  box-shadow: 0 2px 12px rgba(150, 40, 27, .25);
}
.header-inner { display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 14px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .35);
  font-size: 30px; font-family: "STSong", "SimSun", serif; font-weight: bold;
}
.brand-text h1 { font-size: 26px; letter-spacing: 2px; font-family: "STSong", "SimSun", serif; }
.greet {
  display: inline-block;
  font-size: 13px; letter-spacing: 1px; font-family: inherit;
  font-weight: normal; color: var(--gold);
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(217, 164, 65, .55);
  border-radius: 999px;
  padding: 2px 10px;
  margin-right: 8px;
  vertical-align: 3px;
}
.slogan { font-size: 13px; opacity: .85; }

/* 日期条 */
.date-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 16px 0 4px;
  scrollbar-width: none;
}
.date-bar::-webkit-scrollbar { display: none; }
.date-chip {
  white-space: nowrap; padding: 7px 16px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-light);
  font-size: 13px; cursor: pointer; transition: all .15s ease;
}
.date-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 概览卡 */
.digest-card {
  margin-top: 12px;
  background: linear-gradient(160deg, #fffdf8, #fff7ea);
  border: 1px solid #f0e2c8;
  border-radius: var(--radius);
  padding: 18px 20px;
}
.digest-card h2 { font-size: 15px; color: var(--gold); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.digest-card ul { list-style: none; }
.digest-card li {
  font-size: 14px; padding: 5px 0 5px 18px; position: relative;
  color: var(--ink);
}
.digest-card li::before {
  content: ""; position: absolute; left: 2px; top: 14px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
}
.digest-meta { margin-top: 10px; font-size: 12px; color: var(--ink-light); }

/* 指数滚动行情条 */
.ticker-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 6px rgba(60, 40, 20, .06);
}
.ticker-label {
  flex-shrink: 0;
  font-size: 12px; font-weight: 700; color: var(--red);
  background: #fdeeea; border-radius: 4px;
  padding: 3px 8px; letter-spacing: 2px;
}
.ticker { flex: 1; overflow: hidden; }
.ticker-track {
  display: flex; align-items: center;
  width: max-content;
  animation: tickerScroll 45s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-group { display: flex; align-items: center; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tick-item {
  display: inline-flex; align-items: baseline; gap: 7px;
  white-space: nowrap; padding: 9px 4px; font-size: 13px;
}
.tick-name { color: var(--ink-light); }
.tick-price { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tick-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.tick-item.up .tick-price, .tick-item.up .tick-pct { color: #d43a2f; }
.tick-item.down .tick-price, .tick-item.down .tick-pct { color: #1e8e4e; }
.tick-item.flat .tick-pct { color: var(--ink-light); }
.tick-sep { color: var(--line); padding: 0 10px; }

/* 栏目区：商业 / 金融 两列（所有屏幕尺寸均左右并列） */
.columns {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.column-block { margin-top: 18px; min-width: 0; }
.column-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.column-title .bar { width: 5px; height: 22px; border-radius: 3px; background: var(--red); }
.column-title.business .bar { background: var(--red); }
.column-title.finance .bar { background: #1a5276; }
.column-title h2 { font-size: 20px; font-family: "STSong", "SimSun", serif; letter-spacing: 3px; }
.column-title .cnt { font-size: 12px; color: var(--ink-light); }

.news-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: box-shadow .18s ease, transform .18s ease;
}
.news-item:hover { box-shadow: 0 4px 16px rgba(60, 40, 20, .08); transform: translateY(-1px); }
.news-item .news-title { cursor: pointer; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: #fdeeea; color: var(--red); font-weight: 600;
  flex-shrink: 0; margin-top: 3px;
}
.tag.blue { background: #e8f1f8; color: #1a5276; }
.news-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
.news-title a { color: var(--ink); text-decoration: none; }
.news-title a:hover { color: var(--red); }
.news-head { display: flex; align-items: flex-start; gap: 8px; }
.news-foot {
  margin-top: 8px; display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #a8a29a;
}
.news-foot a { color: var(--ink-light); text-decoration: none; cursor: pointer; }
.news-foot a:hover { color: var(--red); }

/* 广告位占位 */
.ad-slot {
  margin: 16px 0; min-height: 8px;
}
.ad-slot:empty { margin: 0; min-height: 0; }

/* 新闻详情弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 12, 8, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: 86vh; overflow-y: auto;
  background: var(--card);
  border-radius: 16px;
  padding: 26px 24px 20px;
  box-shadow: 0 18px 50px rgba(20, 12, 8, .3);
  animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: #f1ede6; color: var(--ink-light);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: #e6e0d6; color: var(--ink); }
.modal-title { font-size: 19px; line-height: 1.5; margin-top: 8px; }
.modal-meta { font-size: 12px; color: #a8a29a; margin-top: 8px; }
.modal-summary { font-size: 15px; color: var(--ink); margin-top: 14px; }
.modal-goto {
  display: block; text-align: center;
  margin-top: 16px; padding: 12px 0;
  background: var(--red); color: #fff;
  font-size: 15px; font-weight: 600;
  border-radius: 10px; text-decoration: none;
  transition: background .15s ease;
}
.modal-goto:hover { background: var(--red-dark); }
.modal-goto:active { transform: translateY(1px); }
.modal-share {
  display: block; width: 100%; text-align: center;
  margin-top: 10px; padding: 12px 0;
  background: #f0faf4; color: #07c160;
  font-size: 15px; font-weight: 600;
  border: 1px solid rgba(7, 193, 96, .35);
  border-radius: 10px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.modal-share:hover { background: #e2f6ea; border-color: #07c160; }
.modal-share:active { transform: translateY(1px); }
.modal-tip { margin-top: 10px; font-size: 11px; color: #b5afa6; text-align: center; }

/* 分享引导层（无原生分享时） */
#shareGuide {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 12, 8, .45);
  animation: modalIn .2s ease;
}
.sg-panel {
  width: 100%; max-width: 560px;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 20px 22px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
}
.sg-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.sg-btns { display: flex; gap: 12px; margin-top: 16px; }
.sg-btn {
  flex: 1; padding: 12px 0; font-size: 15px; font-weight: 600;
  border-radius: 10px; border: none; cursor: pointer;
}
.sg-wechat { background: #07c160; color: #fff; }
.sg-wechat:active { transform: translateY(1px); }
.sg-moments { background: #f0faf4; color: #07c160; border: 1px solid rgba(7, 193, 96, .35); }
.sg-moments:active { transform: translateY(1px); }
.sg-hint { margin-top: 12px; font-size: 12px; color: #a8a29a; line-height: 1.6; }
.sg-copy {
  display: block; width: 100%; margin-top: 12px; padding: 11px 0;
  background: #f1ede6; color: var(--ink);
  font-size: 14px; border: none; border-radius: 10px; cursor: pointer;
}
.sg-close {
  display: block; width: 100%; margin-top: 8px; padding: 11px 0;
  background: transparent; color: #a8a29a;
  font-size: 14px; border: none; cursor: pointer;
}

/* 复制成功提示 */
#shareToast {
  position: fixed; left: 50%; bottom: 12vh; z-index: 2100;
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 12, 8, .85); color: #fff;
  font-size: 13px; padding: 10px 18px;
  border-radius: 999px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
#shareToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 页脚 */
.site-footer {
  margin-top: 36px; padding: 26px 0 40px;
  text-align: center; color: var(--ink-light);
  border-top: 1px solid var(--line);
  font-size: 13px; background: #efece6;
}
.disclaimer { margin-top: 8px; font-size: 12px; color: #a8a29a; }
.copy { margin-top: 6px; font-size: 12px; color: #a8a29a; }

@media (max-width: 768px) {
  .columns { gap: 10px; }
  .brand-text h1 { font-size: 22px; }
  /* 紧凑两列：保证小屏左右并列时依然可读 */
  .news-item { padding: 11px 12px; margin-bottom: 8px; }
  .news-title { font-size: 13px; }
  .news-summary { font-size: 12px; margin-top: 4px; }
  .tag { font-size: 10px; padding: 1px 6px; }
  .column-title { margin-bottom: 8px; }
  .column-title h2 { font-size: 16px; }
  .column-title .bar { height: 18px; }
  .news-foot { font-size: 11px; margin-top: 6px; }
  .digest-card { padding: 14px 14px; }
  .digest-card li { font-size: 12px; padding-left: 14px; }
  .digest-card li::before { top: 11px; width: 5px; height: 5px; }
  .ticker-label { display: none; }
  .ticker-bar { padding: 0 10px; }
  .modal-dialog { padding: 22px 18px 16px; }
  .modal-title { font-size: 16px; }
  .modal-summary { font-size: 13px; }
  .modal-overlay { padding: 14px; }
}
