/* ==========================================================================
   设计令牌 —— 全站唯一来源，改这里就能换整套配色
   对应方案 R5：品牌可配置，学校名称 / LOGO 由服务端注入，主色使用下面的默认令牌
   ========================================================================== */
:root {
  /* 品牌色 */
  --brand: #15507a;
  --brand-deep: #0b2a45;
  --brand-light: #3c7ba6;
  --teal: #1c8c8e;
  --amber: #e9a23b;

  /* 中性色 */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --line: #e3e8ef;
  --line-strong: #d5e0ea;
  --text: #1f2937;
  --muted: #6b7280;
  --placeholder: #9aa4b2;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --success: #1e8e5a;

  /* 字号 */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;

  /* 间距：8 的倍数 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* 圆角与阴影 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 42, 69, 0.08);
  --shadow-lg: 0 24px 60px rgba(11, 42, 69, 0.16);

  /* 字体：全部本机字体，不引外部字体文件 */
  --font-sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;

  --control-h: 44px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

/* 根字号：所有字号都以 rem 定义，改这一个值即全站等比放大。
   JS 的 A- / A / A+ 也是改这里，用户选择记在 localStorage。 */
html {
  font-size: 17px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 键盘焦点：始终可见，不依赖鼠标 */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- 字体缩放控件 */
.font-ctl {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 2px 3px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.font-btn {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.font-btn-reset {
  width: auto;
  min-width: 44px;
  padding: 0 7px;
  color: var(--text);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.font-btn:hover:not(:disabled) {
  background: #eef4f8;
  color: var(--brand);
}

.font-btn:focus-visible {
  outline: 2px solid rgba(21, 80, 122, .28);
  outline-offset: 1px;
}

.font-btn:disabled {
  opacity: .32;
  cursor: default;
}

.font-btn[aria-pressed=true] {
  background: #e8f1f8;
  color: var(--brand);
  font-weight: 600;
}

/* 独立页（登录、注册、协议）用悬浮样式 */
.font-ctl--float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  box-shadow: var(--shadow-md);
}
