/* ============================================================
   内容平台前端 — 主样式表
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=LXGW+WenKai:wght@400;700&family=Noto+Sans+SC:wght@400;500;700;900&family=Noto+Serif+SC:wght@400;600;700;900&display=swap');

@font-face {
  font-family: 'Ma Shan Zheng Masthead';
  src: url('../fonts/MaShanZheng-Masthead-Democracy.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-navy: #16213D;
  --brand-navy-deep: #101830;
  --brand-navy-light: #24365E;

  --bg: #F4F5F7;
  --card-bg: #FFFFFF;
  --text: #1A1D26;
  --text-secondary: #5B6472;
  --text-tertiary: #8891A0;
  --border: #E6E8EC;
  --border-soft: #EFF1F4;

  --accent: var(--brand-navy);

  --font-base: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container-max: 1360px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --header-h: 115px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; overflow-x: clip; font-family: var(--font-base); background: var(--bg); color: var(--text); line-height: 1.72; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

/* ---------------- Header ---------------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title { font-weight: 800; font-size: 16.5px; color: var(--brand-navy); white-space: nowrap; }
.brand-subtitle { font-size: 11px; color: var(--text-tertiary); font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.header-spacer { flex: 1; }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a { padding: 9px 13px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; border-bottom: 2px solid transparent; transition: background .15s, color .15s; }
.main-nav a:hover { background: var(--bg); }
.main-nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 17px; height: 17px; }
.lang-toggle { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--brand-navy); min-width: 44px; }
.auth-entry-link { display: inline-flex; align-items: center; border: 1px solid var(--brand-navy); background: var(--brand-navy); color: #fff; border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.auth-entry-link:hover { background: var(--brand-navy-light); }
.auth-entry-icon { display: none; align-items: center; justify-content: center; }
.auth-entry-icon svg { width: 19px; height: 19px; }
.auth-entry-link.is-authenticated { background: #176b3a; border-color: #176b3a; position: relative; }
.auth-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #59e391; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.article-favorite { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.favorite-button { border: 1px solid #a61b1b; background: #fff; color: #a61b1b; border-radius: 999px; padding: 9px 18px; font-weight: 800; cursor: pointer; }
.favorite-button[aria-pressed="true"] { background: #a61b1b; color: #fff; }
.favorite-status { margin: 0; color: #176b3a; font-size: 14px; }
.my-page { max-width: 980px; margin: 0 auto; }
.my-account-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--border-soft); padding: 20px; margin-bottom: 24px; }
.my-account-card h1 { margin: 0 0 6px; }
.my-account-card p { margin: 0; color: var(--text-muted); }
.logout-button { border: 1px solid var(--brand-navy); background: transparent; color: var(--brand-navy); padding: 9px 16px; font-weight: 800; cursor: pointer; }
.my-section-title { border-bottom: 3px double var(--brand-navy); padding-bottom: 10px; }
.favorites-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.auth-entry-link-mobile { display: block; padding: 15px 4px; font-size: 16px; font-weight: 800; color: var(--brand-navy); border-top: 1px solid var(--border-soft); margin-top: 6px; }
.lang-toggle:hover { background: var(--bg); }
.menu-toggle { display: none; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; align-items: center; justify-content: center; }
.menu-toggle svg { width: 20px; height: 20px; }

.search-overlay { position: fixed; inset: 0; background: rgba(16,24,48,.55); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 90px 20px 20px; }
.search-overlay.is-open { display: flex; }
.search-box { width: 100%; max-width: 620px; background: #fff; border-radius: var(--radius-md); padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.search-box form { display: flex; gap: 8px; }
.search-box input[type="search"] { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; font-family: inherit; }
.search-box button[type="submit"] { background: var(--brand-navy); color: #fff; border: none; border-radius: var(--radius-sm); padding: 0 18px; font-weight: 700; font-size: 14px; }

/* 公告栏样式已随功能一起移除(暂不使用)。如需恢复,可参考 git 历史里的
   .announcement / .announcement-inner 规则,注意公告文字节点要单独给 class,
   不要用裸 <span> 跟装饰用的圆点混在一起找,容易选错节点。 */

/* ---------------- 通用状态组件 ---------------- */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 50px 20px; color: var(--text-tertiary); text-align: center; grid-column: 1/-1; }
.state svg { width: 30px; height: 30px; }
.state-loading .spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-error { color: #C23B3B; }
.btn-retry { margin-top: 4px; border: 1px solid var(--border); background: #fff; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text); }
.btn-retry:hover { background: var(--bg); }
.muted-note { color: var(--text-tertiary); font-size: 13.5px; padding: 12px 0; }

/* ---------------- 页面结构 ---------------- */
.page-body { padding: 24px 0 60px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 16px; }
.section-heading h2 { font-size: 19px; margin: 0; min-width: 0; font-weight: 800; }

/* ---------------- Hero Banner ---------------- */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 8px; }
.hero-main { position: relative; min-width: 0; border-radius: var(--radius-lg); overflow: hidden; display: block; aspect-ratio: 16/9; background: var(--accent); }
.hero-main-media { position: absolute; inset: 0; }
.hero-main-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-main-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; background: linear-gradient(0deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 55%, transparent 100%); color: #fff; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; color: #FFD9A0; }
.hero-eyebrow svg { width: 14px; height: 14px; }
.hero-main-title { font-size: clamp(20px, 2.6vw, 30px); font-weight: 800; margin: 0 0 8px; line-height: 1.3; }
.hero-main-summary { font-size: 14px; opacity: .85; margin: 0; max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hero-side-item { display: flex; gap: 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; flex: 1; }
.hero-side-thumb { width: 76px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg); }
.hero-side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-side-title { font-size: 13.5px; font-weight: 700; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- 内容卡片网格(推荐/最新) ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.content-card { display: flex; flex-direction: column; min-width: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.content-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,48,.08); }
.content-card-thumb { aspect-ratio: 16/10; background: var(--bg); }
.content-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 12%, white); color: var(--accent); }
.thumb-placeholder svg { width: 30%; height: 30%; max-width: 48px; max-height: 48px; }
.thumb-placeholder.large svg { max-width: 72px; max-height: 72px; }
.content-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.content-card-title { font-size: 15px; font-weight: 700; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.content-card:hover .content-card-title { color: var(--accent); }
.content-card-summary { font-size: 13px; color: var(--text-secondary); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.content-card-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ---------------- 分类板块(首页) ---------------- */
.category-block { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 20px; min-width: 0; }
.category-block-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; background: var(--accent); color: #fff; }
.category-block-title { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15.5px; min-width: 0; }
.category-block-title svg { width: 18px; height: 18px; }
.category-block-more { font-size: 13px; font-weight: 600; opacity: .9; }
.category-block-more:hover { opacity: 1; text-decoration: underline; }
.category-block-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 16px 20px; }
.category-block-list .content-card { flex-direction: row; }
.category-block-list .content-card-thumb { width: 108px; aspect-ratio: unset; flex-shrink: 0; }
@media (max-width: 900px) { .category-block-list { grid-template-columns: 1fr; } }
.categories-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .categories-grid { grid-template-columns: 1fr; } }

/* ---------------- 分类/搜索列表页 ---------------- */
.page-title-bar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: var(--radius-md); background: var(--accent); color: #fff; margin-bottom: 20px; }

/* ---------------- 登录/注册预留页面(功能未开放时的占位提示) ---------------- */
.account-placeholder { max-width: 480px; margin: 60px auto; text-align: center; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 32px; }
.account-placeholder h1 { font-size: 22px; font-weight: 800; color: var(--brand-navy); margin: 0 0 12px; }
.account-placeholder p { color: var(--text-secondary); font-size: 14.5px; margin: 0 0 24px; }
.account-placeholder a.btn-back { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 9px 22px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.account-placeholder a.btn-back:hover { background: var(--bg); }

/* 普通用户登录与邮箱验证 */
.auth-page { padding: 42px 0 72px; }
.auth-card { width: min(100%, 520px); margin: 0 auto; padding: 34px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 36px rgba(22,33,61,.08); }
.auth-card h1 { margin: 0; color: var(--brand-navy); font-size: 28px; line-height: 1.3; }
.auth-intro,.auth-panel-note { color: var(--text-secondary); line-height: 1.7; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 24px 0; padding: 5px; background: var(--bg); border-radius: 10px; }
.auth-tabs button { border: 0; border-radius: 7px; padding: 11px; background: transparent; color: var(--text-secondary); font-size: 16px; font-weight: 700; cursor: pointer; }
.auth-tabs button.is-active { background: var(--card-bg); color: var(--brand-navy); box-shadow: 0 2px 8px rgba(22,33,61,.09); }
.auth-form { display: grid; gap: 17px; }
.auth-form[hidden],.auth-tabs[hidden] { display: none; }
.auth-form label { display: grid; gap: 7px; color: var(--text); font-size: 15px; font-weight: 700; }
.auth-form input { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 12px 13px; background: #fff; color: var(--text); font: inherit; font-weight: 400; }
.auth-form input:focus { outline: 3px solid rgba(145,26,30,.12); border-color: #911a1e; }
.auth-primary { border: 0; border-radius: 8px; padding: 13px 18px; background: var(--brand-navy); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer; }
.auth-primary:disabled { opacity: .55; cursor: wait; }
.auth-link { justify-self: center; border: 0; padding: 4px; background: none; color: #7d181c; font-size: 14px; font-weight: 700; cursor: pointer; }
.auth-message { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: #eef7ef; color: #205c2a; line-height: 1.55; }
.auth-message.is-error { background: #fff0f0; color: #9b1c1c; }

@media (max-width: 600px) {
  .auth-page { padding: 22px 0 48px; }
  .auth-card { padding: 24px 18px; border-radius: 12px; }
  .auth-card h1 { font-size: 24px; }
  .auth-form { gap: 15px; }
  .auth-form input,.auth-primary { min-height: 48px; font-size: 16px; }
}
.page-title-bar h1 { font-size: 19px; margin: 0; min-width: 0; display: flex; align-items: center; gap: 10px; }
.page-title-bar svg { width: 20px; height: 20px; }
.breadcrumb { font-size: 13px; color: var(--text-tertiary); margin-bottom: 14px; }
.breadcrumb a:hover { text-decoration: underline; color: var(--brand-navy); }
.list-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 18px; }
.load-more-row { text-align: center; margin-top: 26px; }
.btn-load-more { border: 1px solid var(--border); background: #fff; padding: 10px 26px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.btn-load-more:hover { background: var(--bg); }

/* ---------------- 详情页 ---------------- */
.article-layout { max-width: 820px; margin: 0 auto; }
.article-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; color: #fff; background: var(--accent); margin-bottom: 14px; }
.article-tag svg { width: 14px; height: 14px; }
.article-title { font-size: clamp(22px, 4vw, 32px); font-weight: 800; line-height: 1.35; margin: 0 0 14px; color: var(--brand-navy); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: var(--text-tertiary); margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-meta svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.article-cover { width: 100%; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 24px; aspect-ratio: 16/9; background: var(--bg); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { font-size: 16.5px; color: var(--text); line-height: 1.9; }
.article-body p { margin: 0 0 18px; }

.article-share { margin: 6px 0 18px; padding: 10px 12px; border: 1px solid #cbbda5; border-top: 3px double #5b4632; background: rgba(255,255,255,.42); }
.article-share-title { margin: 0 0 12px; font-size: 14px; font-weight: 800; color: var(--brand-navy); }
.article-share-buttons { display: grid; grid-template-columns: repeat(5, 42px); justify-content: center; gap: 10px; }
.share-button { width: 42px; height: 42px; min-width: 42px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid #b9aa92; border-radius: 9px; background: #fffdf8; color: #241e18; font: inherit; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.share-button:hover { background: #f3eadb; border-color: #7c684e; transform: translateY(-1px); }
.share-button:focus-visible { outline: 3px solid rgba(140,30,27,.24); outline-offset: 2px; }
.share-brand { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #151515; color: #fff; font-family: Arial, sans-serif; font-size: 15px; font-weight: 800; }
.share-facebook .share-brand { background: #1877f2; font-size: 20px; }
.share-tiktok .share-brand { text-shadow: -1px 0 #25f4ee, 1px 0 #fe2c55; }
.share-instagram .share-brand { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); }
.comment-jump .share-brand { background: #8c1e1b; }
.comment-jump .share-brand svg { width: 15px; height: 15px; }
.share-status { display: none; margin: 10px 0 0; font-size: 12.5px; color: #6e5841; }
.share-status.is-visible { display: block; }

@media (max-width: 640px) {
  .article-share { margin: 0 0 12px; padding: 8px; }
  .article-share-buttons { grid-template-columns: repeat(5, 40px); gap: 8px; }
  .share-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
}

/* YouTube 播放器: 用 padding-bottom 撑出 16:9 比例的响应式容器,
   PC/平板/手机下宽度都是 100% 撑满文章列宽,iframe 用绝对定位铺满容器,
   不需要针对断点单独写样式,天然响应式。 */
.video-embed { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-md); margin: 24px 0; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------- 评论区 ---------------- */
.comments-section { margin-top: 32px; padding-top: 22px; border-top: 2px solid var(--border); scroll-margin-top: 190px; }
.comments-heading { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; margin: 0 0 6px; color: var(--brand-navy); }
.comments-count { font-weight: 600; color: var(--text-tertiary); font-size: 14px; }
.comments-hint { font-size: 13px; color: var(--text-tertiary); margin: 0 0 18px; }
.comment-form { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 26px; }
.comment-form textarea { width: 100%; min-height: 88px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; font-family: inherit; font-size: 14.5px; resize: vertical; }
.comment-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.comment-form-note { font-size: 12px; color: var(--text-tertiary); }
.btn-primary { background: var(--brand-navy); color: #fff; border: none; border-radius: var(--radius-sm); padding: 10px 22px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.btn-primary:hover { background: var(--brand-navy-light); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.comment-status-msg { font-size: 13px; margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm); display: none; }
.comment-status-msg.is-visible { display: block; }
.comment-status-msg.ok { background: #E7F5EC; color: #1E7A4C; }
.comment-status-msg.warn { background: #FDEDED; color: #C23B3B; }
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item { display: flex; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); }
.comment-item:last-child { border-bottom: none; padding-bottom: 0; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-navy); color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.comment-body-col { min-width: 0; flex: 1; }
.comment-author-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.comment-author { font-weight: 700; color: var(--text); }
.comment-time { color: var(--text-tertiary); }
.comment-text { font-size: 14.5px; color: var(--text); margin: 0; word-break: break-word; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--brand-navy-deep); color: #fff; margin-top: 40px; }
.footer-inner { padding: 36px 24px 20px; }
.footer-tagline { font-size: 15px; font-weight: 700; color: #C7CEDE; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 24px; text-align: center; font-size: 12px; color: #7C87A3; }

/* ---------------- 响应式导航 ---------------- */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .mobile-nav { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: #fff; z-index: 90; overflow-y: auto; padding: 8px 20px 40px; }
  .mobile-nav.is-open { display: block; }
  .mobile-nav a { display: flex; align-items: center; gap: 10px; padding: 15px 4px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--border-soft); color: var(--text); }
  .mobile-nav .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; overflow-x: auto; }
  .hero-side-item { min-width: 220px; }
}
@media (min-width: 981px) { .mobile-nav { display: none !important; } }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { gap: 10px; }
  .brand-subtitle { display: none; }
  .card-grid, .list-page-grid { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
  .content-card-title { font-size: 13.5px; }
  .content-card-summary { -webkit-line-clamp: 2; font-size: 12px; }
  .category-block-header { padding: 13px 16px; }
  .category-block-list { padding: 14px 16px; grid-template-columns: 1fr; }
  .category-block-list .content-card-thumb { width: 84px; }
  .article-meta { gap: 10px 14px; }
  .comment-form-footer { flex-direction: column; align-items: stretch; }
  .comment-form-footer .btn-primary { width: 100%; }
  .hero-side { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   全球华裔民主联盟 — 报纸风格、手机优先的视频新闻版面
   ============================================================ */
:root {
  --brand-navy: #251d16;
  --brand-navy-deep: #17120e;
  --brand-navy-light: #4f3a27;
  --bg: #eee5d2;
  --card-bg: #fffaf0;
  --text: #201b16;
  --text-secondary: #62584c;
  --text-tertiary: #897c6c;
  --border: #cbbda4;
  --border-soft: #ded2bd;
  --accent: #7d1717;
  --font-base: 'Noto Serif SC', 'Songti SC', SimSun, serif;
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(63,45,27,.04) .7px, transparent .7px),
    linear-gradient(90deg, rgba(255,255,255,.18), transparent 45%, rgba(91,65,36,.025));
  background-size: 7px 7px, 100% 100%;
}

.site-header { background: rgba(246,238,221,.97); border-bottom: 3px double #2b2118; backdrop-filter: blur(8px); }
.header-inner { min-height: var(--header-h); height: auto; gap: 0; padding-top: 7px; flex-direction: column; align-items: stretch; }
.brand { min-width: 0; width: 100%; justify-content: center; gap: 0; overflow: hidden; }
.brand-calligraphy {
  display: block;
  color: #201913;
  font-family: 'Ma Shan Zheng Masthead', 'KaiTi', 'Noto Serif SC', serif;
  font-size: clamp(46px, 5vw, 64px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.035em;
  white-space: nowrap;
  transform: none;
  text-shadow: none;
}
.brand-title-en {
  display: block;
  width: 100%;
  color: #201913;
  font: 800 clamp(32px, 4.2vw, 55px)/1.08 'Inter', Arial, sans-serif;
  letter-spacing: .035em;
  text-align: center;
  white-space: nowrap;
}
.main-nav { display: none; }
.header-secondary { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 10px; }
.brand-slogan { display: block; flex: 1; min-width: 0; color: #e00000; font: 700 19.2px/1.6 'Noto Serif SC', 'Songti SC', SimSun, serif; letter-spacing: .045em; white-space: nowrap; }
.masthead-en .brand-slogan { font: 500 14px/1.35 'Inter', Arial, sans-serif; letter-spacing: .045em; white-space: normal; }
.header-actions { font-family: 'Inter', sans-serif; }
.icon-btn, .lang-toggle, .menu-toggle { background: #fbf5e9; border-color: #b7a78e; }

.category-ribbon { background: #211a14; color: #f7eedc; border-bottom: 1px solid #0f0c09; }
.category-ribbon-shell { position: relative; }
.category-ribbon-inner { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 0 46px; scrollbar-width: none; cursor: grab; scroll-behavior: smooth; }
.category-ribbon-inner.is-dragging { cursor: grabbing; user-select: none; scroll-behavior: auto; }
.category-ribbon-inner::-webkit-scrollbar { display: none; }
.category-scroll-button { display: none; position: absolute; top: 50%; z-index: 2; width: 36px; height: 36px; transform: translateY(-50%); align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; background: rgba(33,26,20,.96); color: #fff4cf; font: 700 28px/1 Arial,sans-serif; box-shadow: 0 2px 10px rgba(0,0,0,.28); }
.category-scroll-button.is-visible { display: flex; }
.category-scroll-button:hover:not(:disabled) { background: #4b3727; }
.category-scroll-button:disabled { opacity: .3; cursor: default; }
.category-scroll-prev { left: 24px; }
.category-scroll-next { right: 24px; }
.category-ribbon a { flex: 0 0 auto; padding: 12px 16px 11px; font-size: 17px; font-weight: 700; letter-spacing: .035em; white-space: nowrap; border-bottom: 3px solid transparent; }
.category-ribbon a:hover, .category-ribbon a.is-active { color: #fff4cf; background: rgba(255,255,255,.07); border-bottom-color: #a9342f; }

.page-body { padding-top: 26px; }
.section-heading { border-top: 3px double #30251b; border-bottom: 1px solid #8f7b61; padding: 12px 0 10px; margin: 38px 0 20px; }
.section-heading h2 { font-size: 21px; letter-spacing: .08em; }
.section-heading h2::before { content: '■'; color: #8c1e1b; font-size: .6em; margin-right: 8px; vertical-align: .15em; }

.hero { gap: 20px; margin-bottom: 14px; }
.hero-main, .hero-side-item, .content-card, .category-block { box-shadow: 0 2px 0 rgba(70,48,27,.12); }
.hero-main-media img, .content-card-thumb img, .hero-side-thumb img { filter: saturate(.88) contrast(1.04); }
.hero-side-thumb { position: relative; }
.content-card-thumb { position: relative; aspect-ratio: 16/9; }
.play-badge, .hero-play-badge, .mini-play-badge { position: absolute; display: grid; place-items: center; border-radius: 50%; background: rgba(139,24,20,.92); box-shadow: 0 2px 12px rgba(0,0,0,.32); }
.play-badge { width: 44px; height: 44px; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.hero-play-badge { width: 66px; height: 66px; left: 50%; top: 45%; transform: translate(-50%,-50%); }
.mini-play-badge { width: 26px; height: 26px; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.play-badge span, .hero-play-badge span, .mini-play-badge span { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid #fff; margin-left: 3px; }
.hero-play-badge span { border-top-width: 9px; border-bottom-width: 9px; border-left-width: 15px; }
.mini-play-badge span { border-top-width: 4px; border-bottom-width: 4px; border-left-width: 7px; }
.video-label { position: absolute; right: 7px; bottom: 7px; padding: 2px 6px; background: rgba(24,18,13,.86); color: #fff; font: 700 10px/1.4 'Inter', sans-serif; letter-spacing: .04em; }
.card-grid, .list-page-grid { gap: 24px; }
.content-card-body { padding: 18px 18px 20px; gap: 10px; }
.content-card-title { font-size: 16px; line-height: 1.62; }
.content-card-summary { line-height: 1.72; }
.content-card-meta { margin-top: 7px; padding-top: 10px; gap: 14px; line-height: 1.55; border-top: 1px dotted #b9aa92; }
.category-block { margin-bottom: 28px; }
.category-block-header { padding: 18px 22px; background: #2b2118; border-bottom: 3px solid var(--accent); }
.category-block-title { letter-spacing: .035em; }
.category-block-list { gap: 20px; padding: 20px 22px 22px; }
.page-title-bar { padding: 20px 22px; margin-bottom: 26px; }
.page-title-bar h1 { line-height: 1.55; letter-spacing: .035em; }
.breadcrumb { margin-bottom: 19px; line-height: 1.7; }
.article-title { line-height: 1.52; margin-bottom: 18px; }
.article-meta { gap: 16px 20px; margin-bottom: 28px; padding-bottom: 24px; line-height: 1.65; }
.article-body { line-height: 2; }
.article-body p { margin-bottom: 24px; }
.comments-section { margin-top: 52px; padding-top: 36px; }
.comment-text { line-height: 1.8; }
.site-footer { border-top: 4px double #c7b99f; }

@media (max-width: 980px) {
  .category-ribbon { position: sticky; top: var(--header-h); z-index: 80; }
  .category-ribbon-shell { padding-left: 0; padding-right: 0; }
  .category-ribbon-inner { padding-left: 12px; padding-right: 12px; cursor: auto; }
  .category-scroll-button { display: none !important; }
  .header-spacer { min-width: 0; }
  .brand-calligraphy { font-size: clamp(46px, 8vw, 58px); }
}

@media (max-width: 640px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .header-inner { gap: 0; padding-top: 7px; }
  .brand { flex: none; }
  .brand-calligraphy { font-size: clamp(39px, 11vw, 47px); letter-spacing: -.045em; }
  .brand-title-en { font-size: clamp(25px, 7vw, 34px); line-height: 1.08; white-space: normal; }
  .header-secondary { min-height: 62px; gap: 5px; }
  .brand-slogan { font-size: 16.8px; line-height: 1.6; letter-spacing: .02em; }
  .masthead-en .brand-slogan { font-size: 11px; line-height: 1.3; letter-spacing: .02em; }
  .header-actions { gap: 4px; }
  .icon-btn, .menu-toggle { width: 32px; height: 32px; }
  .lang-toggle { min-width: 36px; padding: 5px 7px; }
  .category-ribbon-inner { padding-left: 8px; padding-right: 8px; }
  .category-ribbon a { padding: 12px 13px 11px; font-size: 16px; }
  .page-body { padding-top: 18px; }
  .hero-main { aspect-ratio: 16/9; }
  .hero-main-overlay { padding: 16px; }
  .hero-main-summary { display: none; }
  .hero-side { display: none; }
  .card-grid, .list-page-grid { grid-template-columns: 1fr; gap: 24px; }
  .content-card { border-left: 0; border-right: 0; }
  .content-card-body { padding: 16px 14px 18px; gap: 10px; }
  .content-card-title { font-size: 17px; line-height: 1.62; -webkit-line-clamp: 3; }
  .content-card-summary { font-size: 13px; line-height: 1.75; }
  .categories-grid { display: block; }
  .category-block-list .content-card { flex-direction: column; }
  .category-block-list .content-card-thumb { width: 100%; aspect-ratio: 16/9; }
  .section-heading { margin: 32px 0 19px; padding: 11px 0 9px; }
  .section-heading h2 { font-size: 19px; }
  .category-block { margin-bottom: 26px; }
  .category-block-header { padding: 17px 16px; }
  .category-block-list { padding: 18px 14px 20px; gap: 22px; }
  .page-title-bar { padding: 18px 16px; margin-bottom: 24px; }
  .article-title { line-height: 1.55; margin-bottom: 19px; }
  .article-meta { gap: 13px 18px; margin-bottom: 25px; padding-bottom: 22px; }
  .article-body { font-size: 17px; line-height: 2; }
  .article-body p { margin-bottom: 25px; }
  .comments-section { margin-top: 18px; padding-top: 16px; }
}

@media (max-width: 390px) {
  .brand-calligraphy { max-width: 100%; font-size: 9.5vw; letter-spacing: -.035em; }
  .brand-title-en { font-size: 6.8vw; letter-spacing: .02em; }
  .header-secondary { min-width: 0; justify-content: space-between; }
  .brand-slogan { flex: 1 1 auto; font-size: 14px; letter-spacing: 0; }
  .masthead-en .brand-slogan { font-size: 9.5px; line-height: 1.25; letter-spacing: 0; }
  .header-actions { min-width: 0; flex: none; justify-content: flex-end; }
  .lang-toggle { display: inline-flex; }
}

/* 手机与平板已有横向分类导航，去掉重复的三横线菜单，给登录和语言按钮留出空间。 */
@media (max-width: 980px) {
  /* 报头与分类栏必须由同一个顶层容器负责粘住；分别 sticky 会被父容器边界截断。 */
  #site-header { position: sticky; top: 0; z-index: 100; }
  .site-header { position: relative; top: auto; }
  .category-ribbon { position: relative; top: auto; z-index: auto; }
  .menu-toggle { display: none; }
  .auth-entry-link { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; }
  .auth-entry-text { display: none; }
  .auth-entry-icon { display: inline-flex; }
  .auth-entry-link.is-authenticated { width: 34px; height: 34px; padding: 0; gap: 0; border-radius: 8px; }
  .auth-entry-link.is-authenticated .auth-entry-text { display: none; }
  .auth-entry-link.is-authenticated .auth-status-dot { display: none; }
  .favorites-grid { grid-template-columns: 1fr; }
  .my-account-card { align-items: flex-start; flex-direction: column; }
}
