/* ============================================================
   南雁归云 · 南雁回声文化育人品牌平台
   主题：温暖 · 简约 · 书香
   色板：米白 #F7F4EC / 墨绿 #2F4A3C / 暖棕 #8B5E3C
   ============================================================ */
:root {
  --paper: #f7f4ec;
  --paper-2: #fdfbf5;
  --paper-3: #efe9db;
  --ink: #2f4a3c;
  --ink-deep: #22382d;
  --ink-soft: #5c7264;
  --brown: #8b5e3c;
  --brown-deep: #6f4a2e;
  --brown-soft: #c9a227;
  --seal: #9e2b25;
  --text: #2c2c2c;
  --text-2: #5a5a55;
  --line: #dcd5c4;
  --line-soft: #e8e2d3;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 2px 10px rgba(47, 74, 60, .08);
  --shadow-lg: 0 8px 28px rgba(47, 74, 60, .14);
  --header-h: 64px;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}
body.font-lg { font-size: 17px; }
body.font-xl { font-size: 19px; }
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--brown); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* 无障碍：焦点状态 */
:focus-visible {
  outline: 3px solid var(--brown-soft);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* 字体调节条 */
.font-bar {
  display: flex; align-items: center; gap: 4px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 6px;
}
.font-bar button {
  border: none; background: transparent; color: var(--ink-soft);
  width: 26px; height: 26px; border-radius: 50%; font-size: 13px; line-height: 1;
}
.font-bar button:hover { background: var(--paper-3); }
.font-bar .sep { width: 1px; height: 14px; background: var(--line); }

/* ============ 头部导航 ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 244, 236, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  height: var(--header-h); display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 10px; overflow: hidden;
  background: var(--paper-3); flex: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--ink-deep); letter-spacing: 2px; white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--brown); }
.brand-sub { font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; margin-top: -3px; white-space: nowrap; }

.main-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.main-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 14.5px; color: var(--text-2); font-weight: 500; white-space: nowrap;
}
.main-nav a:hover { background: var(--paper-3); color: var(--ink); }
.main-nav a.active { color: var(--ink); background: rgba(47, 74, 60, .1); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  background: var(--paper-2); border-radius: 10px; font-size: 20px; color: var(--ink);
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: var(--header-h); right: 0; left: 0;
    background: var(--paper-2); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px;
    gap: 4px; display: none; box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 12px; font-size: 16px; }
  .font-bar { display: none; }
  .brand-sub { display: none; }
}

/* ============ 页脚 ============ */
.site-footer {
  background: var(--ink-deep); color: #cfd9d2; margin-top: 64px;
  padding: 44px 16px 28px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-brand .brand-name { color: #f2efe6; }
.footer-brand p { font-size: 13px; color: #9fb0a4; margin-top: 10px; max-width: 420px; }
.footer-col h4 { color: #f2efe6; font-size: 14px; margin-bottom: 12px; letter-spacing: 1px; }
.footer-col a { display: block; color: #9fb0a4; font-size: 13.5px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px; margin: 32px auto 0; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12.5px; color: #7e9188; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ============ 通用区块 ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page-hero {
  padding: 44px 16px 36px; text-align: center;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201, 162, 39, .10), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(47, 74, 60, .08), transparent 55%),
    var(--paper);
}
.page-hero h1 { font-family: var(--font-serif); font-size: 30px; color: var(--ink-deep); letter-spacing: 3px; }
.page-hero h1 .seal { color: var(--seal); font-size: .7em; }
.page-hero .sub { margin-top: 10px; color: var(--brown); font-size: 15px; letter-spacing: 2px; }
.page-hero p.lead { max-width: 720px; margin: 14px auto 0; color: var(--text-2); font-size: 14.5px; }

.section-block { padding: 40px 0 8px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-serif); font-size: 22px; color: var(--ink-deep); letter-spacing: 2px; position: relative; padding-left: 14px; }
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px;
  background: var(--brown); border-radius: 3px;
}
.section-head .more { margin-left: auto; font-size: 13.5px; color: var(--brown); }

/* 卡片 */
.card {
  background: var(--paper-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .cover { aspect-ratio: 4/3; overflow: hidden; background: var(--paper-3); position: relative; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .cover img { transform: scale(1.04); }
.card .body { padding: 14px 16px 16px; }
.card .tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: rgba(47, 74, 60, .08); color: var(--ink); font-size: 11.5px;
}
.tag.brown { background: rgba(139, 94, 60, .1); color: var(--brown-deep); }
.tag.gold { background: rgba(201, 162, 39, .14); color: #8a6d13; }
.card .title { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.5; }
.card .title a:hover { color: var(--brown); }
.card .meta { margin-top: 8px; font-size: 12.5px; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; }
.card .summary { margin-top: 8px; font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .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-2 { grid-template-columns: 1fr; } }

/* 筛选条 */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px;
  padding: 10px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.filter-bar .fbtn {
  padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--text-2); font-size: 13.5px;
}
.filter-bar .fbtn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-bar .fbtn:hover:not(.active) { border-color: var(--brown); color: var(--brown); }

/* 空状态 & 加载 */
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); font-size: 14px; }
.loading { text-align: center; padding: 40px 16px; color: var(--ink-soft); }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brown);
  border-radius: 50%; margin: 0 auto 10px; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 首页 Hero ============ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(34, 56, 45, .92), rgba(34, 56, 45, .78)), var(--ink-deep);
  color: #f2efe6; text-align: center; padding: 84px 16px 66px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 110%, rgba(201, 162, 39, .18), transparent),
    radial-gradient(ellipse 40% 35% at 85% 15%, rgba(139, 94, 60, .25), transparent);
}
.hero .hero-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22;
}
.hero-inner { position: relative; z-index: 2; max-width: 860px; margin: 0 auto; }
.hero .logo-badge {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 20px; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.hero .logo-badge img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.hero h1 { font-family: var(--font-serif); font-size: clamp(34px, 7vw, 54px); letter-spacing: 10px; font-weight: 700; }
.hero h1 em { font-style: normal; color: #e4c46b; }
.hero .tagline { margin-top: 16px; font-family: var(--font-serif); font-size: clamp(17px, 3.4vw, 22px); color: #e9e2d2; letter-spacing: 5px; }
.hero .intro { margin: 18px auto 0; max-width: 640px; font-size: 14.5px; color: #c4d0c7; line-height: 2; }
.hero .hero-cta { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; transition: all .2s;
}
.btn.primary { background: var(--brown); color: #fff; }
.btn.primary:hover { background: var(--brown-deep); color: #fff; }
.btn.ghost { border-color: rgba(255, 255, 255, .45); color: #fff; background: rgba(255, 255, 255, .08); }
.btn.ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: var(--ink-deep); color: #fff; }
.btn.outline { border-color: var(--line); background: var(--paper-2); color: var(--ink); }
.btn.outline:hover { border-color: var(--brown); color: var(--brown); }

/* 数据统计 */
.stats-bar {
  background: var(--paper-2); border-bottom: 1px solid var(--line-soft);
}
.stats-inner { max-width: 1200px; margin: 0 auto; padding: 26px 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.stat-item .num { font-family: var(--font-serif); font-size: clamp(26px, 4.5vw, 38px); font-weight: 700; color: var(--brown); }
.stat-item .num i { font-style: normal; font-size: .6em; color: var(--brown-soft); }
.stat-item .label { margin-top: 4px; font-size: 13px; color: var(--text-2); letter-spacing: 1px; }
@media (max-width: 640px) { .stats-inner { grid-template-columns: repeat(2, 1fr); } }

/* 精彩瞬间轮播 */
.carousel { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: var(--paper-3); }
.carousel .slides { display: flex; height: 100%; transition: transform .5s ease; }
.carousel .slide { min-width: 100%; height: 100%; position: relative; }
.carousel .slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel .slide .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 18px 14px;
  background: linear-gradient(transparent, rgba(20, 30, 24, .75));
  color: #fff; font-size: 14px;
}
.carousel .arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 18px; z-index: 3;
}
.carousel .arrow.prev { left: 12px; }
.carousel .arrow.next { right: 12px; }
.carousel .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; z-index: 3; }
.carousel .dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .5); }
.carousel .dots button.on { background: #fff; transform: scale(1.25); }

/* 栏目入口卡 */
.entry-card { position: relative; padding: 26px 22px; height: 100%; }
.entry-card .ec-num { font-family: var(--font-serif); font-size: 30px; color: rgba(139, 94, 60, .25); position: absolute; right: 16px; top: 12px; font-weight: 700; }
.entry-card h3 { font-family: var(--font-serif); font-size: 19px; color: var(--ink-deep); letter-spacing: 2px; margin-bottom: 8px; }
.entry-card h3::after { content: ""; display: block; width: 26px; height: 3px; background: var(--brown); border-radius: 2px; margin-top: 8px; }
.entry-card p { font-size: 13.5px; color: var(--text-2); margin-top: 8px; line-height: 1.8; }
.entry-card .ec-go { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--brown); font-weight: 600; }
.entry-card:hover { border-color: var(--brown); }

/* ============ 时间线 ============ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--brown), rgba(139, 94, 60, .15));
}
.tl-item { position: relative; padding: 0 0 26px 18px; }
.tl-item::before {
  content: ""; position: absolute; left: -23px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--brown);
}
.tl-item.hot::before { background: var(--brown); }
.tl-item .tl-date { font-size: 12.5px; color: var(--brown); letter-spacing: 1px; font-weight: 600; }
.tl-item .tl-title { font-size: 16.5px; font-weight: 600; color: var(--text); margin-top: 2px; }
.tl-item .tl-title a:hover { color: var(--brown); }
.tl-item .tl-summary { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.tl-item .tl-meta { font-size: 12.5px; color: var(--text-2); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.tl-item .tl-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tl-item .tl-thumbs img {
  width: 108px; height: 76px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line-soft); cursor: pointer;
}
.tl-item .tl-thumbs img:hover { opacity: .85; }

/* ============ 详情页 ============ */
.detail-wrap { max-width: 860px; margin: 0 auto; padding: 34px 16px; }
.detail-head { text-align: center; margin-bottom: 26px; }
.detail-head h1 { font-family: var(--font-serif); font-size: 26px; color: var(--ink-deep); letter-spacing: 2px; line-height: 1.5; }
.detail-head .meta { margin-top: 12px; font-size: 13px; color: var(--text-2); display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.detail-body { font-size: 15px; line-height: 2.1; color: #3a3a36; }
.detail-body p { margin-bottom: 14px; }
.detail-body h3 { font-family: var(--font-serif); color: var(--ink-deep); margin: 22px 0 10px; font-size: 18px; }
.detail-body img { border-radius: 10px; margin: 12px 0; }
.detail-gallery { margin-top: 30px; }
.detail-gallery h3 { font-family: var(--font-serif); color: var(--ink-deep); margin-bottom: 14px; font-size: 18px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery-grid img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px;
  cursor: zoom-in; border: 1px solid var(--line-soft);
}
.detail-videos { margin-top: 26px; }
.detail-videos video { width: 100%; border-radius: 10px; background: #000; margin-bottom: 12px; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 999; background: rgba(15, 20, 17, .92);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox .lb-close { position: absolute; top: 18px; right: 22px; background: none; border: none; color: #fff; font-size: 34px; line-height: 1; }

/* ============ 南小雁聊天 ============ */
.chat-fab {
  position: fixed; right: 18px; bottom: 22px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; border: none;
  border-radius: 999px; padding: 8px 18px 8px 8px;
  box-shadow: 0 8px 24px rgba(34, 56, 45, .35); font-size: 14.5px; font-weight: 600;
}
.chat-fab img { width: 34px; height: 34px; border-radius: 50%; background: #fff; }
.chat-fab:hover { background: var(--ink-deep); color: #fff; transform: translateY(-2px); }

.chat-page { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }
.chat-hero { text-align: center; padding: 20px 0 24px; }
.chat-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px; background: var(--paper-3); border: 2px solid var(--line); overflow: hidden; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-hero h1 { font-family: var(--font-serif); font-size: 24px; color: var(--ink-deep); letter-spacing: 2px; }
.chat-hero p { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.chat-hero .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.chips .chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-2); font-size: 13px; color: var(--ink-soft); transition: all .2s;
}
.chips .chip:hover { border-color: var(--brown); color: var(--brown); background: #fff; }

.chat-box {
  background: var(--paper-2); border: 1px solid var(--line-soft);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; height: 62vh; min-height: 420px;
}
.chat-log { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg .avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden; background: var(--paper-3); }
.msg .avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg .bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.8;
  border-top-left-radius: 4px; white-space: pre-wrap; word-break: break-word;
}
.msg.ai .bubble { background: var(--paper-3); color: var(--text); }
.msg.me { flex-direction: row-reverse; margin-left: auto; }
.msg.me .bubble { background: var(--ink); color: #fff; border-radius: 12px; border-top-right-radius: 4px; }
.chat-input { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line-soft); background: #fff; }
.chat-input textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-size: 14.5px; resize: none; height: 46px; font-family: inherit; background: var(--paper);
}
.chat-input textarea:focus { outline: none; border-color: var(--brown); }
.chat-input .send {
  background: var(--brown); color: #fff; border: none; border-radius: 10px;
  padding: 0 22px; font-size: 14.5px; font-weight: 600;
}
.chat-input .send:hover { background: var(--brown-deep); }
.chat-input .send:disabled { opacity: .5; cursor: not-allowed; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brown-soft); margin-right: 4px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ============ 后台 ============ */
.admin-body { background: #f3f1ea; }
.admin-layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--ink-deep); color: #cfd9d2; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .a-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.admin-side .a-brand img { width: 34px; height: 34px; border-radius: 8px; background: #fff; object-fit: cover; }
.admin-side .a-brand span { font-family: var(--font-serif); color: #f2efe6; letter-spacing: 2px; font-size: 15px; }
.admin-side nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px;
  color: #a9b8ad; font-size: 14px; margin-bottom: 3px;
}
.admin-side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.admin-side .a-user { margin-top: 18px; padding: 12px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: #8fa398; }
.admin-main { padding: 24px 26px 60px; max-width: 1300px; }
.admin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { font-family: var(--font-serif); font-size: 22px; color: var(--ink-deep); }
.admin-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.dash-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 18px; }
.dash-card .dc-num { font-size: 28px; font-weight: 700; color: var(--brown); font-family: var(--font-serif); }
.dash-card .dc-label { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.a-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.a-card h3 { font-size: 15.5px; color: var(--ink-deep); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 10px 10px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:hover td { background: #faf8f2; }
.table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.badge.pub { background: rgba(47, 74, 60, .12); color: var(--ink); }
.badge.draft { background: rgba(201, 162, 39, .16); color: #8a6d13; }
.badge.admin { background: rgba(139, 94, 60, .14); color: var(--brown-deep); }
.badge.editor { background: rgba(47, 74, 60, .1); color: var(--ink); }
.badge.user { background: #ecebe4; color: #6a6a64; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(139, 94, 60, .1); }
.field textarea { resize: vertical; min-height: 90px; }
@media (max-width: 820px) { .admin-layout { grid-template-columns: 1fr; } .admin-side { position: static; height: auto; } .form-grid { grid-template-columns: 1fr; } }

/* 模态 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 26, 22, .5); z-index: 500;
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 760px;
  padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.25); position: relative;
}
.modal h2 { font-size: 18px; color: var(--ink-deep); margin-bottom: 16px; padding-right: 40px; }
.modal .m-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 26px; color: var(--text-2); line-height: 1; }
.modal .m-close:hover { color: var(--seal); }
.modal .m-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.upload-zone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 26px;
  text-align: center; color: var(--text-2); font-size: 13.5px; background: #faf9f4;
}
.upload-zone:hover { border-color: var(--brown); background: #fffdf7; }
.upload-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-top: 12px; }
.upload-list .u-item { position: relative; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--paper-3); }
.upload-list .u-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-list .u-item .u-del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 6px; width: 22px; height: 22px; font-size: 13px; line-height: 1; }

.notice { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: none; }
.notice.show { display: block; }
.notice.ok { background: rgba(47, 74, 60, .1); color: var(--ink); }
.notice.err { background: rgba(158, 43, 37, .08); color: var(--seal); }

@media (max-width: 640px) {
  .btn { padding: 10px 18px; font-size: 14px; }
  .page-hero h1 { font-size: 24px; }
  .section-head h2 { font-size: 19px; }
}

/* 打印友好 */
@media print {
  .site-header, .site-footer, .chat-fab, .filter-bar { display: none; }
  body { background: #fff; }
}

/* ============================================================
   SPA 模式（对齐「职场写作AI教师」形态）
   登录遮罩 / 顶栏 / 内容面板 / 常驻聊天侧边栏 / 分享 / 看板
   ============================================================ */
.mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(34, 56, 45, .45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.mask.hidden { display: none; }
.login-box {
  background: var(--paper-2); border-radius: 18px; width: 100%; max-width: 400px;
  padding: 34px 30px 28px; box-shadow: 0 24px 60px rgba(20, 30, 24, .3);
  text-align: center;
}
.login-box .lb-logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 14px; overflow: hidden; border: 2px solid var(--line); }
.login-box .lb-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-box h2 { font-family: var(--font-serif); font-size: 22px; color: var(--ink-deep); letter-spacing: 2px; }
.login-box .lb-sub { font-size: 13px; color: var(--text-2); margin: 8px 0 20px; }
.login-box input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; margin-bottom: 12px;
  background: #fff; color: var(--text);
}
.login-box input:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(139, 94, 60, .12); }
.login-box .row { display: flex; gap: 10px; }
.login-box .row input:first-child { flex: 1; }
.login-box .btn { width: 100%; justify-content: center; }
.login-box .lb-foot { margin-top: 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.8; }
.login-box .lb-foot a { color: var(--brown); cursor: pointer; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(247, 244, 236, .95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; padding: 0 16px; height: var(--header-h);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.topbar .brand .logo { width: 38px; height: 38px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.topbar .brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.topbar .brand-name { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--ink-deep); letter-spacing: 2px; white-space: nowrap; }
.topbar .brand-name em { font-style: normal; color: var(--brown); }
.topbar .top-nav { display: flex; gap: 2px; margin-left: 14px; overflow-x: auto; scrollbar-width: none; }
.topbar .top-nav::-webkit-scrollbar { display: none; }
.topbar .top-nav a {
  padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2);
  white-space: nowrap; font-weight: 500; cursor: pointer;
}
.topbar .top-nav a:hover { background: var(--paper-3); color: var(--ink); }
.topbar .top-nav a.active { color: var(--ink); background: rgba(47, 74, 60, .1); }
.topbar .user-area { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.topbar .user-area .uname { font-size: 13px; color: var(--text-2); margin-right: 4px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-btn {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  border-radius: 8px; padding: 7px 11px; font-size: 13px; cursor: pointer; line-height: 1;
}
.tb-btn:hover { border-color: var(--brown); color: var(--brown); }
.tb-btn.primary { background: var(--brown); border-color: var(--brown); color: #fff; }
.tb-btn.primary:hover { background: var(--brown-deep); }

/* 主布局 */
.app-main { display: flex; align-items: stretch; min-height: calc(100vh - var(--header-h)); }
.content-panel { flex: 1; min-width: 0; padding: 0 16px 60px; }
.chat-sidebar {
  width: 380px; flex: none; border-left: 1px solid var(--line-soft);
  background: var(--paper-2); display: flex; flex-direction: column;
  height: calc(100vh - var(--header-h)); position: sticky; top: var(--header-h);
}
.chat-sidebar.closed { display: none; }
.chat-sidebar .chat-hdr {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.chat-sidebar .chat-hdr .avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none; }
.chat-sidebar .chat-hdr .avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-sidebar .chat-hdr .t { font-family: var(--font-serif); font-size: 15px; color: var(--ink-deep); font-weight: 700; }
.chat-sidebar .chat-hdr .t small { display: block; font-family: var(--font-sans); font-size: 11px; color: var(--text-2); font-weight: 400; }
.chat-sidebar .chat-hdr .sp { margin-left: auto; display: flex; gap: 4px; }
.chat-sidebar .chat-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.chat-sidebar .chat-foot { border-top: 1px solid var(--line-soft); padding: 10px 12px 12px; background: #fff; }
.chat-sidebar .chat-model-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--text-2); }
.chat-sidebar .chat-model-bar select {
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px;
  font-size: 12px; font-family: inherit; background: var(--paper);
}
.chat-sidebar .chat-input-row { display: flex; gap: 6px; align-items: flex-end; }
.chat-sidebar .chat-input-row textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 14px; resize: none; height: 44px; max-height: 110px; font-family: inherit; background: var(--paper);
}
.chat-sidebar .chat-input-row textarea:focus { outline: none; border-color: var(--brown); }
.chat-sidebar .btn-icon { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); font-size: 16px; }
.chat-sidebar .btn-icon:hover { border-color: var(--brown); }

/* 分享弹窗 */
.share-box {
  background: var(--paper-2); border-radius: 18px; width: 100%; max-width: 360px;
  padding: 26px 24px; box-shadow: 0 24px 60px rgba(20, 30, 24, .3); text-align: center;
}
.share-box h3 { font-family: var(--font-serif); font-size: 18px; color: var(--ink-deep); }
.share-box .share-qr { margin: 16px auto; width: 180px; height: 180px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; align-items: center; justify-content: center; }
.share-box .share-qr canvas, .share-box .share-qr img { width: 100% !important; height: 100% !important; }
.share-link-row { display: flex; gap: 8px; }
.share-link-row input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; background: #fff; color: var(--text); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: var(--ink-deep); color: #f2efe6; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 999; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 看板 */
.dash-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 0; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.dash-card {
  background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 20px 18px; text-align: center;
}
.dash-card .n { font-family: var(--font-serif); font-size: 30px; font-weight: 700; color: var(--brown); }
.dash-card .l { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.dash-chart-card { background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.dash-chart-card h3 { font-family: var(--font-serif); font-size: 16px; color: var(--ink-deep); margin-bottom: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .lb { width: 88px; font-size: 13px; color: var(--text-2); flex: none; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-bg { flex: 1; height: 18px; background: var(--paper-3); border-radius: 9px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: linear-gradient(90deg, var(--brown), var(--brown-soft)); border-radius: 9px; min-width: 2px; }
.bar-row .v { width: 46px; font-size: 12.5px; color: var(--brown-deep); font-weight: 600; }

/* 详情模态（SPA 内嵌详情） */
.detail-modal { max-width: 760px !important; }
.detail-modal .dm-body { max-height: 66vh; overflow-y: auto; padding-right: 6px; }
.detail-modal .dm-body img { border-radius: 10px; margin: 8px 0; }
.detail-modal .dm-body .gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.detail-modal .dm-body .gal img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: zoom-in; }

/* SPA 响应式 */
@media (max-width: 960px) {
  .app-main { flex-direction: column; }
  .chat-sidebar {
    width: 100%; height: 62vh; position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    z-index: 400; border-left: none; border-top: 1px solid var(--line-soft);
    box-shadow: 0 -10px 30px rgba(34, 56, 45, .18); border-radius: 16px 16px 0 0;
  }
  .topbar .user-area .uname { display: none; }
  .topbar .tb-btn { padding: 7px 9px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar .brand-name { font-size: 16px; letter-spacing: 1px; }
  .login-box { padding: 26px 20px 22px; }
}
