/* 手写样式表。
 *
 * 旧项目引入了 3 个 jQuery 版本、2 套 Bootstrap、Vue 2.5.16、axios 0.18、
 * CKEditor 4 —— 全部已停止维护。这里一个第三方前端库都不依赖，
 * 换来：无 CDN、无版本漂移、无构建步骤。
 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2024;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --danger: #b91c1c;
  --radius: 0.75rem;
  --shadow: 0 0.0625rem 0.125rem rgba(16, 24, 40, .06), 0 0.25rem 0.75rem rgba(16, 24, 40, .06);
  --maxw: 97.5rem;
}

/* 全站尺寸统一用 rem 表达，于是这一个数字就能整体放大/缩小。
   100% = 浏览器默认字号（通常 16px），即原始尺寸。
   调大就改这里，例如 125% 即整体放大 25%（16px -> 20px）。 */
html {
  font-size: 100%;
}

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

/* 背景图放在 body 上（而不是塞进顶部的 hero 面板），这样整屏都是它。
   background-attachment: fixed 让图片按视口尺寸铺满，滚动时也不跟着跑。 */
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* 在背景图之上、所有内容之下铺一层半透明浅色底。
   照片深浅不可控；不铺这层的话 --muted 的次要文字（页脚、分页状态、
   「没有匹配的站点」、加载提示等）在某些图上会读不清。
   z-index: -1 让它落在 body 背景图之上、所有内容之下。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .5);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.sr-only {
  position: absolute; width: 0.0625rem; height: 0.0625rem; padding: 0; margin: -0.0625rem;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -624.9375rem; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 0.5rem 0.875rem; border-radius: 0 0 0.5rem 0;
}
.skip-link:focus { left: 0; }

/* ---------- 首页 hero ---------- */
/* 顶部标题区。没有任何底色与边框——文字直接落在照片上，
   全靠白色投影保证可读。 */
.hero {
  margin: 2rem 0 1.25rem; padding: 3.5rem 2rem;
  text-align: center;
}
/* 标题样式取自旧站的 .page-title-index：5rem / 白色 / 700 / 负字距 / 深色投影 / 入场动画。
 *
 * 字体族写着 Playball + cursive，但 Playball 是纯拉丁字体、没有中文字形，
 * 所以中文标题从来不会用它（旧站也一样）——真正决定观感的是后面的中文回退。
 * 这里把中文行楷候选写明确，让「书法感」有个确定的结果，而不是看系统碰运气。 */
.hero-title {
  margin: 0.625rem 0;
  font-size: 5rem;
  font-family: "Playball", "楷体", KaiTi, STKaiti, "Kaiti SC", cursive;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.0625rem;
  color: #fff;
  text-shadow: rgba(0, 0, 0, .3) 0 0.1875rem 0.375rem;
  animation: fade-in-down 1s ease .5s 1 normal both;
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* 每日诗词。刻意不设字体族——继承 body 的字体栈，与站点标题、卡片完全同一套字体，
   只用字号与颜色区分层级（cite 记得清掉浏览器默认的斜体）。 */
.poem {
  margin: 0 auto 1.375rem;
  max-width: 42.5rem;
  padding: 0;
  border: 0;
}
.poem-content {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #fff;
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5);
}
.poem-source {
  display: block;
  font-style: normal;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5);
}

.hero-sub {
  margin: 0 0 1.25rem;
  color: #fff;
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5);
}

.search-form { display: flex; gap: 0.5rem; max-width: 32.5rem; margin: 0 auto; }
.search-form input {
  flex: 1; padding: 0.625rem 0.875rem; font-size: 0.9375rem; font-family: inherit;
  border: 0.0625rem solid var(--border); border-radius: 62.4375rem; background: var(--surface);
}
.search-form input:focus { outline: 0.125rem solid var(--accent-soft); border-color: var(--accent); }
.search-form button {
  padding: 0.625rem 1.375rem; font-size: 0.9375rem; font-family: inherit; cursor: pointer;
  border: 0; border-radius: 62.4375rem; background: var(--accent); color: #fff;
}

/* ---------- 分类 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.375rem 0; }
.chip {
  padding: 0.375rem 0.875rem; border-radius: 62.4375rem; font-size: 0.875rem;
  background: rgba(255, 255, 255, .9); color: var(--muted); border: 0.0625rem solid var(--border);
}
.chip:hover { text-decoration: none; color: var(--accent); border-color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 直接落在照片上的文字一律白色 + 深色投影（有自己白底的卡片/分类/输入框不在此列） */
.result-note { color: #fff; font-size: 0.875rem; text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5); }
.empty {
  padding: 3rem 0; text-align: center; color: #fff;
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5);
}

/* ---------- 卡片网格 ---------- */
.site-grid {
  display: grid; gap: 1.25rem; margin-bottom: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.card {
  display: flex; flex-direction: column; gap: 0.375rem;
  padding: 1.125rem; border-radius: var(--radius); background: rgba(255, 255, 255, .94);
  border: 0.0625rem solid var(--border); color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { text-decoration: none; transform: translateY(-0.125rem); box-shadow: var(--shadow); }
.card-cover {
  display: grid; place-items: center; height: 8.75rem; margin-bottom: 0.5rem;
  border-radius: 0.625rem; overflow: hidden;
  background: var(--accent-soft); color: var(--accent);
  font-size: 1.75rem; font-weight: 700;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-weight: 600; font-size: 1.0625rem; }
.card-desc { color: var(--muted); font-size: 0.875rem; line-height: 1.5; }

.sentinel {
  padding: 1.25rem 0 2.5rem; text-align: center; color: #fff; font-size: 0.875rem;
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5);
}

/* ---------- 页面标题（404 页在用） ---------- */
.page-title { margin: 1.75rem 0 1.125rem; font-size: 1.625rem; color: #fff; text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5); }

/* ---------- 按钮（404 页在用） ---------- */
.primary-button {
  display: inline-block; padding: 0.625rem 1.25rem; border: 0; border-radius: 0.5rem;
  background: var(--accent); color: #fff; font: inherit; cursor: pointer;
  text-align: center;
}
.primary-button:hover { text-decoration: none; opacity: .92; }

/* ---------- 消息与错误页 ---------- */
.messages { margin-top: 1rem; display: grid; gap: 0.5rem; }
.message { padding: 0.625rem 0.875rem; border-radius: 0.5rem; background: var(--accent-soft); }
.message-error { background: #fee2e2; color: var(--danger); }
.message-success { background: #dcfce7; color: #166534; }

.error-page { max-width: 32.5rem; margin: 4rem auto; text-align: center; }
.error-code {
  margin: 0; font-size: 3.5rem; font-weight: 700;
  color: rgba(255, 255, 255, .45); text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5);
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 2.5rem; padding: 1.5rem 0;
  color: #fff; font-size: 0.8125rem;
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, .5);
}
.site-footer p { margin: 0; }

/* ---------- 可访问性 / 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .hero { padding: 2rem 1.125rem; }
  /* 5rem 在手机上太挤，等比缩一点 */
  .hero-title { font-size: 2.8rem; }

}
