/* =============================================================
   冠军白菜网论坛网 · 共享 Site CSS
   /assets/site.css
   平板版 v4.2
   ============================================================= */

/* -------------------------------------------------------------
   1. Reset & Variables
   ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cabbage-050: #F0F9F1;
  --cabbage-100: #D8EED9;
  --cabbage-300: #8CCE95;
  --cabbage-500: #3E9B4F;
  --cabbage-700: #1F6B2F;
  --gold-400: #E6C45A;
  --gold-600: #B8952E;
  --navy-800: #12263A;
  --ink-900: #1F2D24;
  --ink-500: #556B5C;
  --paper: #FAF9F5;
  --olive: #7A8B4A;

  --font-headline: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;

  --container-max: 1360px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --transition-fast: 0.18s ease;
  --transition-base: 0.28s ease;
  --shadow-sm: 0 2px 10px rgba(18, 38, 58, 0.05);
  --shadow-md: 0 6px 24px rgba(18, 38, 58, 0.08);
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-900);
  background: var(--cabbage-050);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

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

a {
  color: var(--cabbage-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

a:hover {
  color: var(--cabbage-500);
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--cabbage-300);
  color: var(--cabbage-700);
}

/* -------------------------------------------------------------
   2. 无障碍工具类
   ------------------------------------------------------------- */
.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: fixed;
  left: -9999px;
  top: 10px;
  z-index: 300;
  background: var(--navy-800);
  color: var(--cabbage-050);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  left: 10px;
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 2px;
}

/* -------------------------------------------------------------
   3. 头部 Header
   ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cabbage-050);
  box-shadow: 0 2px 14px rgba(18, 38, 58, 0.05);
  border-bottom: 1px solid var(--cabbage-300);
}

.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--cabbage-500) 0%, var(--gold-400) 50%, var(--cabbage-500) 100%);
}

.site-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  position: relative;
}

.site-header-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-900);
}

.brand:hover {
  color: var(--ink-900);
}

.brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--cabbage-500) 0%, var(--cabbage-700) 100%);
  color: var(--cabbage-050);
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 900;
  border-radius: 12px 12px 12px 4px;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.15), var(--shadow-sm);
  letter-spacing: 0.02em;
}

.brand-identity {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-headline);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: var(--ink-900);
}

.brand-tagline {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* 导航 */
.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-500);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.nav-index {
  font-family: var(--font-headline);
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-600);
  letter-spacing: 0.08em;
}

.nav-link:hover {
  background: var(--cabbage-100);
  color: var(--cabbage-700);
  border-color: var(--cabbage-300);
}

.nav-link[aria-current="page"] {
  background: var(--cabbage-700);
  color: var(--cabbage-050);
  border-color: var(--cabbage-700);
  box-shadow: 0 2px 8px rgba(31, 107, 47, 0.25);
}

.nav-link[aria-current="page"] .nav-index {
  color: var(--gold-400);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--cabbage-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.nav-toggle:hover {
  border-color: var(--cabbage-500);
  background: var(--cabbage-100);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 20px;
  background: var(--cabbage-700);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-fast);
}

[data-nav-toggle][aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

[data-nav-toggle][aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

[data-nav-toggle][aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 头部滚动进度条 */
.header-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cabbage-500), var(--gold-400));
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(230, 196, 90, 0.4);
}

/* 移动端响应式导航 */
@media (max-width: 1024px) {
  .site-header-inner {
    height: 60px;
    padding: 0 16px;
  }

  .brand-emblem {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-tagline {
    font-size: 10px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 85vw);
    margin-left: 0;
    background: var(--navy-800);
    padding: 76px 28px 32px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0s linear 0.35s;
    z-index: 90;
    overflow-y: auto;
    box-shadow: -8px 0 30px rgba(18, 38, 58, 0.25);
  }

  .site-nav[data-open] {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s ease, visibility 0s;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-link {
    justify-content: flex-start;
    color: var(--cabbage-050);
    border-color: rgba(140, 206, 149, 0.18);
    padding: 12px 16px;
    font-size: 15px;
  }

  .nav-link .nav-index {
    color: var(--gold-400);
  }

  .nav-link:hover {
    background: rgba(62, 155, 79, 0.25);
    color: #ffffff;
    border-color: var(--cabbage-300);
  }

  .nav-link[aria-current="page"] {
    background: var(--cabbage-500);
    color: #ffffff;
    border-color: var(--cabbage-500);
    box-shadow: 0 4px 14px rgba(62, 155, 79, 0.3);
  }

  .nav-link[aria-current="page"] .nav-index {
    color: var(--gold-400);
  }
}

body.nav-locked {
  overflow: hidden;
}

/* -------------------------------------------------------------
   4. 页脚 Footer
   ------------------------------------------------------------- */
.site-footer {
  background: var(--navy-800);
  color: rgba(240, 249, 241, 0.8);
  margin-top: auto;
}

.footer-rule {
  height: 3px;
  background: linear-gradient(90deg, var(--gold-400) 0%, var(--cabbage-500) 40%, var(--cabbage-700) 100%);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 56px 24px 32px;
}

.footer-brand-row {
  margin-bottom: 40px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--cabbage-050);
}

.footer-brand:hover {
  color: var(--cabbage-050);
}

.footer-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--cabbage-500), var(--cabbage-700));
  color: var(--cabbage-050);
  font-family: var(--font-headline);
  font-size: 23px;
  font-weight: 900;
  border-radius: 14px 14px 14px 5px;
  box-shadow: 0 4px 16px rgba(62, 155, 79, 0.35);
}

.footer-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.footer-title {
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.footer-subtitle {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(240, 249, 241, 0.55);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col {
  min-width: 0;
}

.footer-heading {
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(140, 206, 149, 0.2);
}

.footer-list li {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
  color: rgba(240, 249, 241, 0.65);
  padding: 3px 0;
}

.footer-list a {
  color: var(--cabbage-300);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.footer-list a:hover {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
}

.footer-version {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 900;
  color: var(--gold-400);
  margin-bottom: 6px;
}

.footer-copy,
.footer-icp {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(240, 249, 241, 0.5);
  line-height: 1.7;
}

.footer-cert {
  font-family: var(--font-headline);
  font-size: 12px;
  color: var(--cabbage-300);
  margin-top: 4px;
}

.footer-trust {
  border-top: 1px solid rgba(140, 206, 149, 0.18);
  padding-top: 20px;
}

.footer-trust p {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(240, 249, 241, 0.45);
  max-width: 800px;
}

@media (max-width: 900px) {
  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .footer-inner {
    padding: 40px 20px 24px;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-brand-row {
    margin-bottom: 28px;
  }
}

/* -------------------------------------------------------------
   5. 通用容器
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 640px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* -------------------------------------------------------------
   6. 通用按钮
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: var(--font-headline);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--cabbage-500);
  color: #ffffff;
  border-color: var(--cabbage-500);
  box-shadow: 0 3px 12px rgba(62, 155, 79, 0.25);
}

.btn--primary:hover {
  background: var(--cabbage-700);
  border-color: var(--cabbage-700);
  color: #ffffff;
}

.btn--ghost {
  background: transparent;
  color: var(--cabbage-700);
  border-color: var(--cabbage-300);
}

.btn--ghost:hover {
  background: var(--cabbage-100);
  border-color: var(--cabbage-700);
  color: var(--cabbage-700);
}

@media (max-width: 640px) {
  .btn {
    padding: 10px 18px;
    font-size: 14px;
  }
}

/* -------------------------------------------------------------
   7. 面包屑
   ------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-headline);
  font-size: 13px;
  color: var(--ink-500);
  padding: 14px 0;
}

.breadcrumb a {
  color: var(--cabbage-700);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--cabbage-500);
}

.breadcrumb li + li::before {
  content: "·";
  margin-right: 6px;
  color: var(--cabbage-300);
}

.breadcrumb li[aria-current="page"] {
  color: var(--ink-900);
  font-weight: 600;
}

/* -------------------------------------------------------------
   8. 章节标识
   ------------------------------------------------------------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold-600);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-label::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--gold-400);
}

.section-title {
  font-family: var(--font-headline);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--ink-900);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.section-desc {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-500);
  max-width: 640px;
  margin-bottom: 24px;
}

/* -------------------------------------------------------------
   9. 正文排版 .prose
   ------------------------------------------------------------- */
.prose {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-900);
  max-width: 780px;
}

.prose p {
  margin-bottom: 1.2em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-headline);
  font-weight: 700;
  color: var(--ink-900);
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}

.prose h2 {
  font-size: 24px;
}

.prose h3 {
  font-size: 19px;
}

.prose ul {
  list-style: disc;
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.prose ol {
  list-style: decimal;
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.prose a {
  color: var(--cabbage-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--cabbage-500);
}

.prose blockquote {
  border-left: 3px solid var(--cabbage-300);
  padding-left: 16px;
  margin: 1.4em 0;
  color: var(--ink-500);
  font-style: italic;
}

/* -------------------------------------------------------------
   10. 网格 / 卡片 / 图片容器
   ------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.image-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cabbage-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--cabbage-300);
}

.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 45%, rgba(230, 196, 90, 0.14) 55%, transparent 70%);
  pointer-events: none;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-frame--tall {
  aspect-ratio: 3 / 4;
}

.image-frame--wide {
  aspect-ratio: 16 / 9;
}

.image-frame--organic {
  border-radius: 48% 52% 45% 55% / 38% 42% 58% 62%;
}

/* -------------------------------------------------------------
   11. 辅助视觉工具
   ------------------------------------------------------------- */
.scale-line {
  height: 2px;
  border: none;
  background: repeating-linear-gradient(90deg, var(--cabbage-500) 0 12px, var(--cabbage-300) 12px 14px, transparent 14px 28px);
  margin: 24px 0;
}

.text-note-vertical {
  writing-mode: vertical-rl;
  font-family: var(--font-headline);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-500);
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .text-note-vertical {
    writing-mode: horizontal-tb;
    font-size: 11px;
  }
}

/* -------------------------------------------------------------
   12. 响应式与动效降级
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .header-progress {
    display: none;
  }

  .nav-toggle-bar {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}
