/* =========================================================
 * 布衣炒股社 · 新中式编辑部主题
 * 宣纸底 · 墨色字 · 朱红点缀 · 鎏金辅助
 * 红涨绿跌（国内惯例）
 * 改版说明：只改视觉层（颜色/字体/圆角/阴影），类名与结构不变
 * ========================================================= */
:root {
  --bg: #faf5eb;               /* 宣纸底 */
  --card-bg: #fffdf8;          /* 卡片米白 */
  --ink: #221e19;              /* 深墨（头图/页脚底色） */
  --primary: #c53a2a;          /* 朱红（印章红） */
  --primary-dark: #a32a1c;
  --primary-soft: #f7e8e4;     /* 朱红浅底 */
  --gold: #c49a4a;             /* 鎏金 */
  --gold-soft: #f1e9d7;
  --up: #c0392b;               /* 涨 · 红 */
  --up-soft: #f7e4e0;
  --down: #2e7d57;             /* 跌 · 绿 */
  --down-soft: #e3efe8;
  --text: #1a1a1a;             /* 墨色文字 */
  --text-soft: #5c5448;        /* 茶褐次级文字 */
  --text-faint: #8a8272;       /* 弱化文字 */
  --border: #e5ddc8;           /* 沙色边线 */
  --border-strong: #cfc4a8;
  --shadow: 0 2px 12px rgba(34, 30, 25, 0.07);
  --shadow-hover: 0 8px 22px rgba(34, 30, 25, 0.12);
  --radius: 3px;               /* 克制锐利，全局小圆角 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
                "STSong", "SimSun", serif;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-serif); }

/* ===== 头部（墨色条幅）===== */
header {
  position: relative;
  background: var(--ink);
  color: #faf5eb;
  padding: 64px 20px 56px;
  text-align: center;
}
/* 引题（金色小字） */
header::before {
  content: "BU YI STOCK CLUB";
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--gold);
  margin-bottom: 18px;
}
/* 朱红短线收尾 */
header::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  background: var(--primary);
  margin: 26px auto 0;
}
header h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  margin-bottom: 16px;
  color: #faf5eb;
}
header p {
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(0.95rem, 2vw, 1.02rem);
  color: #b8b0a0;
  line-height: 1.9;
}

/* ===== 主体容器 ===== */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

/* ===== 筛选分类 ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}
.filter-btn {
  border: 1px solid var(--border-strong);
  background: var(--card-bg);
  color: var(--text-soft);
  padding: 8px 20px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  user-select: none;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff6ec;
}

/* ===== 资源网格 =====
   首页可见的 4 张卡固定一排 4 列；
   窄屏降级：≤900px 两列，≤480px 单列（见下方媒体查询）。 */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card .tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.card h3 {
  font-size: 1.02rem;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: var(--text);
}
.card .desc {
  font-size: 0.82rem;
  color: var(--text-soft);
  flex-grow: 1;
  margin-bottom: 14px;
}
.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card .size {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff6ec;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s ease;
}
.download-btn:hover { background: var(--primary-dark); }

.download-btn.unavailable {
  background: #9a9282;
  color: #fff6ec;
  cursor: not-allowed;
  pointer-events: none;
}

.empty {
  text-align: center;
  color: var(--text-soft);
  padding: 40px;
  grid-column: 1 / -1;
}

/* ===== 页脚（墨色收尾）===== */
footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-faint);
  font-size: 0.85rem;
  border-top: none;
  background: var(--ink);
}
footer a { color: var(--gold); text-decoration: none; }
footer .beian {
  margin: 8px 0 4px;
  font-size: 0.75rem;
  opacity: 0.9;
}
footer .beian-div { margin: 0 8px; opacity: 0.6; }

/* ===== 在线试玩面板 ===== */
.feature {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.feature-body { flex: 1; }
.feature-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.feature h2 { font-size: 1.25rem; letter-spacing: 1px; margin-bottom: 8px; color: var(--text); }
.feature p { font-size: 0.9rem; color: var(--text-soft); line-height: 1.75; }
.feature-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: #fff6ec;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.18s ease;
}
.feature-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  header { padding: 48px 16px 44px; }
  .feature {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }
  .feature-btn { justify-content: center; }
}

/* ===== 顶部导航栏 ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 245, 235, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topnav-logo {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1.5px;
}
.topnav-logo span { color: var(--primary); }
.topnav-links { display: flex; gap: 22px; }
.topnav-links a {
  font-family: var(--font-serif);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 17px 2px 15px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.topnav-links a:hover,
.topnav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }

@media (max-width: 560px) {
  .topnav-inner { height: 48px; padding: 0 14px; }
  .topnav-logo { font-size: 1rem; }
  .topnav-links { gap: 16px; }
  .topnav-links a { font-size: 0.9rem; padding: 14px 2px 12px; }
}
/* 窄屏（≤420px）：导航 6 个入口时压缩字号与间距，避免换行竖排 */
@media (max-width: 420px) {
  .topnav-logo { font-size: 0.92rem; }
  .topnav-links { gap: 9px; }
  .topnav-links a { font-size: 0.8rem; padding: 14px 0 12px; }
}

/* ===== 新闻滚动栏 ===== */
.ticker {
  display: flex;
  align-items: stretch;
  height: 44px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.ticker-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff6ec;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 2;
}
.ticker-viewport { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding-left: 24px;
  will-change: transform;
  animation: ticker-scroll 55s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 56px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
  user-select: none;
}
.ticker-item-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.ticker-item-title { transition: color 0.15s ease; }
.ticker-item:hover .ticker-item-title { color: var(--primary-dark); }
.ticker-item-date {
  font-size: 0.76rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.ticker-item.is-loading { cursor: default; color: var(--text-soft); margin-right: 0; }

@media (max-width: 560px) {
  .ticker { height: 40px; }
  .ticker-label { padding: 0 10px; font-size: 0.76rem; }
  .ticker-item { font-size: 0.8rem; margin-right: 40px; gap: 6px; }
  .ticker-item-date { font-size: 0.7rem; }
}

/* ===== 新闻详情弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(34, 30, 25, 0.55);
}
.modal-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(34, 30, 25, 0.3);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  animation: modal-pop 0.22s ease;
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: var(--primary-soft); color: var(--primary); }
.modal-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 10px;
  border-radius: 2px;
  margin-bottom: 12px;
}
.modal-card h3 { font-size: 1.25rem; letter-spacing: 0.5px; margin-bottom: 6px; padding-right: 28px; }
.modal-meta {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.modal-body {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text);
}

/* ===== 讨论论坛 ===== */
.forum-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.forum-stats { font-size: 0.9rem; color: var(--text-soft); }
.forum-stats b { color: var(--primary); font-variant-numeric: tabular-nums; }
.forum-compose {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 32px;
}
.forum-compose h2 {
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.forum-row { display: flex; gap: 12px; margin-bottom: 12px; }
.forum-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fffdf8;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.forum-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(197, 58, 42, 0.12);
}
textarea.forum-input { width: 100%; resize: vertical; min-height: 110px; line-height: 1.6; }
.forum-compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.forum-hint { font-size: 0.78rem; color: var(--text-faint); }
.forum-btn {
  border: none;
  background: var(--primary);
  color: #fff6ec;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 26px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.forum-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.forum-btn:disabled { background: #9a9282; cursor: not-allowed; transform: none; }

.forum-list { display: flex; flex-direction: column; gap: 16px; }
.forum-post {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: box-shadow 0.18s ease;
}
.forum-post:hover { box-shadow: var(--shadow); }
.forum-post-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.forum-avatar {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff6ec;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  background: var(--primary);
  user-select: none;
}
.forum-post-main { flex: 1; min-width: 0; }
.forum-post-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-word;
}
.forum-post-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.forum-post-meta .replies-count { color: var(--primary-dark); font-weight: 600; }
.forum-toggle {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  background: var(--bg);
  border-radius: 2px;
  padding: 4px 12px;
  margin-top: 2px;
}
.forum-post.open .forum-toggle { background: var(--primary-soft); color: var(--primary-dark); }
.forum-post-preview {
  margin-top: 10px;
  padding-left: 54px;
  font-size: 0.9rem;
  color: var(--text-soft);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.forum-post.open .forum-post-preview { display: none; }

/* 帖子展开后的详情区 */
.forum-detail { display: none; margin-top: 14px; }
.forum-post.open .forum-detail { display: block; }
.forum-detail-content {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.forum-replies-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.forum-replies { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.forum-reply {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius);
}
.forum-reply-avatar {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff6ec;
  font-size: 0.78rem;
  font-weight: 600;
  background: #5c7a62;
  user-select: none;
}
.forum-reply-main { flex: 1; min-width: 0; }
.forum-reply-meta {
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.forum-reply-meta b { color: var(--text); font-weight: 600; }
.forum-reply-content {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.forum-no-reply { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 16px; }
.forum-reply-form { display: flex; flex-direction: column; gap: 10px; }
.forum-reply-form .forum-row { margin-bottom: 0; }
.forum-reply-form textarea.forum-input { min-height: 64px; }

.forum-empty {
  text-align: center;
  color: var(--text-soft);
  padding: 48px 20px;
  background: var(--card-bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* 论坛页顶部稍紧凑 */
.page-header { padding: 40px 20px 52px; }
.page-header p { max-width: 640px; margin: 0 auto; font-size: clamp(0.95rem, 2vw, 1.05rem); color: #b8b0a0; }

@media (max-width: 560px) {
  .forum-compose { padding: 18px 16px; }
  .forum-post { padding: 16px; }
  .forum-row { flex-direction: column; }
  .forum-post-preview { padding-left: 0; }
  .forum-compose-foot { flex-direction: column-reverse; align-items: stretch; }
  .forum-btn { width: 100%; }
  .forum-hint { text-align: center; }
}

/* ===== 弹窗内的原文链接 ===== */
.modal-link-row { margin-top: 18px; }
.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--primary);
  border-radius: 2px;
  padding: 7px 18px;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-link:hover { background: var(--primary); color: #fff6ec; }

/* ===== 新闻快讯归档页 ===== */
.news-history { display: flex; flex-direction: column; gap: 28px; }
.news-day {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
}
.news-day-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.news-day-head h2 { font-size: 1.2rem; letter-spacing: 0.5px; color: var(--text); }
.news-day-count {
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 12px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.news-day-notes {
  font-size: 0.84rem;
  color: #8a6d2f;
  background: var(--gold-soft);
  border: 1px solid #e0d2ae;
  border-radius: var(--radius);
  padding: 9px 14px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.news-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.news-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fffdf8;
  transition: box-shadow 0.15s ease;
}
.news-item:hover { box-shadow: var(--shadow); }
.news-cat {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff6ec;
  padding: 2px 10px;
  border-radius: 2px;
  margin-top: 2px;
  white-space: nowrap;
}
/* 分类色 · 沉稳色系 */
.news-cat-财经 { background: #b0543f; }
.news-cat-足球 { background: #6e7f4f; }
.news-cat-篮球 { background: #b98a3e; }
.news-cat-综合 { background: #7a6a54; }
.news-cat-A股 { background: #c53a2a; }
.news-cat-港股 { background: #c49a4a; }
.news-cat-美股 { background: #4a5a6a; }
.news-cat-政策 { background: #7d5a6e; }
.news-cat-公司 { background: #5c7a62; }
.news-cat-宏观 { background: #4e6e7e; }
.news-cat-基金 { background: #a56a72; }
.news-cat-行业 { background: #4f7d74; }
.news-cat-国际 { background: #6e675c; }
.news-cat-自选股提醒 { background: #b06a3b; }
.news-item-main { flex: 1; min-width: 0; }
.news-item-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
  line-height: 1.55;
  word-break: break-word;
}
a.news-item-title:hover { color: var(--primary); }
.news-item-summary {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 6px;
  word-break: break-word;
}
.news-item-source { font-size: 0.76rem; color: var(--text-faint); }

/* 今日推送：三时段卡片 */
.today-push { margin-bottom: 34px; }
.today-push-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.today-push-head h2 { font-size: 1.3rem; letter-spacing: 1px; color: var(--text); margin: 0; }
.today-push-sub { font-size: 0.84rem; color: var(--text-soft); }
.slot-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.slot-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}
.slot-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-strong);
}
.slot-badge { font-weight: 700; font-size: 0.98rem; color: var(--primary-dark); }
.slot-time { font-size: 0.78rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.slot-now {
  font-size: 0.68rem; color: #fff6ec; background: var(--primary);
  padding: 2px 8px; border-radius: 2px; margin-left: 8px;
}
.slot-empty { color: var(--text-faint); font-size: 0.86rem; padding: 10px 2px; }
.slot-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.slot-list .news-item { box-shadow: none; }
.item-time { font-size: 0.72rem; color: var(--text-faint); margin-left: 4px; }

/* 归档：单日内的时段分组 */
.news-slot-group { margin-top: 16px; }
.news-slot-group:first-of-type { margin-top: 6px; }
.news-slot-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 6px 14px;
  border-radius: 2px;
  margin-bottom: 12px;
}

@media (max-width: 760px) {
  .slot-cards { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .news-day { padding: 16px; }
  .news-item { flex-direction: column; gap: 6px; padding: 12px; }
  .news-cat { align-self: flex-start; }
}

/* ===== 首页核心板块导航卡（一行四列并排）===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.feature-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}
.feature-card .feature-badge {
  margin-bottom: 0;
  font-size: 0.64rem;
  padding: 2px 8px;
}
.feature-card h2 { font-size: 0.94rem; letter-spacing: 0.5px; margin: 6px 0 4px; }
.feature-card p {
  font-size: 0.72rem;
  color: var(--text-soft);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 徽标双色：朱红系 / 鎏金系 */
.feature-badge, .badge-blue, .badge-orange { color: var(--primary); background: var(--primary-soft); }
.badge-teal, .badge-green { color: #8a6d2f; background: var(--gold-soft); }
.feature-go { font-weight: 600; color: var(--primary); font-size: 0.74rem; }
@media (max-width: 639px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .feature-grid { grid-template-columns: 1fr; } }

/* ===== 论坛分区标签与配色 ===== */
.forum-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff6ec;
  padding: 2px 10px;
  border-radius: 2px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.forum-cat-学习心得 { background: #4a5a6a; }
.forum-cat-复盘分享 { background: #5c7a62; }
.forum-cat-避坑经验 { background: #c49a4a; }
.forum-cat-提问求助 { background: #7d5a6e; }
.forum-cat-站务公告 { background: #6e675c; }
#forumFilters { margin-bottom: 18px; }

/* ===== 复盘与工具页 ===== */
.tool-section { margin-bottom: 40px; }
.tool-section h2 { font-size: 1.25rem; letter-spacing: 1px; margin-bottom: 6px; }
.tool-desc {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 16px;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}
.tool-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tool-field label { font-size: 0.8rem; color: var(--text-soft); }
.tool-clear {
  border: 1px solid var(--border-strong);
  background: #fffdf8;
  color: var(--text-soft);
  border-radius: 2px;
  padding: 6px 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tool-clear:hover { color: var(--up); border-color: #e0b3ab; }

.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.review-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.review-date { font-size: 0.8rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.review-symbol { font-family: var(--font-serif); font-size: 1rem; color: var(--text); }
.review-action {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 10px;
  border-radius: 2px;
}
.rv-result {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.rv-result.win { color: var(--up); background: var(--up-soft); }   /* 盈利为红（中式配色） */
.rv-result.loss { color: var(--down); background: var(--down-soft); }  /* 亏损为绿 */
.rv-result.flat { color: #6e675c; background: #efe9db; }
.review-del {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px 6px;
}
.review-del:hover { color: var(--up); }
.review-line { font-size: 0.9rem; line-height: 1.8; color: var(--text); word-break: break-word; }
.review-line b { color: var(--text-soft); font-weight: 600; }
.review-line.lesson { color: #8a6d2f; background: #fdf8ea; border-radius: var(--radius); padding: 8px 12px; margin-top: 6px; }

/* 定投演算结果 */
.dc-result { margin-top: 18px; animation: modal-pop 0.25s ease; }
.dc-nums { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.dc-num {
  flex: 1;
  min-width: 140px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dc-num span { font-size: 0.8rem; color: var(--text-soft); }
.dc-num b { font-size: 1.3rem; font-variant-numeric: tabular-nums; color: var(--text); }
.dc-num.dc-hl { background: var(--primary-soft); }
.dc-num.dc-hl b { color: var(--primary-dark); }
.dc-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.dc-bar-row { display: flex; align-items: center; gap: 12px; font-size: 0.82rem; color: var(--text-soft); }
.dc-bar-row > span { width: 36px; flex-shrink: 0; text-align: right; }
.dc-bar {
  flex: 1;
  height: 14px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.dc-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #8a8272;
  transition: width 0.6s ease;
}
.dc-bar i.gain { background: var(--up); }

@media (max-width: 640px) {
  .tool-card { padding: 16px; }
  .tool-card .forum-row { flex-direction: column; }
  .review-head { align-items: flex-start; }
  .review-del { margin-left: 0; }
  .dc-num b { font-size: 1.1rem; }
}

/* ===== 轻音乐播放器弹窗 ===== */
.music-modal-card { max-width: 520px; }
.music-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.music-loading {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
  padding: 24px 0;
}
.music-row {
  display: grid;
  grid-template-columns: 34px 28px 1fr auto;
  grid-template-areas: "btn idx info time" "bar bar bar bar";
  align-items: center;
  column-gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.music-row:hover { border-color: var(--primary); background: #f7f1e4; }
.music-row.playing {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.music-toggle {
  grid-area: btn;
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff6ec;
  font-size: 0.68rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}
.music-toggle:hover { background: var(--primary-dark); transform: scale(1.06); }
.music-index {
  grid-area: idx;
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.music-row.playing .music-index { color: var(--primary-dark); font-weight: 600; }
.music-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.music-title { font-size: 0.94rem; font-weight: 600; color: var(--text); }
.music-row.playing .music-title { color: var(--primary-dark); }
.music-desc {
  font-size: 0.76rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-time {
  grid-area: time;
  font-size: 0.74rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.music-bar {
  grid-area: bar;
  height: 3px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.music-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.25s linear;
}
@media (max-width: 560px) {
  .music-modal-card { padding: 20px 16px; }
  .music-row { padding: 8px 10px; column-gap: 8px; }
  .music-desc { display: none; }
}

/* ===== 打卡分享页 ===== */
.file-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 22px 14px;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  word-break: break-all;
}
.file-label:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f7f1e4;
}
.file-preview { margin-bottom: 12px; }
.file-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.checkin-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.checkin-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.checkin-card:hover { box-shadow: var(--shadow); }
/* 打卡图片展示盒：固定 aspect-ratio 预留空间防错位，背景用宣纸色填充四周 */
.checkin-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;          /* 与源图统一宽度，避免 100% 升采样发糊 */
  margin: 0 auto;            /* 卡片内居中，两边留宣纸色 */
  background: #efe9db;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.checkin-media {
  display: block;
  width: auto;               /* 自然尺寸展示，不放大 */
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
}
video.checkin-media {
  width: 100%;
  max-width: 560px;
  max-height: 420px;
  background: var(--ink);
}
.checkin-body { padding: 14px 18px 16px; }
.checkin-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
  word-break: break-word;
  line-height: 1.55;
}
.checkin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.checkin-meta b { color: var(--primary-dark); }
/* 移动端：占满卡片宽度（≤ ~342px），高度按各自比例自适应 */
@media (max-width: 720px) {
  .checkin-media-wrap { max-width: 100%; }
  video.checkin-media { max-height: 360px; }
}

/* 表情按钮与提交按钮同行（论坛发帖/回复、打卡评论共用 .ci-emoji-btn） */
.forum-compose-actions, .forum-reply-actions {
  display: flex; align-items: center; gap: 8px;
}
.forum-reply-actions { justify-content: flex-start; margin-top: 2px; }

/* ===== 打卡 · 评论与回复 ===== */
.ci-comments {
  border-top: 1px solid var(--border);
  padding: 10px 18px 16px;
  background: #fdfaf3;
}
.ci-comment-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 4px 0;
  font-family: inherit; font-size: 0.82rem; color: var(--primary-dark);
  cursor: pointer;
}
.ci-comment-toggle:hover { color: var(--primary); }
.ci-comment-toggle b { font-weight: 700; }
.ci-comment-toggle .ci-arrow { color: var(--text-faint); font-size: 0.74rem; }
.ci-comment-body { margin-top: 8px; }
.ci-comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ci-no-comment { font-size: 0.8rem; color: var(--text-faint); margin: 2px 0 4px; }

.ci-avatar {
  flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 0.78rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.ci-comment { display: flex; gap: 8px; }
.ci-comment-main { flex: 1; min-width: 0; }
.ci-comment-meta, .ci-reply-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  font-size: 0.76rem; color: var(--text-faint);
}
.ci-comment-meta b, .ci-reply-meta b { color: var(--text); font-weight: 600; font-size: 0.82rem; }
.ci-comment-content, .ci-reply-content {
  margin-top: 2px;
  font-size: 0.86rem; line-height: 1.6; color: var(--text);
  word-break: break-word; white-space: pre-wrap;   /* 保留换行，表情正常显示 */
}
.ci-reply-to { color: var(--primary-dark); }
.ci-reply-list {
  margin: 8px 0 4px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.ci-reply { display: flex; gap: 8px; }

.ci-reply-btn {
  margin-top: 4px;
  background: none; border: none; padding: 2px 0;
  font-family: inherit; font-size: 0.76rem; color: var(--text-faint);
  cursor: pointer;
}
.ci-reply-btn:hover { color: var(--primary); }

.ci-reply-form[hidden] { display: none; }   /* 覆盖 .ci-reply-form{display:flex}，让 [hidden] 真正生效 */
.ci-comment-form, .ci-reply-form {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px;
}
.ci-reply-form { padding: 8px 0 2px; }
.ci-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit; font-size: 0.86rem; color: var(--text);
}
.ci-input:focus { outline: none; border-color: var(--primary); }
.ci-nickname { max-width: 240px; }
.ci-text { min-height: 62px; resize: vertical; line-height: 1.6; }
.ci-form-actions { display: flex; align-items: center; gap: 8px; }
.ci-emoji-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; font-size: 1rem; cursor: pointer; line-height: 1;
}
.ci-emoji-btn:hover { border-color: var(--primary); background: #fdf6ec; }
.ci-submit-btn, .ci-cancel-btn {
  padding: 6px 16px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 0.84rem; cursor: pointer;
}
.ci-submit-btn {
  background: var(--primary); border: 1px solid var(--primary); color: #fff;
}
.ci-submit-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.ci-submit-btn:disabled { opacity: 0.6; cursor: default; }
.ci-cancel-btn { background: #fff; border: 1px solid var(--border); color: var(--text-soft); }
.ci-cancel-btn:hover { border-color: var(--text-soft); color: var(--text); }
@media (max-width: 560px) {
  .ci-comments { padding: 10px 12px 14px; }
  .ci-nickname { max-width: 100%; }
}

/* ===== 打卡图片 · 点击放大 ===== */
.checkin-media-wrap { cursor: zoom-in; position: relative; }
.checkin-media-wrap:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ci-zoom-hint {
  position: absolute; right: 8px; bottom: 8px;
  padding: 3px 9px; border-radius: 2px;
  background: rgba(34, 30, 25, 0.72);
  color: #f3ede0; font-size: 0.72rem; letter-spacing: 1px;
  opacity: 0; transition: opacity 0.18s ease; pointer-events: none;
}
.checkin-media-wrap:hover .ci-zoom-hint,
.checkin-media-wrap:focus-visible .ci-zoom-hint { opacity: 1; }
@media (hover: none) { .ci-zoom-hint { opacity: 1; } }  /* 触屏常显，否则用户不知道能点 */

.ci-lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(24, 21, 17, 0.96);
  padding: 56px 16px 24px;
  animation: lbFade 0.18s ease;
}
.ci-lightbox[hidden] { display: none; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.ci-lb-figure {
  margin: 0; display: flex; flex-direction: column;
  align-items: center; gap: 12px; max-width: 100%;
}
.ci-lb-img {
  display: block; max-width: 92vw; max-height: 78vh;
  width: auto; height: auto; border-radius: 2px;
  background: #efe9db; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
}
.ci-lightbox.is-actual .ci-lb-img { cursor: zoom-out; max-width: none; max-height: none; }
.ci-lightbox.is-actual { overflow: auto; align-items: flex-start; }
.ci-lightbox.is-loading .ci-lb-img { min-width: 160px; min-height: 100px; }
.ci-lb-cap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  max-width: 92vw; text-align: center;
}
.ci-lb-title {
  font-family: var(--font-serif); font-size: 0.92rem;
  color: #f3ede0; line-height: 1.5;
}
.ci-lb-meta { font-size: 0.75rem; color: #a89e8c; font-variant-numeric: tabular-nums; }

.ci-lb-close, .ci-lb-nav {
  position: absolute; z-index: 2;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f3ede0; border-radius: 2px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ci-lb-close:hover, .ci-lb-nav:hover { background: var(--primary); border-color: var(--primary); }
.ci-lb-close { top: 14px; right: 16px; width: 38px; height: 38px; font-size: 1.5rem; line-height: 1; }
.ci-lb-nav { top: 50%; transform: translateY(-50%); width: 42px; height: 60px; font-size: 1.9rem; line-height: 1; }
.ci-lb-prev { left: 14px; }
.ci-lb-next { right: 14px; }
.ci-lb-close[hidden], .ci-lb-nav[hidden] { display: none; }
@media (max-width: 720px) {
  .ci-lightbox { padding: 52px 8px 18px; }
  .ci-lb-figure { align-items: flex-start; max-width: 100%; overflow: auto; }
  .ci-lb-img { max-width: none; max-height: 72vh; width: auto; }
  .ci-lb-nav { width: 34px; height: 52px; font-size: 1.5rem; }
  .ci-lb-prev { left: 6px; }
  .ci-lb-next { right: 6px; }
  .ci-lb-title { font-size: 0.85rem; }
}
body.ci-lb-open { overflow: hidden; }

/* ===== 首页 · 今日行情模块 ===== */
.market { margin-bottom: 36px; }
.market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.market-head h2 { font-size: 1.3rem; letter-spacing: 2px; }
.market-actions { display: flex; align-items: center; gap: 10px; }
.market-updated { font-size: 0.78rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.market-refresh {
  border: 1px solid var(--border-strong);
  background: var(--card-bg);
  color: var(--text-soft);
  border-radius: 2px;
  padding: 5px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.market-refresh:hover { border-color: var(--primary); color: var(--primary); }
.market-refresh:disabled { opacity: 0.5; cursor: wait; }
.market-demo {
  font-size: 0.84rem;
  color: #8a6d2f;
  background: var(--gold-soft);
  border: 1px solid #e0d2ae;
  border-radius: var(--radius);
  padding: 9px 14px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.market-demo b { font-weight: 700; }

/* 指数卡片 */
.index-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.mkt-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mkt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mkt-name { font-size: 0.88rem; color: var(--text); font-weight: 600; }
.mkt-name span { font-size: 0.7rem; color: var(--text-faint); font-weight: 400; margin-left: 2px; }
.mkt-price { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.mkt-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 2px;
  align-self: flex-start;
  font-variant-numeric: tabular-nums;
}
.mkt-mini {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
/* 红涨绿跌 */
.mkt-card.up .mkt-price, .st-num.up, .st-pct.up { color: var(--up); }
.mkt-card.up .mkt-pill { color: var(--up); background: var(--up-soft); }
.mkt-card.down .mkt-price, .st-num.down, .st-pct.down { color: var(--down); }
.mkt-card.down .mkt-pill { color: var(--down); background: var(--down-soft); }
.mkt-card.flat .mkt-price, .st-num.flat { color: var(--text); }
.mkt-card.flat .mkt-pill { color: #6e675c; background: #efe9db; }

/* 个股表格 */
.stock-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.stock-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.stock-table thead th {
  font-size: 0.76rem;
  color: var(--text-soft);
  font-weight: 600;
  text-align: right;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #f3ede0;
}
.stock-table thead th:first-child { text-align: left; }
.stock-table td {
  font-size: 0.9rem;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stock-table tbody tr:last-child td { border-bottom: none; }
.stock-table tbody tr { transition: background 0.12s ease; }
.stock-table tbody tr:hover { background: #f7f1e4; }
.stock-table td.st-name { text-align: left; color: var(--text); font-weight: 600; }
.st-code { font-size: 0.7rem; color: var(--text-faint); font-weight: 400; margin-left: 3px; }
.st-pct {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.st-pct.up { background: var(--up-soft); }
.st-pct.down { background: var(--down-soft); }
.market-note {
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 10px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .index-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .index-grid { gap: 10px; }
  .mkt-card { padding: 12px; }
  .mkt-price { font-size: 1.2rem; }
  .mkt-mini { flex-wrap: wrap; gap: 2px 8px; }
  .st-opt { display: none; }
  .stock-table { min-width: 420px; }
  .market-head h2 { font-size: 1.15rem; }
}

/* ===== 我的自选 ===== */
.watch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 12px;
}
.watch-head h3 { font-size: 1.08rem; letter-spacing: 1px; }
.watch-add { display: flex; gap: 8px; flex-wrap: wrap; }
.watch-input {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 13px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: #fffdf8;
  width: 210px;
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.watch-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(197, 58, 42, 0.12);
}
.watch-add-btn {
  border: none;
  background: var(--primary);
  color: #fff6ec;
  border-radius: var(--radius);
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.watch-add-btn:hover { background: var(--primary-dark); }
.watch-empty {
  font-size: 0.85rem;
  color: var(--text-soft);
  text-align: center;
  padding: 22px 16px;
  background: var(--card-bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  line-height: 1.8;
}
/* 收藏星标 */
.st-star-col { width: 52px; }
.st-star-cell { text-align: center !important; }
.st-star {
  border: none;
  background: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--border-strong);
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.12s ease, transform 0.12s ease;
}
.st-star:hover { color: var(--gold); transform: scale(1.2); }
.st-star.on { color: var(--gold); }
.st-watch-del {
  border: 1px solid var(--border-strong);
  background: #fffdf8;
  color: var(--text-soft);
  border-radius: 2px;
  padding: 3px 12px;
  font-size: 0.74rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.st-watch-del:hover { color: var(--up); border-color: #e0b3ab; }
@media (max-width: 560px) {
  .watch-add { width: 100%; }
  .watch-input { flex: 1; width: auto; }
}

/* =========================================================
 *  首页 · 右上角实时时钟
 * ========================================================= */
.clock {
  position: fixed;
  top: 110px;
  right: 20px;
  z-index: 9999;
  pointer-events: none;
  user-select: none;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 116px;
  padding: 10px 16px;

  background: rgba(250, 245, 235, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(207, 196, 168, 0.55);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(34, 30, 25, 0.1);
  color: var(--text);
  line-height: 1.6;
}
.clock-time {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.clock-date {
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-soft);
}
@media (max-width: 768px) {
  .clock { top: 104px; right: 14px; min-width: 100px; padding: 8px 13px; }
  .clock-time { font-size: 1.25rem; }
  .clock-date { font-size: 0.72rem; }
}
@media (max-width: 560px) {
  .clock {
    top: 96px; right: 12px;
    flex-direction: row;
    align-items: baseline;
    gap: 8px; min-width: 0; padding: 6px 11px;
  }
  .clock-time { font-size: 1rem; }
  .clock-date { font-size: 0.68rem; }
}

/* =========================================================
 *  首页 · 访客计数徽章（鎏金描边 · 透明底）
 * ========================================================= */
.visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  margin: 22px auto 0;
  padding: 9px 22px;
  border-radius: 2px;
  border: 1px solid rgba(196, 154, 74, 0.65);
  background: rgba(34, 30, 25, 0.35);
  color: #e8dfc9;
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: none;
}
.visitor-badge b {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  color: #f3ead3;
}
.visitor-badge .visitor-total { opacity: 0.9; font-size: 0.82rem; color: var(--gold); }
.visitor-badge[hidden] { display: none; }
@media (max-width: 560px) {
  .visitor-badge { gap: 10px; padding: 8px 16px; font-size: 0.85rem; }
  .visitor-badge b { font-size: 1.05rem; }
}

/* =========================================================
 *  子页面 · 右下角悬浮返回按钮（全站统一）
 * ========================================================= */
.back-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 22px;
  border: 1px solid rgba(197, 58, 42, 0.5);
  border-radius: 2px;
  background: rgba(250, 245, 235, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--primary-dark);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(34, 30, 25, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
              background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.back-fab .back-fab-arrow {
  font-size: 1.05em;
  line-height: 1;
  transition: transform 0.18s ease;
}
.back-fab:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff6ec;
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(197, 58, 42, 0.3);
}
.back-fab:hover .back-fab-arrow { transform: translateX(-3px); }
.back-fab:active {
  transform: translateY(-1px) scale(0.96);
  box-shadow: 0 4px 12px rgba(197, 58, 42, 0.24);
}
.back-fab:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(197, 58, 42, 0.3);
}
/* 移动端：贴边距收紧、尺寸略小，仍不遮挡主内容 */
@media (max-width: 560px) {
  .back-fab {
    right: 14px;
    bottom: 14px;
    padding: 11px 17px;
    font-size: 0.88rem;
    background: rgba(250, 245, 235, 0.95);
  }
}

/* =========================================================
 *  账号与积分（顶栏用户区 / 弹窗 / 积分面板）
 *  沿用宣纸底 · 墨色字 · 朱红点缀 · 鎏金辅助
 * ========================================================= */

/* ---- 顶栏用户区 ---- */
.auth-slot { display: flex; align-items: center; margin-left: 8px; flex: none; }

.auth-entry {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.auth-entry:hover { background: var(--primary); color: #fff; }
.auth-entry:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(197, 58, 42, 0.25); }

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.auth-user:hover { background: var(--gold-soft); border-color: var(--border-strong); }
.auth-user:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(197, 58, 42, 0.22); }

.auth-avatar {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
.auth-user-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.auth-name { font-family: var(--font-serif); font-size: 0.85rem; color: var(--text); }
.auth-lv { font-size: 0.68rem; color: var(--gold); letter-spacing: 0.5px; }
.auth-pts {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 500;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}
.auth-pts i { font-style: normal; font-size: 0.68rem; color: var(--text-faint); margin-left: 1px; }

/* ---- 弹窗 ---- */
.auth-mask {
  position: fixed; inset: 0;
  z-index: 3000;
  background: rgba(34, 30, 25, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: authFade 0.16s ease;
}
.auth-mask[hidden] { display: none; }
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }

.auth-dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(34, 30, 25, 0.28);
  padding: 26px 24px 22px;
  animation: authPop 0.18s ease;
}
@keyframes authPop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.auth-close {
  position: absolute;
  top: 10px; right: 12px;
  background: none; border: none;
  font-size: 1.5rem; line-height: 1;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px 6px;
}
.auth-close:hover { color: var(--primary); }
.auth-close:focus-visible { outline: none; color: var(--primary); }

.auth-dialog-title {
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 1px;
}

/* tab 切换 */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.auth-tabs button {
  flex: 1;
  background: none; border: none;
  padding: 9px 0;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.auth-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-tabs button:hover { color: var(--primary); }

/* 表单 */
.auth-field { display: block; margin-bottom: 13px; }
.auth-field span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-soft);
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.auth-field input {
  width: 100%;
  padding: 9px 11px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.18s ease;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.auth-field input.is-locked,
input.is-locked {
  background: var(--gold-soft);
  color: var(--text-soft);
  cursor: not-allowed;
}

.auth-msg { min-height: 18px; font-size: 0.78rem; color: var(--primary); margin-bottom: 6px; }
.auth-msg.err { color: var(--primary); }

.auth-submit {
  width: 100%;
  padding: 10px 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 2px;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s ease;
}
.auth-submit:hover:not(:disabled) { background: var(--primary-dark); }
.auth-submit:disabled { opacity: 0.6; cursor: default; }
.auth-submit:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(197, 58, 42, 0.3); }

/* 权益说明 */
.auth-perk {
  margin-top: 18px;
  padding: 13px 14px;
  background: var(--gold-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-perk-title { font-size: 0.78rem; color: var(--text-soft); margin-bottom: 8px; letter-spacing: 0.5px; }
.auth-perk-list { display: flex; gap: 14px; font-size: 0.85rem; color: var(--text); }
.auth-perk-list b { color: var(--primary); font-size: 0.95rem; }
.auth-perk-note { margin-top: 8px; font-size: 0.72rem; color: var(--text-faint); }

/* ---- 已登录积分面板 ---- */
.auth-panel-head { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.auth-panel-avatar {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
.auth-panel-name { font-family: var(--font-serif); font-size: 1rem; }
.auth-badge {
  display: inline-block;
  font-size: 0.68rem;
  color: #fff;
  background: var(--gold);
  border-radius: 2px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: 2px;
}
.auth-panel-pts { font-size: 0.78rem; color: var(--text-soft); margin-top: 2px; }
.auth-progress {
  margin-top: 7px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.auth-progress i { display: block; height: 100%; background: var(--gold); transition: width 0.3s ease; }

.auth-panel-sec {
  font-size: 0.74rem;
  color: var(--text-faint);
  letter-spacing: 1px;
  margin: 16px 0 9px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.auth-quota {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  padding: 5px 0;
}
.auth-quota-label { width: 74px; flex: none; color: var(--text); }
.auth-quota-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  min-width: 40px;
}
.auth-quota-bar i { display: block; height: 100%; background: var(--primary); transition: width 0.3s ease; }
.auth-quota-num { font-size: 0.74rem; color: var(--text-soft); width: 34px; text-align: right; flex: none; }
.auth-quota-pts { font-size: 0.74rem; color: var(--primary); width: 30px; text-align: right; flex: none; }
.auth-quota.full .auth-quota-bar i { background: var(--text-faint); }
.auth-quota.full .auth-quota-pts { color: var(--text-faint); }

.auth-stats { display: flex; gap: 18px; font-size: 0.82rem; color: var(--text-soft); margin-top: 4px; }
.auth-stats b { color: var(--text); font-size: 0.95rem; }

.auth-logout {
  width: 100%;
  margin-top: 20px;
  padding: 9px 0;
  font-size: 0.86rem;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.auth-logout:hover { color: var(--primary); border-color: var(--primary); }
.auth-logout:focus-visible { outline: none; border-color: var(--primary); }

/* ---- 面板底部按钮组（修改口令 + 退出登录）---- */
.auth-panel-actions { display: flex; flex-direction: column; gap: 10px; }
.auth-changepass {
  width: 100%;
  margin-top: 20px;
  padding: 9px 0;
  font-size: 0.86rem;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.auth-changepass:hover { background: var(--primary); color: #fff; }
.auth-changepass:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(0,0,0,0.08); }

/* ---- 轻提示 ---- */
.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translate(-50%, 12px);
  z-index: 4000;
  background: var(--ink);
  color: #faf5eb;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(34, 30, 25, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: 86vw;
  text-align: center;
}
.auth-toast.show { opacity: 1; transform: translate(-50%, 0); }

body.auth-modal-open { overflow: hidden; }

/* ---- 移动端 ---- */
@media (max-width: 720px) {
  .auth-user-text { display: none; }           /* 窄屏只留头像与积分 */
  .auth-user { padding: 4px 8px 4px 4px; }
  .auth-pts { border-left: none; padding-left: 0; font-size: 0.78rem; }
  .auth-entry { font-size: 0.78rem; padding: 4px 9px; }
}
@media (max-width: 420px) {
  .topnav-links { gap: 11px; }
  .auth-dialog { padding: 22px 18px 18px; }
}

/* =========================================================
 *  积分榜（论坛页）
 * ========================================================= */
.points-board {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 12px;
  margin-bottom: 22px;
}
.points-board[hidden] { display: none; }

.pb-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.pb-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 1px;
}
.pb-title::before {
  content: "";
  display: inline-block;
  width: 3px; height: 13px;
  background: var(--primary);
  margin-right: 8px;
  vertical-align: -1px;
}
.pb-sub { font-size: 0.74rem; color: var(--text-faint); }

.pb-list { list-style: none; }

.pb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px dashed var(--border);
  font-size: 0.85rem;
}
.pb-item:last-child { border-bottom: none; }

.pb-no {
  width: 20px;
  flex: none;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-faint);
}
.pb-avatar {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
}
.pb-name {
  font-family: var(--font-serif);
  color: var(--text);
  min-width: 62px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pb-level {
  font-size: 0.68rem;
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  background: var(--gold-soft);
  border-radius: 2px;
  padding: 0 6px;
  flex: none;
}
.pb-meta { font-size: 0.72rem; color: var(--text-faint); margin-left: auto; }
.pb-pts {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--primary);
  min-width: 42px;
  text-align: right;
  flex: none;
}

/* 前三名：鎏金渐深 */
.pb-rank-1 .pb-no { color: var(--gold); font-size: 1rem; }
.pb-rank-1 .pb-avatar { background: var(--gold); color: var(--ink); }
.pb-rank-1 .pb-pts { font-size: 1.05rem; }
.pb-rank-2 .pb-avatar { background: #9a8f7a; color: #fff8e8; }
.pb-rank-2 .pb-no { color: #7d7361; }
.pb-rank-3 .pb-avatar { background: #b08a63; color: #fff8e8; }
.pb-rank-3 .pb-no { color: #96795a; }

@media (max-width: 560px) {
  .pb-item { gap: 7px; padding: 7px 2px; font-size: 0.8rem; }
  .pb-meta { display: none; }           /* 窄屏藏掉细分统计 */
  .pb-name { min-width: 48px; }
  .pb-sub { font-size: 0.7rem; }
}

/* ---- 点赞按钮（论坛帖 meta 与打卡卡片 meta 通用）---- */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  padding: 1px 10px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.like-btn:hover { color: var(--primary); border-color: var(--primary); }
.like-btn:active { transform: scale(0.94); }
.like-btn:focus-visible { outline: none; border-color: var(--primary); }
.like-btn.liked {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.like-btn:disabled { opacity: 0.55; cursor: wait; }
