/* 行业速览 —— 以原文图片为主角的画报式阅读界面
   白底 + 混凝土灰占位 + 克莱因蓝点缀（只用在未读与选中态） */
:root {
  --page: #FFFFFF;
  --surface: #F3F3F1;       /* 图片占位、分组底色：混凝土灰 */
  --ink: #161618;
  --ink-2: #4A4A4F;
  --muted: #8C8C91;
  --line: #EBEBEA;
  --accent: #1F3BD6;        /* 克莱因蓝 */
  --on-img: #FFFFFF;
  --danger: #C2412D;
  --radius-img: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0F0F10;
    --surface: #1B1B1D;
    --ink: #F1F1F0;
    --ink-2: #C4C4C6;
    --muted: #85858A;
    --line: #26262A;
    --accent: #7C93FF;
    --danger: #F08A76;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { display: block; max-width: 100%; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
#view { padding: calc(var(--safe-t) + 14px) 0 calc(88px + var(--safe-b)); }
.pad { padding-left: 20px; padding-right: 20px; }

/* 图片：统一的占位与淡入 */
.ph { background: var(--surface); overflow: hidden; position: relative; display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.ph img.ok { opacity: 1; }

/* ---------- 顶部 ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.top h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.top h1 span { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.top .acts { display: flex; gap: 4px; margin-bottom: 2px; }
.ibtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.ibtn:active { background: var(--surface); }
.ibtn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ibtn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.status b { color: var(--ink-2); font-weight: 500; }
.status .warn { color: var(--danger); }
.status button { color: var(--accent); }

/* ---------- 公众号头像条 ---------- */
.stories { display: flex; gap: 12px; overflow-x: auto; padding: 16px 16px 2px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 60px; text-align: center; font-size: 11.5px; line-height: 1.3; color: var(--ink-2); }
.story .ring { display: block; width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 50%; padding: 2.5px; border: 1.5px solid transparent; }
.story.new .ring { border-color: var(--accent); }
.story.on .ring { border-color: var(--ink); border-width: 2px; }
.story .av { width: 100%; height: 100%; }
.story > span:last-child { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story.on > span:last-child { color: var(--ink); font-weight: 600; }
.av { border-radius: 50%; background: var(--surface); overflow: hidden; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av.all { background: var(--ink); color: var(--page); font-size: 13px; }

/* 分类：文字标签 + 下划线 */
.tabs { display: flex; gap: 20px; overflow-x: auto; padding: 12px 16px 0; border-bottom: 1px solid var(--line); scrollbar-width: none; position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 6px 0 10px; font-size: 15px; color: var(--muted); position: relative; }
.tab.on { color: var(--ink); font-weight: 600; }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); border-radius: 1px; }

.search { margin: 12px 14px 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--surface); }
.search svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; flex: none; }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; font-size: 15px; }
.search input::placeholder { color: var(--muted); }

/* ---------- 今日要闻 ---------- */
.brief { margin: 16px 14px 0; padding: 14px 16px 6px; border-radius: 14px; background: var(--surface); }
.brief .hd { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.brief .hd button { color: var(--muted); font-size: 12.5px; }
.brief h3 { margin: 4px 0 6px; font-size: 17px; line-height: 1.45; font-weight: 700; }
.brief .sec { display: block; width: 100%; margin: 7px 0; padding: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.brief .sec b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.brief.folded .sec { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.brief .more { display: block; width: 100%; padding: 6px 0 8px; text-align: left; font-size: 12.5px; color: var(--accent); }

/* ---------- 双列瀑布流（小红书式） ---------- */
.flow { display: flex; gap: 9px; padding: 12px 10px 0; align-items: flex-start; }
.flow .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.note { display: block; width: 100%; }
.note .ph { width: 100%; border-radius: 10px; }
.note .ph::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.06); pointer-events: none; }
.note .badge { position: absolute; top: 8px; right: 8px; z-index: 1; font-size: 11px; line-height: 1; color: #fff; background: rgba(0,0,0,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 4px 7px; border-radius: 9px; }
.note .badge.l { left: 8px; right: auto; }
.note h3 { margin: 8px 4px 0; font-size: 14.5px; line-height: 1.45; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note.read h3 { font-weight: 400; color: var(--ink-2); }
.note .by { margin: 7px 4px 0; display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.note .by .av { width: 17px; height: 17px; font-size: 9px; }
.note .by .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note .by .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.note .by .tm { flex: none; }
/* 没有配图时用文字封面 */
.tcover { width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; padding: 16px 14px; display: flex; flex-direction: column; justify-content: space-between; color: #26241F; }
.tcover b { font-size: 17px; line-height: 1.5; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.tcover span { font-size: 11.5px; opacity: .62; }
.tc0 { background: #E9E4DA; } .tc1 { background: #DCE5DF; } .tc2 { background: #E1E6EE; } .tc3 { background: #EFE2D8; } .tc4 { background: #E5E1EC; }
.note .wait { position: absolute; left: 8px; bottom: 8px; z-index: 1; font-size: 11px; color: #fff; background: rgba(0,0,0,.38); padding: 3px 7px; border-radius: 9px; }

.empty { padding: 56px 28px; text-align: center; color: var(--muted); }
.empty h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.empty p { margin: 0 0 18px; font-size: 14px; line-height: 1.7; }

/* ---------- 按钮 ---------- */
.btn { height: 44px; padding: 0 20px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--ink); color: var(--page); font-weight: 600; font-size: 15px; }
.btn.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; }

/* ---------- 底部标签栏 ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--page) 90%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-top: .5px solid var(--line); }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 3px 0; text-align: center; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on svg { stroke-width: 2.1; }

/* ---------- 笔记详情（小红书式） ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--page); overflow-y: auto; transform: translateX(100%); transition: transform .3s cubic-bezier(.3,.7,.2,1); visibility: hidden; overscroll-behavior: contain; }
.sheet.open { transform: none; visibility: visible; }
.nhead { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 8px) 12px 8px 6px; background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: 560px; margin: 0 auto; }
.nhead .av { width: 32px; height: 32px; font-size: 12px; }
.nhead .who { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nhead .ibtn.on svg { fill: currentColor; }
.ndoc { max-width: 560px; margin: 0 auto; padding-bottom: calc(96px + var(--safe-b)); }
.swiper { position: relative; background: var(--surface); }
.swiper .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: 100%; }
.swiper .track::-webkit-scrollbar { display: none; }
.swiper .slide { flex: none; width: 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; position: relative; }
.swiper .slide img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; }
.swiper .slide img.ok { opacity: 1; }
.swiper .slide.fill img { object-fit: cover; }
.swiper .cnt { position: absolute; top: 12px; right: 12px; z-index: 1; font-size: 12px; color: #fff; background: rgba(0,0,0,.4); padding: 3px 9px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.swiper .tcover { border-radius: 0; aspect-ratio: auto; height: 100%; padding: 32px 28px; }
.swiper .tcover b { font-size: 24px; -webkit-line-clamp: 9; }
.dots { display: flex; justify-content: center; gap: 5px; padding: 12px 0 0; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.dots i.on { background: var(--ink); transform: scale(1.15); }
.ntext { padding: 14px 18px 0; }
.ntext h1 { margin: 0; font-size: 19px; line-height: 1.5; font-weight: 700; text-wrap: pretty; }
.ntext p { margin: 12px 0 0; font-size: 16px; line-height: 1.8; }
.ntext .pts { margin: 14px 0 0; padding: 0; list-style: none; }
.ntext .pts li { position: relative; padding: 4px 0 4px 22px; font-size: 16px; line-height: 1.75; }
.ntext .pts li::before { content: attr(data-n); position: absolute; left: 0; top: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ntext h2 { margin: 22px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ntext .figs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ntext .fig { padding: 12px; border-radius: 10px; background: var(--surface); }
.ntext .fig .n { font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; word-break: break-all; }
.ntext .fig .l { margin-top: 5px; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.ntext .fig.wide { grid-column: span 2; }
.ntext .sum { color: var(--ink-2); font-size: 15px; }
.ntext blockquote { margin: 16px 0 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line); color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.ntext .hash { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 15px; color: var(--accent); }
.ntext .date { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.ntext .note-tip { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.ntext hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0 0; }
.nbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 16px calc(8px + var(--safe-b)); background: var(--page); border-top: .5px solid var(--line); }
.nbar .btn { flex: 1; height: 40px; }
.nbar .ib { display: flex; flex-direction: column; align-items: center; font-size: 10.5px; color: var(--ink-2); gap: 1px; min-width: 44px; }
.nbar .ib svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nbar .ib.on svg { fill: currentColor; }

.fbtn { pointer-events: auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(20,20,22,.42); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.fbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 全屏看图 ---------- */
.viewer { position: fixed; inset: 0; z-index: 40; background: #000; display: none; flex-direction: column; }
.viewer.open { display: flex; }
.viewer .vtop { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-t) + 10px) 14px 10px; color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.viewer .vtop .fbtn { background: rgba(255,255,255,.14); }
.viewer .track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer .track::-webkit-scrollbar { display: none; }
.viewer .slide { flex: none; width: 100vw; height: 100%; display: grid; place-items: center; scroll-snap-align: center; overflow-y: auto; }
.viewer .slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .slide.tall { place-items: start center; }
.viewer .slide.tall img { max-height: none; width: 100%; }

/* ---------- 列表页（公众号 / 设置） ---------- */
.page-h { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.page-s { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.group { margin: 28px 0 0; }
.group > h3 { margin: 0 20px 8px; font-size: 13px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.list { margin: 0 20px; border-radius: 14px; background: var(--surface); padding: 0 14px; }
.list.p { padding: 14px; }
.acc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.acc:last-child { border-bottom: 0; }
.acc .av { width: 42px; height: 42px; background: var(--page); }
.acc .info { flex: 1; min-width: 0; }
.acc .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .sub.err { color: var(--danger); white-space: normal; }
.acc.off .name, .acc.off .av { opacity: .4; }
.acc .more { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); font-size: 18px; letter-spacing: 1px; }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: var(--line); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.18); transition: transform .2s; }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(18px); }

.field { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 21px; border: 0; background: var(--page); outline: 0; font-size: 15px; }
.field input:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }

.kv { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); gap: 12px; font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv .k small { display: block; color: var(--muted); font-size: 12px; }
.kv .v { color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; background: var(--page); border-radius: 16px; }
.stepper button { width: 34px; height: 32px; font-size: 18px; color: var(--ink-2); text-align: center; }
.stepper span { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.times { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }
.times .t { height: 32px; padding: 0 6px 0 14px; border-radius: 16px; background: var(--page); display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.times .t button { width: 22px; height: 22px; border-radius: 50%; color: var(--muted); font-size: 16px; line-height: 1; text-align: center; }
.times input[type=time] { height: 32px; border-radius: 16px; border: 1px dashed var(--muted); padding: 0 10px; background: transparent; }

.login { text-align: center; }
.login .qr { width: 216px; height: 216px; margin: 6px auto 12px; border-radius: 14px; background: #fff; padding: 10px; display: grid; place-items: center; color: #161618; font-size: 14px; }
.login .qr img { width: 100%; height: 100%; }
.login .msg { font-size: 14px; margin: 0 0 12px; }
.login .hint { font-size: 12.5px; color: var(--muted); text-align: left; margin: 12px 0 0; line-height: 1.7; }
.session { display: flex; align-items: center; gap: 12px; }
.session .av { width: 46px; height: 46px; background: var(--page); }
.session .info { flex: 1; }
.session .name { font-weight: 600; }
.session .sub { font-size: 12.5px; color: var(--muted); }
.session .sub.err { color: var(--danger); }

.log { font: 12px/1.7 ui-monospace, Menlo, monospace; color: var(--muted); white-space: pre-wrap; max-height: 260px; overflow: auto; padding: 8px 0; }
.run { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.run:last-child { border-bottom: 0; }
.run .h { display: flex; justify-content: space-between; }
.run .s { color: var(--muted); font-size: 12px; }
.run .e { color: var(--danger); font-size: 12px; }
.run summary { cursor: pointer; }

.notice { margin: 16px 20px 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); font-size: 14px; display: flex; gap: 12px; align-items: center; }
.notice p { margin: 0; flex: 1; line-height: 1.6; }
.results { margin-top: 6px; }

/* ---------- 弹层 / 提示 ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.38); }
.modal.open { display: flex; }
.modal .box { width: 100%; max-width: 560px; background: var(--page); border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + var(--safe-b)); max-height: 86vh; overflow: auto; animation: up .26s cubic-bezier(.3,.7,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.modal h3 { margin: 0 0 4px; font-size: 19px; }
.modal p.sub { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.modal .field input { background: var(--surface); }
.modal .menu button { display: block; width: 100%; padding: 15px 2px; border-bottom: 1px solid var(--line); font-size: 16px; }
.modal .menu button.danger { color: var(--danger); }
.modal .menu button:last-child { border-bottom: 0; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 50; transform: translate(-50%, 8px); background: var(--ink); color: var(--page); padding: 10px 18px; border-radius: 22px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 600px) {
  #view { padding-top: 32px; }
}

/* 公开页：只保留「速览」「收藏」 */
.public .tabbar { grid-template-columns: repeat(2, 1fr); }
.public .tabbar [data-tab="accounts"], .public .tabbar [data-tab="settings"] { display: none; }
