/* Fei · 内页统一皮肤
   与首页共用蓝白配色、白色工具条顶栏、简约卡片（8px 圆角，无窗口装饰）。
   本文件在 Joe 全部样式之后加载，只做覆盖，不改原主题文件里的 DOM 与脚本。
   昼夜判断沿用主题同一把 data-night 钥匙，首页切夜间后进内页不会跳回白天。 */

/* ============ 1. 配色变量：Joe 草绿 → 首页蓝白 ============ */
html {
  --theme: #bfd818;          /* 青柠绿主色（与首页同一套色板） */
  --background: #ffffff;
  --main: #1e1e26;
  --routine: #54545f;
  --minor: #8b8a97;
  --seat: #ded9ea;
  --classA: #e4e0ef;
  --classB: #efecf6;
  --classC: #f5f4fa;
  --classD: #faf9fd;
  --radius-wrap: 14px;
  --radius-inner: 8px;
  --box-shadow: 0 10px 30px rgba(30, 30, 38, .08);
  --theme-deep: #6b8105;     /* 深橄榄：链接 / 小字 */
  --theme-soft: #f3fad2;
  --theme-faint: #f9fcee;
  --card: #ffffff;
  --card-bd: #e7e4ef;
  --ink: #1e1e26;
  --ink-2: #54545f;
  --ink-3: #8b8a97;
  --line: #efecf6;
  --shadow: 0 1px 2px rgba(30, 30, 38, .05);
  --accent: #f92e50;
  --accent-deep: #cf1236;
  --accent-soft: #ffe4e9;
  --mint: #b0f3f9;
  --mint-deep: #1c7c90;
  --lemon-deep: #8a7a04;
  --fei-bg: #f1f0f5;
  --fei-card: rgba(255, 255, 255, .90);
  --fei-card-bd: rgba(255, 255, 255, .92);
  --fei-ink: #1e1e26;
  --fei-ink-2: #54545f;
  --fei-ink-3: #8b8a97;
  --fei-line: #efecf6;
}
html[data-night=night] body, html[data-night=night] {
  --theme: #cfe81f;
  --background: #1d1d25;
  --main: #ecebf3;
  --routine: #b0aec0;
  --minor: #7a7889;
  --seat: #3b3947;
  --classA: #35333f;
  --classB: #2a2833;
  --classC: #232129;
  --classD: #1e1c24;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, .36);
  --theme-deep: #e2f36a;
  --theme-soft: rgba(207, 232, 31, .15);
  --theme-faint: rgba(207, 232, 31, .07);
  --card: #1d1d25;
  --card-bd: rgba(255, 255, 255, .08);
  --ink: #ecebf3;
  --ink-2: #b0aec0;
  --ink-3: #7a7889;
  --line: rgba(255, 255, 255, .08);
  --shadow: 0 1px 2px rgba(0, 0, 0, .30);
  --accent: #ff5a75;
  --accent-deep: #ff8298;
  --accent-soft: rgba(255, 90, 117, .15);
  --mint: #9feded;
  --mint-deep: #9feded;
  --lemon-deep: #f0e58e;
  --fei-bg: #14141a;
  --fei-card: rgba(29, 29, 37, .90);
  --fei-card-bd: rgba(255, 255, 255, .09);
  --fei-ink: #ecebf3;
  --fei-ink-2: #b0aec0;
  --fei-ink-3: #7a7889;
  --fei-line: rgba(255, 255, 255, .08);
}

/* ============ 2. 页面底色与字体 ============ */
body {
  background-color: var(--fei-bg) !important;
  background-image:
    radial-gradient(circle at 10% -5%, rgba(202, 225, 22, .14), transparent 38%),
    radial-gradient(circle at 95% 90%, rgba(176, 243, 249, .20), transparent 38%) !important;
  background-attachment: fixed;
  color: var(--fei-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--theme); color: #23280a; }

/* 原 Joe 顶栏 / 页脚保留 DOM（脚本还要用），只做视觉隐藏 */
.joe_header, .joe_footer { display: none !important; }
.joe_container.fei_single { padding-top: 22px; }

/* ============ 3. 顶栏：与首页同一张悬浮卡片条 ============ */
.site-head.fei-page-head {
  flex: 0 0 auto;
  width: calc(100% - 56px) !important;
  max-width: 1184px !important;
  margin: 14px auto 0 !important;
  padding: 14px 20px !important;
  display: flex; align-items: center; gap: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: relative; z-index: 30;
}
/* 站点名不吃 Joe 的链接色，统一用墨色 */
.site-head .brand, .site-head .brand:hover { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--fei-ink); }
.site-head .brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #d9ef42 0%, var(--theme) 55%, #a6bf0d 100%);
  box-shadow: 0 6px 16px rgba(166, 190, 13, .32);
}
.site-head .brand-mark svg { width: 23px; height: 23px; fill: #26300a; }
.site-head .brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.site-head .brand-txt b { font-size: 18px; letter-spacing: .06em; }
.site-head .brand-txt small { font-size: 11px; color: var(--ink-3); letter-spacing: .08em; margin-top: 3px; }
.site-head .site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
.site-head .site-nav a {
  padding: 7px 14px; font-size: 13px; color: var(--ink-2);
  border-radius: 6px; white-space: nowrap; transition: .2s;
}
.site-head .site-nav a:hover, .site-head .site-nav a.active {
  color: var(--theme-deep); background: var(--theme-soft); font-weight: 600;
}
html[data-night=night] .site-head .site-nav a:hover,
html[data-night=night] .site-head .site-nav a:hover,
html[data-night=night] .site-head .site-nav a.active { color: var(--theme-deep); }
.site-head .head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.site-head .icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--card-bd);
  background: var(--card); color: var(--ink-2); transition: .2s;
}
.site-head .icon-btn:hover { transform: translateY(-2px); color: var(--theme-deep); border-color: var(--theme); }
.site-head .icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-head .icon-btn .sun { display: none; }
html[data-night=night] .site-head .icon-btn .moon { display: none; }
html[data-night=night] .site-head .icon-btn .sun { display: block; }
.site-head .search-wrap { position: relative; display: flex; align-items: center; }
.site-head .search-input {
  width: 0; padding: 0; opacity: 0; height: 36px;
  border-radius: 8px; border: 1px solid var(--card-bd);
  background: var(--card); color: var(--ink);
  outline: none; font: inherit; font-size: 13px;
  transition: width .28s ease, padding .28s ease, opacity .2s ease;
}
.site-head .search-wrap.open .search-input { width: 168px; margin-left: 6px; padding: 0 12px; opacity: 1; }
.site-head .subscribe {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 7px;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(249, 46, 80, .24); transition: .2s;
}
html[data-night=night] .site-head .subscribe { background: var(--accent); }
.site-head .subscribe:hover { transform: translateY(-2px); filter: brightness(1.06); }
.site-head .subscribe svg { width: 16px; height: 16px; }
.site-head .subscribe svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.site-head .subscribe svg circle { fill: currentColor; }
.site-head .subscribe b {
  font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, .22); font-variant-numeric: tabular-nums;
}

/* ============ 4. 内容区卡片：简约蓝白 ============ */
.joe_detail, .joe_archive, .joe_comment,
.joe_census__basic, .joe_census__filing, .joe_census__lately,
.joe_wallpaper__list, .joe_post__pagination, .joe_list__item {
  background: var(--fei-card) !important;
  border: 1px solid var(--fei-card-bd) !important;
  border-radius: 8px !important;
  box-shadow: 0 3px 12px rgba(30, 30, 38, .07) !important;
}
html[data-night=night] .joe_detail,
html[data-night=night] .joe_archive,
html[data-night=night] .joe_comment,
html[data-night=night] .joe_census__basic,
html[data-night=night] .joe_census__filing,
html[data-night=night] .joe_census__lately,
html[data-night=night] .joe_wallpaper__list,
html[data-night=night] .joe_post__pagination,
html[data-night=night] .joe_list__item {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28) !important;
}
/* 列表容器本身透明，避免出现「白卡套白卡」 */
.joe_list { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.joe_list__item { overflow: hidden; }
.joe_bread { background: transparent !important; box-shadow: none !important; }
.joe_bread__bread .link, .joe_bread__bread .item { color: var(--fei-ink-3) !important; }
.joe_bread__bread .link:hover { color: var(--theme-deep) !important; }

/* 内容容器：普通卡片，无窗口标题栏、无红黄绿灯 */
.joe_detail, .joe_comment {
  position: relative;
  padding-top: 20px !important;
  background: var(--fei-card) !important;
}

/* 文章标题、正文、元信息跟随蓝白配色 */
.joe_detail__article, .joe_archive__title, .joe_census__basic,
.joe_wallpaper__type-title { color: var(--fei-ink); }
.joe_detail__article h1, .joe_detail__article h2,
.joe_detail__article h3, .joe_detail__article h4 { color: var(--fei-ink); }
.joe_detail__article blockquote {
  border-left: 3px solid var(--accent) !important;
  background: var(--theme-faint) !important;
  color: var(--fei-ink-2) !important;
}
.joe_detail__article a, .joe_archive__list a { color: var(--theme-deep) !important; }
.joe_detail__article img { border-radius: 8px; }

/* 右下角浮动按钮 */
.joe_action_item {
  background: var(--card) !important;
  color: var(--fei-ink-2) !important;
  border: 1px solid var(--card-bd) !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 18px rgba(30, 30, 38, .11) !important;
}
.joe_action_item:hover { color: var(--theme-deep) !important; }

/* ============ 5. 页脚与提示 ============ */
.site-foot.fei-page-foot {
  flex: 0 0 auto;
  width: calc(100% - 56px) !important;
  max-width: 1184px !important;
  margin: 0 auto !important;
  padding: 11px 20px !important;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 11.5px; color: var(--fei-ink-3);
}
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 999;
  transform: translate(-50%, 12px);
  padding: 9px 18px; border-radius: 9px;
  background: var(--ink); color: var(--card); font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(30, 30, 38, .25);
  opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 6. 响应式 ============ */
@media (max-width: 1080px) {
}
@media (max-width: 720px) {
  .site-head.fei-page-head { width: calc(100% - 32px) !important; padding: 12px 14px !important; gap: 10px; flex-wrap: wrap; }
  .site-head .brand-txt b { font-size: 15px; }
  .site-head .site-nav {
    order: 3; width: 100%; margin: 0; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-head .site-nav a { padding: 5px 10px; font-size: 12px; }
  .site-head .subscribe { padding: 0 10px; }
  .site-head .subscribe span { display: none; }
  .site-head .search-wrap.open .search-input { width: 120px; }
  .joe_container.fei_single { padding-top: 14px; }
  .joe_detail, .joe_comment { padding: 18px 14px 14px !important; border-radius: 8px !important; }
  .site-foot.fei-page-foot { width: calc(100% - 32px) !important; padding: 10px 14px !important; }
}

/* ============ 7. 登录按钮 + 后台设置页脚 ============ */
.site-head .login-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--card-bd); border-radius: 8px;
  background: var(--card); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: color .2s, border-color .2s, transform .2s;
}
.site-head .login-btn:hover { color: var(--theme-deep); border-color: var(--theme); transform: translateY(-2px); }
.site-head .login-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-foot.fei-page-foot { display: block; }   /* Joe 把页脚设成了 flex，这里压回块级，内层才能整行铺开 */
.site-foot.fei-page-foot .foot-inner {
  display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%;
}
.site-foot.fei-page-foot .foot-left { min-width: 0; line-height: 1.7; }
/* 后台「自定义侧边栏模块」的代码：紧接左侧文字往后排 */
.site-foot.fei-page-foot .foot-custom {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  min-width: 0; font-size: 11.5px; line-height: 1.6; color: var(--fei-ink-3);
  overflow-wrap: anywhere;
}
.site-foot.fei-page-foot .foot-custom > * { margin: 0 !important; }
.site-foot.fei-page-foot .foot-custom p,
.site-foot.fei-page-foot .foot-custom ul,
.site-foot.fei-page-foot .foot-custom ol { margin: 0 !important; padding: 0 !important; }
.site-foot.fei-page-foot .foot-custom img { max-height: 18px; max-width: 120px; width: auto; display: inline-block; border-radius: 3px; }
/* 备案等外链：每条一个胶囊按钮，整组靠右 */
.site-foot.fei-page-foot .foot-chips {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.site-foot.fei-page-foot .foot-chip {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--theme-faint);
  color: var(--fei-ink-3); font-size: 11px; line-height: 1;
  letter-spacing: .01em; white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.site-foot.fei-page-foot .foot-chip:hover {
  color: var(--theme-deep); border-color: var(--theme);
  background: var(--card); transform: translateY(-1px);
  text-decoration: none;
}
.site-foot.fei-page-foot a { color: var(--theme-deep); }
.site-foot.fei-page-foot a:hover { text-decoration: underline; }
.site-foot.fei-page-foot .foot-chip:hover { text-decoration: none; }
@media (max-width: 720px) {
  .site-head .login-btn { padding: 0 9px; }
  .site-head .login-btn span { display: none; }
  .site-foot.fei-page-foot .foot-inner { flex-wrap: wrap; gap: 4px 8px; }
  .site-foot.fei-page-foot .foot-chips { margin-left: 0; }
}

/* ============ 8. 内页壳层：顶栏 / 页脚常驻，中间正文区固定高度、溢出滚动 ============ */
html, body { height: 100%; }
body { overflow: hidden; }
#Joe {
  height: 100vh;
  height: 100dvh;
  display: flex; flex-direction: column; gap: 12px;
  box-sizing: border-box;
  padding: 0 0 14px;
  overflow: hidden;
}
/* 面包屑：与卡片同宽，固定在正文区上方 */
.joe_container.joe_bread {
  flex: 0 0 auto;
  width: calc(100% - 56px) !important;
  max-width: 1184px !important;
  margin: 0 auto !important;
  padding: 0 2px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
/* 正文区：吃掉顶栏与页脚之间的全部高度，超出的内容在框里滚 */
.joe_container.fei_single {
  flex: 1 1 auto;
  min-height: 0;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  /* 左右留 28px：窄屏就是页边距，宽屏由 .joe_main 的 1184 上限把卡片居中，
     这样卡片宽度、左右边距都跟顶栏那条卡片条对得上 */
  padding: 2px 28px 12px !important;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--card-bd) transparent;
}
.joe_container.fei_single > .joe_main { width: 100%; max-width: 1184px; margin: 0 auto; }
.joe_container.fei_single::-webkit-scrollbar { width: 6px; height: 6px; }
.joe_container.fei_single::-webkit-scrollbar-track { background: transparent; }
.joe_container.fei_single::-webkit-scrollbar-thumb { background: var(--card-bd); border-radius: 8px; }
.joe_container.fei_single::-webkit-scrollbar-thumb:hover { background: var(--theme); }
.joe_container.fei_single::-webkit-scrollbar-thumb:hover { background: var(--theme); }

/* 正文配图：统一缩到 800 × 800 的框里，超出就等比缩小并居中 */
.joe_detail__article img:not(.owo_image) {
  display: block;
  max-width: 800px;
  max-height: 800px;
  width: auto;
  height: auto;
  margin: 18px auto;
  object-fit: contain;
}

/* 回顶按钮让开固定页脚 */
.joe_action { bottom: 96px; right: 26px; }

@media (max-width: 1080px) {
  .joe_container.fei_single { padding-left: 18px !important; padding-right: 18px !important; }
  .joe_container.joe_bread { width: calc(100% - 56px) !important; }
}
@media (max-width: 720px) {
  #Joe { gap: 10px; padding: 0 0 10px; height: 100dvh; }
  .site-head.fei-page-head { width: calc(100% - 32px) !important; margin: 10px auto 0 !important; }
  .site-foot.fei-page-foot { width: calc(100% - 32px) !important; }
  .joe_container.joe_bread { width: calc(100% - 32px) !important; }
  .joe_container.fei_single { padding-left: 16px !important; padding-right: 16px !important; }
  .joe_action { bottom: 108px; right: 14px; }
  .joe_detail__article img:not(.owo_image) { max-width: 100%; max-height: none; }
}

/* 宽屏（卡片被 1184 上限卡住时）：把右侧滚动条那 6px 补到左边，
   卡片左右边距就和顶栏完全对齐，不再有 5px 的错位 */
@media (min-width: 1240px) {
  .joe_container.fei_single { padding-left: 34px !important; }
}
