/* Fool Blog 2026 visual system
 * A focused editorial UI layered over the legacy component styles.
 */

:root {
  --primary: #2563eb;
  --primary-light: #4f83f1;
  --primary-dark: #174fc7;
  --primary-rgb: 37, 99, 235;
  --primary-light-rgb: 79, 131, 241;
  --success: #139c72;
  --danger: #dd4758;
  --warning: #d89118;
  --info: #2489d8;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f8fc;
  --surface-muted: #f0f1f7;
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-border: rgba(24, 28, 46, .09);
  --card-shadow: 0 18px 50px rgba(25, 28, 55, .07);
  --text: #171927;
  --text-primary: #171927;
  --text-secondary: #64687a;
  --text-tertiary: #9599a8;
  --border: #e5e6ee;
  --input-bg: #ffffff;
  --input-border: #dcdde7;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(25, 28, 55, .05);
  --shadow-md: 0 12px 32px rgba(25, 28, 55, .08);
  --shadow-lg: 0 22px 65px rgba(25, 28, 55, .12);
  --serif: "Noto Serif SC", "Songti SC", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html.dark {
  --bg: #0d0f16;
  --surface: #151821;
  --surface-soft: #1a1d28;
  --surface-muted: #202430;
  --card: #151821;
  --card-solid: #151821;
  --card-border: rgba(255, 255, 255, .09);
  --card-shadow: 0 22px 64px rgba(0, 0, 0, .28);
  --text: #f2f3f7;
  --text-primary: #f2f3f7;
  --text-secondary: #a7aaba;
  --text-tertiary: #747888;
  --border: #292d39;
  --input-bg: #11141c;
  --input-border: #343846;
  --inline-code-bg: #252936;
  --inline-code-text: #ff86b4;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

@media (pointer: fine) {
  body,
  html {
    cursor: url("/static/cursor-pointer.cur"), auto !important;
  }

  a,
  button,
  [onclick],
  label[for],
  input[type="submit"],
  input[type="button"] {
    cursor: url("/static/cursor-link.cur"), pointer !important;
  }

  input,
  textarea,
  select {
    cursor: url("/static/cursor-text.cur"), text !important;
  }

  input[type="color"] {
    cursor: url("/static/cursor-cross.cur"), crosshair !important;
  }
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% -5%, rgba(var(--primary-rgb), .11), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(52, 211, 153, .07), transparent 24rem);
  background-attachment: fixed;
  letter-spacing: -.006em;
  line-height: 1.72;
}

html body.has-wallpaper[data-wallpaper] {
  background-color: transparent !important;
  background-image: none !important;
}

body::before,
body::after {
  pointer-events: none;
}

::selection {
  color: #fff;
  background: rgba(var(--primary-rgb), .86);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-tertiary) 62%, transparent);
  background-clip: padding-box;
}

#progress-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #38bdf8, #22c55e);
  box-shadow: 0 0 14px rgba(var(--primary-rgb), .55);
}

.container {
  width: min(100%, 1240px);
  max-width: 1240px;
  padding-inline: clamp(20px, 4vw, 48px);
}

.site-header {
  min-height: 48px;
  border-bottom: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: 0 6px 24px rgba(25, 28, 55, .035);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

html.dark .site-header {
  background: rgba(13, 15, 22, .82);
  border-color: rgba(255, 255, 255, .07);
}

body.has-wallpaper .site-header {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: 0 8px 28px rgba(25, 28, 55, .05);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

html.dark body.has-wallpaper .site-header {
  background: rgba(9, 12, 20, .34);
  border-color: rgba(255, 255, 255, .08);
}

.nav { height: auto; min-height: 48px; gap: 20px; }

.brand {
  gap: 9px;
  color: var(--text) !important;
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -.03em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: 0 5px 14px rgba(var(--primary-rgb), .18);
  transition: transform .25s ease, box-shadow .25s ease;
}

.brand:hover .brand-icon {
  transform: translateY(-2px) rotate(-3deg);
  box-shadow: 0 12px 24px rgba(var(--primary-rgb), .28);
}

.nav-links { gap: 4px; align-items: center; }

.nav-links > a,
.nav-links > .user-dropdown > .user-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 570;
  line-height: 30px;
  background: transparent;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.nav-links > a:hover,
.nav-links > .user-dropdown > .user-chip:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), .035);
  border-color: transparent;
}

.nav-links > a.active {
  color: inherit;
  font-weight: 680;
}
.nav-links > a i { margin-right: 5px; opacity: .82; }

.nav-links > .btn-mini {
  border-color: var(--border);
  background: var(--card-solid);
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.nav-links > .btn-mini:hover {
  color: var(--primary) !important;
  border-color: rgba(var(--primary-rgb), .25);
  background: rgba(var(--primary-rgb), .04);
}

.user-chip img,
.avatar-fallback { width: 24px; height: 24px; }

/* 明/暗模式分段开关（smooth-option-switcher 平面两选项适配）。
   radio 与 .mode-switch 必须保持兄弟顺序；滑块在常规流中，主内容绝对定位覆盖其上。 */
.mode-field {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.mode-input {
  /* 视觉隐藏但保留键盘焦点与辅助技术可达性（不要用 hidden） */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  opacity: 0;
  clip-path: inset(50%);
  overflow: hidden;
  pointer-events: none;
}
.mode-switch {
  position: relative;
  width: 68px;
  height: 30px;
  padding: 2px;
  border-radius: 999px;
  background: var(--border);
}
.mode-content {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  width: 100%;
  height: 100%;
  border-radius: 999px;
}
.mode-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: color 0.35s cubic-bezier(0.34, 0.96, 0.6, 0.99);
}
.mode-slider {
  width: 50%;
  height: 100%;
  border-radius: 999px;
  background: var(--card-solid);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.34, 0.96, 0.6, 0.99);
}
#modeDark:checked ~ .mode-switch .mode-slider { transform: translateX(100%); }
#modeLight:checked ~ .mode-switch label[for="modeLight"],
#modeDark:checked ~ .mode-switch label[for="modeDark"] { color: var(--primary); }
/* 焦点环画在可见 label 上；用 :focus-visible 避免鼠标点击闪现 */
#modeLight:focus-visible ~ .mode-switch label[for="modeLight"],
#modeDark:focus-visible ~ .mode-switch label[for="modeDark"] {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dropdown-menu,
#color-picker {
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow-lg);
}

html.dark .dropdown-menu,
html.dark #color-picker {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.dropdown-menu a,
.dropdown-btn {
  min-height: 40px;
  border-radius: 10px;
}

.content {
  width: min(100%, 1240px);
  padding-top: clamp(28px, 4vw, 52px);
  padding-bottom: 42px;
  gap: clamp(22px, 3vw, 34px);
}

.hero-section {
  --hero-header-height: 48px;
  width: 100%;
  height: calc(100svh - var(--hero-header-height));
  margin: calc(-1 * clamp(28px, 4vw, 52px)) 0 0;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
}

.hero-section::before,
.hero-section::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.hero-section::before {
  top: 10%;
  left: 50%;
  width: min(70vw, 720px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(var(--primary-rgb), .13), rgba(var(--primary-rgb), .035) 45%, transparent 71%);
}

.hero-section::after {
  top: 16%;
  left: calc(50% + 250px);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(34, 197, 94, .12), transparent 70%);
}

.hero-content {
  width: auto;
  justify-self: center;
  max-width: 1180px;
  margin-inline: auto;
  padding-bottom: 78px;
  text-align: center;
}

.hero-icon {
  position: relative;
  margin-bottom: 28px;
}

.hero-icon::after {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border: 1px solid rgba(var(--primary-rgb), .18);
  border-radius: 28px;
  background: rgba(var(--primary-rgb), .07);
  transform: rotate(7deg);
}

.hero-icon img {
  width: 84px !important;
  height: 84px !important;
  border-radius: 24px !important;
  box-shadow: 0 18px 38px rgba(var(--primary-rgb), .2);
}

.hero-title {
  max-width: none;
  font-size: 64px;
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: 1.06;
  white-space: nowrap;
  margin-inline: auto;
}

.hero-subtitle {
  width: 100%;
  min-height: 35px;
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: clamp(17px, 2vw, 22px);
  text-align: center;
}

.hero-actions { width: auto; gap: 22px; margin: 32px auto 20px; }

.hero-meta {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-tertiary);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  font-size: 12px;
  margin-inline: auto;
}

.hero-scroll-hint i { font-size: 20px; }

.home-main-content { gap: 34px; }

.card {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--card-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* All cards outside article detail: transparent */
.card:not(.article-main .card) {
  background: color-mix(in srgb, var(--surface) 48%, transparent);
}

html.dark .card:not(.article-main .card) {
  background: color-mix(in srgb, var(--surface) 35%, transparent);
}

/* Article detail cards: glassmorphism */
.article-main .card,
.article-main #comments,
.article-main .related-articles {
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

html.dark .article-main .card,
html.dark .article-main #comments,
html.dark .article-main .related-articles {
  background: rgba(31,41,55,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.card h2 {
  margin: 0 0 24px;
  color: var(--text);
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 780;
  letter-spacing: -.035em;
}

#top-articles h2::after {
  content: "";
  width: 34px;
  height: 4px;
  margin-left: 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, #f0b600, rgba(var(--primary-rgb), .16));
}

.card h2::after {
  content: "";
  width: 34px;
  height: 4px;
  margin-left: 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), rgba(var(--primary-rgb), .16));
}

.article-list {
  display: grid;
  gap: 14px;
}

.article-item {
  min-height: 138px;
  margin: 0;
  padding: clamp(19px, 2.4vw, 25px);
  gap: clamp(18px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
  box-shadow: none;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

.article-item::after { display: none; }

.article-item:hover {
  border-color: rgba(var(--primary-rgb), .3);
  box-shadow: 0 16px 36px rgba(25, 28, 55, .08);
  transform: translateY(-3px);
}

html.dark .article-item,
html.dark .article-item:hover {
  background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
  box-shadow: none;
}

.article-item.pinned {
  border-color: rgba(245, 158, 11, .2);
  background: linear-gradient(135deg, rgba(245, 158, 11, .08), var(--surface-soft) 52%);
}

html.dark .article-item.pinned {
  background: linear-gradient(135deg, rgba(251, 191, 36, .12), rgba(251, 191, 36, .03) 60%, transparent);
  border-color: rgba(251, 191, 36, .3);
}

html.dark .article-item.pinned:hover {
  border-color: rgba(251, 191, 36, .45);
  box-shadow: 0 4px 16px rgba(251, 191, 36, .1);
}

.article-item .title {
  color: var(--text);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 740;
  letter-spacing: -.025em;
  line-height: 1.35;
}

.article-item .meta {
  margin-top: 10px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.article-item .summary {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.article-item-cover {
  width: clamp(150px, 18vw, 220px);
  min-width: clamp(150px, 18vw, 220px);
  height: 132px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.article-item-cover::before { display: none; }
.article-item-cover img { height: 100%; object-fit: cover; transform: none; }
.article-item-cover:hover img { transform: scale(1.06); }

.tags-row { gap: 7px; margin-top: 12px; }

.tag {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid rgba(var(--primary-rgb), .13);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), .075);
  font-size: 11px;
  font-weight: 650;
}

.tag:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  transform: translateY(-1px);
}

.tag-cloud.big { gap: 12px; }
.tag-cloud.big .tag { min-height: 42px; padding: 0 16px; font-size: 14px; }
.tag-count { opacity: .62; }

.form { gap: 18px; }
.form label { color: var(--text); font-size: 13px; font-weight: 680; }

.form input,
.form textarea,
.form select {
  min-height: 40px;
  margin-top: 7px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

html.dark .form input,
html.dark .form textarea,
html.dark .form select {
  border-color: var(--input-border);
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  color: var(--text);
  box-shadow: none;
}

html.dark .form input:focus,
html.dark .form textarea:focus,
html.dark .form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15);
}

.form textarea,
.comment-form textarea { padding: 13px 14px; }

.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .11);
}

.form .primary,
button.primary {
  min-height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  background: #1d4ed8;
  color: #fff;
  font-weight: 600;
  transition: background-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.form .primary:hover,
button.primary:hover {
  background: #1e40af;
  box-shadow: 0 4px 14px rgba(29, 78, 216, .3);
  transform: translateY(-1px);
}

.form .primary:active,
button.primary:active {
  transform: translateY(0) scale(.97);
  box-shadow: none;
  background: #1e3a8a;
}

.form .primary:focus-visible,
button.primary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.notice,
.alert,
.empty {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(var(--primary-rgb), .14);
}

.auth-card {
  width: min(100%, 470px);
  min-width: 0 !important;
  max-width: 470px;
  padding: 36px 40px;
}

.auth-card::before {
  content: "";
  display: block;
  width: 46px;
  height: 5px;
  margin: 0 auto 20px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #38bdf8);
}

.auth-card h2 { justify-content: center; font-size: 30px; text-align: center; }
.auth-card h2::after { display: none; }
.qq-login-btn { border-radius: 8px; }

.auth-card .auth-submit,
.auth-card .qq-login-btn {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

.auth-card .auth-submit:hover,
.auth-card .qq-login-btn:hover { transform: translateY(-1px); }

.auth-card .auth-submit:active,
.auth-card .qq-login-btn:active { transform: translateY(0) scale(.97); }

.auth-form input:not([type="hidden"]),
.auth-form select {
  min-height: 40px;
  margin-top: 2px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 2px solid var(--input-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-form input:not([type="hidden"]):focus,
.auth-form select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: none;
}

.auth-form .input-eye-wrap input { padding-right: 38px; }
.auth-form .input-eye-btn { right: 0; }
.auth-form .form-row { align-items: flex-end; }

.search-form {
  display: flex;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  box-shadow: none;
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.search-form input::placeholder {
  color: var(--text-tertiary);
}

.search-form input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1);
}

html.dark .search-form input {
  border-color: var(--input-border);
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  color: var(--text);
}

html.dark .search-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .2);
}

.pagination { gap: 7px; }
.pg-num,
.pg-edge,
.pg-jump-box {
  height: 38px;
  min-width: 38px;
  border-color: var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.pg-current { color: #fff; border-color: var(--primary); background: var(--primary); }

.article-layout { gap: clamp(24px, 4vw, 48px); }

.article-main { min-width: 0; }

.article-detail {
  padding: clamp(26px, 4.5vw, 54px);
  border-radius: 26px;
}

.article-detail h1 {
  margin-bottom: 18px;
  color: var(--text);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 820;
  letter-spacing: -.045em;
  line-height: 1.28;
  text-wrap: balance;
}

.article-detail .meta {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-tertiary);
}

.article-detail .article-cover {
  margin: 26px 0 34px;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.article-toc {
  top: 96px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 17px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
html.dark .article-toc {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(31,41,55,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.toc-title { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }

.message-item,
.notify-article {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 48%, transparent);
}

html.dark .message-item,
html.dark .notify-article {
  background: color-mix(in srgb, var(--surface) 35%, transparent);
}

.related-articles {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.guestbook-form-card {
  background: color-mix(in srgb, var(--surface) 48%, transparent);
}

.ai-review-card {
  border: 1px solid rgba(139, 92, 246, .24);
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.06);
}
html.dark .ai-review-card {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
}

.ai-review-header,
.ai-review-toggle { color: #7c3aed; }

html.dark .ai-review-header,
html.dark .ai-review-toggle { color: #b9a3ff; }

html.dark .form .primary,
html.dark button.primary,
html.dark .btn.primary,
html.dark .auth-submit,
html.dark .checkin-btn {
  color: #fff;
  border: 2px solid #3b82f6;
  background: #2563eb;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .24);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

html.dark .form .primary:hover,
html.dark button.primary:hover,
html.dark .btn.primary:hover,
html.dark .auth-submit:hover,
html.dark .checkin-btn:hover {
  color: #fff;
  border-color: #60a5fa;
  background: #1d4ed8;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .4);
  transform: translateY(-1px);
}

html.dark .form .primary:active,
html.dark button.primary:active,
html.dark .btn.primary:active,
html.dark .auth-submit:active,
html.dark .checkin-btn:active {
  background: #1d4ed8;
  box-shadow: 0 2px 7px rgba(37, 99, 235, .24);
  transform: translateY(0) scale(.97);
}

html.dark .btn:not(.primary):not(.danger),
html.dark .actions button,
html.dark .share-btn,
html.dark .reply-btn,
html.dark .comment-like-btn,
html.dark .comment-report-trigger,
html.dark .toc-toggle-btn {
  color: var(--text-secondary);
  border-color: #353a48;
  background: #202430;
  box-shadow: none;
}

html.dark .btn:not(.primary):not(.danger):hover,
html.dark .actions button:hover,
html.dark .share-btn:hover,
html.dark .reply-btn:hover,
html.dark .comment-like-btn:hover,
html.dark .comment-report-trigger:hover,
html.dark .toc-toggle-btn:hover {
  color: #8bb9ff;
  border-color: #4777c9;
  background: #27344b;
}

html.dark .form .primary:disabled,
html.dark button.primary:disabled,
html.dark .btn.primary:disabled {
  color: #777d8d;
  border-color: #343846;
  background: #252936;
  box-shadow: none;
  transform: none;
}

.ai-review-content {
  white-space: normal;
}

.ai-review-content.is-typing {
  white-space: pre-wrap;
}

.ai-review-content > :first-child { margin-top: 0; }
.ai-review-content > :last-child { margin-bottom: 0; }
.ai-review-content p { margin: .45em 0; line-height: 1.72; }
.ai-review-content h1,
.ai-review-content h2,
.ai-review-content h3,
.ai-review-content h4 { margin: .9em 0 .35em; }
.ai-review-content ul,
.ai-review-content ol { margin: .45em 0; }

#comments .comment-form { margin-bottom: 20px; }

#comments .comment-form textarea {
  width: 100%;
  min-height: 96px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  box-shadow: none;
}

#comments .comment-form textarea:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1);
}

#comments .comment-form-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

#comments .comment-list {
  border-top: 1px solid var(--border);
}

#comments .comment-item {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#comments .comment-item:last-child { border-bottom: 0; }
#comments .comment-content { color: var(--text-secondary); line-height: 1.75; }
#comments .comment-head { flex-wrap: wrap; row-gap: 5px; }

#comments .comment-actions button,
#comments .reply-btn,
#comments .comment-report-trigger {
  min-height: 24px;
  padding: 2px 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
}

#comments .reply-form textarea {
  min-height: 64px;
  padding: 9px 11px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
}

.profile-grid { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 42px; }
.profile-avatar-card {
  padding: 26px;
  border-radius: 18px;
}
.profile-avatar { box-shadow: 0 12px 28px rgba(var(--primary-rgb), .18); }
.profile-page-header { border-radius: 24px; }
.profile-tabs { border-bottom-color: var(--border); }
.profile-tab-nav a { min-height: 43px; font-weight: 650; }

.about-author-card {
}

.archive-year-title,
.archive-month-title { border-radius: 12px; }
.archive-timeline::before { background: var(--border); }

.modal-overlay,
.app-download-overlay,
.img-lightbox { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.modal-box,
.app-download-modal {
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
}

html.dark .modal-box,
html.dark .app-download-modal {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.emoji-picker,
.qr-modal-content {
  background: color-mix(in srgb, var(--surface) 75%, transparent) !important;
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

html.dark .emoji-picker,
html.dark .qr-modal-content {
  background: color-mix(in srgb, var(--surface) 58%, transparent) !important;
}

.ms-toast {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.site-footer {
  margin-top: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--card-border);
  color: var(--text-tertiary);
  background: color-mix(in srgb, var(--surface) 54%, transparent);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.site-footer .container { max-width: 1240px; }

body.has-wallpaper .site-footer {
  background: rgba(255, 255, 255, .2);
}

html.dark body.has-wallpaper .site-footer {
  background: rgba(9, 12, 20, .34);
}

.footer-inner { display: grid; gap: 4px; }

.footer-top,
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.footer-signature {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.footer-signature > img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 4px;
}

.footer-signature-text {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.footer-signature-text strong {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.footer-signature-text span {
  max-width: 120px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

.footer-stats {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

.footer-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  border-left: 1px solid var(--border);
  font-size: 10px;
}

.footer-stats > span:first-child { border-left: 0; }
.footer-stats i { color: var(--primary); opacity: .78; font-size: 9px; }
.footer-stats b { color: var(--text-secondary); font-weight: 680; }
.footer-stats a { color: var(--text-tertiary); text-decoration: none; transition: color .16s ease; }
.footer-stats a:hover { color: var(--primary); }

.footer-bottom {
  padding-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: 10px;
}

.footer-powered { white-space: nowrap; }

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-tertiary);
  font-size: 10px;
  text-decoration: none;
  transition: color .16s ease;
}

.footer-links a:hover { color: var(--primary); }
.footer-links img { width: 12px; height: 12px; object-fit: contain; }

.footer-extra {
  display: inline-block;
  margin: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 260px;
}

.footer-extra a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color .16s ease;
}

.footer-extra a:hover { color: var(--primary); }

@media (max-width: 980px) {
  .nav-links {
    display: none;
    top: 66px;
    right: 20px;
    left: 20px;
    max-height: calc(100svh - 92px);
    padding: 10px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  html.dark .nav-links {
    background: color-mix(in srgb, var(--surface) 55%, transparent);
  }
  .nav-links > a,
  .nav-links > .user-dropdown > .user-chip { width: 100%; min-height: 40px; line-height: 38px; }
  .nav-links .icon-btn { width: 100%; }
  /* 移动端下拉里明暗开关与图标按钮一样铺满整行（等分两段，滑块公式不变） */
  .nav-links .mode-field,
  .nav-links .mode-switch { width: 100%; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .article-layout { display: block; }
  .article-toc { display: none; }
  .hero-title { font-size: 52px; }
}

@media (max-width: 720px) {
  .container { padding-inline: 16px; }
  .site-header,
  .nav { min-height: 44px; }
  .brand-icon { width: 28px; height: 28px; border-radius: 9px; }
  .content { padding-top: 22px; }
  .hero-section {
    --hero-header-height: 44px;
    margin-top: -22px;
  }
  .hero-content { padding-inline: 12px; }
  .hero-title { font-size: 38px; }
  .hero-icon img { width: 70px !important; height: 70px !important; border-radius: 20px !important; }
  .hero-actions { width: auto; max-width: 100%; gap: 16px; }
  .hero-btn { flex: 0 0 auto; justify-content: center; }
  .card { padding: 21px 18px; border-radius: 19px; }
  .card h2 { margin-bottom: 19px; }
  .article-item { min-height: 0; padding: 17px; }
  .article-item-cover { width: 112px; min-width: 112px; height: 90px; }
  .article-item .summary { display: none; }
  .article-detail { padding: 24px 19px; border-radius: 20px; }
  .profile-grid { grid-template-columns: 1fr; gap: 24px; }
  .search-form { max-width: none; }
  #comments .comment-item {
    gap: 10px;
    padding-top: 14px !important;
    padding-right: 0 !important;
    padding-bottom: 14px !important;
    padding-left: calc(min(var(--depth, 0), 4) * 12px) !important;
  }
  #comments .comment-avatar { width: 34px; height: 34px; }
  #comments .comment-head { column-gap: 7px; }
  .pg-jump,
  .pg-total { margin-left: 0; }
  .site-footer { margin-top: 10px; padding-block: 6px; }
  .footer-top,
  .footer-bottom { flex-direction: column; gap: 4px; }
  .footer-signature-text span { display: none; }
  .footer-stats { width: 100%; justify-content: center; overflow-x: auto; }
  .footer-stats > span { flex: 1 0 auto; justify-content: center; padding-inline: 7px; }
  .footer-links { justify-content: flex-start; gap: 10px 14px; }
}

@media (max-width: 600px) {
  .article-item-cover { width: 100%; min-width: 0; height: 170px; order: 3; }
  .article-item-cover:hover img { transform: none; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
  .hero-actions { gap: 9px; }
  .hero-btn { flex-basis: auto; }
  .article-item-cover { height: 150px; }
  .article-item .meta .m-opt,
  .article-item .meta .m-hide { display: none; }
  .search-form { padding: 0; }
  .auth-card { padding: 28px 22px; }
  .auth-form .form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .auth-form .form-row > div { padding-top: 0 !important; }
  .auth-form .form-row button { width: 100%; }
  .modal-box { min-width: 0; width: calc(100% - 28px); padding: 24px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
