/* =====================================================================
   武汉大学 · 杜伦大学联合学院 · 文化交流问答
   styles.css  —  柔和动态背景 / 干净卡片式界面
   ===================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --whu: #2f7d76;
  --whu-deep: #1e5c58;
  --dur: #6b4376;
  --dur-deep: #4b2953;
  --sakura: #e6a2b5;
  --sand: #f3e0ca;

  --ink: #22403f;
  --ink-2: #5b7375;
  --ink-3: #8b9ea3;

  --paper: rgba(255, 255, 255, 0.8);
  --paper-soft: rgba(255, 255, 255, 0.62);
  --line: rgba(34, 64, 63, 0.1);
  --line-strong: rgba(34, 64, 63, 0.18);

  --shadow-lg: 0 24px 60px -34px rgba(28, 52, 60, 0.55);
  --shadow-sm: 0 10px 26px -20px rgba(28, 52, 60, 0.6);

  --r: 20px;
  --r-sm: 13px;
  --r-xs: 9px;

  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia,
    "Times New Roman", serif;

  --ease: cubic-bezier(0.33, 0.02, 0.24, 1);
}

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

html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink);
  background: #faf7f1;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.35; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: rgba(230, 162, 181, 0.38); }

:focus-visible {
  outline: 2px solid var(--whu);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 界面语言切换：成对出现的长短文案 */
html[data-ui-lang="zh"] .i18n-en { display: none !important; }
html[data-ui-lang="en"] .i18n-zh { display: none !important; }

/* =====================================================================
   1. 背景层
   ===================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 缓慢流动的柔和渐变 */
.bg-layer {
  position: absolute;
  inset: -25%;
  background:
    linear-gradient(115deg,
      #fdf8f1 0%,
      #eaf5f1 18%,
      #e6eef8 36%,
      #f5eaf2 55%,
      #fdf1e7 74%,
      #f1f6f2 88%,
      #fdf8f1 100%);
  background-size: 320% 320%;
  animation: gradientDrift 110s var(--ease) infinite;
}

@keyframes gradientDrift {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 62% 18%; }
  50%  { background-position: 100% 58%; }
  75%  { background-position: 34% 92%; }
  100% { background-position: 0% 50%; }
}

/* 缓慢漂浮的色团 */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(58px);
  opacity: 0.62;
  will-change: transform;
}
.o1 {
  width: 46vw; height: 46vw; max-width: 720px; max-height: 720px;
  left: -8%; top: -14%;
  background: radial-gradient(circle at 40% 40%, rgba(58, 150, 140, 0.55), rgba(58, 150, 140, 0) 68%);
  animation: floatA 76s var(--ease) infinite;
}
.o2 {
  width: 44vw; height: 44vw; max-width: 700px; max-height: 700px;
  right: -10%; bottom: -20%;
  background: radial-gradient(circle at 50% 50%, rgba(133, 84, 148, 0.5), rgba(133, 84, 148, 0) 68%);
  animation: floatB 92s var(--ease) infinite;
}
.o3 {
  width: 40vw; height: 40vw; max-width: 620px; max-height: 620px;
  right: 4%; top: -18%;
  background: radial-gradient(circle at 50% 50%, rgba(240, 176, 196, 0.55), rgba(240, 176, 196, 0) 68%);
  animation: floatC 84s var(--ease) infinite;
}
.o4 {
  width: 36vw; height: 36vw; max-width: 560px; max-height: 560px;
  left: 2%; bottom: -18%;
  background: radial-gradient(circle at 50% 50%, rgba(246, 213, 172, 0.5), rgba(246, 213, 172, 0) 68%);
  animation: floatA 104s var(--ease) infinite reverse;
}

@keyframes floatA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(5%, -4%, 0) scale(1.12); }
}
@keyframes floatB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
  50%      { transform: translate3d(-6%, -5%, 0) scale(1); }
}
@keyframes floatC {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.04); }
  50%      { transform: translate3d(-4%, 6%, 0) scale(0.94); }
}

/* 两校元素剪影 */
.scene {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(230px, 42vh, 480px);
  animation: sceneDrift 68s var(--ease) infinite;
}
@keyframes sceneDrift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-0.8%, -6px, 0); }
}
.skyline { width: 100%; height: 100%; display: block; }

.scene-label {
  position: absolute;
  bottom: 12px;
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  opacity: 0.85;
}
.scene-label b { display: block; font-weight: 600; }
.scene-label em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}
.scene-label.left { left: 3.5%; color: var(--whu-deep); }
.scene-label.right { right: 3.5%; text-align: right; color: var(--dur-deep); }

/* 飘落的樱花 */
.petals { position: absolute; inset: 0; overflow: hidden; }
.petal {
  position: absolute;
  top: -10vh;
  left: var(--x, 50%);
  width: var(--s, 10px);
  height: var(--s, 10px);
  animation: petalFall var(--d, 26s) linear var(--delay, 0s) infinite;
  will-change: transform;
}
.petal::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(140deg, #fbe3ea, #f0b3c5);
  border-radius: 62% 38% 56% 44% / 58% 54% 46% 42%;
  opacity: var(--o, 0.55);
  animation: petalSway calc(var(--d, 26s) / 3.2) ease-in-out infinite alternate;
}
@keyframes petalFall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift, 60px), 112vh, 0) rotate(320deg); }
}
@keyframes petalSway {
  0%   { transform: translateX(-8px) rotate(-16deg); }
  100% { transform: translateX(8px) rotate(16deg); }
}

/* 顶部提亮，保证文字可读 */
.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 78% at 50% -10%, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 18%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.24) 100%);
}

/* 两校建筑线稿水印（背景上层） */
.campus-mark {
  position: absolute;
  width: min(23vw, 330px);
  opacity: 0.19;
  will-change: transform;
}
.campus-mark svg { display: block; width: 100%; height: auto; }
.mark-whu {
  left: 1.5%;
  top: 11%;
  color: #1e5c58;
  animation: markFloat 96s var(--ease) infinite alternate;
}
.mark-durham {
  right: 1.5%;
  top: 8%;
  color: #4b2953;
  animation: markFloat 112s var(--ease) infinite alternate-reverse;
}
.mark-label {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.mark-whu .mark-label { color: #1e5c58; }
.mark-durham .mark-label { color: #4b2953; text-align: right; }
@keyframes markFloat {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(1.2%, -1.6%, 0) scale(1.02); }
  100% { transform: translate3d(-0.8%, 1.2%, 0) scale(0.99); }
}

/* =====================================================================
   2. 顶栏
   ===================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 26px -26px rgba(28, 52, 60, 0.7);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}
.crests { display: flex; }
.crest { width: 34px; height: 34px; }
.crest + .crest { margin-left: -11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 15.5px;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.brand-text small { font-size: 11.5px; color: var(--ink-2); letter-spacing: 0.04em; }

.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex: 1 1 auto;
}
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.nav-btn:hover { background: rgba(47, 125, 118, 0.09); color: var(--whu-deep); }
.nav-btn.is-active {
  background: linear-gradient(120deg, rgba(47, 125, 118, 0.16), rgba(107, 67, 118, 0.16));
  color: var(--ink);
  font-weight: 600;
}

.top-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.lang-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-toggle span {
  display: block;
  padding: 3px 9px;
  font-size: 12px;
  border-radius: 999px;
  color: var(--ink-3);
  transition: all 0.25s var(--ease);
  letter-spacing: 0.03em;
}
html[data-ui-lang="zh"] .lang-toggle .lzh,
html[data-ui-lang="en"] .lang-toggle .len {
  background: linear-gradient(120deg, var(--whu), var(--dur));
  color: #fff;
  font-weight: 600;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  padding: 3px 12px 3px 3px;
  font-size: 13px;
  max-width: 160px;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.profile-chip:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.profile-chip .avatar { width: 26px; height: 26px; font-size: 12px; }
.profile-chip .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
   3. 布局与通用组件
   ===================================================================== */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px 22px 0;
}
.view { display: block; animation: viewIn 0.5s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.hero { padding: 12px 4px 20px; }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(21px, 3.1vw, 30px);
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.hero-sub {
  margin-top: 9px;
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 62ch;
}

.panel {
  position: relative;
  background: var(--paper);
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title { font-family: var(--serif); font-size: 20px; }
.panel-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 5px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.8);
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary {
  background: linear-gradient(120deg, var(--whu), var(--dur));
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(75, 41, 83, 0.7);
}
.btn.primary:hover { box-shadow: 0 14px 28px -14px rgba(75, 41, 83, 0.8); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.btn.ghost:hover { color: var(--whu-deep); border-color: rgba(47, 125, 118, 0.4); background: rgba(255, 255, 255, 0.85); }
.btn.ghost.is-on {
  background: linear-gradient(120deg, rgba(47, 125, 118, 0.16), rgba(107, 67, 118, 0.16));
  color: var(--ink);
  border-color: transparent;
  font-weight: 600;
}
.btn.danger { color: #a8455a; border-color: rgba(168, 69, 90, 0.3); }
.btn.danger:hover { color: #8e3149; border-color: rgba(168, 69, 90, 0.55); background: rgba(255, 245, 246, 0.9); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.xs { padding: 4px 10px; font-size: 12.5px; }
.btn.inline { margin-left: 8px; vertical-align: middle; }
.btn b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 「译」按钮：整站的招牌动作，给一点柔和的撞色 */
.btn.ghost[data-act="translate"] {
  background: linear-gradient(120deg, rgba(230, 162, 181, 0.3), rgba(163, 142, 203, 0.28));
  border-color: rgba(255, 255, 255, 0.6);
  color: #4a3556;
  font-weight: 600;
  box-shadow: 0 6px 16px -12px rgba(74, 53, 86, 0.8);
}
.btn.ghost[data-act="translate"]:hover {
  background: linear-gradient(120deg, rgba(230, 162, 181, 0.44), rgba(163, 142, 203, 0.42));
  color: #3b2846;
}
.btn.ghost[data-act="translate"].is-on {
  background: linear-gradient(120deg, rgba(47, 125, 118, 0.22), rgba(107, 67, 118, 0.22));
  color: var(--ink);
}

.round {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s var(--ease);
}
.round:hover { color: var(--whu-deep); transform: rotate(180deg); box-shadow: var(--shadow-sm); }

.select {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235b7375' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  background-size: 11px;
  border-radius: 999px;
  padding: 7px 30px 7px 13px;
  font-size: 13px;
  color: var(--ink-2);
  transition: border-color 0.25s var(--ease);
}
.select:hover { border-color: rgba(47, 125, 118, 0.4); }

/* 分类小标签 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  position: relative;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  transition: all 0.22s var(--ease);
}
.chip:hover { color: var(--whu-deep); border-color: rgba(47, 125, 118, 0.4); }
.chip.is-active {
  background: linear-gradient(120deg, rgba(47, 125, 118, 0.9), rgba(107, 67, 118, 0.9));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip.static { pointer-events: none; }

/* 工具条 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 15px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.search:focus-within { border-color: rgba(47, 125, 118, 0.5); box-shadow: 0 0 0 4px rgba(47, 125, 118, 0.08); }
.search svg { width: 16px; height: 16px; color: var(--ink-3); flex: 0 0 auto; }
.search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
}
.search input::placeholder { color: var(--ink-3); }

/* 统计 */
.stats { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 14px;
}
.stat b { font-family: var(--serif); font-size: 19px; color: var(--whu-deep); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--ink-2); }
.stats.small .stat { padding: 6px 12px; }

/* 数据来源徽标：共享数据库 / 仅本机 */
.stat.mode {
  gap: 7px;
  background: rgba(47, 125, 118, 0.1);
  border-color: rgba(47, 125, 118, 0.22);
}
.stat.mode .mode-dot {
  align-self: center;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--whu);
  box-shadow: 0 0 0 3px rgba(47, 125, 118, 0.16);
}
.stat.mode span { font-size: 12.5px; color: var(--whu-deep); }
.stat.mode.is-local { background: rgba(255, 255, 255, 0.5); border-color: var(--line); }
.stat.mode.is-local .mode-dot { background: #aab7b8; box-shadow: none; }
.stat.mode.is-local span { color: var(--ink-2); }

/* =====================================================================
   4. 问答卡片
   ===================================================================== */
.list { display: flex; flex-direction: column; gap: 15px; margin-top: 18px; }

.card {
  background: var(--paper);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px 12px;
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
.card:hover { box-shadow: 0 28px 64px -34px rgba(28, 52, 60, 0.62); }

.post-head { display: flex; align-items: center; gap: 10px; }
.avatar {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.4);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12.5px; }
.who { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; flex: 1 1 auto; }
.who .name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.who .sub { font-size: 12px; color: var(--ink-3); }
.tag-you {
  font-style: normal;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(47, 125, 118, 0.14);
  color: var(--whu-deep);
  font-weight: 600;
}
.chip.cat {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--line);
  color: var(--ink-2);
}

.post-title {
  font-family: var(--serif);
  font-size: 17.5px;
  margin: 12px 0 0;
  color: var(--ink);
}
.post-body, .answer-body {
  margin-top: 8px;
  color: #2c4a49;
  font-size: 14.8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.post-foot, .answer-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}
.answer-foot { border-top: 0; padding-top: 6px; margin-top: 8px; }

.lang-badge {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.5);
}
.badge-best {
  font-size: 11.5px;
  font-weight: 600;
  color: #7a5a17;
  background: linear-gradient(120deg, rgba(247, 226, 173, 0.85), rgba(243, 224, 202, 0.85));
  border-radius: 999px;
  padding: 2px 10px;
}

/* 译文块 */
.tr-box {
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  background: linear-gradient(120deg, rgba(47, 125, 118, 0.07), rgba(107, 67, 118, 0.07));
  border-left: 3px solid rgba(107, 67, 118, 0.45);
  animation: viewIn 0.45s var(--ease) both;
}
.tr-text { font-size: 14.5px; white-space: pre-wrap; color: #2c4a49; }
.tr-src {
  display: inline-block;
  margin-top: 7px;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}
.tr-loading { font-size: 13.5px; color: var(--ink-3); }
.tr-loading::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--whu);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.15); }
}

/* 回答区 */
.answers { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.answer {
  display: flex;
  gap: 11px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}
.answer + .answer { margin-top: 10px; }
.answer.is-best {
  background: linear-gradient(120deg, rgba(250, 240, 214, 0.7), rgba(255, 255, 255, 0.55));
  border-color: rgba(214, 182, 111, 0.5);
}
.answer-main { min-width: 0; flex: 1 1 auto; }
.answer-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.answer-head .name { font-size: 13.5px; font-weight: 600; }
.answer-head .sub { font-size: 11.5px; color: var(--ink-3); }

.answer-form { margin-top: 12px; }
.answer-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 13px;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.answer-form textarea:focus {
  border-color: rgba(47, 125, 118, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 125, 118, 0.08);
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}
.hint { font-size: 12px; color: var(--ink-3); margin-right: auto; }

/* 空状态 */
.empty {
  margin-top: 20px;
  padding: 42px 20px;
  text-align: center;
  background: var(--paper-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
}
.empty-title { font-family: var(--serif); font-size: 18px; }
.empty-hint { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.empty .btn { margin-top: 14px; }

/* =====================================================================
   5. 翻译台
   ===================================================================== */
.tr-grid {
  display: grid;
  grid-template-columns: 1fr 46px 1fr;
  gap: 10px;
  align-items: stretch;
  margin-top: 14px;
}
.tr-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}
.tr-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}
.tr-pane-head .count { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tr-input {
  flex: 1 1 auto;
  min-height: 168px;
  border: 0;
  outline: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.75;
  resize: vertical;
}
.tr-output {
  flex: 1 1 auto;
  min-height: 168px;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  outline: none;
}
.tr-output .ph { color: var(--ink-3); }
.tr-pane-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
}
.tr-mid { display: flex; align-items: center; justify-content: center; }
.tr-foot { display: flex; align-items: center; gap: 13px; margin-top: 14px; flex-wrap: wrap; }
.tr-status { font-size: 12.5px; color: var(--ink-3); }
.tr-status.is-warn { color: #a8722a; }
.kbd-hint { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.kbd {
  font-size: 10.5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.7);
}

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 38px; height: 21px;
  border-radius: 999px;
  background: rgba(34, 64, 63, 0.16);
  position: relative;
  transition: background 0.3s var(--ease);
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2.5px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s var(--ease);
}
.switch input:checked + .track { background: linear-gradient(120deg, var(--whu), var(--dur)); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* 关于页排版 */
.prose { padding: 24px 26px 26px; }
.prose h3 {
  font-family: var(--serif);
  font-size: 15.5px;
  margin: 20px 0 5px;
  color: var(--whu-deep);
}
.prose h3:first-of-type { margin-top: 14px; }
.prose p, .prose li { color: var(--ink-2); font-size: 14.2px; }
.prose ol { margin: 6px 0 0; padding-left: 22px; }
.prose li { margin: 4px 0; }

/* =====================================================================
   6. 弹窗与表单
   ===================================================================== */
.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(680px, 92vw);
  width: 100%;
  color: var(--ink);
}
.modal::backdrop {
  background: rgba(30, 52, 58, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-card {
  background: linear-gradient(170deg, #fffefb, #fdfaf6);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 40px 90px -40px rgba(24, 46, 52, 0.6);
  padding: 20px 22px 18px;
  margin: 0;
  max-height: 88vh;
  overflow: auto;
  animation: viewIn 0.4s var(--ease) both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--serif); font-size: 19px; }
.icon-x {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  padding: 2px 6px;
  border-radius: 8px;
  transition: all 0.2s var(--ease);
}
.icon-x:hover { color: var(--ink); background: rgba(34, 64, 63, 0.07); }

.field-row { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 220px; }
.field { display: block; margin-top: 14px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.field input[type="text"], .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.85);
  padding: 9px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field select.select { border-radius: var(--r-sm); padding-right: 30px; }
.field textarea { resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(47, 125, 118, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 125, 118, 0.08);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.modal-foot.split { justify-content: flex-start; }
.grow { flex: 1 1 auto; }

body.modal-open { overflow: hidden; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 60;
  background: rgba(34, 64, 63, 0.94);
  color: #fff;
  font-size: 13.5px;
  padding: 9px 20px;
  border-radius: 999px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 手机端悬浮提问按钮 */
.fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 22px;
  z-index: 40;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  padding-bottom: 3px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, var(--whu), var(--dur));
  box-shadow: 0 18px 32px -16px rgba(75, 41, 83, 0.8);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 22px 36px -16px rgba(75, 41, 83, 0.9); }

/* =====================================================================
   7. 页脚
   ===================================================================== */
.site-foot {
  position: relative;
  z-index: 1;
  margin-top: 46px;
  padding: 26px 0 30px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.44) 42%,
    rgba(255, 255, 255, 0.64) 100%);
}
.foot-inner { padding: 0 22px; }
.foot-line { font-size: 12.5px; color: var(--ink-2); max-width: 70ch; }
.foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
}
.sep { opacity: 0.6; }

/* =====================================================================
   8. 响应式
   ===================================================================== */
@media (max-width: 1240px) {
  .campus-mark { opacity: 0.13; }
}
@media (max-width: 1020px) {
  .campus-mark { display: none; }
}

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; padding: 9px 15px; gap: 10px; }
  .brand-text strong { font-size: 14.5px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .nav::-webkit-scrollbar { display: none; }
  .top-actions { margin-left: auto; }
  .wrap { padding: 20px 15px 0; }
  .panel, .card { padding: 14px 15px; }
  .tr-grid { grid-template-columns: 1fr; }
  .tr-mid { padding: 2px 0; }
  .tr-mid .round { transform: rotate(90deg); }
  .tr-mid .round:hover { transform: rotate(270deg); }
  .profile-chip .pname { display: none; }
  .scene-label em { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .hero { padding: 6px 2px 16px; }
  .stats { gap: 7px; }
  .stat { padding: 6px 11px; }
  .stat b { font-size: 17px; }
  .post-foot .btn, .answer-foot .btn { font-size: 12px; padding: 4px 9px; }
  .scene-label { font-size: 11px; }
  .modal-card { padding: 16px 15px; border-radius: 18px; }
}

/* 窄屏：顶栏收紧，提问改为悬浮按钮 */
@media (max-width: 560px) {
  .topbar-inner { padding: 8px 12px; gap: 8px; }
  .crest { width: 28px; height: 28px; }
  .crest + .crest { margin-left: -9px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-text { min-width: 0; }
  .brand-text strong {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-text small { display: none; }
  .lang-toggle span { padding: 2px 7px; font-size: 11px; }
  .profile-chip { padding: 2px 8px 2px 2px; }
  #askBtn { display: none; }
  .fab { display: flex; }
  .toast { bottom: 88px; }
}

/* =====================================================================
   9. 降低动效
   ===================================================================== */
body.no-motion .bg-layer,
body.no-motion .orb,
body.no-motion .scene,
body.no-motion .campus-mark,
body.no-motion .petal,
body.no-motion .petal::before,
body.no-motion .tr-loading::after {
  animation: none !important;
}
body.no-motion .petals { display: none; }
body.no-motion .view, body.no-motion .tr-box, body.no-motion .modal-card { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .bg-layer, .orb, .scene, .campus-mark, .petal, .petal::before { animation: none !important; }
  .petals { display: none; }
  * { transition-duration: 0.01ms !important; }
}
