/* 话题广场三分层主入口（S1 · D110）
   独立文件：square.css 被 square/user/library 三页共用，改它会连带影响另两页；
   本文件只由 square.html 以 ?v=2026111501 引用，改动面最小、缓存版本独立。 */

.sq-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

/* 字体口径（2026-11-16 对齐轮）：原型全页 `font-family:"Microsoft YaHei","PingFang SC"`；
   本站 news.css 的 body 是 -apple-system 栈 → Windows 上中文回落到更窄的系统字形，
   同为 12.5px 也比原型看着小（字号逐项实测与原型一致，差在字形）。
   只作用于本页主体（本文件仅 square.html 引用），不动全站与详情页。 */
.sq-container { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }

/* 2026-11-16 对齐轮逐字对齐原型 .tb-tab（含 22:4x/22:5x 覆盖段）：
   固定卡宽（min-width 150）+ 可换行；名字与小字**同排一行**（baseline 对齐），
   小字 11px/400/淡灰蓝 nowrap；选中态＝绿字加粗 + 底 3px 绿条。 */
.sq-section-tab {
    flex: 0 1 auto;
    min-width: 150px;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 7px;
    padding: 10px 16px;
    border: 1px solid #dfe6ed;
    border-bottom: 3px solid #dfe6ed;
    border-radius: 9px 9px 0 0;
    background: #fff;
    color: #3c4a58;
    font-size: 14px;
    text-decoration: none;
    /* 原型 .tb-tab 未设 line-height（normal ≈1.6）⇒ 卡高 46px；1.35 时只有 43px */
    line-height: 1.6;
    transition: border-color .15s, color .15s;
}

.sq-section-tab:hover { border-color: #9cc6ae; }
.sq-section-tab:focus-visible { outline: 2px solid #188038; outline-offset: 2px; }

.sq-section-tab.on {
    border-color: #cfe7d8;
    border-bottom-color: #188038;
    color: #188038;
    font-weight: bold;
}

.sq-section-name { font-size: inherit; }
/* 小字 11px：原型 .tb-tab small 有两处定义，22:4x 覆盖段最终是 11px（非 11.5） */
.sq-section-tab small { font-size: 11px; line-height: 1.4; color: #8a9bb5; font-weight: normal; white-space: nowrap; }
.sq-section-tab.on small { color: #5a8a6d; }

.sq-circle-bar {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #fafcff;
}

.sq-circle-bar-head {
    font-size: 14px;
    font-weight: 600;
    color: #243447;
    margin-bottom: 8px;
}

.sq-circle-bar-head span {
    font-size: 12px;
    font-weight: 400;
    color: #6b7a8d;
    margin-left: 6px;
}

.sq-circle-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.sq-circle-chip {
    border: 1px solid #d6e2f0;
    border-radius: 999px;
    background: #fff;
    color: #35618f;
    font-size: 13px;
    padding: 5px 12px;
    cursor: pointer;
}

.sq-circle-chip:hover { border-color: #188038; }
.sq-circle-chip:focus-visible { outline: 2px solid #188038; outline-offset: 2px; }
.sq-circle-chip.on { background: #188038; border-color: #188038; color: #fff; }

.sq-circle-hint { font-size: 12px; color: #6b7a8d; }

@media (max-width: 720px) {
    .sq-section-nav { gap: 6px; }
    .sq-section-tab { padding: 10px 10px; min-width: 0; flex: 1 1 44%; }
    /* 原型 22:5x：末张卡在 ≤720 只占半行，否则 flex-grow 会把整行吃满 */
    .sq-section-tab:last-child { flex: 0 0 calc(50% - 4px); }
    .sq-circle-bar-head span { display: block; margin: 2px 0 0; }
    .sq-annc-d { display: none; }
}

/* ============ 公告条 + 最新话题（2026-11-16 A 档 · 原型 .tb-notice 逐字） ============ */
.sq-notice {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 0 13px;
    overflow: hidden;
}
/* 公告段：无公告时 JS 整行隐藏，不占位不造假 */
.sq-annc {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 5px 0;
    font-size: 12.5px;
    color: #5b6b7a;
}
.sq-annc-tag {
    flex: 0 0 auto;
    font-size: 11px;
    color: #c0392b;
    background: #fdf3f2;
    border: 1px solid #f0c9c4;
    border-radius: 3px;
    padding: 0 5px;
    line-height: 16px;
}
.sq-annc-txt { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-annc-d { flex: 0 0 auto; font-size: 11px; color: #9aa7b2; }
/* 最新段：右侧，与公告之间细分隔线（原型 .tb-latest 口径，2026-11-16 对齐轮
   把「标签/标题/全部话题」收成一行——之前 section 块级堆叠出三行，走样） */
.sq-latest {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 60%;
    margin-left: auto;
    padding: 5px 0 5px 14px;
    border-left: 1px solid #eef2f6;
    font-size: 12.5px;
    color: #5b6b7a;
}
.sq-latest section { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sq-latest .sq-topshead { flex: 0 0 auto; margin: 0; justify-content: flex-start; }
/* 原型 .tb-latest .f5-shead：「最新」＝绿底小标签 */
.sq-latest .sq-tops-tag {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: bold;
    color: #188038;
    background: #f2f8f4;
    border: 1px solid #c7e3d1;
    border-radius: 3px;
    padding: 0 5px;
    line-height: 16px;
    white-space: nowrap;
}
/* 原型 22 系口径：年份分组表头在单行里与「最新」语义重复，隐藏（DOM 保留可回退） */
.sq-latest .sq-topsd { display: none; }
.sq-topshead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.sq-tops-tag { font-size: 13px; font-weight: bold; color: #1f2d3d; }
.sq-topsd { font-size: 11px; color: #9aa7b2; }
.sq-tops { list-style: none; margin: 0; padding: 0; }
.sq-latest ul.sq-tops { flex: 1 1 auto; min-width: 0; }
.sq-latest .sq-tops li { border: 0; line-height: 1.6; gap: 8px; min-width: 0; }
.sq-tops li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.8; }
.sq-tpt {
    flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; color: #3c4a58; text-decoration: none; cursor: pointer;
}
.sq-tpt:hover { color: #188038; }
.sq-tpd { flex: 0 0 auto; font-size: 11px; color: #9aa7b2; }
.sq-latest .sq-tmore { flex: 0 0 auto; margin: 0; font-size: 11.5px; white-space: nowrap; color: #1a66ff; }
.sq-tmore { display: inline-block; margin-left: 12px; font-size: 12px; color: #188038; cursor: pointer; white-space: nowrap; }
.sq-tmore:hover { text-decoration: underline; }
@media (max-width: 900px) {
    /* 原型：900 以下放不下一行 ⇒ 折回「公告 / 最新」两行，不硬挤 */
    .sq-notice { flex-wrap: wrap; padding: 0 12px; }
    .sq-annc { flex: 1 0 100%; }
    .sq-latest { flex: 1 0 100%; max-width: none; margin-left: 0; padding: 6px 0 8px; border-left: 0; border-top: 1px solid #eef2f6; }
    .sq-annc .sq-annc-d { display: none; }
}

/* ============================================================================
   广场分区外壳统一 + 字阶/间距对齐（D145 · 2026-11-16 15:5x 用户拍板）
   ----------------------------------------------------------------------------
   本段只解决两件事：① 广场与另三个分区「同一外壳」；② 字阶/间距「同一节奏」。
   🔴 本轮明确**不动卡片视觉重量**：圆角 12px 与投影保持原样，仅改字号/行高/
      内边距/块间距。要收圆角、去投影、加描边是下一步（B4 视觉重量），需另行拍板。
   🔴 覆盖写在本文件（只被 square.html 引用），不碰被 square/user/library 三页
      共用的 square.css。
   ========================================================================== */

/* ---------- 1. 单栏：右栏退役，四区同宽 ---------- */
/* sections.js 已恒隐藏 .sq-sidebar 并给 .sq-layout 加 no-side；这两条是兜底
   （JS 未执行 / 被别的逻辑改回来时，也不让 300px 空轨把内容列压窄 324px）。 */
.sq-container .sq-layout { display: block; }
.sq-container .sq-sidebar { display: none !important; }

/* ---------- 2. 列表控件行：h1 + 子 Tab + 搜索 + 全部话题 合成一行 44px ---------- */
/* 改前：子Tab 34 + 工具栏 38 + h1 28 三层堆叠 ⇒ 内容起始 y=314；
   改后：一行 44 ⇒ 起始 y≈238，与发现/圈子/互动（y=180）同一量级。 */
.sq-listbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0 0 14px;
}
.sq-listbar > .sq-tabs { margin: 0; flex: 0 0 auto; gap: 8px; }
/* 工具栏吃掉剩余宽度、内容右对齐：搜索框固定上限 300，避免把子 Tab 挤换行 */
.sq-listbar > .sq-toolbar { margin: 0; flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.sq-listbar .sq-search { flex: 0 1 300px; min-width: 200px; }  /* 兜底：不许缩成只剩放大镜 */
/* align-items:center 下按钮不再被 stretch 撑高，显式给 38 与搜索框齐平 */
.sq-listbar .sq-all-topics { height: 38px; padding: 0 16px; }

/* h1「话题广场」：SSR 带内联样式（list_seo_page.go:438 20px/14px 6px），
   只能 !important 覆盖。🔴 不隐藏、不改文案、不动 DOM 语义（D136）。 */
.sq-container .sq-listbar > h1,
.sq-container .sq-main > h1 {
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1.4 !important;
    color: #243447;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* 折两行阈值取 1199 而不是 1023：1024~1199 这一档 .sq-container 是 760px 平板宽
   （square.css:1665），一行放不下 h1+5 个子Tab+搜索+全部话题，硬挤会把搜索框
   压成只剩放大镜（1024 实测截图）。≥1200 才走单行。 */
@media (max-width: 1199px) {
    .sq-listbar { flex-wrap: wrap; row-gap: 10px; }
    .sq-listbar > .sq-toolbar { flex: 1 0 100%; justify-content: flex-start; }
    .sq-listbar .sq-search { flex: 1 1 auto; }
}

/* ---------- 3. 字阶与间距：对齐发现区（.sq-disc-thread）已在用的口径 ---------- */
/* 依据：probes/square_typography_probe.mjs 实测 + 原型 多tab版-主页面.html
   （原型里 15px 只用于数字/头像字/区块小标题，列表正文一律 13px；
     块间距主力 14px；卡片 padding 14px 16px）。 */
.sq-container .sq-card { padding: 14px 16px; }                       /* 16 → 14/16 */
.sq-container .sq-feed { gap: 14px; }                                /* 12 → 14 */
.sq-container .sq-card-head { gap: 8px; margin-bottom: 8px; }         /* 10/10 → 8/8 */
.sq-container .sq-card-title { font-size: 16px; font-weight: 700; color: #1f2d3d; }
.sq-container .sq-card-content { font-size: 13px; line-height: 1.8; color: #3c4a58; } /* 15/1.7 → 13/1.8 */
.sq-container .sq-card-name { font-size: 12.5px; font-weight: 500; color: #243447; }  /* 14/600 → 12.5/500 */
.sq-container .sq-card-time { font-size: 11.5px; color: #9aa7b2; }   /* 12 → 11.5 */
.sq-container .sq-card-actions { margin-top: 10px; padding-top: 8px; gap: 8px; }      /* 12/10/10 → 10/8/8 */
.sq-container .sq-action-btn { font-size: 11.5px; color: #8a97a3; }  /* 13 → 11.5 */

/* 标题链接 hover 由蓝改主色（D128 统一 50 处时漏掉的 `square.css:1172 #2f80ed`） */
.sq-container .sq-card-title-link:hover { color: #188038; }

/* ---------- 4. 卡片视觉重量（D146）：圆角 12→10 / 去投影 / 1px 描边 / 头像 38→32 ---------- */
/* 依据不是新标准：发现区 .sq-disc-thread 本来就用 radius 10 + 1px 描边 + 无投影
   （square-discover.css:148-154，仅底色不同）。广场是白卡，描边取中性色 #e3e8ee，
   与前三区「靠线分隔、不靠影子」的观感一致。 */
.sq-container .sq-card {
    border-radius: 10px;
    border: 1px solid #e3e8ee;
    box-shadow: none;
    background: #fff;
    transition: border-color 0.18s ease;
}
/* hover 只加深描边，不把投影加回来（否则又回到「重卡」） */
.sq-container .sq-card:hover { border-color: #cfdbe6; }

/* 头像 38 → 32：配合正文 13px，卡片头不再比正文重一档 */
.sq-container .sq-card-avatar-link,
.sq-container .sq-card-avatar {
    width: 32px;
    height: 32px;
}

/* 未登录引导卡同属列表区白卡，口径一并收（原 12 圆角 + 投影） */
.sq-container .sq-login-tip {
    border-radius: 10px;
    border: 1px solid #e3e8ee;
    box-shadow: none;
}

/* ---------- 5. 清掉「绿字 + 淡蓝底」（D128 统一主色时漏的 7 处 rgba 蓝底） ---------- */
/* square.css 里 .sq-topic-tag / .sq-filter-kw / .sq-filter-chip / .sq-carousel-arrow:hover
   / .sq-drawer-item.selected 都是 color:#188038 配 rgba(25,118,210,.08~.22)，
   在轻卡上会看成脏灰底。统一换成主色的淡底，层次按原 opacity 比例保留。 */
.sq-container .sq-topic-tag { background: rgba(24, 128, 56, 0.08); }
.sq-container .sq-topic-tag:hover { background: rgba(24, 128, 56, 0.16); }
.sq-container .sq-filter-kw { background: rgba(24, 128, 56, 0.08); }
.sq-container .sq-filter-chip { background: rgba(24, 128, 56, 0.10); }
.sq-container .sq-filter-chip:hover { background: rgba(24, 128, 56, 0.18); }
.sq-container .sq-carousel-arrow:hover { background: rgba(24, 128, 56, 0.08); }
/* 抽屉挂在 .sq-container 之外（square.html:268），本表只被 square.html 引用，
   故此处不带容器前缀（user/library 两页无 .sq-drawer，不受影响）。 */
.sq-drawer-item.selected { background: rgba(24, 128, 56, 0.09); }

/* ---------- 筛选条尾部提示（原型外新增，D160 待用户确认） ---------- */
/* 背景：话题/方向/关键词筛选只存在内存（state.topics / state.themes / state.keyword），
   浏览器 URL 只有 #tab=（分区），刷新会被还原。不明示的话用户会当成 bug。
   样式：12px 次级灰（与 .sq-filter-label / .sq-filter-clear 同族），排在「清除」之后。 */
.sq-container .sq-filter-hint {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}
