/* ============================================================
   宇的小站 · 黄昏配色
   ------------------------------------------------------------
   所有颜色都在下面的 :root 里。想换配色，只改这里。
   ============================================================ */

:root {
  --bg: #16101c;
  --card: rgba(28, 19, 30, 0.55);
  --line: rgba(255, 170, 130, 0.2);
  --text: #f7ece4;
  --dim: #c3a89d;
  --accent: #ff9e7a;
  --gold: #ffc35e;
  --radius: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  padding: 0 1.5rem 4rem;
  background:
    radial-gradient(760px 380px at 50% -4%, rgba(255, 158, 87, 0.45), transparent 62%),
    radial-gradient(1300px 620px at 50% -12%, rgba(255, 96, 122, 0.26), transparent 62%),
    radial-gradient(900px 700px at 12% 108%, rgba(78, 66, 150, 0.34), transparent 62%),
    linear-gradient(180deg, #3b1c2a 0%, #1d1222 55%, #0a0710 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.75;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  top: -30vh;
  left: 50%;
  width: 80vw;
  height: 80vw;
  max-width: 900px;
  max-height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 190, 110, 0.16), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

/* ===== 顶栏 ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 920px;
  margin: 0 auto;
  padding: 1.1rem 0;
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
}

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

.links {
  display: flex;
  gap: 0.35rem;
}

.links a {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.links a.active {
  color: var(--text);
  background: rgba(255, 158, 122, 0.16);
}

/* ===== 版心 ===== */
main,
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
}

main {
  padding-top: 2.5rem;
  min-height: 55vh;
}

/* ===== 首页英雄区 ===== */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  background: linear-gradient(100deg, #fff4e8 5%, var(--accent) 52%, var(--gold) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin-top: 0.9rem;
  color: var(--dim);
  font-size: 0.95rem;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

/* ===== 倒计时 ===== */
.countdown {
  text-align: center;
  margin-bottom: 1.25rem;
}

.card-label {
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  color: var(--dim);
  margin-bottom: 1.2rem;
}

.clock {
  display: flex;
  justify-content: center;
  gap: clamp(0.6rem, 3vw, 2rem);
  flex-wrap: wrap;
}

.unit {
  min-width: 4.2rem;
}

.unit span {
  display: block;
  font-size: clamp(1.9rem, 6vw, 3rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 195, 94, 0.32);
}

.unit small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--dim);
  letter-spacing: 0.15em;
}

.tip {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--dim);
}

/* ===== 卡片网格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.item {
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.item:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 170, 130, 0.5);
}

.item .icon {
  display: inline-block;
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.item h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.item p {
  font-size: 0.88rem;
  color: #d8c7bc;
}

.item .meta {
  margin-top: 0.9rem;
  font-size: 0.76rem;
  color: var(--dim);
  letter-spacing: 0.05em;
}

/* ===== 区块标题 ===== */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
}

.section-title h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.section-title a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}

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

/* ===== 记事列表 ===== */
.note-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-row {
  display: block;
  padding: 1.15rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.note-row:hover {
  border-color: rgba(255, 170, 130, 0.5);
  transform: translateX(4px);
  background: rgba(40, 26, 38, 0.6);
}

.note-row .row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.note-row h3 {
  font-size: 1rem;
  font-weight: 600;
}

.note-row time {
  font-size: 0.76rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.note-row p {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--dim);
}

/* ===== 文章正文 ===== */
.article-head {
  margin-bottom: 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
}

.article-head h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 600;
  line-height: 1.35;
}

.article-head time {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--dim);
}

.prose {
  font-size: 0.98rem;
  color: #e8dcd4;
}

.prose > * + * {
  margin-top: 1.05rem;
}

.prose h2 {
  margin-top: 2.2rem;
  font-size: 1.15rem;
  color: var(--text);
}

.prose h3 {
  margin-top: 1.6rem;
  font-size: 1rem;
  color: var(--text);
}

.prose strong {
  color: var(--text);
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li {
  margin-top: 0.35rem;
}

.prose code {
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.86em;
  font-family: "Cascadia Code", Consolas, monospace;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
}

.prose pre code {
  padding: 0;
  background: none;
  color: #f3e6dc;
  font-size: 0.85rem;
  line-height: 1.6;
}

.prose blockquote {
  padding-left: 1rem;
  border-left: 3px solid rgba(255, 158, 122, 0.45);
  color: var(--dim);
}

.prose a {
  color: var(--accent);
}

/* 文章里的插图 */
.prose img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

/* ===== 记事：搜索与标签筛选 ===== */
.count {
  font-size: 0.8rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

#search {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#search::placeholder {
  color: var(--dim);
  opacity: 0.7;
}

#search:focus {
  border-color: rgba(255, 158, 122, 0.6);
  background: rgba(0, 0, 0, 0.4);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(255, 170, 130, 0.45);
}

.chip.on {
  background: rgba(255, 158, 122, 0.18);
  border-color: rgba(255, 158, 122, 0.5);
  color: var(--text);
}

/* ===== 标签 ===== */
.tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.tag {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--dim);
  font-size: 0.72rem;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.tag:hover {
  color: var(--text);
  background: rgba(255, 158, 122, 0.22);
}

.empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--dim);
  font-size: 0.88rem;
}

/* ===== 上一篇 / 下一篇 ===== */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.pager-link:hover {
  border-color: rgba(255, 170, 130, 0.5);
  background: rgba(40, 26, 38, 0.5);
  transform: translateY(-2px);
}

.pager-link small {
  font-size: 0.72rem;
  color: var(--dim);
  letter-spacing: 0.1em;
}

.pager-link span {
  font-size: 0.9rem;
}

.pager-link.next {
  text-align: right;
}

/* ===== 相册 ===== */
.gallery-intro {
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--dim);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.photo {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 2;
  background: rgba(0, 0, 0, 0.3);
  cursor: zoom-in;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, filter 0.3s ease;
}

.photo:hover img {
  transform: scale(1.06);
  filter: brightness(1.1);
}

.photo-cap {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.4rem 0.9rem 0.8rem;
  background: linear-gradient(transparent, rgba(10, 6, 14, 0.92));
  font-size: 0.78rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.photo:hover .photo-cap,
.photo:focus-visible .photo-cap {
  opacity: 1;
  transform: translateY(0);
}

.photo-cap strong {
  font-weight: 600;
  font-size: 0.84rem;
}

.photo-cap em {
  font-style: normal;
  color: var(--dim);
  font-size: 0.74rem;
}

/* 首页那一排小图：小屏时只留一张 */
@media (max-width: 700px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .strip {
    grid-template-columns: 1fr;
  }
  .strip .photo:not(:first-child) {
    display: none;
  }
}

/* ===== 大图浮层 ===== */
body.no-scroll {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(6, 4, 10, 0.92);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  animation: fade-in 0.22s ease;
}

.lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox p {
  font-size: 0.85rem;
  color: var(--dim);
  text-align: center;
}

.lightbox p strong {
  color: var(--text);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== 大图上的按钮 ===== */
.lb-actions {
  display: flex;
  gap: 0.6rem;
}

.lb-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lb-btn:hover {
  background: rgba(255, 158, 122, 0.25);
  border-color: rgba(255, 158, 122, 0.6);
}

/* ===== 相册：添加照片那一格 ===== */
.add-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px dashed rgba(255, 170, 130, 0.35);
  background: rgba(255, 255, 255, 0.02);
  color: var(--dim);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.add-tile:hover {
  border-color: rgba(255, 158, 122, 0.7);
  background: rgba(255, 158, 122, 0.08);
  color: var(--text);
}

.add-tile .plus {
  font-size: 1.7rem;
  line-height: 1;
}

.add-tile .hint {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  text-align: center;
}

.add-tile .hint small {
  font-size: 0.7rem;
  opacity: 0.75;
}

.add-tile.busy {
  opacity: 0.45;
  pointer-events: none;
}

/* 服务器没在跑的时候：看起来就是"点不了"，点一下会告诉你为什么 */
.add-tile.off {
  border-color: rgba(255, 170, 130, 0.18);
  color: rgba(195, 168, 157, 0.55);
  cursor: not-allowed;
}

.add-tile.off .plus {
  opacity: 0.5;
}

.gallery-tip {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--dim);
}

/* ===== 底部提示条 ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 200;
  max-width: min(90vw, 520px);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(24, 16, 28, 0.94);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 0.84rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== 状态 ===== */
.loading,
.error {
  padding: 2rem 0;
  text-align: center;
  color: var(--dim);
  font-size: 0.9rem;
}

.error {
  color: #ffb4a8;
}

.error code {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

/* ===== 页脚 ===== */
.site-footer {
  margin-top: 4rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--dim);
}

.quote {
  margin-top: 0.4rem;
  font-style: italic;
  opacity: 0.75;
}

/* ===== 小屏 ===== */
@media (max-width: 560px) {
  body {
    padding: 0 1rem 3rem;
  }
  .site-nav {
    padding: 0.9rem 0;
  }
  .links a {
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 1.35rem;
  }
  .unit {
    min-width: 3.2rem;
  }
}
