/* 页面间无闪烁切换（Chrome 126+ View Transitions API） */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.08s; }

/* ================================================
   大同堂书法艺术平台 — Met Museum Edition
   参考：The Metropolitan Museum of Art (metmuseum.org)
   映射：Met红色 → 大同堂金色 #8B6331
   datongtang.com
   ================================================ */

/* ─── CSS 设计令牌 ─── */
:root {
  /* 品牌色（对齐大都会：朱红 #E42D2D） */
  --brand:      #E42D2D;
  --brand-d:    #B01E1E;
  --brand-lt:   #E85555;
  --brand-pale: #FFF5F5;

  /* 基础色（大都会：纯白底 + 深墨文字） */
  --white:   #FFFFFF;
  --gray-1:  #F5F5F5;   /* 浅灰交替背景（大都会alt section） */
  --gray-2:  #EBEBEB;   /* 边框/分割 */
  --gray-3:  #CCCCCC;   /* 浅灰文字 */

  /* 文字层级（实色，告别rgba半透明） */
  --ink:   #1A1A1A;   /* 标题主色 */
  --ink-2: #333333;   /* 正文 */
  --ink-3: #555555;   /* 辅助说明 */
  --ink-4: #888888;   /* 元数据/时间戳 */

  /* 系统色 */
  --green:  #2D7A3A;
  --red:    #B83232;

  /* 字体系统（大都会: 无衬线为主，衬线用于display） */
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-ser:  'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-en:   'Cormorant Garamond', 'Garamond', Georgia, serif;

  /* 尺寸 */
  --nav-h:      88px;    /* 大都会导航高度（精确：88px） */
  --ann-h:      40px;   /* 顶部公告条 */
  --container:  1280px;
  --gutter:     clamp(20px, 4vw, 48px);
  --section-v:  clamp(36px, 4.5vw, 64px);
  --radius:     6px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow:    0 4px 24px rgba(0,0,0,0.09);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.12);

  /* 过渡 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.22s var(--ease);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-weight: 400;
  /* 预留导航+公告条高度，防止 JS 注入前页面跳位 */
  padding-top: calc(var(--ann-h) + var(--nav-h));
}
img  { max-width: 100%; display: block; }
a    { text-decoration: none; color: inherit; }
ul   { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── 排版：标题用衬线，正文用无衬线（大都会风格） ─── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-ser);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0.02em;
}
p { line-height: 1.82; color: var(--ink-2); }

/* ─── 容器 ─── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--section-v) 0; }
.section-gray { background: var(--gray-1); }   /* 大都会交替浅灰 */
.section-brand { background: var(--brand); }    /* 品牌色区块 */
.section-dark { background: var(--ink); }

/* ─── Section 头部（大都会：左标题 + 右"查看全部 >"） ─── */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.sec-eyebrow {
  display: block;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 6px;
}
/* 大都会：section标题用更大字号，强视觉层级 */
.sec-head h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.03em;
  line-height: 1.18;
}
.sec-more {
  font-size: 0.82rem;
  color: var(--brand);
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--t);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sec-more:hover { color: var(--brand-d); }

/* ─── 按钮系统（大都会风格） ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 28px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  border-radius: var(--radius);
}
/* 主按钮：品牌金色实底（大都会红色→金色） */
.btn-primary, .btn-gold {
  background: var(--brand);
  color: var(--white);
  border: 2px solid var(--brand);
}
.btn-primary:hover, .btn-gold:hover {
  background: var(--brand-d);
  border-color: var(--brand-d);
}
/* 描边按钮 */
.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn-outline:hover {
  background: var(--brand);
  color: var(--white);
}
/* 白底描边（深色背景上） */
.btn-outline-w {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.70);
}
.btn-outline-w:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--white);
}
/* 暗色按钮 */
.btn-dark {
  background: #fff;
  color: #333333;
  border: 1px solid var(--brand);
}
.btn-dark:hover { background: #fff; color: var(--brand); border-color: var(--brand); }
/* 幽灵按钮 */
.btn-ghost {
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--gray-2);
}
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); }

/* 尺寸变体 */
.btn-sm  { padding: 7px 16px; font-size: 0.80rem; }
.btn-lg  { padding: 14px 40px; font-size: 0.92rem; }
.btn-full { width: 100%; justify-content: center; }

/* ─── 顶部公告条 ─── */
#announce-bar {
  background: #6D1212;
  color: rgba(255,255,255,0.95);
  height: var(--ann-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.84rem;             /* 大都会：公告条文字稍大 */
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.02em;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1010;
}
#announce-bar a {
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.6);
  padding-bottom: 1px;
  font-weight: 500;
  transition: opacity var(--t);
}
#announce-bar a:hover { opacity: 0.75; }
.ann-close {
  position: absolute;
  right: 20px;
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: color var(--t);
}
.ann-close:hover { color: #fff; }

/* ════════════════════════════════════════════════════════
   主导航 — 精确对标 metmuseum.org（88px 高度）
   ·  Logo 方块：撑满全高（显式 88px，不依赖 height:100%）
   ·  导航链接：align-items: flex-end，贴底，字体加粗
   ·  右侧按钮：align-self: flex-start，贴顶
   ·  overflow: hidden 防止任何内容撑高导航
   ════════════════════════════════════════════════════════ */
#nav {
  position: fixed;
  left: 0; right: 0;
  z-index: 1000;
  background: var(--brand);
  height: 88px;                   /* ★ 显式像素，不用变量，防止嵌套解析失败 */
  overflow: hidden;               /* ★ 锁死高度，任何内容超出直接裁剪 */
  display: flex;
  align-items: stretch;
  transition: box-shadow var(--t);
}
#nav.scrolled { box-shadow: 0 3px 14px rgba(0,0,0,0.22); }

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
  height: 88px;                   /* ★ 显式像素 */
  display: flex;
  align-items: stretch;
}

/* ── Logo 方块 ──────────────────────────────────────────
   大都会：Logo 占满导航全高，是醒目的独立方块
   大同堂：竖排书法 Logo，同样占满全高
   ─────────────────────────────────────────────────────── */
.nav-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  padding-right: 12px;
}
.nav-logo-box {
  width: 72px;
  height: 88px;                   /* ★ 显式像素，和 #nav 一致 */
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-logo-img {
  width: 56px;                    /* 宽度固定 */
  height: 76px;                   /* 高度固定，比 Logo 方块略小留呼吸感 */
  object-fit: contain;
  display: block;
}

/* ── 导航链接 ──────────────────────────────────────────
   大都会：贴底排列，字体 ~1rem 加粗 500，hover 只有底线
   ─────────────────────────────────────────────────────── */
.nav-links {
  flex: 1;
  display: flex;
  align-items: flex-end;          /* ★ 贴底 */
  justify-content: flex-start;
  height: 88px;                   /* ★ 显式像素 */
}
.nav-links a {
  display: flex;
  align-items: flex-end;
  height: 88px;                   /* ★ 撑满高度，文字实际通过 padding-bottom 定位 */
  padding: 0 16px 14px;           /* bottom: 14px 控制文字距底边 */
  font-size: 1rem;                /* ★ 加大 */
  font-weight: 500;               /* ★ 加粗，与大都会一致 */
  color: #fff;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: border-color var(--t), opacity var(--t);
  box-sizing: border-box;
}
.nav-links a:hover {
  /* ★ 大都会 hover：无背景，无加深，仅白色底线 */
  border-bottom-color: rgba(255,255,255,0.75);
  opacity: 1;
}
.nav-links a:not(:hover) { opacity: 0.88; }
.nav-links a.active {
  opacity: 1;
  font-weight: 600;
  border-bottom-color: #fff;
}

/* ── 右侧功能按钮 ──────────────────────────────────────
   大都会：贴顶排列，与链接高度错位
   ─────────────────────────────────────────────────────── */
.nav-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: flex-start;         /* ★ 贴顶 */
  padding-top: 16px;
  gap: 6px;
  height: auto;
}
.nav-actions a {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.92);
  font-family: var(--font-sans);
  padding: 5px 10px;
  transition: color var(--t);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.nav-actions a:hover { color: #fff; }
.nav-actions .btn-outline {
  padding: 5px 14px;
  font-size: 0.82rem;
  border: 1.5px solid rgba(255,255,255,0.8);
  color: #fff !important;
  background: transparent !important;
  border-radius: 3px;
}
.nav-actions .btn-outline:hover {
  background: rgba(255,255,255,0.15) !important;
  border-color: #fff !important;
}
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.22); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: var(--t);
  text-decoration: none;
}
.nav-avatar:hover { box-shadow: 0 0 0 3px rgba(139,99,49,0.25); }

/* 搜索按钮 */
.nav-search {
  background: none; border: none;
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  padding: 6px 12px 14px; cursor: pointer;
  transition: color var(--t), opacity var(--t);
  display: flex; align-items: flex-end;
  height: 88px;
  line-height: 1;
  border-bottom: 3px solid transparent;
  box-sizing: border-box;
}
.nav-search:hover { color: #fff; opacity: 1; border-bottom-color: rgba(255,255,255,0.75); }
@media (max-width: 960px) {
  .nav-search { height: 60px; padding-bottom: 10px; }
}
@media (max-width: 640px) {
  .nav-search { height: 54px; padding-bottom: 8px; }
}

/* ─── 搜索遮罩层 ─── */
#search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 9500;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  animation: searchFadeIn 0.18s ease;
}
#search-overlay.open { display: flex; }
@keyframes searchFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#search-box {
  width: 100%;
  max-width: 760px;
  margin: 0 20px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
#search-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  flex-shrink: 0;
}
.search-tab {
  padding: 10px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.search-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
#search-input-wrap {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
#search-input-wrap svg {
  flex-shrink: 0;
  color: var(--ink-3);
}
#search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 18px 12px;
  color: var(--ink-1);
  background: transparent;
  font-family: inherit;
}
#search-input::placeholder { color: var(--ink-3); }
#search-clear {
  background: none; border: none;
  color: var(--ink-3); cursor: pointer;
  font-size: 1.1rem; padding: 4px 8px;
  display: none;
  line-height: 1;
}
#search-clear.visible { display: block; }
#search-results {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
#search-results:empty::before {
  content: attr(data-hint);
  display: block;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.88rem;
  padding: 40px 20px;
}
.search-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 18px 6px;
  border-top: 1px solid var(--line);
}
.search-group-title:first-child { border-top: none; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background var(--t);
}
.search-result-item:hover { background: var(--bg-2); }
.search-result-item.focused { background: var(--bg-2); }
.search-result-thumb {
  width: 46px; height: 46px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--line);
}
.search-result-thumb-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--bg-2);
}
.search-result-text { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.search-result-title mark {
  background: none;
  color: var(--brand);
  font-weight: 700;
}
.search-result-sub {
  font-size: 0.77rem;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-tag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--bg-2);
  color: var(--ink-3);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.search-no-result {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
  font-size: 0.88rem;
}
.search-no-result strong { display: block; font-size: 1rem; color: var(--ink-2); margin-bottom: 6px; }
.search-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-3);
  display: flex;
  gap: 16px;
  flex-shrink: 0;
  background: var(--bg-2);
}
.search-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink-2);
}
/* 响应式：移动端 */
@media (max-width: 640px) {
  #search-overlay { padding-top: 0; align-items: flex-end; }
  #search-box {
    margin: 0;
    border-radius: 12px 12px 0 0;
    max-height: 85vh;
  }
  .search-footer { display: none; }
}

/* 汉堡菜单（白色三横线，在红色导航上） */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  border-radius: 1px;
  transition: var(--t);
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* 移动端菜单面板（红底白字，大都会风格） */
#nav-mobile {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 999;
  background: var(--brand);
  padding: 80px var(--gutter) 32px;
  gap: 0;
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
  overflow-y: auto;
}
#nav-mobile.open { transform: translateX(0); }
#nav-mobile a {
  display: block;
  padding: 18px 0;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  font-weight: 400;
  color: rgba(255,255,255,0.90);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.04em;
  transition: color var(--t);
}
#nav-mobile a:hover { color: #fff; }

/* ─── 导航下拉菜单（仿 Met Museum 全宽红色面板） ─── */
.nav-dd-btn {
  display: flex;
  align-items: flex-end;
  height: 88px;
  padding: 0 16px 14px;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: border-color var(--t), opacity var(--t);
  box-sizing: border-box;
  gap: 4px;
}
.nav-dd-btn:hover,
.nav-dd-btn.dd-open { border-bottom-color: #fff; color: #fff; }
.nav-dd-btn.active  { font-weight: 600; border-bottom-color: #fff; color: #fff; }
.nav-dd-arrow { font-size: 0.65rem; margin-left: 2px; opacity: 0.7; transition: transform 0.2s; }
.nav-dd-btn.dd-open .nav-dd-arrow { transform: rotate(180deg); }

#nav-dropdown-panel {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--ann-h) + 88px);
  background: var(--brand);
  z-index: 999;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, box-shadow 0.25s;
  box-shadow: none;
}
#nav-dropdown-panel.open {
  max-height: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.nav-dd-section { display: none; }
.nav-dd-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px var(--gutter) 32px;
  display: flex;
  align-items: flex-start;
  gap: 48px;
}
.nav-dd-main-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.03em;
  font-family: var(--font-ser);
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 2px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.nav-dd-main-link:hover { border-bottom-color: #fff; }
.nav-dd-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0 40px;
  flex-direction: row;
  align-items: center;
}
.nav-dd-item {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.82);
  font-family: var(--font-sans);
  padding: 5px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--t), border-color var(--t);
  white-space: nowrap;
}
.nav-dd-item:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.6); }

@media (max-width: 960px) {
  .nav-links   { display: none; }
  .nav-hamburger { display: flex; }

  /* 移动端：高度缩小到 60px，所有元素垂直居中 */
  #nav         { height: 60px; overflow: hidden; }
  .nav-inner   { height: 60px; }
  .nav-logo    { padding-right: 12px; align-items: center; }
  .nav-logo-box { width: 48px; height: 60px; }
  .nav-logo-img { width: 38px; height: 52px; }
  .nav-links   { height: 60px; }
  .nav-actions { align-self: center; padding-top: 0; }
}
@media (max-width: 640px) {
  #nav       { height: 54px; }
  .nav-inner { height: 54px; }
  .nav-logo-box { height: 54px; }
  .nav-logo-img { width: 34px; height: 46px; }
}

/* ─── 语言切换器 ─── */
.lang-switcher { position: relative; }
/* 语言切换器 — 大都会风格：无边框，纯文字 + 地球图标 */
.lang-toggle {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.88);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--t);
  letter-spacing: 0.02em;
}
.lang-toggle:hover { color: #fff; background: #6D1212; border-radius: var(--radius); }
.lang-dropdown {
  position: fixed;                  /* ★ fixed 脱离 #nav 的 overflow:hidden 裁剪 */
  background: var(--white);
  border: 1px solid var(--gray-2);
  box-shadow: var(--shadow);
  min-width: 130px; z-index: 1100;
  display: none; flex-direction: column; overflow: hidden;
  border-radius: 0 0 4px 4px;
}
.lang-dropdown.open { display: flex; }
.lang-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 0.83rem;
  color: var(--ink-2); background: transparent; border: none;
  cursor: pointer; font-family: var(--font-sans);
  transition: background var(--t); text-align: left;
}
.lang-opt:hover { background: var(--gray-1); color: var(--ink); }
.lang-opt.active { color: var(--brand); font-weight: 600; background: var(--brand-pale); }

/* ─── 内页 Hero Banner（大都会：白底大标题区） ─── */
.hero-banner {
  padding: clamp(56px, 8vw, 104px) var(--gutter) clamp(48px, 7vw, 88px);
  text-align: center;
  background: var(--white);
  border-bottom: 3px solid var(--brand);
  position: relative;
}
.hero-banner h1 {
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  color: var(--ink);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  font-family: var(--font-ser);
  font-weight: 600;
  line-height: 1.18;
}
.hero-banner p {
  color: var(--ink-3);
  max-width: 540px;
  margin: 16px auto 0;
  font-size: 0.96rem;
  line-height: 1.82;
  font-family: var(--font-sans);
}

/* ─── 卡片系统（大都会：无边框，hover时出现阴影） ─── */
.card {
  background: var(--white);
  overflow: hidden;
  transition: box-shadow 0.28s var(--ease), transform 0.28s var(--ease);
  cursor: pointer;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card-img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.card-body { padding: 20px 22px 24px; }
.card-eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--brand);
  font-family: var(--font-en);
  font-style: italic;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.card-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
  font-family: var(--font-ser);
}
.card-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  background: var(--gray-1);
  color: var(--ink-3);
  margin-bottom: 8px;
  font-family: var(--font-sans);
  text-transform: uppercase;
}
.card-tag.gold { background: var(--brand-pale); color: var(--brand-d); }
.card-meta {
  font-size: 0.78rem;
  color: var(--ink-3);
  font-family: var(--font-sans);
  line-height: 1.6;
}
.card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  margin-top: 12px;
  font-family: var(--font-en);
  letter-spacing: 0.04em;
}
.card-price .original {
  font-size: 0.76rem;
  color: var(--ink-4);
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 400;
}
.card-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--gray-2);
}

/* ─── Grid 系统 ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 16px; }
}

/* ─── Tab 标签（大都会风格：下划线式） ─── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-2);
  margin-bottom: 40px;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 12px 22px;
  font-size: 0.86rem;
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--t);
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ─── 徽章 ─── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}
.badge-free   { background: #EBF5EB; color: var(--green); }
.badge-member { background: var(--brand-pale); color: var(--brand-d); }
.badge-vip    { background: var(--ink); color: #DAAF6A; }

/* ─── 表单 ─── */
.form-group { margin-bottom: 22px; }
.form-label {
  display: block;
  font-size: 0.84rem;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--gray-2);
  font-family: var(--font-sans);
  font-size: max(16px, 0.92rem);   /* iOS防缩放 */
  transition: border-color var(--t);
  outline: none;
  border-radius: var(--radius);
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(139,99,49,0.10);
}
.form-input::placeholder { color: var(--ink-4); }
.form-error  { font-size: 0.76rem; color: var(--red); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.form-hint   { font-size: 0.76rem; color: var(--ink-4); margin-top: 4px; }

/* ─── 灯箱 ─── */
#lightbox {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.96);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-height: 88vh; max-width: 88vw;
  object-fit: contain;
}
#lightbox-close {
  position: absolute; top: 24px; right: 28px;
  color: rgba(255,255,255,0.50); font-size: 1.6rem;
  cursor: pointer; background: none; border: none;
  padding: 8px; line-height: 1;
  transition: color var(--t);
}
#lightbox-close:hover { color: #fff; }
#lightbox-caption {
  position: absolute; bottom: 28px; left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,0.45);
  font-size: 0.80rem; letter-spacing: 0.14em;
  font-family: var(--font-en); font-style: italic;
}
@media (max-width: 640px) {
  #lightbox-close { top: 12px; right: 12px; font-size: 1.8rem; padding: 12px; }
  #lightbox img { max-width: 96vw; max-height: 80vh; }
}

/* ─── 作品图块 ─── */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 3px; }
.art-item {
  position: relative; overflow: hidden;
  cursor: pointer; background: var(--gray-1);
}
.art-item img {
  width: 100%; height: 280px; object-fit: cover;
  transition: transform 0.55s var(--ease);
  display: block;
}
.art-item:hover img { transform: scale(1.04); }
.art-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, transparent 55%);
  opacity: 0; transition: opacity 0.28s var(--ease);
  display: flex; align-items: flex-end; padding: 18px;
}
.art-item:hover .art-overlay { opacity: 1; }
.art-overlay-text { color: #fff; }
.art-overlay-text h4 { font-size: 0.90rem; font-weight: 600; margin-bottom: 3px; font-family: var(--font-ser); }
.art-overlay-text span { font-size: 0.74rem; color: rgba(255,255,255,0.65); }
.member-only-mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.member-only-mask .lock-icon { font-size: 1.6rem; color: var(--brand-lt); }
.member-only-mask span { font-size: 0.80rem; color: rgba(255,255,255,0.85); letter-spacing: 0.08em; }

/* ─── 课程卡片 ─── */
.course-card { display: flex; flex-direction: column; }
.course-card .card-img { aspect-ratio: 16/9; }
.course-card .card-body { flex: 1; display: flex; flex-direction: column; }

/* ─── 登录/注册页 ─── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-1); padding: 24px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--gray-2);
  padding: clamp(36px, 5vw, 56px) clamp(28px, 5vw, 48px);
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 36px; }
.auth-logo h1 { font-size: 1.5rem; letter-spacing: 0.14em; color: var(--brand); font-family: var(--font-ser); }
.auth-logo .en-sub {
  font-size: 0.64rem; color: var(--ink-4);
  letter-spacing: 0.24em; margin-top: 6px;
  font-family: var(--font-en); font-style: italic;
}
.auth-logo .gold-line { width: 28px; height: 2px; background: var(--brand); margin: 12px auto; }
.auth-tabs {
  display: flex; margin-bottom: 32px;
  border-bottom: 2px solid var(--gray-2);
}
.auth-tab {
  flex: 1; text-align: center; padding: 10px;
  font-size: 0.88rem; cursor: pointer;
  color: var(--ink-3); font-family: var(--font-sans);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  background: none; border-left: none; border-right: none; border-top: none;
  transition: var(--t); letter-spacing: 0.04em;
}
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-footer-note {
  text-align: center; margin-top: 20px;
  font-size: 0.80rem; color: var(--ink-3);
}
.auth-footer-note a { color: var(--brand); }

/* ─── 会员中心 ─── */
.member-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
@media (max-width: 768px) { .member-layout { grid-template-columns: 1fr; } }
.member-sidebar {
  background: var(--white);
  border: 1px solid var(--gray-2);
  padding: 28px 20px;
}
.member-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 700;
  margin: 0 auto 14px;
}
.member-menu { margin-top: 20px; }
.member-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px;
  font-size: 0.86rem; font-family: var(--font-sans);
  color: var(--ink-2);
  transition: var(--t);
  letter-spacing: 0.02em;
}
.member-menu a:hover,
.member-menu a.active { background: var(--gray-1); color: var(--brand); }

/* ─── 页脚（大都会：深色底，清晰白字） ─── */
#footer {
  background: #1a1814;
  color: rgba(255,255,255,0.62);
  padding: clamp(48px, 7vw, 80px) 0 0;
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
}
/* Logo区 */
.footer-brand-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.footer-logo-box {
  width: 40px; height: 48px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden;
}
.footer-logo-img {
  width: 32px; height: 40px;
  object-fit: contain; display: block;
}
.footer-brand-name {
  font-size: 1.05rem; font-weight: 700;
  color: var(--white); letter-spacing: 0.16em;
  font-family: var(--font-ser);
}
.footer-brand p {
  font-size: 0.80rem; line-height: 1.9;
  color: rgba(255,255,255,0.55);
  max-width: 248px;
  font-family: var(--font-sans);
  font-weight: 300;
}
.footer-gold-line {
  width: 24px; height: 2px;
  background: var(--brand-lt);
  margin: 14px 0;
}
.footer-col h4 {
  color: rgba(255,255,255,0.90);
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.footer-col a {
  display: block;
  font-size: 0.80rem;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.60);
  font-family: var(--font-sans);
  font-weight: 300;
  transition: color var(--t);
  letter-spacing: 0.02em;
}
.footer-col a:hover { color: rgba(255,255,255,0.95); }
.footer-bottom {
  max-width: var(--container); margin: 48px auto 0;
  padding: 20px var(--gutter);
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; font-family: var(--font-sans); font-weight: 300;
  color: rgba(255,255,255,0.38);
  flex-wrap: wrap; gap: 8px;
}
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ─── Toast ─── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 4000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  padding: 13px 20px; background: var(--ink); color: var(--white);
  font-size: 0.85rem; font-family: var(--font-sans);
  box-shadow: var(--shadow-lg); pointer-events: none;
  animation: toast-in 0.24s var(--ease);
  max-width: 300px; letter-spacing: 0.02em;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--brand); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 回顶部 ─── */
#back-top {
  position: fixed; bottom: 32px; right: 28px; z-index: 500;
  width: 44px; height: 44px;
  background: var(--brand); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; opacity: 0; pointer-events: none;
  transition: opacity 0.28s, transform 0.28s; cursor: pointer;
  border: none;
}
#back-top.visible { opacity: 1; pointer-events: auto; }
#back-top:hover { background: var(--brand-d); transform: translateY(-2px); }
@media (max-width: 640px) { #back-top { bottom: 20px; right: 16px; } }

/* ─── 分割线 ─── */
.divider {
  display: flex; align-items: center; gap: 20px; margin: 56px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-2);
}
.divider-icon {
  color: var(--brand); font-size: 0.72rem;
  letter-spacing: 0.32em; white-space: nowrap;
  font-family: var(--font-en); font-style: italic;
}

/* ─── 工具类 ─── */
.text-center { text-align: center; }
.text-brand  { color: var(--brand); }
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-8  { margin-bottom: 32px; }
.hidden { display: none !important; }
.page-top { margin-top: 0; }

/* ─── 响应式断点 ─── */
@media (min-width: 768px) and (max-width: 1024px) {
  .container { padding: 0 32px; }
  .section { padding: 72px 0; }
  .footer-inner { grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
}
@media (max-width: 960px) {
  :root { --nav-h: 60px; --ann-h: 36px; }
  /* 导航栏 960px 以下：隐藏文字按钮，只保留语言切换器（汉堡菜单负责登录/会员） */
  .nav-member-btn,
  #nav-login-btn,
  #nav-logout-btn,
  #nav-avatar { display: none !important; }
  #nav-avatar.mobile-show { display: flex !important; }
}
@media (max-width: 640px) {
  :root {
    --nav-h: 54px;
    --ann-h: 34px;
    --section-v: 56px;
    --gutter: 16px;
  }
  body { line-height: 1.72; }
  .btn-lg { padding: 12px 28px; font-size: 0.88rem; }
  .card-body { padding: 16px 18px 20px; }
  .sec-head { margin-bottom: 28px; }
  /* 语言下拉框在小屏：fixed 定位由 JS 计算，此处不覆盖 */
  /* course-detail 学习成果网格：手机单列 */
  .outcomes-grid { grid-template-columns: 1fr !important; }
  /* 价格表横向可滚动 */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 公告条文字缩小 */
  #announce-bar { font-size: 0.75rem; padding: 6px var(--gutter); }
}
@media (max-width: 480px) {
  :root { --gutter: 14px; }
  /* 登录卡片内边距缩小 */
  .auth-card { padding: 28px 20px; }
  /* 课程行卡片：图片和内容垂直排列 */
  .course-row { flex-direction: column; }
  .course-row-img { width: 100%; height: 180px; }
}

/* 触控优化（iOS/Android 点击目标最小 44px） */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .tab-btn { min-height: 44px; }
  .nav-links a { min-height: 44px; }
  .lang-opt { min-height: 44px; padding: 12px 16px; }
  .filter-item { min-height: 44px; }
  .card { transform: none !important; }
  .card:active { box-shadow: var(--shadow); }
  /* 触控设备禁用 hover 变换，防止 iOS 点击后卡住 */
  .card:hover { transform: none; box-shadow: none; }
}

/* iPhone 安全区域（刘海 / Dynamic Island / Home Bar） */
@supports (padding: max(0px)) {
  #nav { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
  #announce-bar { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
  #footer { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
  #nav-mobile { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}

/* 超宽屏 */
@media (min-width: 1600px) {
  :root { --container: 1400px; }
}

/* ─── 二维码弹窗（页脚联系我们） ─── */
#qr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#qr-overlay.open { display: flex; }
#qr-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  text-align: center;
  max-width: 260px;
  width: 90%;
  position: relative;
  animation: qrSlideIn 0.25s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}
@keyframes qrSlideIn {
  from { opacity:0; transform: scale(0.92) translateY(12px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
#qr-box img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #f0ebe3;
  margin-bottom: 14px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
#qr-title {
  font-size: 15px;
  font-weight: 700;
  color: #2c1810;
  margin-bottom: 6px;
}
#qr-hint {
  font-size: 12px;
  color: #999;
  line-height: 1.6;
  margin-bottom: 16px;
}
#qr-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  font-size: 18px; color: #bbb;
  cursor: pointer; line-height: 1;
  padding: 4px;
  transition: color .15s;
}
#qr-close:hover { color: #555; }
.qr-close-btn {
  width: 100%;
  padding: 10px;
  background: #8B4513;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s;
}
.qr-close-btn:hover { background: #7a3a0f; }
