/* family.css · 片库 / 私影 / 图库 三站共用的一层（2026-11-11）
 *
 * 每个站最后加载这一份，三份内容完全相同（图库那份是拷贝，改这里后同步过去）。
 * 只放“三站都该一样”的东西：字体、中英文混排、滚动条、选中色、焦点、减少动态。
 * 各站自己的配色、版式、组件都不在这里；各站在自己的样式里给出强调色 --fam-acc（不给就是片库的金色）。
 *
 * 字体：
 *   正文 = 西文 Segoe UI Variable / 苹果系统字 + 中文 思源黑体（本机有就用，
 *          没有就落到苹方 / 雅黑 / 系统字）。思源黑体有 Medium 字重，雅黑没有。
 *   标题 = 思源宋体。先找本机装的（local()，不走网络），没有再用各站自己
 *          引入的网络字体，最后落到系统宋体。
 *   字重只用 400 / 500 / 700（标题另有 900），别再写 550、650、780 这类
 *   中文字体里并不存在的字重。
 */
@font-face { font-family: "Fam Serif"; font-weight: 500; font-display: swap;
  src: local("Noto Serif SC Medium"), local("Source Han Serif SC Medium"), local("Songti SC Regular"), local("STSongti-SC-Regular"); }
@font-face { font-family: "Fam Serif"; font-weight: 700; font-display: swap;
  src: local("Noto Serif SC Bold"), local("Source Han Serif SC Bold"), local("Songti SC Bold"), local("STSongti-SC-Bold"); }
@font-face { font-family: "Fam Serif"; font-weight: 900; font-display: swap;
  src: local("Noto Serif SC Black"), local("Source Han Serif SC Heavy"), local("Songti SC Black"), local("STSongti-SC-Black"); }

:root {
  --fam-sans: "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Noto Sans SC", "Source Han Sans SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --fam-serif: "Fam Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  /* 各站原有的变量名都指到这一套上 */
  --font: var(--fam-sans);
  --serif: var(--fam-serif);
  --fam-ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

/* ---- 排版 ---------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  text-autospace: normal;            /* 中文与英文、数字之间自动留一条细缝（Chrome 140+） */
  font-kerning: normal;
  font-optical-sizing: auto;
}
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3 { text-wrap: balance; }   /* 标题折行时两行长度接近，不留孤字 */
p { text-wrap: pretty; }
/* 数字等宽，时长、数量变化时不左右跳 */
time, kbd, [class*="count"], [class*="-len"], [class*="dur"], [class*="num"] { font-variant-numeric: tabular-nums; }

/* ---- 滚动条：细、暗、不抢画面 --------------------------------------------- */
html { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }

/* ---- 选中文字 ------------------------------------------------------------ */
::selection { background: color-mix(in srgb, var(--fam-acc, #d9bb85) 42%, transparent); color: #fff; }

/* ---- 键盘焦点：各站强调色 ------------------------------------------------- */
:focus-visible { outline-color: var(--fam-acc, #d9bb85); }

/* ---- 触感 ---------------------------------------------------------------- */
a, button, summary, label, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, summary, nav, [role="button"], [role="menu"], [role="tablist"] { -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; }      /* 拖动时不带出一张半透明的封面 */
button:not(:disabled), summary, [role="button"] { cursor: pointer; }


/* ======================================================================== *
 * 骨架：三站的顶栏和手机底栏长成一个样（2026-11-11）
 * 各站的类名不同（片库 .top/.tabbar，私影 .bar/.tabs，图库 .topbar/.tabbar），
 * 这里一并列出；颜色只取各站的强调色 --fam-acc。手机断点三站都是 760px。
 * ======================================================================== */
:root {
  --fam-fg: var(--fg, #eeeeee);
  --fam-muted: var(--fg-2, var(--fg2, #a7adb8));
  --fam-dim: var(--dim, var(--fg3, var(--fg-3, #767c86)));
  --fam-tint: color-mix(in srgb, var(--fam-acc, #d9bb85) 15%, rgba(255, 255, 255, .06));
}

/* ---- 顶栏右侧的圆形图标按钮（搜索、随机、眼睛、账户） ---------------------- */
:is(.top .priv, .top .top-ib, .bar .ib, .topbar .icon-btn) {
  width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--fam-muted); transition: background .15s, color .15s, transform .12s;
}
:is(.top .priv, .top .top-ib, .bar .ib, .topbar .icon-btn):active { transform: scale(.94); }
@media (hover: hover) {
  :is(.top .priv, .top .top-ib, .bar .ib, .topbar .icon-btn):hover { background: rgba(255, 255, 255, .08); color: var(--fam-fg); }
}
/* 眼睛：遮挡中 = 强调色图标 + 一点底色 */
:is(.top .priv.on, .bar #privBtn.on, .topbar .privacy-toggle.on) { color: var(--fam-acc, #d9bb85); background: color-mix(in srgb, var(--fam-acc, #d9bb85) 15%, transparent); }

@media (min-width: 761px) {
  /* ---- 导航：分段胶囊，紧跟站名 ---------------------------------------- */
  :is(.top, .bar, .topbar) > .nav { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
  :is(.top, .bar, .topbar) > .nav a {
    position: relative; height: 34px; padding: 0 16px; display: grid; place-items: center; border-radius: 999px;
    font-size: 14px; font-weight: 500; letter-spacing: 0; white-space: nowrap; text-decoration: none; color: var(--fam-muted);
    box-shadow: none; transition: color .15s, background .2s;
  }
  :is(.top, .bar, .topbar) > .nav a::after { display: none; }
  :is(.top, .bar, .topbar) > .nav a:hover { color: var(--fam-fg); }
  :is(.top, .bar, .topbar) > .nav a:is(.on, .active) { color: var(--fam-fg); background: var(--fam-tint); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }

  /* ---- 搜索框：同宽、同高、同圆角 --------------------------------------- */
  :is(.top > .search, .bar > .find) { flex: 0 1 340px; width: auto; max-width: none; margin-left: auto; }
  :is(.top > .search, .bar > .find) input { height: 38px; border-radius: 999px; font-size: 14px; }
}

@media (max-width: 760px) {
  /* ---- 底栏：悬浮的圆角条 ---------------------------------------------- */
  :is(nav.tabbar, nav.tabs) {
    position: fixed; inset: auto 10px calc(10px + env(safe-area-inset-bottom)) 10px; height: auto; padding: 6px;
    border: 1px solid rgba(255, 255, 255, .12); border-radius: 22px;
    background: rgba(18, 18, 22, .82); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  }
  :is(nav.tabbar, nav.tabs) a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 6px 0; border-radius: 16px; font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-decoration: none;
    color: var(--fam-dim); transition: color .2s, background .2s;
  }
  :is(nav.tabbar, nav.tabs) a svg { width: 22px; height: 22px; transform: none; }
  :is(nav.tabbar, nav.tabs) a:is(.on, .active) { color: var(--fam-fg); background: var(--fam-tint); }
  :is(nav.tabbar, nav.tabs) a:is(.on, .active) svg { color: var(--fam-acc, #d9bb85); }
}

/* ======================================================================== *
 * 遮挡状态：每次打开都是它，所以按“正式的一屏”来做
 * 封面统一成偏暗、去色的磨砂块（不再是一片鲜艳的色团），标题是同一种轻模糊；
 * 大图中间放同一句提示。各站只管“哪些元素要遮”，遮成什么样看这里。
 * ======================================================================== */
:root {
  --fam-veil: blur(26px) saturate(.5) brightness(.58);
  --fam-veil-text: blur(max(7px, .45em));   /* 随字号加大：30px 以上的大标题用 7px 还能隐约认出字 */
}
/* 片库首页大图、私影“随手翻翻”大图（图库的提示是它自己页面里的元素，样子一致） */
body.privacy :is(.hero-art, .pk-art)::after {
  content: '已模糊 · 点右上角显示'; position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%);
  padding: 9px 16px 9px 38px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .38) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-opacity='.85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.6 5.1A10 10 0 0 1 12 5c6.4 0 10 7 10 7a17 17 0 0 1-3.2 4.1M6.6 6.6C3.6 8.6 2 12 2 12s3.6 7 10 7a9.7 9.7 0 0 0 5.4-1.6M9.9 9.9a3 3 0 0 0 4.2 4.2M3 3l18 18'/%3E%3C/svg%3E") 14px 50% / 16px 16px no-repeat;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 500 13px/1.2 var(--fam-sans); letter-spacing: .04em; color: rgba(255, 255, 255, .85); white-space: nowrap; pointer-events: none;
}
@media (max-width: 900px) {
  body.privacy :is(.hero-art, .pk-art)::after { top: 22%; }
}

/* 站名永远是一行：顶栏挤的时候（中等宽度的窗口）收缩的是搜索框，不是把“私影”折成上下两个字。 */
:is(.top, .bar, .topbar) > .brand { flex: none; white-space: nowrap; }

/* 761–1180px（半屏的窗口、平板横屏）：顶栏仍要放得下全部东西。导航收紧、间距收小；
 * 再窄一档（≤ 960px）字号也小一号。之前只测了 2000px 和手机，这一段右边的按钮会被挤出屏幕。 */
@media (min-width: 761px) and (max-width: 1180px) {
  :is(.top, .bar, .topbar) { gap: 14px; }
  :is(.top, .bar, .topbar) > .nav a { padding: 0 11px; }
}
@media (min-width: 761px) and (max-width: 960px) {
  :is(.top, .bar, .topbar) { gap: 10px; padding-inline: 18px; }
  :is(.top, .bar, .topbar) > .nav a { padding: 0 9px; font-size: 13.5px; }
}
