/* 松果智能云 · 设计系统基座
   参考 Linear / Vercel / Arc：克制、精致、有呼吸感
   主色青蓝渐变 #06B6D4 → #3B82F6；CSS 变量；亮/暗双主题；圆角统一（卡片 12px、按钮 8px）；多层柔和阴影；1px 半透明描边 */
:root {
  --primary: #06B6D4; --primary-2: #3B82F6; --accent: #8B5CF6;
  --grad: linear-gradient(135deg, var(--primary), var(--primary-2));
  --bg: #0b1220; --bg-soft: #0f172a; --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .1);
  --text: #e5e7eb; --text-dim: #9ca3af; --text-mute: #6b7280;
  --ok: #22c55e; --warn: #f59e0b; --err: #ef4444; --info: #38bdf8;
  --r-card: 12px; --r-btn: 8px; --r-lg: 20px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3); --sh-2: 0 6px 20px rgba(0, 0, 0, .28); --sh-3: 0 18px 50px rgba(0, 0, 0, .42);
  --f-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --f-serif: "Source Han Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --dur: 200ms; --ease: cubic-bezier(.22, .61, .36, 1);
  --nav-h: 58px; --side-w: 240px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
html[data-mode="light"] {
  --bg: #f7f8fa; --bg-soft: #ffffff; --panel: rgba(15, 23, 42, .035); --panel-2: rgba(15, 23, 42, .06);
  --line: rgba(15, 23, 42, .1); --text: #0f172a; --text-dim: #475569; --text-mute: #64748b;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .08); --sh-2: 0 8px 24px rgba(15, 23, 42, .1); --sh-3: 0 20px 50px rgba(15, 23, 42, .14);
}
* { box-sizing: border-box }
html, body { margin: 0; padding: 0; min-height: 100% }
body {
  font-family: var(--f-sans); color: var(--text); background: transparent;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-bottom: var(--safe-b); font-size: 15px; line-height: 1.6;
}
a { color: inherit; text-decoration: none }
button, input, select, textarea { font: inherit; color: inherit }
img { max-width: 100% }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em }
p { margin: 0 0 .8em }
code, pre, .mono { font-family: var(--f-mono) }
.muted { color: var(--text-dim) }
.small { font-size: 12.5px }
.hidden { display: none !important }

/* 背景层（由 background.js 渲染：纯色/渐变/图片/视频/粒子） */
.bg-root { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg) }
.bg-root > * { position: absolute; inset: 0 }
.bg-img { background-size: cover; background-position: center; will-change: transform, opacity }
.bg-video { width: 100%; height: 100%; object-fit: cover }
.bg-overlay { background: rgba(0, 0, 0, .35) }
.bg-particles { display: block; width: 100%; height: 100% }

/* 通用组件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  will-change: transform; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); transform: scale(1.02) }
.btn:active { transform: scale(.98) }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--sh-2) }
.btn.ghost { background: transparent }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; border-color: transparent }
.btn.big { padding: 13px 26px; font-size: 16px; border-radius: 12px }
.btn[aria-disabled="true"], .btn.need-wait { opacity: .55; pointer-events: none }
.pulse { animation: pulse 2.4s var(--ease) infinite }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, .45) } 50% { box-shadow: 0 0 0 14px rgba(6, 182, 212, 0) } }
.input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: rgba(0, 0, 0, .18); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
html[data-mode="light"] .input, html[data-mode="light"] select, html[data-mode="light"] textarea { background: #fff }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(6, 182, 212, .18) }
label.field { display: block; margin-bottom: 12px }
label.field > span { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px }
label.field.req > span::after { content: " *"; color: var(--err) }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; box-shadow: var(--sh-1) }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-dim) }
.badge { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line) }
.badge.lv-1 { color: #cbd5e1 } .badge.lv-2 { color: #d97706 } .badge.lv-3 { color: #94a3b8 }
.badge.lv-4 { color: #f59e0b } .badge.lv-5 { color: #22d3ee } .badge.lv-6 { color: #a78bfa }
.toast-root { position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none }
.toast { background: rgba(17, 24, 39, .95); color: #fff; padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); box-shadow: var(--sh-2); animation: toastIn .28s var(--ease) }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.modal-mask { position: fixed; inset: 0; background: rgba(3, 7, 18, .66); display: grid; place-items: center; z-index: 900; animation: fadeIn .18s var(--ease) }
.modal { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; width: min(92vw, 560px); max-height: 86vh; overflow: auto; box-shadow: var(--sh-3); animation: popIn .22s var(--ease) }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }
.progress { height: 8px; border-radius: var(--r-pill); background: var(--panel-2); overflow: hidden }
.progress > i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform var(--dur) linear; will-change: transform }
table.tbl { width: 100%; border-collapse: collapse }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px }
table.tbl th { color: var(--text-dim); font-weight: 600; font-size: 12.5px; cursor: pointer; user-select: none }
table.tbl tr:hover td { background: var(--panel) }

/* 首屏骨架屏 + 品牌呼吸 */
.boot-skeleton { padding: 40px 20px; max-width: 960px; margin: 0 auto }
.sk-logo { width: 72px; height: 72px; border-radius: 20px; background: var(--grad); margin-bottom: 22px }
.breathe { animation: breathe 2.2s var(--ease) infinite; will-change: transform, opacity }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .92 } 50% { transform: scale(1.045); opacity: 1 } }
.sk-line { height: 14px; border-radius: 8px; background: var(--panel-2); margin-bottom: 10px; animation: shimmer 1.4s infinite }
.sk-line.short { width: 42% }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 22px }
.sk-card { height: 120px; border-radius: var(--r-card); background: var(--panel-2); animation: shimmer 1.4s infinite }
@keyframes shimmer { 0%, 100% { opacity: .55 } 50% { opacity: .9 } }
.sk-tip { margin-top: 18px; color: var(--text-mute); font-size: 13px }

/* 路由淡入上移 200ms（只用 transform/opacity） */
.view-enter { animation: viewIn var(--dur) var(--ease) }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
/* 滚动交错淡入 */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .42s var(--ease), transform .42s var(--ease); will-change: opacity, transform }
.reveal.in { opacity: 1; transform: none }
/* 悬浮播放器 */
.player-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; display: flex; align-items: center; gap: 12px; padding: 8px 14px calc(8px + var(--safe-b)); background: rgba(9, 14, 26, .92); border-top: 1px solid var(--line); backdrop-filter: blur(12px) }
.player-bar .cover { width: 40px; height: 40px; border-radius: 8px; object-fit: cover }
.player-bar .meta { min-width: 0; flex: 1 }
.player-bar .meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.player-bar .ctl { display: flex; gap: 6px; align-items: center }
.player-bar input[type=range] { width: 120px }
.player-bar .lyric { font-size: 12px; color: var(--text-dim); max-width: 30vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
/* 客服悬浮按钮（呼吸动效，绝不自动弹出） */
.support-widget { position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)); z-index: 850 }
.support-fab { width: 54px; height: 54px; border-radius: 50%; background: var(--grad); border: 0; color: #fff; font-size: 22px; cursor: pointer; box-shadow: var(--sh-2); animation: fab 3s var(--ease) infinite; will-change: transform }
@keyframes fab { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.06) } }
.support-panel { position: absolute; right: 0; bottom: 64px; width: min(92vw, 340px); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden; animation: popIn .2s var(--ease) }
.support-panel header { padding: 12px 14px; background: var(--grad); color: #fff; font-weight: 600 }
.support-panel .body { padding: 12px 14px; max-height: 52vh; overflow: auto }
.support-panel .faq { padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer }
/* 微信/QQ 引导浮层 */
.wx-guide { position: fixed; inset: 0; z-index: 990 }
.wx-mask { position: absolute; inset: 0; background: rgba(3, 7, 18, .82) }
.wx-panel { position: relative; margin: 8vh auto 0; width: min(92vw, 420px); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; text-align: center; box-shadow: var(--sh-3) }
.wx-arrow { position: absolute; top: -46px; right: 12px; font-size: 40px; color: #fff; animation: arrowUp 1.4s var(--ease) infinite; will-change: transform }
@keyframes arrowUp { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.wx-steps { text-align: left; padding-left: 20px; color: var(--text-dim); font-size: 13.5px }
.wx-qr img { width: 160px; height: 160px; border-radius: 12px; background: #fff; padding: 6px }
/* 公开页（分享/下载/收集/聊天/主页） */
.pub-page { min-height: 100vh; padding: 22px 16px calc(40px + var(--safe-b)) }
.pub-main { max-width: 980px; margin: 0 auto }
.pub-foot { text-align: center; color: var(--text-mute); font-size: 12.5px; margin-top: 28px }
.pw-card { max-width: 420px; margin: 12vh auto; text-align: center }
.pw-ico { font-size: 40px }
.pw-card.shake { animation: shake .4s }
@keyframes shake { 10%, 90% { transform: translateX(-2px) } 30%, 70% { transform: translateX(4px) } 50% { transform: translateX(-6px) } }
.err-msg { color: var(--err); font-size: 13px; margin-top: 8px }
.card.err { text-align: center; max-width: 460px; margin: 14vh auto }
.err-ico { font-size: 44px }
.share-page .file-card { max-width: 720px; margin: 0 auto }
.fc-head { display: flex; gap: 14px; align-items: center }
.fc-thumb { width: 92px; height: 92px; object-fit: cover; border-radius: var(--r-card) }
.fc-ico { width: 92px; height: 92px; display: grid; place-items: center; border-radius: var(--r-card); background: var(--panel-2); font-family: var(--f-mono); font-weight: 700 }
.fc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px }
.pv { margin: 16px 0; border-radius: var(--r-card); overflow: hidden; background: rgba(0, 0, 0, .25) }
.pv img, .pv video, .pv iframe { width: 100%; display: block; border: 0; min-height: 220px }
.direct-view { text-align: center }
.direct-view img { max-height: 82vh; border-radius: var(--r-card); box-shadow: var(--sh-3) }
.float-dl { position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)) }
/* 相册 */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px }
.gal-grid figure { margin: 0; border-radius: var(--r-card); overflow: hidden; background: var(--panel); cursor: zoom-in }
.gal-grid img { width: 100%; height: 130px; object-fit: cover; display: block }
.gal-grid figcaption { padding: 6px 8px; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.gal-viewer { position: fixed; inset: 0; background: rgba(3, 7, 18, .95); z-index: 950; display: flex; flex-direction: column }
.gal-stage { flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: pan-y }
.gal-stage img { max-width: 96vw; max-height: 78vh; transition: transform var(--dur) var(--ease); will-change: transform }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .12); border: 0; color: #fff; font-size: 30px; width: 46px; height: 62px; border-radius: 12px; cursor: pointer }
.gal-nav.prev { left: 10px } .gal-nav.next { right: 10px }
.gal-bar { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 12px; flex-wrap: wrap }
/* 下载页模板（≥6 种，结构与视觉均不同） */
.dl-page { max-width: 860px; margin: 0 auto }
.dl-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-dim); font-size: 13px; margin: 10px 0 }
.dl-author { display: flex; gap: 10px; align-items: center; margin: 12px 0 }
.dl-author img, .dl-author .ph { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); object-fit: cover }
.dl-btn { display: inline-flex; padding: 14px 34px; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 700; box-shadow: var(--sh-2); animation: pulse 2.6s infinite }
.tpl-simple .simple-box { background: #fff; color: #111; border-radius: 14px; padding: 34px; max-width: 560px; margin: 8vh auto; text-align: center; box-shadow: var(--sh-3) }
.tpl-dark .dark-wrap { min-height: 70vh; display: grid; place-items: center }
.tpl-dark .dark-card { background: #0b0f1a; border: 1px solid #1f2937; border-radius: 18px; padding: 34px; text-align: center; max-width: 520px }
.tpl-dark .dark-ico { font-family: var(--f-mono); font-size: 26px; color: #38bdf8; margin-bottom: 10px }
.tpl-gradient .grad-wrap { position: relative; min-height: 70vh; display: grid; place-items: center; overflow: hidden }
.tpl-gradient .grad-blob { position: absolute; width: 46vw; height: 46vw; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform }
.tpl-gradient .b1 { background: #06B6D4; top: -12vw; left: -8vw } .tpl-gradient .b2 { background: #8B5CF6; bottom: -14vw; right: -6vw }
.tpl-gradient .grad-inner { position: relative; text-align: center; padding: 24px }
.tpl-gradient .grad-qr { width: 130px; border-radius: 12px; margin-top: 16px; background: #fff; padding: 6px }
.tpl-card .card-wrap { padding: 20px 0 }
.tpl-card .big-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; max-width: 560px; margin: 0 auto; box-shadow: var(--sh-3) }
.tpl-card .big-card header img { width: 100%; height: 210px; object-fit: cover; display: block }
.tpl-card .ph-ico { height: 210px; display: grid; place-items: center; background: var(--grad); font-size: 40px; font-family: var(--f-mono); color: #fff }
.tpl-card .bc-body { padding: 22px; text-align: center }
.tpl-gallery .gal-wrap { display: grid; grid-template-rows: 260px auto; gap: 0 }
.tpl-gallery .gal-hero { background: var(--panel-2); display: grid; place-items: center; overflow: hidden }
.tpl-gallery .gal-hero img { width: 100%; height: 100%; object-fit: cover }
.tpl-gallery .gal-ph { font-family: var(--f-serif); font-size: 56px; opacity: .5 }
.tpl-gallery .gal-body { padding: 26px; font-family: var(--f-serif) }
.tpl-gallery .lede { font-size: 17px; color: var(--text-dim) }
.tpl-tech .tech-wrap { position: relative; min-height: 74vh; display: grid; place-items: center; font-family: var(--f-mono) }
.tpl-tech .tech-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(56, 189, 248, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(56, 189, 248, .08) 1px, transparent 1px); background-size: 34px 34px; animation: gridMove 12s linear infinite; will-change: transform }
@keyframes gridMove { from { transform: translate3d(0, 0, 0) } to { transform: translate3d(34px, 34px, 0) } }
.tpl-tech .tech-panel { position: relative; background: rgba(2, 6, 23, .82); border: 1px solid rgba(56, 189, 248, .35); border-radius: 14px; padding: 24px; max-width: 620px; box-shadow: 0 0 40px rgba(56, 189, 248, .12) }
.tpl-tech .tech-log { color: #4ade80; font-size: 12.5px; white-space: pre-wrap; background: rgba(0, 0, 0, .4); padding: 12px; border-radius: 10px }
.tpl-tech .tech-title { font-family: var(--f-mono); letter-spacing: .04em }
.cap-box { margin: 12px 0; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r-card) }
/* 收集页 */
.collect-page { max-width: 760px; margin: 0 auto }
.col-head h1 { font-size: 26px }
.col-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px }
.col-form section { margin-bottom: 20px }
.drop { border: 2px dashed var(--line); border-radius: var(--r-card); padding: 30px 16px; text-align: center; background: var(--panel); transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); cursor: pointer }
.drop.over { border-color: var(--primary); transform: scale(1.01) }
.drop input { display: none }
.file-list { list-style: none; padding: 0; margin: 12px 0 }
.file-list li { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 8px; background: var(--panel); margin-bottom: 6px; font-size: 13.5px }
.rename-preview { padding: 12px; border-radius: var(--r-card); background: var(--panel); margin: 10px 0 }
.rename-preview ul { margin: 6px 0 0; padding-left: 18px }
.success-anim { text-align: center; padding: 60px 20px }
.success-anim .check { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 40px; display: grid; place-items: center; animation: popIn .4s var(--ease) }
.style-b.collect-page { font-family: var(--f-mono) }
.style-b .col-head { border: 1px solid rgba(56, 189, 248, .3); border-radius: 16px; padding: 18px; background: rgba(2, 6, 23, .6) }
.style-c .col-form { display: grid; gap: 10px }
.style-c .drop { padding: 18px }
.style-d .col-head { background: var(--grad); border-radius: 20px; padding: 20px; color: #fff }
.end-card { text-align: center }
/* 发布页 */
.pub-article { max-width: 820px; margin: 0 auto }
.page-head { display: flex; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; position: relative }
.ph-avatar img, .ph-avatar span { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700 }
.ph-meta h1 { font-size: 24px; margin: 0 0 4px }
.ph-live { position: absolute; right: 0; top: 0; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ok); animation: fadeIn .3s }
.ph-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: breathe 1.6s infinite }
.live-bar { font-size: 12.5px; color: var(--text-dim); padding: 6px 10px; border-radius: var(--r-pill); background: var(--panel); display: inline-block; margin-bottom: 14px }
.ver-tag { font-size: 12px; color: var(--warn); margin-left: 8px; font-style: normal }
.update-history { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 14px }
.update-history ol { padding-left: 20px; color: var(--text-dim); font-size: 13.5px }
.blk-h { margin-top: 1.4em }
.blk-text { white-space: pre-wrap }
.blk-quote { border-left: 3px solid var(--primary); padding: 6px 14px; color: var(--text-dim); background: var(--panel); border-radius: 0 var(--r-card) var(--r-card) 0 }
.blk-code { background: rgba(2, 6, 23, .8); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px; overflow: auto; display: flex; gap: 10px }
.blk-code .ln { color: var(--text-mute); text-align: right; user-select: none; font-size: 12.5px }
.blk-image img { border-radius: var(--r-image, 12px); opacity: var(--o, 1); transform: rotate(var(--rot, 0deg)); transition: transform var(--dur) var(--ease) }
.blk-image figcaption { text-align: center; color: var(--text-mute); font-size: 13px; margin-top: 6px }
.blk-video video, .blk-pdf iframe, .blk-iframe iframe, .blk-map iframe { width: 100%; border: 0; border-radius: var(--r-card); background: #000 }
.blk-filecard { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--panel); margin: 10px 0 }
.blk-filecard .fc-info { flex: 1; min-width: 0 } .blk-filecard .fc-info b { display: block }
.blk-filecard .fc-info i { font-style: normal; color: var(--text-mute); font-size: 12.5px }
.blk-download { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; background: var(--panel); margin: 14px 0 }
.blk-download .dl-file { display: flex; gap: 10px; align-items: center; margin-bottom: 12px }
.blk-download .dl-file .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px }
.blk-columns { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 12px 0 }
.blk-bubble { display: flex; flex-direction: column; margin: 10px 0; max-width: 78% }
.blk-bubble.right { margin-left: auto; align-items: flex-end }
.blk-bubble .who { font-size: 12px; color: var(--text-mute); margin-bottom: 3px }
.blk-bubble .bub { padding: 9px 13px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); animation: bubIn .26s var(--ease) }
.blk-bubble.right .bub { background: var(--grad); color: #fff; border-color: transparent }
@keyframes bubIn { from { opacity: 0; transform: translateY(6px) scale(.98) } to { opacity: 1; transform: none } }
.blk-timeline { border-left: 2px solid var(--line); padding-left: 18px; margin: 14px 0 }
.tl-item { position: relative; margin-bottom: 14px }
.tl-dot { position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary) }
.blk-collapse summary { cursor: pointer; padding: 10px 12px; border-radius: var(--r-btn); background: var(--panel); border: 1px solid var(--line) }
.blk-collapse .body { padding: 12px }
.blk-linkcard { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--panel) }
.blk-linkcard img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px }
.blk-divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0 }
.blk-latex { font-family: var(--f-serif); text-align: center; padding: 10px; overflow: auto }
.canvas-stage { position: relative; width: 100%; overflow: auto; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; border-radius: var(--r-card); border: 1px solid var(--line) }
.canvas-item { position: absolute; cursor: move }
.canvas-item.selected { outline: 2px solid var(--primary); outline-offset: 2px }
/* 个人主页 */
.profile-page { max-width: 860px; margin: 0 auto }
.pf-head { display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); margin-bottom: 20px }
.pf-avatar img, .pf-avatar span { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 30px; font-weight: 700 }
.pf-sec { margin-bottom: 22px }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px }
.pf-card { padding: 12px; border-radius: var(--r-card); background: var(--panel); border: 1px solid var(--line); transition: transform var(--dur) var(--ease) }
.pf-card:hover { transform: translateY(-3px) }
.pf-card img, .pf-card .ph { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: var(--panel-2); display: block }
.pf-files { list-style: none; padding: 0 }
.pf-files li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px }
/* 编辑器 */
.editor { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start }
.editor .blocks-panel { position: sticky; top: 12px }
.block-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--panel); margin-bottom: 8px; cursor: grab }
.block-item .handle { color: var(--text-mute); margin-right: 6px }
/* 低动效偏好：关闭全部动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important }
  .breathe, .pulse, .support-fab, .tpl-tech .tech-grid { animation: none !important }
}
/* 低端机降级：关闭模糊与粒子（由 JS 追加 data-lowend） */
html[data-lowend="1"] .bg-img { filter: none !important }
html[data-lowend="1"] .bg-particles { display: none }
html[data-lowend="1"] .modal, html[data-lowend="1"] .card { backdrop-filter: none }
/* 移动端 */
@media (max-width: 680px) {
  .editor { grid-template-columns: 1fr }
  .editor .blocks-panel { position: static; display: flex; gap: 8px; overflow: auto }
  .pf-head { flex-direction: column; text-align: center }
  .gal-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) }
}


/* ==== 动效体系 V2（现代感微交互 · 全站统一 · 支持低端机与 prefers-reduced-motion 降级）==== */
:root {
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-smooth: cubic-bezier(.4, 0, .2, 1);
  --t-fast: .16s; --t-base: .26s; --t-slow: .42s;
  --lift: 0 6px 18px rgba(6, 182, 212, .12), 0 2px 6px rgba(0, 0, 0, .08);
  --lift-strong: 0 14px 34px rgba(6, 182, 212, .18), 0 4px 12px rgba(0, 0, 0, .12);
}
/* 统一过渡基线：交互元素一律有反馈 */
.btn, .card, .input, textarea, select, a, .chip, .tag, .tab, .nav-item, .menu-item,
.ts-item, .ae-btn, .list-item, .file-row, .track, .room, .product, .sk-card, .badge, .avatar {
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              background-color var(--t-fast) var(--ease-smooth),
              border-color var(--t-fast) var(--ease-smooth),
              color var(--t-fast) var(--ease-smooth),
              opacity var(--t-base) var(--ease-out);
}
/* 按钮：悬浮抬升 + 按下回弹 */
.btn { will-change: transform; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--lift); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: none; transition-duration: .06s; }
.btn.primary:hover { box-shadow: var(--lift-strong); filter: saturate(1.12) brightness(1.04); }
/* 卡片：悬浮抬升 + 边框微光 */
.card:hover { transform: translateY(-3px); box-shadow: var(--lift); border-color: rgba(6, 182, 212, .38); }
/* 输入框：聚焦光环 */
.input:focus, textarea:focus, select:focus {
  outline: none; transform: translateY(-1px);
  border-color: rgba(6, 182, 212, .85);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, .14), var(--lift);
}
/* 可见焦点环（键盘可访问性） */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid rgba(6, 182, 212, .9); outline-offset: 2px; border-radius: 8px;
}
/* 导航链接：下划线滑入 */
.mn-link, .nav-item, .tab, .ts-item { position: relative; }
.mn-link::after, .tab::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; width: 72%; height: 2px;
  background: linear-gradient(90deg, #06B6D4, #8B5CF6); border-radius: 2px;
  /* 性能红线：只动画 transform/opacity（不用 width，避免触发重排） */
  transform: translateX(-50%) scaleX(0); transform-origin: center;
  opacity: 0; transition: transform var(--t-base) var(--ease-out), opacity var(--t-base) var(--ease-out);
}
.mn-link:hover::after, .mn-link.on::after, .tab:hover::after, .tab.on::after {
  transform: translateX(-50%) scaleX(1); opacity: 1;
}
.mn-link:hover, .nav-item:hover, .tab:hover { transform: translateY(-1px); }
/* 列表项：悬浮左移高亮 */
.list-item:hover, .file-row:hover, .track:hover, .room:hover, .product:hover {
  transform: translateX(3px); background-color: rgba(6, 182, 212, .06);
}
/* 图片：悬浮轻缩放（画廊/封面） */
.gal-grid img, .card img, .cover img, .pf-cover img {
  transition: transform var(--t-slow) var(--ease-out), filter var(--t-slow) var(--ease-out);
}
.gal-grid img:hover, .card img:hover, .cover:hover img { transform: scale(1.045); filter: saturate(1.08); }
/* 入场：视图切换 */
.view-enter { animation: viewIn var(--t-slow) var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px) scale(.994); } to { opacity: 1; transform: none; } }
/* 入场：卡片错峰浮现（stagger，最多 12 个） */
.card, .sk-card { animation: cardIn var(--t-slow) var(--ease-out) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.card:nth-child(2), .sk-card:nth-child(2) { animation-delay: .045s }
.card:nth-child(3), .sk-card:nth-child(3) { animation-delay: .09s }
.card:nth-child(4) { animation-delay: .135s }
.card:nth-child(5) { animation-delay: .18s }
.card:nth-child(6) { animation-delay: .225s }
.card:nth-child(7) { animation-delay: .27s }
.card:nth-child(8) { animation-delay: .315s }
.card:nth-child(9) { animation-delay: .36s }
.card:nth-child(10) { animation-delay: .405s }
.card:nth-child(11) { animation-delay: .45s }
.card:nth-child(12) { animation-delay: .495s }
/* 弹窗/抽屉：缩放淡入 + 背景虚化渐显 */
.modal, .dialog, .drawer, .sheet { animation: popIn var(--t-base) var(--ease-spring) both; }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
.modal-mask, .overlay, .mask { animation: fadeIn var(--t-base) var(--ease-smooth) both; backdrop-filter: blur(3px); }
/* 提示条：滑入 + 轻弹 */
.toast-root > * { animation: toastIn var(--t-base) var(--ease-spring) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
/* 进度条：流动条纹 */
.progress > *, .bar > *, progress::-webkit-progress-value {
  background-image: linear-gradient(115deg, rgba(255,255,255,.28) 25%, transparent 25%, transparent 50%,
    rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%, transparent 75%, transparent);
  background-size: 22px 22px; animation: stripes 1.1s linear infinite;
}
@keyframes stripes { to { background-position: 22px 0; } }
/* 涟漪点击反馈（.ripple 元素） */
.ripple { position: relative; overflow: hidden; }
.ripple::after {
  content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%),
    rgba(255, 255, 255, .45) 0%, transparent 62%);
  opacity: 0; transform: scale(.4); transition: opacity .5s var(--ease-out), transform .55s var(--ease-out);
  pointer-events: none;
}
.ripple:active::after { opacity: 1; transform: scale(1.5); transition-duration: .08s; }
/* 滚动显现（由 lib.js 的 IntersectionObserver 添加 .in） */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
/* 徽标/头像：呼吸与弹入 */
.badge, .avatar { animation: bubIn var(--t-slow) var(--ease-spring) both; }
/* 未登录全局入口（跨 10 套主题布局） */
.auth-entry {
  position: fixed; right: 18px; bottom: 18px; z-index: 900; display: flex; gap: 8px;
  padding: 8px; border-radius: 999px; background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(6, 182, 212, .28); box-shadow: var(--lift-strong);
  backdrop-filter: blur(12px) saturate(1.2); animation: fab var(--t-slow) var(--ease-spring) both;
}
html[data-theme="cyberdark"] .auth-entry, html[data-theme="immersive"] .auth-entry {
  background: rgba(16, 20, 28, .82); border-color: rgba(6, 182, 212, .4);
}
.auth-entry.on-login { opacity: .55; transform: scale(.94); }
.auth-entry.on-login:hover { opacity: 1; transform: none; }
@keyframes fab { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
.ae-btn { border-radius: 999px; padding: 8px 18px; font-weight: 600; }
/* 骨架屏微光（已有 shimmer，补充渐变位移） */
.sk-line, .sk-card, .sk-logo { position: relative; overflow: hidden; }
.sk-line::after, .sk-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: translateX(-100%); animation: shimmer 1.35s var(--ease-smooth) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
/* 表格行悬浮 */
tr:hover td { background-color: rgba(6, 182, 212, .05); }
/* 低端机与用户偏好：全面降级（保留可用性，去掉位移与模糊） */
html[data-lowend="1"] .card, html[data-lowend="1"] .btn,
html[data-lowend="1"] .list-item, html[data-lowend="1"] .gal-grid img { transition: none !important; animation: none !important; }
html[data-lowend="1"] .card:hover, html[data-lowend="1"] .btn:hover { transform: none !important; box-shadow: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .card:hover, .btn:hover, .list-item:hover { transform: none !important; }
}
/* ==== 动效体系 V2 结束 ==== */


/* ==== 移动端通用外壳 V1（对全部主题生效，修复"桌面布局塞进手机"）====
   问题来源：侧栏在窄屏挤占横向空间、桌面表格列被压到重叠、触控目标过小、内容右侧大片空白 */
html, body { overflow-x: hidden; max-width: 100% }
#app, .app-root { max-width: 100%; overflow-x: hidden }
@media (max-width: 820px) {
  /* 1) 桌面侧栏/导航轨一律隐藏（各主题类名逐一枚举，不用通配以免误伤） */
  .db-rail, .db-menu, .mz-rail, .mz-railh, .sd-side, .tl-rail, .bz-nav,
  .cy-termbar, .ms-toolbar, .sd-inlinebar { display: none !important }
  /* 2) 主内容区取消侧栏留白，占满整宽，消除右侧空白 */
  .db-grid3, .mz-grid, .ms-list, .cd-grid, .bz-pagehead, .mn-main,
  [class$="-main"], [class$="-content"], [class$="-body"] {
    margin-left: 0 !important; padding-left: 12px !important; padding-right: 12px !important;
    max-width: 100% !important; width: 100% !important;
  }
  /* 3) 多栏栅格塌成单列（保留卡片流式排列，不强行 1fr 破坏宫格） */
  .db-grid3, .mz-grid, .cd-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)) !important; gap: 10px !important }
  /* 4) 桌面表格：横向滚动 + 吸顶表头，不再把列压到重叠 */
  .bz-table, .cy-table, .db-table, .mz-table, .mz-railtable, .sd-table, table {
    display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch;
    white-space: nowrap; max-width: 100%;
  }
  .bz-table thead th, .cy-table thead th, .db-table thead th, .mz-table thead th,
  .sd-table thead th, table thead th { position: sticky; top: 0; z-index: 2 }
  .bz-table td, .cy-table td, .db-table td, .mz-table td, .sd-table td, table td { padding: 11px 12px !important }
  /* 5) 触控目标 ≥44px（导航项、按钮、图标按钮、列表行） */
  .mn-link, .bz-navitem, .db-menu a, .mz-rail a, .tl-rail a, .cd-tabbar a, .cd-tabbar button,
  .btn, .btn-icon, .tab, .tab-item, .chip, .list-item, .mn-row, .file-row {
    min-height: 44px; display: inline-flex; align-items: center;
  }
  .mn-row, .list-item, .file-row { display: flex; width: 100% }
  .btn-icon, .tab, .tab-item { min-width: 44px; justify-content: center }
  /* 6) 长文本不撑破窄屏 */
  .mn-row a, .list-item b, .file-row b, td, th { overflow-wrap: anywhere; max-width: 78vw }
  /* 7) 卡片间距与内边距收紧，避免窄屏拥挤 */
  .card { border-radius: 14px !important; margin-bottom: 10px }
  .pf-head, .editor, .gal-grid { padding: 12px !important }
  /* 8) 底部安全区（刘海屏/手势条） */
  body { padding-bottom: calc(var(--safe-b) + 8px) }
}
/* 极窄屏（≤380px）再降一档字号，保证不溢出 */
@media (max-width: 380px) {
  body { font-size: 14px }
  .mn-title, h1 { font-size: 24px !important }
  .kpis, .db-grid3 { grid-template-columns: 1fr !important }
}
/* ==== 移动端通用外壳 V1 结束 ==== */


/* ==== 加载态与错误态（全站通用，与主题无关）==== */
.cp-skel { padding: 22px 18px 40px; display: flex; flex-direction: column; gap: 14px; max-width: 1180px; margin: 0 auto }
.cp-skel .sk { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s var(--ease) infinite; border-radius: var(--r-btn); border: 1px solid var(--line) }
.cp-skel .sk-hero { height: 132px; border-radius: var(--r-card) }
.cp-skel .sk-grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px }
.cp-skel .sk-k { height: 92px; border-radius: var(--r-card) }
.cp-skel .sk-block { height: 168px; border-radius: var(--r-card) }
.cp-skel .sk-block.short { height: 74px }
.cp-skel .sk-tip2 { text-align: center; color: var(--text-mute); font-size: 12.5px; font-family: var(--f-mono); margin: 4px 0 0 }
.cp-errcard { max-width: 460px; margin: 64px auto; padding: 30px 26px; text-align: center; border-radius: var(--r-card);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-2); animation: cpUp .32s var(--ease) both }
.cp-erric { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 22px; color: var(--err); background: color-mix(in srgb, var(--err) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--err) 34%, transparent) }
.cp-errcard h2 { font-size: 18px; margin: 0 0 8px }
.cp-erract { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap }
@media (max-width: 820px) { .cp-skel { padding: 14px 12px 32px } .cp-skel .sk-hero { height: 96px } .cp-errcard { margin: 32px 14px } }
@media (prefers-reduced-motion: reduce) { .cp-skel .sk { animation: none } }
