/* ============================================================
   index.css —— 首页专属样式
   内容：容器、统计、搜索、筛选、网格卡片、分页、
         吸顶条、空状态、关于/免责弹窗
   依赖：chrome.css（须先引入，本文件使用其 CSS 变量）
   ============================================================ */

.wrap { max-width:1000px; margin:0 auto; padding:28px 26px 40px; }

/* ── 统计 ── */
.hstats { display:flex; align-items:flex-end; gap:34px; flex-wrap:wrap; margin:16px 0 4px; }
.hstats .hs b { display:block; font-size:24px; font-weight:800; line-height:1.2; }
.hstats .hs span { font-size:11.5px; color:var(--gray); }
/* 期数行右侧：关于 / 说明 / 返回旺小谷 */
.hs-acts { margin-left:auto; display:flex; align-items:center; gap:10px; padding-bottom:3px;
  flex-wrap:wrap; }
.hs-acts button, .hs-acts .back-link { font-family:inherit; cursor:pointer; font-size:12px;
  border-radius:6px; padding:5px 12px; white-space:nowrap; line-height:1.4; text-decoration:none; }
.hs-acts .ab-sm { background:var(--brand-bg); color:var(--brand); border:1px solid var(--brand); font-weight:600; }
.hs-acts .ab-sm:hover { background:var(--brand); color:#fff; }
.hs-acts .md-sm { background:var(--card); color:var(--ink2); border:1px solid var(--line); }
.hs-acts .md-sm:hover { border-color:var(--brand); color:var(--brand); }
.hs-acts .back-link { background:var(--card); color:var(--ink2); border:1px solid var(--line); font-weight:600; }
.hs-acts .back-link:hover { border-color:var(--accent); color:var(--accent); }

/* ── 搜索 / 筛选 ── */
.search-row { display:flex; align-items:center; gap:14px; margin:14px 0 12px; }
.search { position:relative; flex:1; max-width:460px; }
.search input { width:100%; display:block; padding:9px 38px 9px 36px; font-size:13.5px;
  border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); outline:none; }
.search input:focus { border-color:var(--brand); }
.search .ic { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--gray); font-size:13px; }
.shint { font-size:12px; color:var(--gray); white-space:nowrap; }
@media(max-width:720px){ .shint { display:none; } }
/* 一键清除关键词 */
.clr { position:absolute; right:8px; top:50%; transform:translateY(-50%); width:22px; height:22px;
  display:none; align-items:center; justify-content:center; font-size:11px; line-height:1;
  color:var(--gray); background:var(--line); border:none; border-radius:50%; cursor:pointer;
  font-family:inherit; padding:0; }
.clr.on { display:flex; }
.clr:hover { background:var(--gray); color:#fff; }
.tabs { display:flex; gap:8px; overflow-x:auto; padding-bottom:12px; margin-bottom:8px; scrollbar-width:thin; }
.tab { flex-shrink:0; font-size:12.5px; color:var(--ink2); border:1px solid var(--line); background:var(--card);
  padding:5px 14px; border-radius:6px; cursor:pointer; user-select:none; }
.tab:hover { border-color:var(--brand); color:var(--brand); }
.tab.on { background:var(--brand-bg); border-color:var(--brand); color:var(--brand); font-weight:700; }

/* ── 工具条：刷新 + 日报/周报筛选 ── */
.toolbar { display:flex; align-items:center; gap:12px; margin:2px 0 14px; }
.btn { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color:var(--ink2);
  background:var(--card); border:1px solid var(--line); border-radius:8px; padding:7px 14px;
  cursor:pointer; font-family:inherit; }
.btn:hover { border-color:var(--brand); color:var(--brand); }
.btn .rf-ic { display:inline-block; font-size:14px; line-height:1; }
.btn.spinning .rf-ic { animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.rf-time { font-size:11.5px; color:var(--gray); }
.toolbar .tabs { margin:0 0 0 auto; padding:0; flex-wrap:wrap; }
/* 移动端：刷新按钮样式与右侧「全部/日报/周报」tab 统一；顶部操作按钮隐藏 */
@media(max-width:640px){
  .hs-acts { display:none; }
  .rf-time { display:none; }
  .toolbar { gap:8px; flex-wrap:wrap; }
  .toolbar .tabs { margin-left:auto; }
  #refresh {
    flex-shrink:0; font-size:12.5px; font-weight:400; color:var(--ink2);
    background:var(--card); border:1px solid var(--line); border-radius:6px;
    padding:5px 14px; line-height:1.4; cursor:pointer; font-family:inherit; }
  #refresh:hover { border-color:var(--brand); color:var(--brand); }
  .f-acts .ab-btn, .f-acts .md-link, .f-acts .back-link {
    flex:1 1 0; text-align:center; white-space:nowrap;
    padding:7px 8px; font-size:12px; }
  .f-acts .back-link {
    display:inline-flex; align-items:center; justify-content:center;
    color:var(--ink2); background:var(--card); border:1px solid var(--line);
    border-radius:20px; text-decoration:none; font-weight:600; }
  .f-acts .back-link:hover { border-color:var(--brand); color:var(--brand); }
}

/* ── 网格视图 ── */
.grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
@media(max-width:900px){ .grid { grid-template-columns:repeat(2,1fr); } }
@media(max-width:560px){ .grid { grid-template-columns:1fr; } .wrap { padding:22px 16px 32px; } }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px 17px 14px;
  display:flex; flex-direction:column; transition:transform .16s ease, box-shadow .16s ease; min-width:0; }
.card:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(31,35,41,.08); }

/* ── 列表由 data/feed.json 客户端渲染：加载前的骨架屏，避免布局跳动 ── */
.card.skel { min-height:158px; position:relative; overflow:hidden; pointer-events:none; }
.card.skel::after { content:''; position:absolute; inset:0;
  background:linear-gradient(90deg, transparent, rgba(31,35,41,.05) 50%, transparent);
  animation:skel 1.2s ease-in-out infinite; }
@keyframes skel { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
.load-fail { grid-column:1/-1; padding:22px; text-align:center; color:var(--gray);
  font-size:13.5px; line-height:1.9; border:1px dashed var(--line); border-radius:10px; }
.load-fail a { color:var(--brand); text-decoration:underline; }
.load-fail .btn { margin:0 4px; padding:4px 12px; font-size:12.5px; }
.c-top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.c-date { font-family:var(--serif); font-size:15px; font-weight:800; color:var(--ink); letter-spacing:.5px; }
.pill { font-size:10.5px; padding:2px 9px; border-radius:20px; font-weight:600; letter-spacing:.5px;
  white-space:nowrap; flex-shrink:0; }
.pill-ok { background:var(--brand-bg); color:var(--ok); }
.pill-wk { background:var(--wk); color:#fff; }
.pill-bf { background:rgba(163,98,10,.14); color:var(--bf); }
.c-title { font-size:15.5px; font-weight:700; margin-bottom:6px; line-height:1.45; }
.c-desc { font-size:12.5px; color:var(--ink2); line-height:1.7; margin-bottom:14px; flex:1;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.c-stats { display:flex; gap:16px; border-top:1px solid var(--line); padding-top:11px; flex-wrap:wrap; }
.cs { font-size:12px; color:var(--gray); white-space:nowrap; }
.cs b { color:var(--ink); font-weight:700; margin-right:3px; font-size:13.5px; }

/* ── 分页 ── */
.pager { display:none; align-items:center; justify-content:center; gap:16px; margin:22px 0 4px;
  font-size:12.5px; color:var(--gray); }
.pager.on { display:flex; }
.pager button { font-size:12.5px; color:var(--ink2); background:var(--card); border:1px solid var(--line);
  border-radius:7px; padding:6px 14px; cursor:pointer; font-family:inherit; }
.pager button:disabled { opacity:.4; cursor:default; }
.pager button:not(:disabled):hover { border-color:var(--brand); color:var(--brand); }

/* ── 吸顶条（下滑时出现） ── */
.stick { position:fixed; top:0; left:0; right:0; z-index:60; background:var(--paper);
  border-bottom:1px solid var(--line); transform:translateY(-110%); transition:transform .18s ease;
  box-shadow:0 2px 10px rgba(31,35,41,.05); }
.stick.show { transform:translateY(0); }
.stick-in { max-width:1000px; margin:0 auto; padding:8px 26px; display:flex; gap:14px;
  align-items:center; flex-wrap:wrap; }
.st-brand { font-weight:800; font-size:14px; letter-spacing:.5px; white-space:nowrap;
  font-family:var(--serif); }
/* 吸顶条内的搜索框（含一键清除） */
.stick-q-wrap { position:relative; flex:1; max-width:360px; display:flex; }
.stick .st-q { width:100%; padding:6px 34px 6px 12px; font-size:12.5px; border:1px solid var(--line);
  border-radius:7px; background:var(--card); color:var(--ink); outline:none; }
.stick .st-q:focus { border-color:var(--brand); }
.clr-sm { right:6px; width:20px; height:20px; font-size:10px; }
.st-acts { display:flex; align-items:center; gap:9px; margin-left:auto; flex-shrink:0; }
.st-link { font-size:12.5px; font-weight:600; color:var(--brand); display:inline-flex;
  align-items:center; gap:4px; white-space:nowrap; }
.st-link:hover { text-decoration:underline; }
.st-link::after { content:'↗'; font-size:11px; }
@media(max-width:560px){ .stick-in { padding:8px 16px; gap:10px; }
  .st-brand { font-size:13px; } .stick-q-wrap { max-width:none; order:3; flex:1 1 100%; } }

/* 首页顶部信息条：移动端隐藏「Personal AI Observer」与「出品」两行，只留时钟 */
@media(max-width:640px){
  .flag2 .f2-a, .flag2 .f2-b { display:none; }
  .flag2 { justify-content:flex-start; }
}

.empty { display:none; text-align:center; color:var(--gray); font-size:13px; padding:48px 0; }
footer .bf-tag { background:rgba(163,98,10,.14); color:var(--bf); border-radius:20px;
  padding:1px 8px; font-size:10.5px; font-weight:600; }

/* ── 底部：关于/说明/返回旺小谷 一行两端对齐 + 信息两段一行左右分列 ── */
.f-acts { display:flex; align-items:center; justify-content:space-between; gap:12px;
  flex-wrap:wrap; padding-bottom:12px; }
.f-acts .lb-min { display:none; }
.f-acts .back-link { font-size:12px; font-weight:600; color:var(--ink2); background:var(--card);
  border:1px solid var(--line); border-radius:20px; padding:6px 14px; text-decoration:none; }
.f-acts .back-link:hover { border-color:var(--brand); color:var(--brand); }
@media(max-width:640px){
  /* 移动端：关于 / 说明 并排一行，使用简化文案 */
  .f-acts { flex-wrap:nowrap; gap:8px; }
  .f-acts .ab-btn, .f-acts .md-link { flex:1 1 0; text-align:center; white-space:nowrap;
    padding:7px 8px; font-size:12px; }
  .f-acts .lb-full { display:none; }
  .f-acts .lb-min { display:inline; }
}
.f-line { display:flex; justify-content:space-between; align-items:baseline; gap:12px 34px;
  flex-wrap:wrap; border-top:1px solid var(--line); padding-top:11px; }
.f-line .fl-a { flex:0 1 auto; min-width:0; }
.f-line .fl-b { flex:0 1 auto; min-width:0; text-align:right; }
.f-line b { color:var(--ink2); font-weight:700; margin-right:2px; }
@media(max-width:720px){
  .f-line { flex-direction:column; align-items:flex-start; }
  .f-line .fl-b { text-align:left; }
}

/* ── 关于 / 免责按钮 ── */
.ab-btn, .md-link { font-family:inherit; font-size:12px; font-weight:600; color:var(--brand);
  background:var(--brand-bg); border:1px solid var(--brand-bg); border-radius:20px; padding:6px 14px;
  cursor:pointer; line-height:1.5; }
.ab-btn:hover, .md-link:hover { border-color:var(--brand); }
.md-link { background:transparent; border-color:var(--line); color:var(--gray); }
.md-link:hover { color:var(--brand); border-color:var(--brand); }

/* ── 弹窗：沿用日报详情页的报纸式排版 ── */
.modal { position:fixed; inset:0; z-index:100; display:none; align-items:center; justify-content:center;
  padding:20px; background:rgba(21,21,21,.5); }
.modal.on { display:flex; }
.modal-overlay { position:absolute; inset:0; background:transparent; }
.modal-box { position:relative; max-width:760px; max-height:calc(100vh - 40px); width:100%;
  background:var(--card); border:1px solid var(--line); border-radius:4px;
  box-shadow:0 18px 60px rgba(21,21,21,.22); display:flex; flex-direction:column; overflow:hidden; }
/* 报头：与详情页 .mast 一致的居中双线报头 */
.modal-hd { position:relative; text-align:center; padding:24px 56px 16px; border-bottom:3px double var(--ink); }
.modal-hd .mh-flag { font-size:10px; letter-spacing:2.6px; color:var(--gray); text-transform:uppercase; margin-bottom:8px; }
.modal-hd h2 { font-family:var(--serif); font-size:25px; font-weight:900; margin:0; letter-spacing:3px; line-height:1.2; }
.modal-hd .mh-sub { font-size:11.5px; color:var(--wk); letter-spacing:1.5px; margin-top:8px; }
.modal-close { position:absolute; top:14px; right:14px; width:34px; height:34px; display:flex;
  align-items:center; justify-content:center; font-size:20px; line-height:1; color:var(--gray);
  background:none; border:1px solid transparent; border-radius:6px; cursor:pointer; }
.modal-close:hover { color:var(--ink); border-color:var(--line); }
.modal-body { padding:24px 44px 34px; overflow-y:auto; font-size:14px; line-height:1.9; color:var(--ink2); }
.modal-body p { margin:0 0 13px; text-align:justify; }
/* 导语：与详情页 .lead 一致（左侧竖线 + 大号衬线） */
.modal-body .lead { border-left:3px solid var(--brand); padding:2px 0 2px 16px; margin:0 0 20px; }
.modal-body .lead p { font-family:var(--serif); font-size:16px; font-weight:700; line-height:1.8;
  color:var(--ink); margin:0 0 10px; }
.modal-body .lead p:last-child { margin-bottom:0; }
.modal-body .lead p.sub { font-family:var(--sans); font-size:13px; font-weight:400; color:var(--ink2); }
/* 小节标题：衬线 + 双线，仿详情页分栏标题 */
.modal-body h3 { font-family:var(--serif); font-size:16px; font-weight:900; color:var(--ink);
  border-bottom:2px solid var(--ink); padding-bottom:7px; margin:30px 0 14px; letter-spacing:1px; }
.modal-body h3:first-child { margin-top:0; }
.modal-body h3 .n { font-family:var(--sans); font-size:11px; color:var(--brand); letter-spacing:1.5px;
  display:block; font-weight:700; margin-bottom:3px; }
.modal-body ol, .modal-body ul { padding-left:0; margin:0 0 14px; list-style:none; }
.modal-body li { position:relative; padding-left:16px; margin-bottom:8px; }
.modal-body li::before { content:"·"; position:absolute; left:3px; top:-2px; color:var(--brand);
  font-weight:900; font-size:18px; }
/* 结尾口号：与详情页 .final 一致的黑色描边方框 */
.modal-body .slogan { margin:28px 0 0; padding:22px 20px; border:2px solid var(--ink); text-align:center;
  line-height:1.9; background:transparent; }
.modal-body .slogan strong { display:block; font-family:var(--serif); font-size:17px; font-weight:900;
  letter-spacing:1px; color:var(--ink); margin-bottom:6px; }
.modal-body .slogan span { font-size:12px; color:var(--gray); letter-spacing:.6px; }
.modal-body .note { margin-top:20px; font-size:12px; color:var(--gray); border:1px dashed var(--line);
  padding:13px 16px; line-height:1.85; }
.modal-body .note b { color:var(--ink2); }
@media(max-width:560px){
  .modal { padding:10px; }
  .modal-box { max-height:calc(100vh - 20px); border-radius:3px; }
  .modal-hd { padding:18px 44px 13px; }
  .modal-hd h2 { font-size:20px; letter-spacing:2px; }
  .modal-hd .mh-flag { letter-spacing:1.8px; }
  .modal-body { padding:18px 20px 26px; font-size:13.5px; }
  .modal-body .lead p { font-size:15px; }
}
@media(prefers-color-scheme:dark){ .modal { background:rgba(0,0,0,.62); } }
