
/* ===== 叠玩 · 资讯/攻略/教程 文章模块样式（PC + 移动共用） =====
   由 show_article.css 派生：去掉移动端页头(.detail-header)与侧边菜单(.side-menu)，
   那两块接站后由 templates/*/content/header_m.html + m_style.css / pc_style.css 提供。
   移动端样式为基准，PC 端差异集中在文件末尾的 @media (min-width: 769px)。 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --brand-50: #e6faf6; --brand-100: #b2f2e6; --brand-500: #00bfa5; --brand-600: #00a68f; --brand-700: #008c79;
  --white: #fff;
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-300: #d1d5db; --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563; --gray-700: #374151; --gray-800: #1f2937; --gray-900: #111827;
  --red-50: #fef2f2; --red-500: #ef4444; --red-600: #dc2626;
  --orange-50: #fff7ed; --orange-400: #fb923c; --orange-500: #f97316;
  --yellow-50: #fefce8; --yellow-500: #eab308;
  --green-50: #f0fdf4; --green-500: #22c55e;
  --blue-50: #eff6ff; --blue-500: #3b82f6;
  --purple-50: #faf5ff; --purple-500: #a855f7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05); --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06); --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06); --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius-sm: 6px; --radius: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-2xl: 20px; --radius-full: 9999px;
  --font: "PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --actbar-h: 58px;
  --header-h: 56px;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-700); background: var(--gray-50); line-height: 1.6; -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--actbar-h) + var(--safe-bottom)); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; font-family: inherit; background: none; }
input { font-family: inherit; outline: none; border: none; }

/* ===== Page Wrapper ===== */
.page { max-width: 750px; margin: 0 auto; background: var(--gray-50); min-height: 100vh; position: relative; }

/* ===== Article ===== */
.article-detail { background: var(--white); }
.article-cover { width: 100%; height: 200px; object-fit: cover; background: var(--gray-200); }
.article-head { padding: 16px 14px 14px; border-bottom: 1px solid var(--gray-100); }
.article-h1 { font-size: 1.2rem; font-weight: 800; color: var(--gray-900); line-height: 1.5; }
.article-byline { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 0.7rem; color: var(--gray-400); }
.ab-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--gray-200); flex-shrink: 0; }
.ab-name { color: var(--gray-600); font-weight: 600; }
.ab-sep { width: 1px; height: 10px; background: var(--gray-300); }
.ab-views { margin-left: auto; display: flex; align-items: center; gap: 4px; }

/* ===== Article Content ===== */
.article-content { padding: 8px 14px 20px; }
.article-content p { font-size: 0.88rem; color: var(--gray-700); line-height: 1.95; margin-bottom: 14px; }
.article-content h2 { font-size: 1.05rem; font-weight: 700; color: var(--gray-800); margin: 24px 0 12px; }
.article-content figure { margin: 4px 0 16px; }
.article-content figure img { width: 100%; border-radius: var(--radius-lg); background: var(--gray-200); }
.article-content figcaption { font-size: 0.68rem; color: var(--gray-400); text-align: center; margin-top: 6px; }
.article-content blockquote { border-left: 3px solid var(--brand-500); background: var(--brand-50); padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.82rem; color: var(--gray-600); margin-bottom: 14px; line-height: 1.7; }
.article-content blockquote::before { content: '💡 '; }
.article-content ul.tips { background: var(--gray-50); border-radius: var(--radius-lg); padding: 14px 14px 14px 34px; margin-bottom: 14px; }
.article-content ul.tips li { font-size: 0.82rem; color: var(--gray-700); line-height: 2; list-style: disc; }
.article-content ul.tips li strong { color: var(--gray-800); font-weight: 700; }
.article-content .ref-link { color: var(--brand-600); font-weight: 600; }

/* ===== Article Actions (Inline) ===== */
.art-actions { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 14px; border-top: 1px solid var(--gray-100); border-bottom: 8px solid var(--gray-50); }
.aa-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gray-500); font-size: 0.65rem; padding: 6px 18px; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); min-width: 72px; }
.aa-btn svg { width: 20px; height: 20px; }
.aa-btn.active.liked { color: var(--red-500); border-color: var(--red-50); background: var(--red-50); }
.aa-btn.active.faved { color: var(--brand-600); border-color: var(--brand-50); background: var(--brand-50); }

/* ===== Section ===== */
.section { background: var(--white); margin-top: 8px; padding: 14px 12px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 6px; }
.section-title::before { content: ''; width: 4px; height: 18px; background: var(--brand-500); border-radius: 2px; flex-shrink: 0; }
/* 小标题绿条去重：pc_style.css 的 .section-title 自带 border-left，与本文件的 ::before 叠成「双条」；此处抵消，只保留 18px 短条（与「用户评论」一致） */
.section .section-title { border-left: 0; padding-left: 0; }
.section-more { font-size: 0.72rem; color: var(--gray-400); }
.section-more::after { content: ' ›'; }

/* ===== Author Card ===== */
.author-card { display: flex; gap: 14px; align-items: flex-start; }
.ac-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--gray-200); }
.ac-info { flex: 1; min-width: 0; }
.ac-name { font-size: 0.92rem; font-weight: 700; color: var(--gray-800); }
.ac-desc { font-size: 0.72rem; color: var(--gray-400); margin-top: 4px; line-height: 1.5; }
.ac-stats { display: flex; gap: 16px; margin-top: 8px; }
.ac-stat { font-size: 0.68rem; color: var(--gray-400); }
.ac-stat b { font-size: 0.82rem; color: var(--gray-800); font-weight: 700; }
.ac-follow { background: var(--brand-500); color: #fff; border-radius: var(--radius-full); padding: 6px 16px; font-size: 0.74rem; font-weight: 600; flex-shrink: 0; align-self: center; }
.ac-follow:active { background: var(--brand-600); }
.ac-follow.followed { background: var(--gray-100); color: var(--gray-500); }

/* ===== Related Articles ===== */
.article-list { display: flex; flex-direction: column; }
.article-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.article-item:last-child { border-bottom: none; }
.article-item:active { opacity: 0.8; }
.art-thumb { width: 108px; height: 74px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; background: var(--gray-200); }
.art-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.art-badge { display: inline-flex; font-size: 0.56rem; padding: 1px 7px; border-radius: var(--radius-full); font-weight: 600; margin-bottom: 4px; align-self: flex-start; }
.art-badge.huodong { background: var(--purple-50); color: var(--purple-500); }
.art-badge.gonglue { background: var(--green-50); color: var(--green-500); }
.art-badge.ceping { background: var(--orange-50); color: var(--orange-500); }
.art-badge.tuijian { background: var(--blue-50); color: var(--blue-500); }
.art-badge.qianzhan { background: var(--blue-50); color: var(--blue-500); }
.art-badge.jiaoxue { background: var(--brand-50); color: var(--brand-600); }
.art-badge.jiaocheng { background: var(--brand-50); color: var(--brand-600); }
.art-badge.zixun { background: var(--gray-100); color: var(--gray-600); }
.art-title { font-size: 0.84rem; font-weight: 600; color: var(--gray-800); line-height: 1.42; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-meta { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 0.64rem; color: var(--gray-400); }
.art-meta .art-views { margin-left: auto; }

/* ===== Rank Mini ===== */
.rank-mini { display: flex; flex-direction: column; gap: 0; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.rank-row:last-child { border-bottom: none; }
.rank-row:active { opacity: 0.8; }
.rank-num { width: 22px; height: 22px; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--gray-500); font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-num.top3 { background: var(--orange-500); color: #fff; }
.rank-title { flex: 1; font-size: 0.78rem; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-views { font-size: 0.64rem; color: var(--gray-400); flex-shrink: 0; }

/* ===== Hot Tags ===== */
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-tag { font-size: 0.74rem; color: var(--gray-600); background: var(--gray-50); border: 1px solid var(--gray-200); padding: 5px 12px; border-radius: var(--radius-full); }
.hot-tag:active { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }

/* ===== Action Bar (Sticky Bottom) ===== */
.act-bar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 750px; margin: 0 auto; background: var(--white); border-top: 1px solid var(--gray-200); display: flex; align-items: center; gap: 6px; padding: 8px 12px calc(8px + var(--safe-bottom)); z-index: 200; box-shadow: 0 -2px 12px rgba(0,0,0,0.06); }
.act-input { flex: 1; background: var(--gray-100); border-radius: var(--radius-full); height: 38px; display: flex; align-items: center; padding: 0 14px; color: var(--gray-400); font-size: 0.78rem; }
.act-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--gray-500); flex-shrink: 0; padding: 0 7px; position: relative; }
.act-btn svg { width: 20px; height: 20px; }
.act-btn small { font-size: 0.55rem; }
.act-btn.active.liked { color: var(--red-500); }
.act-btn.active.faved { color: var(--brand-600); }
.act-btn .ab-count { font-size: 0.55rem; }

/* ===== Footer ===== */
.app-footer { background: var(--gray-800); color: var(--gray-400); padding: 20px 16px; text-align: center; }
.app-footer p { font-size: 0.7rem; line-height: 1.8; }
.app-footer .footer-links { display: flex; justify-content: center; gap: 12px; margin-bottom: 6px; }
.app-footer .footer-links a { font-size: 0.7rem; color: var(--gray-400); }
.app-footer .footer-links a:active { color: var(--white); }

/* ===== Comments ===== */
.comment-section { background: var(--white); padding: 14px 12px 24px; }
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.comment-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 6px; }
.comment-title::before { content: ''; width: 4px; height: 18px; background: var(--brand-500); border-radius: 2px; }
.comment-count { font-size: 0.7rem; color: var(--gray-400); font-weight: 500; margin-left: 4px; }
.comment-sort { font-size: 0.72rem; color: var(--gray-400); }
.comment-sort .active { color: var(--brand-600); font-weight: 600; }
.comment-input-wrap { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--gray-50); border-radius: var(--radius-lg); margin-bottom: 14px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--gray-200); }
.comment-input { flex: 1; background: var(--white); border-radius: var(--radius-full); padding: 8px 14px; font-size: 0.78rem; color: var(--gray-700); border: 1px solid var(--gray-200); outline: none; }
.comment-input:focus { border-color: var(--brand-500); }
.comment-input::placeholder { color: var(--gray-400); }
.comment-submit { background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 8px 14px; border-radius: var(--radius-full); flex-shrink: 0; }
.comment-submit:active { opacity: 0.85; }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 10px; }
.comment-item .comment-avatar { width: 34px; height: 34px; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-name { font-size: 0.78rem; font-weight: 600; color: var(--gray-800); display: flex; align-items: center; gap: 6px; }
.cmt-name .cmt-tag { font-size: 0.55rem; padding: 1px 6px; border-radius: var(--radius-full); background: var(--brand-50); color: var(--brand-600); font-weight: 500; }
.cmt-time { font-size: 0.65rem; color: var(--gray-400); margin-top: 2px; }
.cmt-text { font-size: 0.82rem; color: var(--gray-700); line-height: 1.6; margin-top: 6px; word-wrap: break-word; }
.cmt-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.cmt-action { font-size: 0.65rem; color: var(--gray-400); display: flex; align-items: center; gap: 3px; }
.cmt-action:active { color: var(--brand-600); }
.cmt-action svg { width: 14px; height: 14px; }
.comment-more { text-align: center; padding: 12px; font-size: 0.78rem; color: var(--gray-500); background: var(--gray-50); border-radius: var(--radius-lg); margin-top: 14px; }
.comment-more:active { color: var(--brand-600); }

/* ===== Back to Top ===== */
.back-top {
  position: fixed;
  right: 14px;
  bottom: calc(var(--actbar-h) + var(--safe-bottom) + 14px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  z-index: 150;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s;
  border: none;
}
.back-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12)); }

/* ===== Toast ===== */
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(31,41,55,0.95); color: #fff; padding: 10px 20px; border-radius: var(--radius-lg); font-size: 0.78rem; z-index: 300; animation: toastIn 0.25s ease, toastOut 0.25s ease 2s forwards; pointer-events: none; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, -10px); } }

/* ===== Share Sheet ===== */
.share-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.share-mask.show { opacity: 1; pointer-events: auto; }
.share-sheet { position: fixed; bottom: 0; left: 0; right: 0; max-width: 750px; margin: 0 auto; background: var(--white); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; padding: 20px 16px calc(20px + var(--safe-bottom)); z-index: 301; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94); }
.share-sheet.show { transform: translateY(0); }
.share-title { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); text-align: center; margin-bottom: 18px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.share-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.share-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.share-icon svg { width: 24px; height: 24px; color: #fff; }
.share-icon.wx { background: #07c160; }
.share-icon.wb { background: #e6162d; }
.share-icon.qq { background: #1296db; }
.share-icon.link { background: var(--gray-500); }
.share-label { font-size: 0.65rem; color: var(--gray-500); }
.share-cancel { margin-top: 16px; text-align: center; padding: 12px; background: var(--gray-100); border-radius: var(--radius-lg); font-size: 0.85rem; color: var(--gray-600); font-weight: 500; }

/* ===== 列表页补充（原 show_article.css 只有详情页组件） ===== */
.art-desc { margin-top: 4px; font-size: 0.76rem; color: var(--gray-400); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty-tip { padding: 46px 16px; text-align: center; color: var(--gray-400); font-size: 0.86rem; }


/* ============================================================
   PC 端适配（>= 769px）
   移动端样式在上面是基准，这里只覆盖宽度相关与"移动专属"元素
   ============================================================ */
@media (min-width: 769px) {
  body { padding-bottom: 0; }

  .article-detail { border-radius: var(--radius-lg); overflow: hidden; }
  .article-cover { height: 300px; }
  .article-head { padding: 26px 32px 18px; }
  .article-h1 { font-size: 1.55rem; line-height: 1.45; }
  .article-byline { font-size: 0.8rem; margin-top: 16px; }
  .ab-avatar { width: 36px; height: 36px; }

  .article-content { padding: 24px 32px 36px; }
  .article-content p { font-size: 1rem; line-height: 2.05; margin-bottom: 18px; }
  .article-content h2 { font-size: 1.25rem; margin: 30px 0 14px; }
  .article-content blockquote { font-size: 0.98rem; }
  .article-content ul.tips li { font-size: 0.96rem; }

  .art-actions { justify-content: flex-start; gap: 14px; padding: 16px 32px 22px; border-bottom: none; }

  /* 移动端底部悬浮操作条 / 分享面板：PC 上不需要 */
  .act-bar { display: none; }

  /* ---- 列表区 / 内容区块：PC 上统一为白卡 ---- */
  .section,
  .comment-section {
    margin-top: 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow);
  }
  .section-header { margin-bottom: 14px; }
  .article-detail { box-shadow: var(--shadow); }

  /* 相关推荐 / 列表：两列独立小卡（移动端原为单列 + 下划线） */
  .article-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .article-item {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 12px;
    gap: 14px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }
  .article-item:last-child { border-bottom: 1px solid var(--gray-100); }
  .article-item:hover { box-shadow: var(--shadow-md); border-color: var(--brand-100); }
  .article-item:hover .art-title { color: var(--brand-600); }
  .art-title { font-size: 0.95rem; }
  .art-desc { font-size: 0.8rem; }
  .art-thumb { width: 132px; height: 88px; }

  .pagination { margin-top: 1.25rem; }

  .rank-row { font-size: 0.92rem; }
  .author-card { padding: 4px 0; }
  .ac-name { font-size: 1rem; }
  .hot-tags { gap: 10px; }
  .hot-tag:hover { border-color: var(--brand-100); color: var(--brand-600); }
  .comment-input-wrap { padding: 0 0 14px; }

  /* 长文正文图片不溢出 */
  .article-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
}
