/* ==========================================================================
   广西大学智能建造研究所 · 站点样式
   设计基调：浅色、克制、技术感。小圆角 + 细描边 + 等宽标签 + 网格纹理。
   ========================================================================== */

/* ------------------------------------------------------------------ 变量 */
/*
 * 配色对齐广西大学视觉识别：
 * 主色为广西大学标准红 #9e1b32（校徽标准色为红色，校旗红底黄字），
 * 深色取 #6e1223，浅色底纹取 #f7eaec / #f6efef，
 * 强调金取 #a9781b（校旗黄字），科技感点缀青蓝取 #0e7c86（校徽“蓝色代表近海”）。
 */
:root {
  --ink: #24262b;
  --ink-2: #474c57;
  --muted: #5f6672;
  --muted-2: #8c939e;

  --bg: #fcfaf9;
  --surface: #ffffff;
  --surface-2: #fdfafa;
  --surface-3: #f6efef;

  --line: #eae0e0;
  --line-strong: #d8c9ca;

  /* 广西大学标准色：校徽标准色为红色，校旗为红底黄字。
     主色取大学红 #9e1b32；金色 #a9781b 呼应校旗黄字，用于数据/强调；
     青蓝 #0e7c86 呼应校徽中“蓝色代表近海”，承担科技感点缀。 */
  --brand: #9e1b32;
  --brand-dark: #6e1223;
  --brand-soft: #f7eaec;
  --accent: #0e7c86;
  --accent-2: #a9781b;
  --accent-soft: #e8f2f3;
  --warn: #b4531a;
  --danger: #9d0000;
  --ok: #0f7b52;

  --radius: 4px;
  --radius-lg: 6px;
  --shadow-sm: 0 1px 2px rgba(80, 25, 35, .06);
  --shadow: 0 4px 16px rgba(80, 25, 35, .08);
  --shadow-lg: 0 12px 36px rgba(80, 25, 35, .13);

  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;

  --maxw: 1200px;
  --header-h: 64px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, iframe { max-width: 100%; }
a { color: var(--brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  color: var(--ink);
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.01em;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.5em; }
li { margin: .25em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

code, kbd, pre, samp { font-family: var(--mono); }
code {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .1em .35em;
  font-size: .88em;
}
pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.65;
}
pre code { background: none; border: 0; padding: 0; }

blockquote {
  margin: 1.2em 0;
  padding: .8em 1.2em;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  color: var(--ink-2);
}

table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: .93rem; }
th, td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--surface-3); font-weight: 600; color: var(--ink); }
tbody tr:nth-child(even) td { background: var(--surface-2); }

::selection { background: rgba(0, 169, 196, .22); }

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

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

.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-tight { padding: 32px 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------------------------------------------------------- 通用小组件 */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section-head { margin-bottom: 28px; }
.section-head h2 { margin-bottom: .3em; }
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }
.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.more-link {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}
.more-link:hover { color: var(--accent); }

.badge {
  display: inline-block;
  font-size: .74rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.7;
  white-space: nowrap;
}
.badge--brand { background: var(--brand-soft); border-color: #c3d8f0; color: var(--brand); }
.badge--accent { background: var(--accent-soft); border-color: #b9e6ef; color: #067c92; }
.badge--warn { background: #fdf2e7; border-color: #f5d9bd; color: var(--warn); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--accent:hover { background: #0092ac; border-color: #0092ac; }
.btn--sm { padding: 6px 14px; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

/* 顶部细横条，技术感点缀 */
.card--tech { position: relative; }
.card--tech::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--brand) 60%, transparent);
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: .75;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
  background: var(--brand-dark);
  color: #e6dada;
  font-size: .8rem;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  gap: 16px;
}
.topbar a { color: #e6dada; }
.topbar a:hover { color: #fff; }
.topbar-meta { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar-meta span { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; }

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--brand) 0%, #0a2f5c 100%);
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 1.02rem; font-weight: 700; letter-spacing: .01em; }
.brand-text span {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 导航 */
.nav { display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-link {
  display: block;
  padding: 8px 13px;
  font-size: .93rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--radius);
  white-space: nowrap;
}
.nav-link:hover { color: var(--brand); background: var(--surface-3); }
.nav-item.is-active > .nav-link { color: var(--brand); }
.nav-item.is-active > .nav-link::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px; bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: .89rem;
  color: var(--ink-2);
  border-radius: 3px;
}
.nav-dropdown a:hover { background: var(--brand-soft); color: var(--brand); }

.nav-toggle {
  display: none;
  width: 40px; height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--ink);
  margin: 4px auto;
  transition: transform .18s ease, opacity .18s ease;
}

/* ------------------------------------------------------------------ 首屏 */
.hero {
  position: relative;
  background: var(--ink);
  color: #e8eef5;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 169, 196, .13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 169, 196, .13) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 30% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 30% 40%, #000 0%, transparent 78%);
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 380px at 78% 18%, rgba(0, 169, 196, .20), transparent 65%),
    radial-gradient(560px 300px at 8% 88%, rgba(14, 76, 146, .55), transparent 70%);
  z-index: -1;
}
.hero .container { padding: 76px 24px 68px; }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: .01em;
}
.hero-sub {
  font-size: 1.12rem;
  color: #b9c9da;
  margin-bottom: 14px;
  max-width: 46ch;
}
.hero-intro { color: #93a7bb; max-width: 62ch; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-actions .btn--ghost { color: #dbe6f0; border-color: rgba(255, 255, 255, .35); }
.hero-actions .btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-stat {
  background: rgba(9, 24, 45, .72);
  padding: 18px 20px;
}
.hero-stat b {
  display: block;
  font-family: var(--mono);
  font-size: 1.62rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.hero-stat span { font-size: .82rem; color: #8fa4b9; }

/* ---------------------------------------------------------------- 面包屑 */
.breadcrumb {
  font-size: .82rem;
  color: var(--muted);
  padding: 16px 0 0;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 7px; color: var(--line-strong); }

/* ------------------------------------------------------------ 页面头部 */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 30px 0 26px;
}
.page-head h1 { margin-bottom: .2em; font-size: 1.75rem; }
.page-head .page-sub { color: var(--muted); margin: 0; }

/* ------------------------------------------------------------ 内容排版 */
.prose { max-width: 78ch; }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  margin-top: 1.8em;
  padding-bottom: .3em;
  border-bottom: 1px solid var(--line);
  font-size: 1.3rem;
}
.prose h3 { margin-top: 1.5em; font-size: 1.08rem; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li::marker { color: var(--accent); }
.prose a { text-decoration: underline; text-decoration-color: rgba(14, 76, 146, .3); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }

.md-figure { margin: 1.4em 0; }
.md-figure img { width: 100%; }
.md-figure figcaption {
  margin-top: 8px;
  font-size: .84rem;
  color: var(--muted);
  text-align: center;
}

.video-embed {
  position: relative;
  margin: 1.4em 0;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ------------------------------------------------------------ 列表卡片 */
.entry-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.entry {
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  transition: background .15s ease;
}
.entry:hover { background: var(--surface-2); }
.entry-date {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
  letter-spacing: .02em;
}
.entry-main { min-width: 0; }
.entry-title { font-size: .98rem; font-weight: 600; color: var(--ink); display: block; margin-bottom: 2px; }
.entry:hover .entry-title { color: var(--brand); }
.entry-summary {
  font-size: .86rem;
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry-tag { flex: none; }

/* 新闻置顶 */
.entry--pinned { background: var(--surface-2); }
.entry--pinned .entry-title::before {
  content: "置顶";
  font-family: var(--mono);
  font-size: .68rem;
  color: #fff;
  background: var(--accent);
  padding: 1px 6px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: 1px;
}

/* 卡片网格 */
.card-grid { display: grid; gap: 20px; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* 研究方向 */
.dir-card { padding: 24px 22px; }
.dir-index {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent);
  letter-spacing: .1em;
  margin-bottom: 10px;
  display: block;
}
.dir-card h3 { font-size: 1.08rem; margin-bottom: .4em; }
.dir-card p { font-size: .9rem; color: var(--muted); margin: 0; }
.dir-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* 成员 */
.member-card { text-align: center; padding: 24px 18px; }
.member-avatar {
  width: 96px; height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  display: grid;
  place-items: center;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-avatar-fallback {
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--brand);
  font-weight: 700;
}
.member-card h3 { font-size: 1.02rem; margin-bottom: .2em; }
.member-role { font-size: .85rem; color: var(--accent); margin-bottom: 8px; }
.member-meta { font-size: .8rem; color: var(--muted); margin: 0; word-break: break-all; }

.member-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 22px;
  padding: 22px;
}
.member-row .member-avatar { width: 110px; height: 110px; margin: 0; }

/* 论文 */
.pub-item {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.pub-item:last-child { border-bottom: 0; }
.pub-title { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--brand); }
.pub-authors { font-size: .89rem; color: var(--ink-2); margin-bottom: 4px; }
.pub-venue { font-size: .87rem; color: var(--muted); font-style: italic; margin-bottom: 10px; }
.pub-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 项目/成果 */
.project-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-cover {
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-cover-empty {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(14, 76, 146, .05) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(14, 76, 146, .05) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--surface-2);
  font-family: var(--mono);
  color: var(--muted-2);
  font-size: .78rem;
  letter-spacing: .1em;
}
.project-body { padding: 20px 22px; flex: 1; display: flex; flex-direction: column; }
.project-body h3 { font-size: 1.05rem; margin-bottom: .35em; }
.project-meta { font-size: .83rem; color: var(--muted); margin-bottom: 10px; }
.project-summary { font-size: .89rem; color: var(--ink-2); flex: 1; }
.project-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ------------------------------------------------------------ 侧边栏 */
.layout-side { display: grid; grid-template-columns: 1fr 280px; gap: 36px; align-items: start; }
.sidebar-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.sidebar-block h3 {
  font-size: .82rem;
  font-family: var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.sidebar-list li:last-child { border-bottom: 0; }
.sidebar-list a { color: var(--ink-2); }
.sidebar-list a:hover { color: var(--accent); }
.sidebar-count { float: right; font-family: var(--mono); font-size: .78rem; color: var(--muted-2); }

/* 筛选条 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.filter-chip {
  font-size: .85rem;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ------------------------------------------------------------ 分页 */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 34px; }
.pager a, .pager span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .88rem;
  color: var(--ink-2);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .is-disabled { opacity: .45; }

/* ------------------------------------------------------------ 表单 */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.form-row .hint { font-size: .79rem; color: var(--muted); font-weight: 400; margin-left: 6px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: .92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 169, 196, .12);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline > * { flex: 1; min-width: 140px; }
.form-inline .btn { flex: none; }

.captcha-box {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.captcha-img {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  height: 48px;
  cursor: pointer;
  flex: none;
}
.captcha-img svg { display: block; height: 46px; }
.captcha-refresh {
  font-size: .8rem;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  font-family: var(--mono);
}
.captcha-refresh:hover { color: var(--accent); }

.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .89rem;
  margin-bottom: 18px;
  border: 1px solid;
}
.alert--info { background: var(--brand-soft); border-color: #c3d8f0; color: var(--brand-dark); }
.alert--ok { background: #e7f5ee; border-color: #b7e0cc; color: var(--ok); }
.alert--warn { background: #fdf2e7; border-color: #f5d9bd; color: var(--warn); }
.alert--error { background: #fdeceb; border-color: #f4c9c6; color: var(--danger); }
.alert:empty { display: none; }

/* ------------------------------------------------------------ 下载保护 */
.download-box {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 18px 20px;
  margin: 22px 0;
}
.download-box h4 {
  font-size: .86rem;
  font-family: var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.download-box .form-inline { align-items: center; }

/* ------------------------------------------------------------ 留言板 */
.message-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.message-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.message-author { font-weight: 600; font-size: .95rem; color: var(--ink); }
.message-time { font-family: var(--mono); font-size: .76rem; color: var(--muted-2); }
.message-body { font-size: .92rem; color: var(--ink-2); white-space: pre-wrap; margin: 0; }
.message-reply {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .89rem;
}
.message-reply b { color: var(--brand-dark); }

/* ------------------------------------------------------------ 联系方式 */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.contact-item {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact-key {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.contact-val { font-size: .95rem; color: var(--ink); word-break: break-word; }

/* ------------------------------------------------------------------ 页脚 */
.footer {
  background: var(--ink);
  color: #a8a29e;
  font-size: .87rem;
  margin-top: 0;
}
.footer .container { padding: 44px 24px 28px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer h4 {
  color: #fff;
  font-size: .84rem;
  font-family: var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer a { color: #a8a29e; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 7px 0; }
.footer-brand p { margin: 12px 0 0; max-width: 34ch; line-height: 1.8; }
.footer-motto {
  margin: 10px 0 0;
  font-size: .95rem;
  letter-spacing: .18em;
  color: #e3b95c;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  font-size: .8rem;
  color: #8f8985;
}
.footer-bottom a { color: #8f8985; }
.footer-bottom a:hover { color: #fff; }
.footer-meta { display: flex; gap: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------ 返回顶部 */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s;
  z-index: 50;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }

/* ---------------------------------------------------- 背景动态元素（可选） */
/*
 * 该层由构建期开关 appearance.backgroundAnimation 控制是否输出。
 * 动效极度克制：仅缓慢漂移的网格与两团柔光，不影响可读性与性能。
 */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 78% -8%, #fbeef0 0%, rgba(251, 238, 240, 0) 62%),
    radial-gradient(900px 520px at 6% 4%, #eef6f7 0%, rgba(238, 246, 247, 0) 58%);
}

.bg-fx__grid {
  position: absolute;
  inset: -12% -12% -12% -12%;
  background-image:
    linear-gradient(to right, rgba(158, 27, 50, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(158, 27, 50, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: bgGridDrift 46s linear infinite;
  will-change: transform;
}

.bg-fx__glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 420px;
  min-height: 420px;
  border-radius: 50%;
  filter: blur(72px);
  opacity: .5;
}
.bg-fx__glow--a {
  top: -16vw;
  right: -10vw;
  background: radial-gradient(circle, rgba(158, 27, 50, .16) 0%, rgba(158, 27, 50, 0) 68%);
  animation: bgGlowA 34s ease-in-out infinite;
}
.bg-fx__glow--b {
  bottom: -20vw;
  left: -12vw;
  background: radial-gradient(circle, rgba(14, 124, 134, .14) 0%, rgba(14, 124, 134, 0) 70%);
  animation: bgGlowB 42s ease-in-out infinite;
}

@keyframes bgGridDrift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(46px, 46px, 0); }
}
@keyframes bgGlowA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-3.5%, 3%, 0) scale(1.07); }
}
@keyframes bgGlowB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(3%, -2.5%, 0) scale(1.05); }
}

/* --------------------------------------------- 静态预览模式的降级提示 */
.captcha-img--error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-3);
}
.captcha-fallback {
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}
.topbar-meta a.is-disabled {
  color: var(--muted-2);
  cursor: help;
  text-decoration: none;
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .layout-side { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav-link { padding: 11px 14px; border-radius: var(--radius); }
  .nav-item.is-active > .nav-link::after { display: none; }
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    margin: 0 0 6px 12px;
    padding: 0 0 0 6px;
    display: none;
  }
  .nav-item:hover .nav-dropdown,
  .nav-item:focus-within .nav-dropdown,
  .nav-item.is-open .nav-dropdown { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .member-row { grid-template-columns: 1fr; }
  .member-row .member-avatar { margin: 0 auto; }
  .entry { grid-template-columns: 1fr; gap: 6px; }
  .entry-summary { white-space: normal; }
  .entry-tag { justify-self: start; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .container { padding: 0 16px; }
  .grid-4, .card-grid--3, .card-grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero .container { padding: 52px 16px 46px; }
  .section { padding: 40px 0; }
  .topbar-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
