/* ==========================================================================
   海角社区 · 前端重构样式
   设计取向：深色底 + 海角蓝强调色（取自 logo #1ea0f8） + 克制的留白节奏
   ========================================================================== */

/* Content card tags only; full detail tags and filter controls retain their layouts. */
html body.reskin-app :is(.video-card-tags, .anime-card-tags, .gossip08__tags, .article09-card-tags, .tag-category14__tags, .tag13-tags, .hj-blogger-profile__category, .s15-card-tags, .card__tags, .not-found27__tags) {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
html body.reskin-app :is(.video-card-tags, .anime-card-tags, .gossip08__tags, .article09-card-tags, .tag-category14__tags, .tag13-tags, .hj-blogger-profile__category, .s15-card-tags, .card__tags, .not-found27__tags) > * {
  flex: 0 0 auto;
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: visible;
  text-overflow: clip;
}

:root {
  /* 色板：不用纯黑，#0b0b0f 更有层次，缩略图边缘不会糊成一片 */
  --bg:         #0b0b0f;
  --bg-elev:    #141419;
  --surface:    #17171e;
  --surface-2:  #1e1e27;
  --line:       rgba(255, 255, 255, .07);
  --line-strong:rgba(255, 255, 255, .14);

  --text:       #f4f4f6;
  --text-dim:   #c2c2cc;
  --text-faint: #9a9aa8;
  --control-border: #6b6b7c;
  --button-bg:  #1476cc;
  --button-hover: #126ab8;

  --brand:      #1ea0f8;
  --brand-soft: #5cc2ff;
  --brand-glow: rgba(30, 160, 248, .35);
  --accent:     #ffb03a;

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;

  --gap:        18px;
  --shell:      1440px;
  --header-h:   64px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景上方的一层极淡辉光，避免整页死黑 */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  background: radial-gradient(72% 100% at 50% 0%, rgba(30, 160, 248, .13), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* 排序标题保留 H2 语义，按钮沿用各栏目 Tab 样式。 */
.channel-sort-heading { margin: 0; font: inherit; }

/* 点击高亮：移动端和部分桌面浏览器会在点中的元素上盖一层方块高亮 */
a, button, input, [role="button"] { -webkit-tap-highlight-color: transparent; }
/* 鼠标点击后残留的焦点环去掉，键盘 Tab 的焦点环保留（下面的 :focus-visible） */
:focus:not(:focus-visible) { outline: none; }

:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 3px; border-radius: 4px; }
/* The legacy a:focus!important must not erase keyboard navigation feedback. */
.reskin-app a:focus-visible { outline: 2px solid var(--brand-soft) !important; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: clamp(12px, 3vw, 28px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 跳到主内容：无障碍 + 搜索引擎都吃这一套 */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(11, 11, 15, .72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  min-height: var(--header-h);
  display: flex; align-items: center; flex-wrap: wrap;
  gap: clamp(8px, 1.4vw, 18px);
}

.logo { display: flex; align-items: center; flex-shrink: 0; }
/* 高度定死、宽度按比例，换图只要保持 91:47 左右的比例就不用改 CSS */
.logo__img { display: block; height: 30px; width: auto; }   /* header 高 64px；横版字标 662×160，30px 高约 124px 宽 */
.logo__img--footer { height: 34px; }
@media (max-width: 719px) { .logo__img { height: 24px; } }

/* 搜索 */
/* 和导航同排时占满剩余空间，导航增减项目都不会在中间留空；
   窄屏导航换到第二行后，第一排只剩 logo+搜索+按钮，再限宽免得拉成一长条 */
.search { flex: 1 1 180px; min-width: 0; margin-left: auto; position: relative; }
@media (max-width: 1519px) { .search { max-width: 520px; } }
.search__input {
  width: 100%; height: 40px; padding: 0 92px 0 40px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.search__input::placeholder { color: var(--text-faint); }
.search__input:focus { background: var(--surface-2); border-color: var(--line-strong); outline: none; }
.search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
/* 不用高亮填充：header 里同时出现两三个实心粉按钮会互相抢，反而看不出重点 */
.search__btn {
  position: absolute; right: 4px; top: 4px; height: 32px; padding: 0 18px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--text-dim); background: var(--surface-2);
  border: 1px solid var(--line-strong);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.search__btn:hover { color: #fff; border-color: var(--brand); background: var(--surface); }

.header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.reskin-account-actions { display: flex; align-items: center; }
.reskin-account-link { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); font-size: 14px; font-weight: 600; transition: border-color .18s var(--ease); }
.reskin-account-link:hover { border-color: var(--brand); color: var(--text); }
.reskin-account-avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; overflow: hidden; border-radius: 50%; background: var(--surface-2); }
.reskin-account-link .my-user-avatar { width: 100%; height: 100%; margin: 0 !important; object-fit: cover; }
.reskin-account-name { min-width: 0; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reskin-account-go { margin-left: auto; color: var(--text-faint); font-size: 13px; font-weight: 500; }
@media (max-width: 719px) { .reskin-header .reskin-account-actions { display: none; } }


/* 搜索框已经在栏里了，桌面端不需要再放一个放大镜；
   窄屏搜索框隐藏，放大镜直接跳搜索页（app.js 的 goSearch） */
#btn-search-toggle { display: none; }
@media (max-width: 719px) { #btn-search-toggle { display: grid; } }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text-dim); border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.btn-menu { display: none; }

/* ==========================================================================
   主导航
   ========================================================================== */

/* 主导航现在和 logo 同排，在 header 内部 */
.nav { min-width: 0; }
.nav__list { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav__list::-webkit-scrollbar { display: none; }
.nav__link {
  display: flex; align-items: center; height: var(--header-h);
  padding: 0 clamp(9px, 1vw, 14px); font-size: 15px; font-weight: 500;
  color: var(--text-dim); white-space: nowrap; position: relative;
  transition: color .2s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link[aria-current="page"] { color: var(--text); font-weight: 700; }
/* 下划线贴在 header 底边上 */
.nav__link[aria-current="page"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand), #38d0ff); border-radius: 2px 2px 0 0;
}

/* 十个导航 + logo + 搜索框（留够 ~260px）+ 登录注册一行需要约 1520px；不够就让导航换到第二行占满宽度 */
@media (max-width: 1519px) {
  .nav { order: 10; flex-basis: 100%; border-top: 1px solid var(--line); }
  .nav__link { height: 44px; }
}
/* 手机端有汉堡抽屉，抽屉里就是同一份导航，横排那行是重复的 */
@media (max-width: 719px) { .nav { display: none; } }

/* 图标下面的文字标签只在手机端出现 */
.icon-btn__label { display: none; }

@media (max-width: 719px) {
  /* 手机头三段式：左「导航」、中 logo、右「搜索」，两侧等宽 logo 才真正居中 */
  .header__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
  .btn-menu { justify-self: start; }
  .logo { justify-self: center; }
  .header__actions { justify-self: end; }
  /* 登录/注册挪到抽屉里，三段式才立得住 */
  .header__actions .auth-btn { display: none; }

  .icon-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    width: auto; height: auto; padding: 4px 8px; border-radius: 10px;
  }
  .icon-btn__label { display: block; font-size: 11px; line-height: 1; color: var(--text-dim); }
  .icon-btn:hover .icon-btn__label { color: var(--text); }
}

/* 公共分区与卡片 */

.section { margin-bottom: clamp(34px, 5vw, 56px); position: relative; z-index: 1; }

.section__head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.section__title { white-space: nowrap; }
.section__title {
  margin: 0; font-size: clamp(17px, 2vw, 21px); font-weight: 750; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.section__title::before {
  content: ""; width: 4px; height: 19px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), #38d0ff);
}
.section__sub {
  color: var(--text-faint); font-size: 13px; padding-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
@media (max-width: 719px) { .section__sub { display: none; } }
.section__more {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 13px; color: var(--text-dim);
  transition: color .2s var(--ease), gap .2s var(--ease);
}
.section__more:hover { color: var(--brand-soft); gap: 8px; }

/* 卡片网格：移动 2 列，逐级放大到 5 列 */
/* 固定 4 列 × 2 排 = 8 条。中间不设 3 列档，否则 8 条会排成 2 排半 */
.reskin-main .grid:not([class*="grid-cols-"]) {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) { .reskin-main .grid:not([class*="grid-cols-"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ==========================================================================
   视频卡片
   ========================================================================== */

.card { position: relative; }
.card__link { display: block; }

.thumb {
  --h: 330;                       /* 由 data.js 的 hue 注入，占位图各不相同 */
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); background: var(--surface-2);
  background-image:
    radial-gradient(60% 70% at 15% 18%, hsl(var(--h) 62% 34% / .60), transparent 60%),
    radial-gradient(55% 65% at 82% 28%, hsl(calc(var(--h) + 55) 58% 30% / .48), transparent 62%),
    radial-gradient(70% 80% at 55% 100%, hsl(calc(var(--h) - 35) 50% 22% / .55), transparent 65%),
    linear-gradient(140deg, hsl(var(--h) 26% 14%) 0%, hsl(calc(var(--h) + 45) 24% 10%) 100%);
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.thumb::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .25s var(--ease);
  pointer-events: none;
}
.card__link:hover .thumb img { transform: scale(1.06); }
.card__link:hover .thumb::after { box-shadow: inset 0 0 0 1px rgba(30, 160, 248, .55); }

/* 悬停时浮出的播放键 */
.thumb__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(8, 8, 12, .34); opacity: 0;
  transition: opacity .25s var(--ease);
}
.thumb__play span {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(30, 160, 248, .92); color: #fff;
  transform: scale(.82); transition: transform .25s var(--ease);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.card__link:hover .thumb__play { opacity: 1; }
.card__link:hover .thumb__play span { transform: scale(1); }

/* 角标 */
.badge {
  position: absolute; z-index: 2; font-size: 11px; line-height: 1;
  padding: 4px 7px; border-radius: 6px; font-weight: 600;
  background: rgba(6, 6, 9, .78); backdrop-filter: blur(4px); color: #fff;
}
.badge--time { right: 7px; bottom: 7px; font-variant-numeric: tabular-nums; }
.badge--hd   { left: 7px; top: 7px; background: rgba(255, 255, 255, .92); color: #14141a; }   /* 文案「视频」 */
.badge--hot  { left: 7px; top: 7px; background: linear-gradient(135deg, var(--brand), #38d0ff); }

.card__title {
  margin: 10px 0 8px; font-size: 14px; font-weight: 550; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .2s var(--ease);
}
.card__link:hover .card__title { color: var(--brand-soft); }

.card__meta { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 12px; }

/* 卡片下方的标签：独立于卡片链接之外，避免 <a> 套 <a> */
.card__tags {
  margin: 0; display: flex; gap: 6px;
  white-space: nowrap; overflow: hidden;   /* 固定一行，保证各卡片等高 */
}
.card__tags a {
  flex: 0 0 auto;
  padding: 3px 9px; border-radius: 6px; font-size: 11.5px; line-height: 1.5;
  color: var(--text-faint); background: var(--surface); border: 1px solid var(--line);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.card__tags a:hover {
  color: #fff; background: rgba(30, 160, 248, .14); border-color: rgba(30, 160, 248, .45);
}
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ==========================================================================
   Footer
   ========================================================================== */

/* 上方栏目本身已有 56px 下边距，页脚顶部再来 44px 就太空了 */
.footer { border-top: 1px solid var(--line); background: var(--bg-elev); padding: clamp(16px, 1.8vw, 22px) 0 22px; position: relative; z-index: 1; }
.footer__grid { display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }

.footer__brand p { color: var(--text-faint); font-size: 13px; max-width: 40ch; margin: 12px 0 0; }
.footer__col .footer__title { margin: 0 0 12px; font-size: 14px; font-weight: 650; color: var(--text); }
.footer__col li { margin-bottom: 8px; }
.footer__col a { color: var(--text-dim); font-size: 14px; transition: color .18s var(--ease); }
.footer__col a:hover { color: var(--brand-soft); }

.footer__bottom {
  margin-top: clamp(24px, 3vw, 34px); padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  color: var(--text-faint); font-size: 13px;
}
.footer__age {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--brand); color: var(--brand-soft); font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

.drawer {
  position: fixed; inset: 0 auto 0 0; width: min(78vw, 300px); z-index: 120;
  background: var(--bg-elev); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .3s var(--ease);
  padding: 18px; overflow-y: auto;
}
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
/* 只作用于导航链接，不要波及抽屉头部的 logo */
.drawer nav a {
  display: block; padding: 12px 14px; border-radius: 10px; margin-bottom: 6px;
  background: var(--surface); font-weight: 550;
}
.drawer nav a:hover { background: var(--surface-2); color: var(--brand-soft); }
.scrim {
  position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
  backdrop-filter: blur(2px);
}
.scrim.is-on { opacity: 1; visibility: visible; }

.auth-btn {
  height: 36px; padding: 0 16px; border-radius: 999px; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: var(--text-dim);
  background: transparent; border: 1px solid var(--line-strong);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.auth-btn:hover { color: #fff; border-color: var(--brand); }
/* 注册和登录同样式，不做实心高亮 */
.auth-btn--primary { color: var(--text-dim); }

/* 窄屏放不下两个按钮，只留「登录」，弹窗里照样能切到注册 */
@media (max-width: 719px) {
  .header__actions .auth-btn--primary { display: none; }
  .header__actions .auth-btn { height: 32px; padding: 0 12px; font-size: 13px; }
}
.drawer__auth { display: flex; gap: 8px; margin-top: 14px; }
.drawer__auth .auth-btn { flex: 1; height: 40px; }


/* Bridge the existing theme utilities without changing data or plugin contracts. */
:root {
  --color-primary: var(--brand); --dx-primary-color: var(--brand);
  --color-base1: var(--bg-elev); --color-base2: var(--surface); --color-base3: var(--surface);
  --color-base4: var(--surface-2); --color-base5: var(--line); --color-base6: var(--surface-2);
  --color-font: var(--text); --color-font1: var(--text-dim); --color-font2: var(--text-faint);
  --dx-base3-color: var(--surface-2); --dx-header-height: 108px;
}
body.reskin-app { position: static; width: auto; min-width: 0; padding-top: 0; background: var(--bg); color: var(--text); }
/* Let body overflow propagate to the viewport, as in the design's normal document flow. */
html:has(body.reskin-app) { overflow: visible; scrollbar-gutter: auto; }
html.reskin-menu-open:has(body.reskin-app), html.modal-open:has(body.reskin-app) { overflow: hidden; }
html.modal-open.reskin-auth-gutter:has(body.reskin-app) { scrollbar-gutter: stable; }
/* Undo legacy universal declarations while allowing explicit page utilities to win. */
:where(.reskin-app) * { font-family: inherit; }
:where(.reskin-app) svg { color: inherit; }
html:has(body.reskin-app)::-webkit-scrollbar,
body.reskin-app::-webkit-scrollbar,
:where(.reskin-app) ::-webkit-scrollbar { width: auto; height: auto; }
.reskin-app .bg-white { background-color: var(--surface); }
.reskin-app .dx-container { max-width: var(--shell); width: 100%; margin-inline: auto; padding-inline: clamp(12px,3vw,28px); }
.reskin-app .reskin-header { height: auto; position: sticky; width: 100%; top: 0; padding: 0; z-index: 90; }
.reskin-header .app-header { height: auto; padding-block: 0; position: relative; background: transparent; }
.reskin-header .nav { display: flex; overflow-x: auto; scrollbar-width: none; }
.reskin-header .nav__link { flex-shrink: 0; }
.reskin-header .search-box { margin: 0 0 0 auto; max-width: none; width: auto; }
.reskin-search-field { position: relative; width: 100%; }
.reskin-header .search__input { display: block; padding-left: 40px; box-shadow: none; }
.reskin-header .reskin-search-link { display: block; color: inherit; text-decoration: none; border-radius: 999px; }
.reskin-header .reskin-search-link .search__input {
  min-width: 0; line-height: 38px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reskin-header .reskin-search-link .search__btn { display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.reskin-header .arrow-left { display: none; }
.reskin-header .header__actions { position: relative; }
.reskin-header .popover-containe { gap: 8px; }
.reskin-header .login-box { gap: 8px; }
.reskin-header .popover { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.reskin-header .popover-content { background: transparent; }
.reskin-header .history-container { display: none; position: absolute; top: 48px; right: 0; width: 100%; height: auto; max-height: 60vh; padding: 16px; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); }
.reskin-header .is-fixed .history-container { display: block; }
.reskin-search-history-head { display: flex; justify-content: space-between; margin-bottom: 16px; }
.reskin-header .history-list { display: flex; flex-wrap: wrap; gap: 10px; }
.reskin-search-toggle { display: none; }
.reskin-app .app-main { display: block; padding-top: 24px; }
.reskin-app .app-main > .app-aside, .reskin-app > .app-aside { display: none; }
.reskin-app .app-main > .index-content { width: 100%; min-width: 0; max-width: none; }
.reskin-app > .main { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 24px clamp(12px,3vw,28px); }
.reskin-main { position: relative; z-index: 1; padding-top: 0; padding-bottom: 0; }
.reskin-main > * { min-width: 0; }
.footer { margin-top: 0; }
.footer__brandrow { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.app-btn { display: inline-flex; align-items: center; font-size: 13px; }
.footer__description { color: var(--text-faint); font-size: 13px; margin-block: 12px; overflow-wrap: anywhere; }
.footer__entries { margin-top: 14px; color: var(--text-dim); font-size: 13px; }
.footer__entries li { margin-block: 6px; overflow-wrap: anywhere; }
.footer__socials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.footer__socials a { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; }
.footer__copyright { margin-left: auto; }
.reskin-app .cus-pagination-container { gap: 12px; margin-block: 28px; color: var(--text-dim); overflow: visible; }
.reskin-app .cus-pagination-container .preBtn, .reskin-app .cus-pagination-container .nextBtn,
.reskin-app .cus-pagination li a, .reskin-app .jumpBtn, .reskin-app .jumpInput { min-height: 38px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); color: var(--text); }
.reskin-app .cus-pagination li a { min-width: 36px; }
.reskin-app .cus-pagination li a.is-active { background: var(--brand); color: white; }
.reskin-app .dx-modal .modal-content { background: var(--bg-elev); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); }
.reskin-app .dx-modal .modal-header { border-color: var(--line); }
.reskin-app .dx-modal .form-control { background: var(--surface); color: var(--text); border-color: var(--line-strong); border-radius: var(--radius-sm); }
.reskin-drawer-account { display: flex; width: 100%; height: 48px; padding: 0 14px 0 8px; margin-top: 12px; }
.reskin-drawer-account .reskin-account-avatar { width: 34px; height: 34px; }
.drawer[aria-hidden="true"] { visibility: hidden; }
.drawer.is-open { visibility: visible; }
html.reskin-menu-open { overflow: hidden; }
@media (max-width: 1519px) and (min-width: 720px) {
  .reskin-header .nav { flex-basis: 100%; order: 10; }
  .reskin-header .search-box { max-width: 520px; }
}
@media (min-width: 1520px) { :root { --dx-header-height: 64px; } }
@media (max-width: 719px) {
  :root { --dx-header-height: 64px; --gap: 12px; }
  .reskin-header .btn-menu { display: flex; }
  .reskin-header .nav { display: none; }
  .reskin-header .search-box { display: none; }
  .reskin-header .reskin-search-toggle { display: flex; }
  .reskin-header .is-fixed .search-box { display: flex; align-items: flex-start; gap: 8px; position: fixed; inset: 0; width: 100%; padding: 12px; max-width: none; background: var(--bg); z-index: 130; }
  .reskin-header .is-fixed .arrow-left { display: block; padding-top: 10px; }
  .reskin-header .is-fixed .history-container { display: block; width: calc(100% - 24px); top: 70px; right: 12px; }
  .reskin-header .header__actions { gap: 4px; }
  .reskin-header .mobile-user { width: 30px; }
  .reskin-app .app-main { padding-top: 16px; }
  .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__copyright { margin-left: 0; width: 100%; }
  .reskin-app .cus-pagination-container { flex-wrap: wrap; }
  .reskin-app .jump-page-container { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
/* IDs in the legacy stylesheet carry stronger specificity than theme utilities. */
#app-header.reskin-header { position: sticky; top: 0; z-index: 90; padding-top: 0; }
#app-header.reskin-header .app-header { padding-top: 0; }
@media (min-width: 1520px) {
  .reskin-header .header__inner { flex-wrap: nowrap; }
  .reskin-header .nav { flex: 0 0 auto; gap: 2px; }
  .reskin-header .search-box { flex: 1 1 180px; min-width: 0; }
}
@media (min-width: 720px) { .reskin-header .mobile-not-login { display: none; } }

.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 16px 0 4px; font-size: 13px; color: var(--text-faint);
  position: relative; z-index: 1;
}
.crumbs a { color: var(--text-dim); transition: color .18s var(--ease); }
.crumbs a:hover { color: var(--brand-soft); }
.crumbs svg { opacity: .45; flex-shrink: 0; }
.crumbs [aria-current] { color: var(--text); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-head { padding: clamp(14px, 2vw, 22px) 0 clamp(16px, 2.4vw, 26px); position: relative; z-index: 1; }
.page-head h1 {
  margin: 0 0 8px; font-size: clamp(21px, 2.8vw, 31px);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.25;
}
.page-head p { margin: 0 0 6px; color: var(--text-dim); font-size: clamp(13.5px, 1.2vw, 15px); }
.page-head__count { color: var(--text-faint); font-size: 13px; }

.prose {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 36px); margin-bottom: clamp(28px, 4vw, 44px);
  position: relative; z-index: 1;
}
.prose h2 { margin: 26px 0 10px; font-size: 16.5px; font-weight: 700; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0; color: var(--text-dim); font-size: 14.5px; }
.prose a { color: var(--brand-soft); }


/* Shared second-round alignment; scoped against legacy theme selectors. */
.inner-links { margin: clamp(30px, 4vw, 48px) 0 clamp(24px, 3vw, 36px); position: relative; z-index: 1; }

.inner-links__grid {
  display: grid; gap: var(--gap);
  /* auto-fit + 170px 下限：卡片数量在 5~6 之间变（当前页自己那条会被去掉），宽屏一行排满；
     auto-fill 会留下空轨道，auto-fit 则让空轨道塌陷，剩下几张就铺满几张 */
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.inner-links__card {
  display: block; height: 100%;
  padding: clamp(16px, 1.8vw, 22px);
  border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.inner-links__card:hover {
  background: var(--surface-2); border-color: rgba(30, 160, 248, .45);
  transform: translateY(-2px);
}

.inner-links__card h3 {
  margin: 0 0 8px; font-size: 15.5px; font-weight: 700;
  display: flex; align-items: center; gap: 5px;
  transition: color .2s var(--ease);
}
.inner-links__card:hover h3 { color: var(--brand-soft); }
.inner-links__card h3 svg { opacity: .55; transition: transform .2s var(--ease); }
.inner-links__card:hover h3 svg { transform: translateX(3px); opacity: 1; }

.inner-links__card p {
  margin: 0; color: var(--text-faint); font-size: 13.5px; line-height: 1.7;
}


.reskin-related .section__head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.reskin-related .section__title { margin: 0; font-size: clamp(17px,2vw,21px); font-weight: 750; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; line-height: 1.6; }
.reskin-related .section__title::before { content: ''; width: 4px; height: 19px; border-radius: 3px; background: linear-gradient(180deg,var(--brand),#38d0ff); }
@media (min-width: 1200px) { .reskin-related .inner-links__card { min-height: 148px; } }
#app-footer.footer { color: var(--text); }
#app-footer .footer__grid > * { min-width: 0; }
#app-footer .footer__col { overflow-wrap: anywhere; }
#app-footer .footer__brand p { max-width: 40ch; }
#app-footer .footer__description blockquote { margin: 0; padding: 0; border: 0; background: transparent; color: var(--text-faint); }
#app-footer .footer__description { margin: 0; }
#app-footer .footer__description p { margin: 12px 0 0; font-size: 13px; }
#app-footer .footer__description a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
#app-footer .footer__entries { display: block; margin: 18px 0 0; color: var(--text); font-size: 15px; }
#app-footer .footer__entries li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 9px; font-size: 13.5px; }
#app-footer .footer__entries span { color: var(--text-faint); flex-shrink: 0; }
#app-footer .footer__entries span::after { content: '：'; }
#app-footer .footer__entries a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
#app-footer .footer__entries a:hover { color: white; }
#app-footer .footer__socials { gap: 10px; margin-top: 18px; }
#app-footer .footer__socials a { width: 38px; height: 38px; color: var(--text-dim); background: var(--surface); border-color: var(--line); }
#app-footer .footer__socials svg { color: inherit; }
#app-footer .footer__socials a:hover { color: white; background: var(--surface-2); border-color: var(--brand); }
#app-footer .app-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px 0 8px; border-radius: 999px; color: white; background: linear-gradient(135deg,var(--brand),#38d0ff); box-shadow: 0 10px 24px -8px var(--brand-glow); }
#app-footer .app-btn b { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
#app-footer .app-btn[aria-disabled="true"] { opacity: .6; }
.reskin-unavailable, .nav__link[aria-disabled="true"] { color: var(--text-faint); cursor: default; }
.reskin-unavailable { font-size: 13.5px; }
.reskin-app #login_modal { width: 100%; right: auto; }
.reskin-app #login_modal .modal-dialog { max-width: 420px; width: calc(100% - 32px); margin-inline: auto; background: transparent; }
.reskin-app #login_modal .modal-content { position: relative; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); }
.reskin-app #login_modal .modal-body { padding: clamp(22px,3vw,30px); }
.reskin-app #login_modal .reskin-auth-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-faint); z-index: 1; }
.reskin-app #login_modal .reskin-auth-close:hover { background: var(--surface); color: white; }
.reskin-app #login_modal .reskin-auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; border: 0; }
.reskin-app #login_modal .dx-tab { flex: none; height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; font-weight: 650; color: var(--text-faint); }
.reskin-app #login_modal .dx-tab--active { color: white; background: var(--surface-2); }
.reskin-app #login_modal .dx-tab::after { display: none; }
.reskin-app #login_modal .input-control { margin-bottom: 14px; }
.reskin-app #login_modal .input-control > label { display: block; margin-bottom: 6px; color: var(--text-faint); font-size: 13px; font-weight: 400; }
.reskin-app #login_modal .form-control { width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 15px; box-shadow: none; }
.reskin-app #login_modal .form-control:focus { border-color: var(--brand); }
.reskin-app #login_modal .form-control[aria-invalid="true"] { border-color: #ff6b6b; }
.reskin-app #login_modal .form-control::placeholder { color: var(--text-faint); }
.reskin-app #login_modal .has-icon-right .form-control { padding-right: 44px; }
.reskin-app #login_modal .input-control-icon-right { top: 27px; height: 44px; width: 40px; display: grid; place-items: center; padding: 0; color: var(--text-faint); }
.reskin-app #login_modal .tip { color: #ff6b6b; font-size: 13px; }
.reskin-app #login_modal .tip:empty { display: none; }
.reskin-auth-check { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 14px; font-size: 13px; font-weight: 400; color: var(--text-dim); line-height: 1.5; }
.reskin-auth-check input { margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.reskin-auth-check a { color: var(--brand-soft); }
.reskin-auth-message { margin: 0 0 12px; min-height: 18px; color: #ff6b6b; font-size: 13px; }
.reskin-auth-submit { width: 100%; height: 46px; border-radius: 999px; color: white; font-size: 15px; font-weight: 700; background: linear-gradient(135deg,var(--brand),#1c7ef0); box-shadow: 0 8px 24px var(--brand-glow); }
.reskin-auth-submit:disabled { opacity: .6; cursor: wait; }
.reskin-auth-switch { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--text-faint); }
.reskin-auth-switch button { color: var(--brand-soft); font-size: 13px; padding: 1px 6px; }
@media (min-width: 1520px) {
  .reskin-header .nav__link { padding: 0 12px; }
  .reskin-header .nav__link[aria-current="page"]::after { left: 8px; right: 8px; }
  .reskin-header .search__input { padding-right: 68px; }
  .reskin-header .search__btn { padding: 0 14px; }
}
@media (max-width: 719px) {
  :root { --gap: 10px; --header-h: 56px; --dx-header-height: 56px; }
  .reskin-header .header__inner { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .reskin-header .btn-menu { justify-self: start; }
  .reskin-header .logo { justify-self: center; }
  .reskin-header .header__actions { justify-self: end; }
  .reskin-header .header__actions .mobile-not-login, .reskin-header .header__actions .mobile-user { display: none; }
  .reskin-header .icon-btn { width: auto; height: auto; padding: 4px 8px; flex-direction: column; gap: 3px; border-radius: 10px; }
  .reskin-header .icon-btn__label { display: block; font-size: 10px; }
  #app-footer .footer__socials { margin-top: 12px; }
  #app-footer .footer__socials a { width: 34px; height: 34px; }
  #app-footer { padding-top: 20px; }
  #app-footer .footer__grid { gap: 22px 12px; }
  #app-footer .logo__img--footer { height: 28px; }
  #app-footer .footer__brand p { margin-top: 8px; font-size: 12.5px; max-width: none; }
  #app-footer .footer__entries { margin-top: 12px; }
  #app-footer .footer__entries li { margin-bottom: 6px; font-size: 13px; gap: 4px; }
  #app-footer .footer__col .footer__title { margin-bottom: 8px; font-size: 13.5px; }
  #app-footer .footer__col li { margin-bottom: 5px; }
  #app-footer .footer__col a, #app-footer .reskin-unavailable { font-size: 14px; }
  #app-footer .footer__bottom { margin-top: 20px; padding-top: 14px; }
}

.fab { position: fixed; right: 20px; bottom: 24px; z-index: 95; display: flex; flex-direction: column; gap: 12px; }
.fab__btn {
  width: 64px; height: 64px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #fff; background: linear-gradient(135deg, var(--brand), #38d0ff);
  box-shadow: 0 10px 28px var(--brand-glow);
  padding: 0; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; line-height: 1.2; letter-spacing: .02em;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .25s var(--ease), visibility .25s;
}
.fab__btn svg { width: 20px; height: 20px; }
.fab__btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px var(--brand-glow); }
/* 返回顶部滚动 600px 后才出现；隐藏时仍占位，浏览记录按钮位置不跳 */
.backtop { opacity: 0; visibility: hidden; transform: translateY(10px); }
.backtop.is-on { opacity: 1; visibility: visible; transform: none; }
.backtop.is-on:hover { transform: translateY(-2px); }

/* 浏览记录面板：桌面在按钮左侧弹出，手机从底部升起 */
.hist {
  position: fixed; right: 100px; bottom: 24px; z-index: 96; width: 340px; max-height: min(70vh, 560px);
  display: flex; flex-direction: column; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
}
.hist[hidden] { display: none; }
.hist__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.hist__head #reskin-history-title { margin: 0; font-size: 15px; font-weight: 750; }
.hist__clear { margin-left: auto; font-size: 12.5px; color: var(--text-faint); }
.hist__clear:hover { color: var(--brand-soft); }
.hist__close { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text-dim); }
.hist__close:hover { background: var(--surface-2); color: #fff; }
.hist__list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.hist__list a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; }
.hist__list a:hover { background: var(--surface-2); }
.hist__thumb { flex: 0 0 88px; border-radius: 8px; }
.hist__thumb .badge { font-size: 9.5px; padding: 2px 5px; left: 4px; top: 4px; }
.hist__info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hist__title { font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist__meta { font-size: 11.5px; color: var(--text-faint); }
.hist__empty { padding: 36px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }
.hist__all { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-dim); }
.hist__all:hover { color: var(--brand-soft); }


.reskin-app > .dx-backtop { display: none; }
.reskin-floating .fab__btn--app { background: linear-gradient(135deg,#ffb03a,#ff7a3d); box-shadow: 0 10px 28px rgba(255,150,58,.38); }
.reskin-floating button:disabled { cursor: default; opacity: .6; }
.reskin-history #reskin-history-content { overflow-y: auto; }
.reskin-history .hist__head { position: static; color: var(--text); }
.reskin-history .hist__clear:disabled { opacity: .5; cursor: default; }
.reskin-history .hist__empty button { margin-top: 10px; }
.reskin-history .hist__thumb { width: 88px; background: var(--surface-2); }
.reskin-history .hist__meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 719px) {
  .reskin-floating { right: 12px; bottom: 16px; gap: 10px; }
  .reskin-floating .fab__btn { width: 56px; height: 56px; font-size: 10.5px; letter-spacing: 0; }
  .reskin-floating .fab__btn svg { width: 18px; height: 18px; }
  .reskin-history { right: 12px; left: 12px; bottom: 16px; width: auto; max-height: 65vh; }
}

.reskin-pager {
  /* 整组居中：两端对齐在 1200px 宽的容器里会被拉得很散 */
  display: flex; align-items: center; justify-content: center; gap: 12px;
  flex-wrap: wrap;
  margin: clamp(26px, 4vw, 42px) 0 clamp(30px, 4vw, 48px);
  position: relative; z-index: 1;
}

.pager__jump { display: flex; align-items: center; gap: 10px; }
.pager__count {
  color: var(--text-dim); font-size: 15px; font-variant-numeric: tabular-nums;
  margin-right: 2px;
}

.pager__input, .pager__go, .pager__step {
  height: 44px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--text); font-size: 15px;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}

.pager__input {
  width: 68px; padding: 0 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
/* 去掉数字框的上下箭头，否则 68px 宽被它占掉一半 */
.pager__input::-webkit-outer-spin-button,
.pager__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pager__input:focus { outline: none; border-color: var(--brand); }

.pager__go, .pager__step {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 20px; cursor: pointer; white-space: nowrap;
}
.pager__go:hover, .pager__step:hover { border-color: var(--brand); color: #fff; background: rgba(30, 160, 248, .12); }

.pager__steps { display: flex; align-items: center; gap: 10px; }

@media (max-width: 559px) {
  .pager__steps { width: 100%; justify-content: center; }
  .pager__step { flex: 1; }
}


/* Neutralize the legacy modal shell and its transformed close control. */
.reskin-app #login_modal .modal-dialog { border: 0; border-radius: 0; box-shadow: none; }
.reskin-app #login_modal .reskin-auth-close { transform: none; }
.reskin-app #login_modal svg { color: inherit; }
.reskin-app:has(#login_modal.in) > .modal-backdrop { background: rgba(0,0,0,.68); opacity: 1; backdrop-filter: blur(3px); width: 100vw; }

.reskin-app #login_modal.in { display: flex !important; }
.reskin-app #login_modal .modal-dialog { top: auto !important; transform: none !important; margin: auto; flex-shrink: 0; }

/* Hide legacy brand covers before lazyload runs; retain the real cover's layout. */
.reskin-app img[src*="/themes/haijiao/static/images/loading.png"],
.reskin-app img[data-image-state="loading"]:not([src]) { visibility: hidden; }
.reskin-app .media-cover-empty {
  display: grid; place-items: center; box-sizing: border-box;
  width: 100%; height: 100%; min-height: 3rem; padding: 8px;
  color: var(--text-faint); background: var(--surface-2);
  font-size: 12px; line-height: 1.5; text-align: center;
}
