/* 白夜之初 - 共用样式（科技蓝 + 照片墙 + 鼠标光效）
   对比度均过 WCAG AA：正文 17.1:1 / 次要 10.2:1 / 弱化 6.3:1 / 强调 9.2:1 */

:root {
  --bg: #050c18;
  --surface: rgba(13, 28, 50, .55);
  --surface-hover: rgba(16, 34, 60, .72);
  --surface-solid: #0d1c32;
  --fg: #e6f0ff;
  --fg-2: #a8bdd6;
  --fg-3: #7e94ad;
  --line: rgba(90, 140, 200, .16);
  --line-strong: rgba(56, 189, 248, .42);
  --accent: #38bdf8;
  --accent-2: #2563eb;
  --radius: 14px;
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .45);
}

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

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

body {
  margin: 0;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1000px 560px at 12% -8%, rgba(37, 99, 235, .22), transparent 62%),
    radial-gradient(760px 460px at 88% 2%, rgba(56, 189, 248, .12), transparent 58%),
    radial-gradient(900px 620px at 50% 112%, rgba(37, 99, 235, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* 科技感网格，只在页面上部显现 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(90, 140, 200, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 140, 200, .05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

/* 跟随鼠标的光晕，由 site.js 注入并驱动 */
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 620px;
  height: 620px;
  margin: -310px 0 0 -310px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(56, 189, 248, .10) 0%, rgba(37, 99, 235, .055) 42%, transparent 70%);
  will-change: transform;
}

::selection { background: rgba(56, 189, 248, .28); color: #fff; }

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ---------- 头部 ---------- */

.site-header { padding: 88px 0 0; }

.accent-bar {
  width: 38px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 16px rgba(56, 189, 248, .55);
  margin-bottom: 24px;
}

h1 {
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--fg);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: linear-gradient(180deg, #ffffff 32%, #9ec6ea);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.subtitle {
  font-size: .9rem;
  color: var(--fg-3);
  letter-spacing: .04em;
}

.intro { padding: 32px 0 0; }

.intro p {
  font-size: 1.02rem;
  color: var(--fg-2);
  line-height: 1.9;
  margin: 0;
}

/* ---------- 卡片 ---------- */

.cards {
  padding: 44px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px 20px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .3s ease, transform .3s ease, background .3s ease;
}

/* 卡片内的跟随聚光 */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(56, 189, 248, .14), transparent 62%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .10), var(--shadow-lg);
  transform: translateY(-3px);
}

.card:hover::after { opacity: 1; }

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ico {
  width: 20px;
  height: 20px;
  stroke: var(--fg-3);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: stroke .2s ease;
}

.card:hover .ico { stroke: var(--accent); }

.card .num {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--fg-3);
  transition: color .2s ease;
}

.card:hover .num { color: var(--accent); }

.card h2 {
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0 0 8px;
}

.card p {
  font-size: .84rem;
  color: var(--fg-3);
  line-height: 1.72;
  margin: 0;
  flex: 1;
}

.card .more {
  margin-top: 14px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .02em;
}

/* ---------- 照片区块 ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 52px 0 0;
}

.section-head h2 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: .01em;
}

.section-head a {
  font-size: .82rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.section-head a:hover { text-decoration: underline; }

.section-head a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* 首页四张横排 */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 0 0;
}

.strip a {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  transition: border-color .25s ease, transform .25s ease, box-shadow .3s ease;
}

.strip a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .38);
}

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

.strip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.strip a:hover img { transform: scale(1.06); }

/* 作品页两列大图 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 36px 0 0;
}

.photo {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color .25s ease, transform .3s ease, box-shadow .3s ease;
}

.photo:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

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

.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.photo:hover img { transform: scale(1.05); }

.photo .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 16px 14px;
  background: linear-gradient(transparent, rgba(5, 12, 24, .92));
  font-size: .84rem;
  color: #e6f0ff;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.photo .cap span {
  font-size: .75rem;
  color: var(--fg-3);
  white-space: nowrap;
}

/* ---------- 分割线与说明 ---------- */

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 52px 0 0;
}

/* ---------- 名言 + 月历 ---------- */

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 44px 0 0;
}

.quote {
  position: relative;
  margin: 0;
  padding: 24px 22px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 大引号装饰，避免卡片留白过空 */
.quote::before {
  content: "\201C";
  position: absolute;
  top: 6px;
  left: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.2rem;
  line-height: 1;
  color: rgba(56, 189, 248, .16);
  pointer-events: none;
}

.quote blockquote {
  margin: 0;
  font-size: .92rem;
  line-height: 1.9;
  color: var(--fg-2);
}

.quote figcaption {
  margin-top: 14px;
  font-size: .78rem;
  color: var(--fg-3);
  letter-spacing: .02em;
}

.calendar {
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title {
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.cal-nav { display: flex; gap: 6px; }

.cal-nav button {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-3);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.cal-nav button:hover {
  border-color: var(--line-strong);
  color: var(--accent);
  background: rgba(56, 189, 248, .08);
}

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

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-dow {
  font-size: .66rem;
  color: var(--fg-3);
  text-align: center;
  padding: 4px 0 6px;
  letter-spacing: .04em;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .76rem;
  color: var(--fg-2);
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}

.cal-day.is-weekend { color: var(--fg-3); }

.cal-day.is-other { color: rgba(126, 148, 173, .3); }

.cal-day.is-today {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #04101f;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(56, 189, 248, .35);
}

/* ---------- 页脚 ---------- */

.site-footer { margin-top: auto; padding: 60px 0 44px; }

.site-footer .ft-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin-bottom: 24px;
}

.site-footer p {
  font-size: .78rem;
  color: var(--fg-3);
  line-height: 2;
  margin: 0;
}

.site-footer a {
  color: var(--fg-3);
  text-decoration: none;
  transition: color .2s;
}

.site-footer a:hover { color: var(--fg-2); }

.site-footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

/* ---------- 栏目页 ---------- */

.page-head { padding: 80px 0 0; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  color: var(--fg-3);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color .2s;
}

.back:hover { color: var(--accent); }

.back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

.page-head h1 {
  font-size: 1.75rem;
  margin: 0;
}

.page-desc {
  font-size: .95rem;
  color: var(--fg-2);
  line-height: 1.85;
  margin: 12px 0 0;
}

.entry-list {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.entry { padding: 22px 0; }

.entry + .entry { border-top: 1px solid var(--line); }

.entry .meta {
  font-size: .76rem;
  color: var(--fg-3);
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.entry h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.entry p {
  font-size: .87rem;
  color: var(--fg-2);
  line-height: 1.75;
  margin: 0;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .site-header { padding-top: 60px; }
  h1 { font-size: 1.7rem; }
  .cards { grid-template-columns: 1fr; gap: 10px; padding-top: 34px; }
  .card { padding: 20px 18px; }
  .strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .photo-grid { gap: 10px; }
  .section-head { padding-top: 42px; }
  .duo { grid-template-columns: 1fr; gap: 12px; padding-top: 32px; }
  .quote { padding: 20px 18px; }
  .page-head { padding-top: 56px; }
  .divider { margin-top: 40px; }
  .site-footer { padding: 46px 0 34px; }
  .cursor-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .card:hover, .photo:hover, .strip a:hover { transform: none; }
  .cursor-glow { display: none; }
}
