/**
 * 全站基础样式 — 「碑拓青墨」视觉系统
 * ------------------------------------------------------------
 * 用于：公共头/导航/页脚、全局排版、表单控件
 * 灵感：碑拓（石刻拓本）的青灰纸面 + 朱砂印章 + 青墨字色
 * 刻意避开：奶油底+陶土橙、纯黑霓虹、报纸细线栏
 */

/* ========== 设计令牌 ========== */
:root {
  --ink: #14212b;          /* 青墨：主文字 / 导航底 */
  --ink-soft: #3a4a56;     /* 次级文字 */
  --paper: #e8e6df;        /* 石纸：页面底（偏冷灰绿，非奶油） */
  --field: #f5f4ef;        /* 内容纸面 */
  --rule: #c2bfb4;         /* 碑边线 */
  --cinnabar: #a31828;     /* 朱砂：忌 / 强调 / 印 */
  --jade: #1a6b4a;         /* 碧玉：宜 */
  --gilt: #8a7340;         /* 暗金：点缀 */
  --mist: rgba(20, 33, 43, 0.06);
  --shadow: 0 12px 40px rgba(20, 33, 43, 0.08);
  --radius: 2px;           /* 碑面感：近直角 */
  /* 标题：拉丁用自托管 Syne；中文回落系统黑体/宋体 */
  --font-display: "Syne", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  /* 正文：不自托管中文字体，直接用系统字体（省体积、首屏更快） */
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  --max: 1080px;
  --pad: clamp(14px, 3vw, 28px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========== Reset ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden; /* 禁止整页横向溢出 */
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  background-color: var(--paper);
  /* 拓纸微噪点：碑拓质感，非装饰渐变堆砌 */
  background-image:
    radial-gradient(ellipse 120% 80% at 10% -10%, rgba(163, 24, 40, 0.05), transparent 50%),
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(26, 107, 74, 0.04), transparent 45%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  color: var(--cinnabar);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: normal;
}

p, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ========== 品牌栏 ========== */
.site-header {
  background: var(--field);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--pad);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.site-brand:hover {
  color: var(--ink);
}

/* 签名元素之一：站名旁朱文方印 */
.site-brand__seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--field);
  background: var(--cinnabar);
  border: 2px solid color-mix(in srgb, var(--cinnabar) 70%, #000);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  transform: rotate(-3deg);
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-brand__name {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.site-brand__tag {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

/* ========== 导航 ========== */
.site-nav {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-nav__track {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 8px;
}

.site-nav__track::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  flex: 0 0 auto;
  color: rgba(245, 244, 239, 0.78);
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 13px 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.site-nav a:hover,
.site-nav a.on {
  color: #fff;
  border-bottom-color: var(--cinnabar);
}

/* ========== 页脚 ========== */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 70%, var(--ink) 8%);
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--pad);
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.site-footer a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}

.site-footer a:hover {
  color: var(--cinnabar);
}

/* 首页姊妹站外链：平铺、无分类标题；窄屏自动换行 */
.site-footer__sisters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px dashed var(--rule);
}

.site-footer__sisters a {
  border-bottom: none;
  font-size: 13px;
  letter-spacing: 0.04em;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 4px 2px;
}

.site-footer__sisters a:hover {
  color: var(--cinnabar);
}

/* ========== 通用页面壳 ========== */
.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--pad) 8px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  text-align: center; /* 全站栏目页标题居中 */
}

.page-intro {
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 42em;
  margin: 0 auto 22px; /* 居中块 */
  text-align: center; /* 全站栏目页说明居中 */
}

.panel {
  background: var(--field);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 16px;
}

/* 表单控件统一 */
.ctrl,
select.chajiri_select,
.conv_row select,
.wnl_head select,
.wnl_head .select_month,
.wnl_head .select_holiday {
  appearance: none;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px 28px 8px 10px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  min-height: 40px;
}

.btn,
.chajiri_btn,
.conv_btn,
.wnl_head .bktoday,
.wnl_head .bkhuangli {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--field) !important;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  letter-spacing: 0.12em;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.btn:hover,
.chajiri_btn:hover,
.conv_btn:hover,
.wnl_head .bktoday:hover {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #fff !important;
}

/* 旧图标类兼容（不再依赖巨型 icon font） */
[class^="icon-"],
[class*=" icon-"] {
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  speak: never;
}

.icon-arrow-bottom:before { content: "▾"; }
.icon-jiantouz:before { content: "‹"; }
.icon-jiantouy:before { content: "›"; }
.icon-sign:before { content: "●"; font-size: 0.7em; }
.icon-fenxiang:before { content: "↺"; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== 响应式：Pad ≤1024 / 手机 ≤768 / 小屏 ≤480 ========== */
@media (max-width: 1024px) {
  .site-header__inner,
  .site-nav__track,
  .site-footer__inner,
  .page-shell {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .site-brand__name {
    font-size: 24px;
  }

  .site-nav a {
    padding: 12px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .site-footer {
    margin-top: 32px;
  }
}

@media (max-width: 480px) {
  .site-brand__name {
    font-size: 22px;
  }

  .site-brand__seal {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .site-nav a {
    padding: 12px 10px;
    font-size: 13px;
  }

  .site-footer__sisters {
    gap: 4px 12px;
  }
}
