/* ============================================================
   吃土皮皮虎 · 基础层：变量 / 重置 / 骨架 / 通用组件
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f2f4;
  --bg-hover: #ebedf0;
  --text: #17181a;
  --text-secondary: #5c6066;
  --text-tertiary: #9aa0a8;
  --border: #e7e9ec;
  --border-strong: #d6d9de;
  --accent: #f4511e;
  --accent-hover: #dd410f;
  --accent-soft: rgba(244, 81, 30, 0.1);
  --link: #175199;
  --link-hover: #0f3d75;
  --note: #ff2e4d;
  --note-soft: rgba(255, 46, 77, 0.1);
  --shadow-sm: 0 1px 2px rgba(18, 20, 24, 0.04), 0 1px 3px rgba(18, 20, 24, 0.06);
  --shadow-md: 0 2px 8px rgba(18, 20, 24, 0.06), 0 8px 24px rgba(18, 20, 24, 0.06);
  --shadow-lg: 0 8px 32px rgba(18, 20, 24, 0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --header-h: 60px;
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Georgia", "Songti SC", "SimSun", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #0f1012;
  --bg-elevated: #17191c;
  --bg-subtle: #1d1f23;
  --bg-hover: #24272c;
  --text: #ecedef;
  --text-secondary: #a2a7ae;
  --text-tertiary: #6d737b;
  --border: #26292e;
  --border-strong: #363a41;
  --accent: #ff6b3d;
  --accent-hover: #ff835c;
  --accent-soft: rgba(255, 107, 61, 0.14);
  --link: #7ab0ec;
  --link-hover: #9cc6f5;
  --note: #ff5470;
  --note-soft: rgba(255, 84, 112, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ------------------------------- 布局容器 ------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.container-narrow {
  max-width: 940px;
}

.page {
  padding: 28px 0 72px;
  min-height: calc(100vh - var(--header-h) - 200px);
}

/* --------------------------------- 顶栏 --------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  flex-shrink: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ff8f4d);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(244, 81, 30, 0.3);
}
.brand:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.nav-link {
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.15s var(--ease);
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box input {
  width: 190px;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--bg-subtle);
  font-size: 14px;
  outline: none;
  transition: all 0.2s var(--ease);
}
.search-box input:focus {
  width: 230px;
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-box input::placeholder {
  color: var(--text-tertiary);
}
.search-box svg {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all 0.15s var(--ease);
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.menu-toggle {
  display: none;
}

/* 移动端抽屉 */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 18px;
  z-index: 99;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.22s var(--ease);
}
.mobile-nav.open {
  display: block;
}
.mobile-nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}
.mobile-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.mobile-search {
  margin-bottom: 10px;
}
.mobile-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
  outline: none;
  font-size: 15px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------- 页脚 --------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 36px 0 30px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}
.footer-brand {
  max-width: 320px;
}
.footer-brand .brand {
  margin-bottom: 10px;
}
.footer-desc {
  font-size: 13.5px;
  color: var(--text-tertiary);
  line-height: 1.7;
}
.footer-links {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.4px;
}
.footer-col a {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 4px 0;
}
.footer-col a:hover {
  color: var(--accent);
}
.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-tertiary);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
}

/* ------------------------------- 通用组件 ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text);
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-hover);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}
.btn-sm {
  height: 32px;
  padding: 0 13px;
  font-size: 13.5px;
  border-radius: 8px;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 13px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  transition: all 0.15s var(--ease);
}
.tag:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-gray {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
}
.badge-note {
  background: var(--note-soft);
  color: var(--note);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section-title::before {
  content: '';
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--accent);
}
.section-more {
  font-size: 13.5px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.section-more:hover {
  color: var(--accent);
}

.page-head {
  margin-bottom: 24px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  margin-bottom: 6px;
}
.page-sub {
  font-size: 14.5px;
  color: var(--text-tertiary);
}

.empty {
  text-align: center;
  padding: 72px 20px;
  color: var(--text-tertiary);
}
.empty-icon {
  font-size: 44px;
  margin-bottom: 14px;
  opacity: 0.5;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-text {
  font-size: 14px;
}

/* -------------------------------- 分页 -------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.15s var(--ease);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.pagination .dots {
  border: none;
  background: none;
}

/* ------------------------------- 图片灯箱 ------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s var(--ease);
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  animation: zoomIn 0.22s var(--ease);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  backdrop-filter: blur(8px);
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.45);
  padding: 5px 14px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}
.lightbox-prev {
  left: 20px;
}
.lightbox-next {
  right: 20px;
}
.lightbox-nav svg {
  width: 22px;
  height: 22px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 顶部阅读进度条 */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--accent), #ff9a5c);
  z-index: 200;
  width: 0;
  transition: width 0.1s linear;
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.22s var(--ease);
  z-index: 90;
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.to-top svg {
  width: 18px;
  height: 18px;
}

/* 骨架淡入 */
.fade-in {
  animation: fadeUp 0.4s var(--ease) backwards;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------- 响应式 -------------------------------- */
@media (max-width: 900px) {
  .nav,
  .search-box {
    display: none;
  }
  .menu-toggle {
    display: grid;
  }
  .header-inner {
    justify-content: space-between;
  }
  .footer-links {
    gap: 32px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }
  .container {
    padding: 0 14px;
  }
  .page {
    padding: 18px 0 56px;
  }
  .page-title {
    font-size: 23px;
  }
  .section-title {
    font-size: 17px;
  }
  .footer {
    padding: 28px 0 24px;
  }
  .footer-inner {
    flex-direction: column;
    gap: 22px;
  }
  .footer-links {
    gap: 28px;
  }
  .to-top {
    right: 14px;
    bottom: 14px;
  }
}

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