/**
 * index.css —— 首页样式
 *
 * 设计令牌（CSS 自定义属性）+ Hero + 公告卡片 + 工具网格 + 页脚。
 * 浅色系、indigo/violet 主色，卡片白底细边大圆角多层柔影，
 * 入场「上浮渐显」动画并错峰，支持 prefers-reduced-motion；
 * 另支持 html[data-theme='dark'] 暗色主题（同一套令牌换值）。
 */

/* ========== 设计令牌 ========== */
:root {
  --font-stack: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'MiSans',
    'Microsoft YaHei', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  --color-primary: #6366f1;        /* indigo-500 */
  --color-primary-strong: #4f46e5; /* indigo-600 */
  --color-violet: #7c3aed;         /* violet-600 */
  --gradient-brand: linear-gradient(120deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);

  --text-strong: #221f3a;
  --text-body: #4a4760;
  --text-muted: #6f6c8a;         /* 白底对比度 ≥4.5:1 */

  --bg-page: #f5f6fb;
  --bg-card: #ffffff;
  --border-soft: #e7e7f4;
  --border-strong: #d8d8ee;

  --shadow-sm: 0 1px 2px rgba(34, 31, 58, 0.05);
  --shadow-md: 0 1px 2px rgba(34, 31, 58, 0.04), 0 8px 24px rgba(34, 31, 58, 0.07);
  --shadow-lg: 0 2px 6px rgba(34, 31, 58, 0.06), 0 18px 40px rgba(79, 70, 229, 0.16);

  --radius-card: 18px;
  --radius-pill: 999px;
  --container-width: 1080px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========== 暗色主题 ========== */
/* 与浅色共用同一套令牌名，仅覆盖取值；品牌渐变（indigo/violet）保持不变 */
html[data-theme='dark'] {
  color-scheme: dark;

  --text-strong: #e6e6ef;
  --text-body: #b9b8cc;
  --text-muted: #9a97b3;

  /* 品牌强调色保留 indigo/violet 色相，仅按暗底提亮，保证文本对比度 ≥4.5:1 */
  --color-primary: #818cf8;
  --color-primary-strong: #a5b4fc;

  --bg-page: #16161f;
  --bg-card: #1e1e2a;
  --border-soft: #2b2b3d;
  --border-strong: #3a3a52;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.32), 0 18px 40px rgba(79, 70, 229, 0.35);
}

/* 暗色下令牌覆盖不到的硬编码浅色取值，按组件逐个适配 */
html[data-theme='dark'] .date-capsule {
  background: rgba(30, 30, 42, 0.75);
}

html[data-theme='dark'] .empty-state {
  background: rgba(30, 30, 42, 0.6);
}

html[data-theme='dark'] .footer {
  background: rgba(22, 22, 31, 0.55);
}

html[data-theme='dark'] .beian-badge {
  color: #9ca3af;
}

html[data-theme='dark'] .dot-grid {
  background-image: radial-gradient(rgba(129, 140, 248, 0.16) 1px, transparent 1px);
}

html[data-theme='dark']::-webkit-scrollbar-thumb {
  background: #3a3a52;
  border-color: #16161f;
}

html[data-theme='dark']::-webkit-scrollbar-thumb:hover {
  background: #4a4a66;
}

/* ========== hidden 属性兜底 ========== */
/* 防止组件级 display 规则覆盖浏览器 UA 默认样式 [hidden] { display: none } */
[hidden] {
  display: none !important;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-body);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(99, 102, 241, 0.22);
  color: var(--text-strong);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cfcfe4;
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-page);
}

::-webkit-scrollbar-thumb:hover {
  background: #b6b6d6;
}

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

a {
  color: var(--color-primary-strong);
  text-decoration: none;
}

/* ========== 背景装饰 ========== */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}

.blob-a {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.32), rgba(99, 102, 241, 0) 70%);
}

.blob-b {
  width: 620px;
  height: 620px;
  top: -220px;
  right: -180px;
  background: radial-gradient(circle at 70% 30%, rgba(168, 85, 247, 0.26), rgba(168, 85, 247, 0) 70%);
}

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(99, 102, 241, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 30%, transparent 78%);
}

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

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 76px 0 52px;
}

.date-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}

.hero-title {
  margin: 22px 0 10px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  margin: 0 0 14px;
  font-size: clamp(15px, 2.4vw, 18px);
  font-weight: 500;
  color: var(--text-body);
}

.welcome {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-muted);
}

/* ========== 栏目标题 ========== */
.section {
  margin: 40px 0;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
}

.section-head h2::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--gradient-brand);
}

.count-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary-strong);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ========== 卡片通用 ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
}

/* ========== 公告卡片 ========== */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notice-card {
  padding: 20px 22px;
}

.notice-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notice-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-strong);
}

.pin-badge {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: #8a5a00;
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.25);
  white-space: nowrap;
}

.notice-date {
  display: block;
  margin: 6px 0 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.notice-content {
  margin: 0;
  white-space: pre-line;
  font-size: 14.5px;
  color: var(--text-body);
}

/* 公告卡片可点态：与工具链接卡片一致的悬浮上浮 + 指针光标，键盘可达 */
.notice-card.notice-clickable {
  cursor: pointer;
}

.notice-card.notice-clickable .notice-hint {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary-strong);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
}

.notice-card.notice-clickable:hover .notice-hint,
.notice-card.notice-clickable:focus-visible .notice-hint {
  opacity: 1;
}

/* ========== 文件下载区 ========== */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.file-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  color: inherit;
}

.file-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.file-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(99, 102, 241, 0.12);
}

.file-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.file-arrow {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 15px;
  color: var(--color-primary);
  opacity: 0;
  transform: translate(-2px, 2px);
  transition:
    opacity 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}

.file-card:hover .file-arrow,
.file-card:focus-visible .file-arrow {
  opacity: 1;
  transform: none;
}

/* 文件卡片可点态：与公告卡片一致的可点反馈 + 指针光标 + 键盘可达 */
.file-card.file-clickable {
  cursor: pointer;
}

.file-card.file-clickable .file-hint {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary-strong);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
}

.file-card.file-clickable:hover .file-hint,
.file-card.file-clickable:focus-visible .file-hint {
  opacity: 1;
}

/* ========== 栏目大框（带边框容器，内部可分页） ========== */
.panel-box {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  /* 用页面底色作框内底，白色卡片在框内形成层次，呈现「整体包裹」的边界感 */
  background: var(--bg-page);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

/* ========== 分页器 ========== */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.pager-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--color-primary-strong);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.pager-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: rgba(99, 102, 241, 0.08);
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 76px;
  text-align: center;
}

/* ========== 公告详情模态框 ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(34, 31, 58, 0.42);
  backdrop-filter: blur(3px);
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 84vh;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  word-break: break-word;
}

.modal-close {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--bg-page);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out);
}

.modal-close:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.modal-meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.modal-body {
  margin-top: 14px;
}

.modal-text {
  margin: 0;
  white-space: pre-line;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-body);
  word-break: break-word;
}

/* ========== 公告富文本正文（notice.html 渲染） ========== */
/* 内容为服务端白名单净化后的 HTML；样式仅覆盖白名单标签，
   图片限宽、链接可辨识，暗色主题经 CSS 变量自动适配 */

.modal-rich-body {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-body);
  word-break: break-word;
}

.modal-rich-body p {
  margin: 0 0 10px;
}

.modal-rich-body p:last-child {
  margin-bottom: 0;
}

.modal-rich-body h2 {
  font-size: 18px;
  margin: 16px 0 8px;
  color: var(--text-strong);
}

.modal-rich-body h3 {
  font-size: 15.5px;
  margin: 14px 0 6px;
  color: var(--text-strong);
}

.modal-rich-body b,
.modal-rich-body strong {
  color: var(--text-strong);
}

.modal-rich-body ul,
.modal-rich-body ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.modal-rich-body li {
  margin: 3px 0;
}

.modal-rich-body blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--color-primary);
  background: var(--bg-page);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}

.modal-rich-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-rich-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 6px 0;
  display: block;
}

.modal-foot {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-primary {
  min-height: 36px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #ffffff;
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease-out);
}

.btn-primary:hover {
  background: var(--color-primary-strong);
}

.btn-secondary {
  min-height: 36px;
  padding: 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-body);
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
}

/* 文件详情模态框内的信息行（键 / 值） */
.modal-info {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-body);
}

.modal-info:last-child {
  margin-bottom: 0;
}

.modal-info .modal-info-key {
  color: var(--text-muted);
  margin-right: 6px;
}

.modal-info .modal-info-val {
  color: var(--text-strong);
  font-weight: 600;
}

/* ========== 工具链接网格 ========== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* 空态在网格容器内需横跨所有列，否则仅占首列轨道变成窄条 */
.link-grid .empty-state {
  grid-column: 1 / -1;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: inherit;
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.link-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.link-icon-letter {
  color: #ffffff;
  font-weight: 700;
  font-size: 19px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.link-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.link-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-arrow {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 13px;
  color: var(--color-primary);
  opacity: 0;
  transform: translate(-2px, 2px);
  transition:
    opacity 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}

.link-card:hover .link-arrow,
.link-card:focus-visible .link-arrow {
  opacity: 1;
  transform: none;
}

/* ========== 空状态 / 加载失败 ========== */
.empty-state {
  text-align: center;
  padding: 44px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-muted);
}

.empty-icon {
  display: block;
  font-size: 30px;
  margin-bottom: 8px;
}

.empty-state p {
  margin: 0;
}

.load-error {
  margin: 20px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13.5px;
}

/* 暗色主题：.load-error 的硬编码浅橙配色无法透过令牌覆盖，单独适配（暗系底色 + 可读暖色亮调，保留「错误」语义） */
html[data-theme='dark'] .load-error {
  background: #3a2a1e;
  border-color: #7c4a2a;
  color: #fdba74;
}

/* ========== 页脚 ========== */
.footer {
  margin-top: auto;
  /* env(safe-area-inset-bottom) 适配 iPhone 底部指示条，桌面端为 0 无感 */
  padding: 28px 0 calc(34px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
}

/* 页脚整体竖排居中：不依赖媒体查询，桌面端与移动端表现一致 */
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.footer-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* 构建版本号：紧随页脚文字弱化呈现（竖线分隔、小号、半透明），
   本地源码直跑无 version.json 时由 JS 置 [hidden] 整块隐藏 */
.footer-version {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border-soft);
  font-size: 11px;
  opacity: 0.7;
  white-space: nowrap;
}

/* 底部信息区：两行竖排 + 水平居中；gap 保证两行间距完全一致 */
.footer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

/* 单行清零外边距，行距只由 .footer-info 的 gap 决定（保证间距一致） */
.footer-info-row {
  margin: 0;
  line-height: 1.6;
}

.beian-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

.beian-link:hover {
  color: var(--color-primary-strong);
}

.beian-badge {
  flex: none;
  color: #6b7280;
}

.admin-entry {
  font-size: 12.5px;
  color: var(--text-muted);
  opacity: 0.7;
  transition:
    opacity 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
}

.admin-entry:hover {
  opacity: 1;
  color: var(--color-primary-strong);
}

/* 页脚友情链接：横排文字链，无数据由 JS 控制整块隐藏 */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  font-size: 13px;
}

.friend-links-label {
  color: var(--text-muted);
  font-weight: 600;
}

.friend-links-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.friend-link-item {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
}

.friend-link-item:hover {
  opacity: 0.78;
  text-decoration: underline;
}

.friend-links-sep {
  color: var(--border-strong);
  user-select: none;
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-body);
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

.theme-toggle:hover {
  color: var(--color-primary-strong);
  border-color: var(--border-strong);
}

/* ========== 入场动画 ========== */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-in {
  animation: rise-in 0.55s var(--ease-out) backwards;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .hero {
    /* 顶部留出固定主题按钮的空间，避免与日期胶囊重叠 */
    padding: 72px 0 40px;
  }

  /* 主题按钮热区 ≥44px */
  .theme-toggle {
    min-height: 44px;
  }

  /* 小屏两列、间距适中；
     minmax(0, 1fr) 允许列收缩到内容最小尺寸之下（1fr 的 auto 下限会被
     图标 + nowrap 链接名撑破容器），超长文案由卡片内 ellipsis 截断 */
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .link-card {
    min-height: 44px;
    padding: 14px;
  }

  /* 公告卡片行高与留白更舒适 */
  .notice-card {
    padding: 18px 16px;
  }

  .notice-content {
    line-height: 1.75;
  }

  /* 可点元素热区 ≥44px：备案链接与后台入口 */
  .beian-link {
    min-height: 44px;
  }

  .admin-entry {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* 可点元素热区 ≥44px：公告详情模态框的关闭「×」按钮
     （基础 32×32px，小屏触控偏小；桌面端保持 32px 图标观感，仅移动端提热区） */
  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ========== 动效减弱 ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
