/* =========================================================
   主题：极光玻璃 · 浅色（Aurora Glass Light）
   ========================================================= */
:root {
  --bg: #F7F5FF;
  --text: #1E1B3A;
  --muted: #5B5677;
  --teal: #0F766E;
  --teal-hover: #115E59;
  --violet: #6D28D9;
  --violet-deep: #5B21B6;
  --pink: #DB2777;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.85);
  --line: rgba(109, 40, 217, 0.12);
  --shadow: 0 10px 36px rgba(76, 58, 140, 0.10);
  --shadow-lg: 0 14px 44px rgba(76, 58, 140, 0.16);
  --r: 20px;
  --r-s: 12px;
  --grad: linear-gradient(90deg, #0F766E, #6D28D9);
  --grad-text: linear-gradient(90deg, #0D9488, #7C3AED 55%, #DB2777);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.75 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 55% 40% at 10% 0%, rgba(45, 212, 191, 0.32), transparent 70%),
    radial-gradient(ellipse 50% 45% at 92% 6%, rgba(167, 139, 250, 0.38), transparent 70%),
    radial-gradient(ellipse 45% 35% at 70% 55%, rgba(244, 114, 182, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 15% 100%, rgba(94, 234, 212, 0.22), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.3; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.inline { display: inline; }

/* 毛玻璃卡片 */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 0 rgba(76, 58, 140, 0.06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 64px; }
.topbar .logo { display: inline-flex; align-items: center; min-height: 44px; transition: opacity .15s; }
.topbar .logo:hover { opacity: .8; }
/* logo.png 左右自带透明留白，用负外边距抵消，让字形与正文左边缘对齐 */
.topbar .logo img { --h: 35px; display: block; height: var(--h); width: auto; margin: 0 calc(var(--h) * -0.24); }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.topbar nav a, .topbar nav .linkbtn {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--muted); font-size: 14px;
}
.topbar nav a:hover, .topbar nav .linkbtn:hover { background: rgba(255, 255, 255, 0.85); color: var(--text); text-decoration: none; }

main.wrap { padding-top: 8px; padding-bottom: 40px; min-height: 70vh; }
.foot { color: var(--muted); font-size: 13px; padding: 28px 24px 36px; text-align: center; }

/* ---------- 通用控件 ---------- */
.flash { padding: 12px 16px; border-radius: var(--r-s); margin: 16px 0; background: rgba(240, 253, 250, 0.85); border: 1px solid rgba(15, 118, 110, 0.25); color: #134E4A; }
.flash.err { background: rgba(255, 241, 242, 0.9); border-color: rgba(190, 18, 60, 0.3); color: #9F1239; }
.flash.warn { background: rgba(255, 251, 235, 0.9); border-color: rgba(180, 83, 9, 0.3); color: #92400E; }
.empty { color: var(--muted); padding: 32px 16px; text-align: center; margin: 0; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--grad); color: #fff; font: inherit; font-weight: 600;
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.25); transition: transform .15s, box-shadow .15s;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(109, 40, 217, 0.32); color: #fff; text-decoration: none; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 0; color: var(--teal); cursor: pointer; font: inherit; box-shadow: none; }
.linkbtn:hover { transform: none; box-shadow: none; color: var(--teal-hover); text-decoration: underline; }

input, select, textarea {
  font: inherit; color: var(--text); width: 100%; min-height: 44px; padding: 8px 14px;
  background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(109, 40, 217, 0.18); border-radius: var(--r-s);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12); }
input::placeholder { color: #8A85A6; }

.tag {
  display: inline-block; font-size: 13px; padding: 2px 12px; margin: 2px 6px 2px 0; border-radius: 999px;
  background: rgba(109, 40, 217, 0.08); color: var(--violet-deep);
}
.tag:hover { background: rgba(109, 40, 217, 0.15); color: var(--violet-deep); text-decoration: none; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.mark { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--teal); margin-right: 10px; vertical-align: middle; }
.mark-violet { background: var(--violet); }

/* 顶部主菜单 */
.topbar nav a.on { background: rgba(255, 255, 255, 0.9); color: var(--text); font-weight: 600; box-shadow: 0 2px 10px rgba(76, 58, 140, 0.12); }
.nav-sep { width: 1px; height: 18px; background: rgba(109, 40, 217, 0.2); margin: 0 6px; }

/* ---------- 首页：Hero ---------- */
.hero { padding: 48px 0 36px; }
.hero .search { max-width: 720px; }
.kicker { margin: 0 0 12px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; color: var(--teal); }
.hero-title { margin: 0; font-size: clamp(34px, 5vw, 54px); line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: 16px 0 28px; max-width: 520px; color: var(--muted); font-size: 17px; }

/* 搜索框 */
.search {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px;
  background: rgba(255, 255, 255, 0.62); box-shadow: var(--shadow-lg);
}
.search input[type="search"] { flex: 1 1 180px; min-width: 0; border: 0; background: transparent; box-shadow: none; }
.search input[type="search"]:focus { box-shadow: none; }
.btn-grad { flex: none; }

/* 3D 星球标签云（分类与标签混合） */
.cloud-card {
  position: relative; isolation: isolate; overflow: hidden; padding: 2px; border-radius: var(--r);
  background: #1A1342;
  box-shadow: 0 18px 50px rgba(76, 29, 149, 0.32), 0 0 34px rgba(45, 212, 191, 0.14);
  transition: box-shadow .4s;
}
.cloud-card:hover { box-shadow: 0 22px 60px rgba(76, 29, 149, 0.42), 0 0 54px rgba(167, 139, 250, 0.38); }
/* 流光边框：放大的锥形渐变在卡片下方旋转，只露出 2px */
.cloud-card::before {
  content: ""; position: absolute; z-index: -2; left: 50%; top: 50%; width: 170%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: conic-gradient(#2DD4BF, #1A1342 18%, #A78BFA 36%, #F472B6 48%, #1A1342 66%, #38BDF8 84%, #2DD4BF);
  animation: cloud-spin 9s linear infinite;
}
.cloud-card::after {
  content: ""; position: absolute; z-index: -1; inset: 2px; border-radius: calc(var(--r) - 2px);
  background:
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.42), transparent 58%),
    radial-gradient(ellipse 80% 50% at 12% 0%, rgba(45, 212, 191, 0.30), transparent 70%),
    radial-gradient(ellipse 70% 55% at 100% 100%, rgba(236, 72, 153, 0.28), transparent 70%),
    linear-gradient(160deg, #120D33, #0B0820 60%, #170B36);
}
.cloud-card > .muted { margin: 0; padding: 28px 16px; text-align: center; color: #C4BEE6; }
.cloud3d { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 24px 16px; }
.cloud3d.is-3d {
  display: block; position: relative; height: 380px; padding: 0; overflow: hidden; border-radius: calc(var(--r) - 2px);
  cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
.cloud3d.is-drag { cursor: grabbing; }
.cloud-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* 两道倾斜轨道光环 */
.cloud3d.is-3d::before, .cloud3d.is-3d::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 270px; height: 270px; margin: -135px 0 0 -135px; border-radius: 50%;
  border: 1px solid rgba(94, 234, 212, 0.16); border-top-color: rgba(94, 234, 212, 0.75); pointer-events: none;
  animation: cloud-orbit-a 14s linear infinite;
}
.cloud3d.is-3d::after { border-color: rgba(244, 114, 182, 0.14); border-top-color: rgba(244, 114, 182, 0.7); animation: cloud-orbit-b 19s linear infinite; }
@keyframes cloud-spin { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(1turn); } }
@keyframes cloud-orbit-a { from { transform: rotateX(68deg) rotateY(18deg) rotateZ(0); } to { transform: rotateX(68deg) rotateY(18deg) rotateZ(1turn); } }
@keyframes cloud-orbit-b { from { transform: rotateX(62deg) rotateY(-34deg) rotateZ(1turn); } to { transform: rotateX(62deg) rotateY(-34deg) rotateZ(0); } }

/* 标签：每个是独立胶囊，相邻标签轮换颜色；--c 为该标签的主色 */
.ci { --c: #5EEAD4; display: inline-block; color: #fff; text-decoration: none; }
.ci.hue1 { --c: #C4B5FD; } .ci.hue2 { --c: #F9A8D4; } .ci.hue3 { --c: #7DD3FC; } .ci.hue4 { --c: #FCD34D; } .ci.hue5 { --c: #86EFAC; }
.ci:hover { color: #fff; text-decoration: none; }
.ci:focus-visible { outline: none; }
.ci-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 190px; padding: 3px 10px; border-radius: 999px;
  white-space: nowrap; font-weight: 600; line-height: 1.5; color: var(--c);
  background: rgba(17, 12, 48, 0.9); border: 1px solid var(--c);
  box-shadow: 0 4px 14px rgba(5, 3, 20, 0.5);
}
.ci-name { overflow: hidden; text-overflow: ellipsis; }
.ci-pill small { flex: none; font: 400 10px/1 var(--mono); color: #fff; opacity: .75; }
.lv1 { font-size: 12px; } .lv2 { font-size: 13px; } .lv3 { font-size: 14px; } .lv4 { font-size: 16px; } .lv5 { font-size: 18px; }
.ci.lv4 .ci-pill, .ci.lv5 .ci-pill { box-shadow: 0 4px 14px rgba(5, 3, 20, 0.5), 0 0 16px -3px var(--c); }
.ci:hover .ci-pill, .ci:focus-visible .ci-pill { background: var(--c); color: #120D33; box-shadow: 0 0 26px -2px var(--c); }
.ci:hover .ci-pill small, .ci:focus-visible .ci-pill small { color: #120D33; opacity: .8; }
.ci:focus-visible .ci-pill { outline: 2px solid #fff; outline-offset: 2px; }
.ci.on .ci-pill { background: linear-gradient(90deg, #0F766E, #6D28D9); border-color: #fff; color: #fff; }
.ci.on .ci-pill small { color: #fff; opacity: .9; }
.ci-dot { display: none; }
/* 3D 模式：锚点为球面上的点，胶囊与光点都以它为中心；收缩为光点时胶囊淡出 */
.is-3d .ci { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform, opacity; }
.is-3d .ci-pill { position: absolute; left: 0; top: 0; width: max-content; transform: translate(-50%, -50%); transition: opacity .25s .1s, transform .25s .1s, background-color .2s, color .2s; }
.is-3d .ci.is-dot .ci-pill { opacity: 0; transform: translate(-50%, -50%) scale(.4); pointer-events: none; transition: opacity .12s, transform .12s; }
.is-3d .ci-dot { display: block; position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle, #fff 0 1.5px, var(--c) 2.5px 3px, transparent 4px); opacity: 0; transition: opacity .25s; }
.is-3d .ci.is-dot .ci-dot { opacity: 1; }

/* ---------- 首页：列表 + 侧栏 ---------- */
.layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.main-col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.side-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.result-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 18px; font-size: 14px; color: var(--muted); }
.result-bar b { color: var(--text); }

.card { overflow: hidden; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-body { padding: 22px 26px; }
.card h2 { margin: 6px 0 8px; font-size: 21px; }
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--violet); text-decoration: none; }
.card .meta a { color: var(--teal); }
.excerpt { margin: 0 0 12px; color: var(--muted); }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; font-family: var(--mono); }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px;
  border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--glass-border); color: var(--text);
}
.pager a:hover { background: #fff; text-decoration: none; }
.pager .cur { background: var(--grad); color: #fff; border-color: transparent; }

.rank-card { padding: 22px 22px 18px; }
.rank-card h2 { margin: 0 0 14px; font-size: 17px; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rank li { display: flex; gap: 12px; align-items: baseline; padding: 8px 6px; border-radius: var(--r-s); }
.rank li:hover { background: rgba(255, 255, 255, 0.7); }
.rank .no { flex: none; width: 26px; font-family: var(--mono); font-size: 18px; font-weight: 700; background: linear-gradient(180deg, #0D9488, #7C3AED); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank li:nth-child(n+4) .no { background: none; color: #A5A0C2; }
.rank li a { min-width: 0; color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.rank li a:hover { color: var(--violet); }

/* ---------- 文章页 ---------- */
.post {
  max-width: 860px; margin: 32px auto 0; padding: 36px 44px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r);
  box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.post h1 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 36px); }
.post .meta { display: block; }
.post .meta a { color: var(--teal); }
.content { margin: 28px 0; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.content h2, .content h3, .content h4 { margin: 1.6em 0 .6em; }
.content img { display: block; max-width: 80%; height: auto; margin: 0 auto; border-radius: var(--r-s); box-shadow: var(--shadow); }
.content .post-img-link { display: block; max-width: 100%; text-align: center; cursor: zoom-in; border-radius: var(--r-s); }
.content .post-img-link:hover { opacity: .9; }
.content .post-img-link:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.content pre { background: rgba(30, 27, 58, 0.92); color: #EDE9FE; padding: 16px 18px; border-radius: var(--r-s); overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.content code { font-family: var(--mono); background: rgba(109, 40, 217, 0.08); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.content pre code { background: none; padding: 0; }
.content blockquote { margin: 1.2em 0; padding: 10px 18px; border-radius: var(--r-s); background: rgba(109, 40, 217, 0.06); border-left: 4px solid #A78BFA; color: var(--muted); }
.content hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.content table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 15px; }
.content th, .content td { padding: 8px 14px; border: 1px solid rgba(109, 40, 217, 0.14); text-align: left; vertical-align: top; }
.content th { background: rgba(109, 40, 217, 0.06); font-weight: 600; }
.content tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.5); }
.content ul, .content ol { padding-left: 1.6em; }
.content li { margin: .3em 0; }
.post-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.post-foot .tags { margin: 0; }
.post-foot .tag:last-child { margin-right: 0; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow); color: var(--violet);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  transition: transform .15s, box-shadow .15s, color .15s;
}
.back-to-top:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--pink); text-decoration: none; }
.back-to-top:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

/* ---------- 关于页 ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 56px 0 36px; }
.about-lead { margin: 18px 0 0; font-size: 20px; line-height: 1.7; max-width: 560px; }
.career { padding: 24px 26px; }
.career-title { margin: 0 0 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.career-path { list-style: none; margin: 0; padding: 0; position: relative; }
.career-path::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(180deg, rgba(45, 212, 191, .5), rgba(124, 58, 237, .6)); border-radius: 2px; }
.career-path li { position: relative; display: flex; align-items: center; gap: 14px; padding: 8px 0; color: var(--muted); }
.career-dot { position: relative; z-index: 1; flex: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #A78BFA; }
.career-path li.now { color: var(--text); font-weight: 700; font-size: 17px; }
.career-path li.now .career-dot { border: 0; background: var(--grad); box-shadow: 0 0 0 5px rgba(124, 58, 237, .15); }
.career-tag { font-size: 12px; font-weight: 600; padding: 1px 10px; border-radius: 999px; background: var(--grad); color: #fff; }

.memorial { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 40px; align-items: center; padding: 28px; margin-bottom: 24px; }
.memorial-photo { margin: 0; }
.memorial-photo img { display: block; width: 100%; height: auto; border-radius: 16px; filter: saturate(.92); }
.memorial-photo figcaption { margin-top: 10px; text-align: center; font-size: 13px; color: var(--muted); }
.memorial-text h2 { margin: 0 0 18px; font-size: 40px; letter-spacing: .04em; }
.memorial-line { margin: 0 0 14px; font-size: 18px; line-height: 1.8; }
.memorial-note { margin: 0 0 22px; color: var(--muted); line-height: 1.9; }
.memorial-rip { margin: 0; padding-top: 18px; border-top: 1px solid var(--line); font-style: italic; font-size: 18px; color: var(--violet-deep); letter-spacing: .02em; }

/* ---------- 相册列表（拍立得堆叠） ---------- */
.album-hero { padding-bottom: 28px; }
.year-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.year-filter a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; color: var(--muted); background: rgba(255, 255, 255, 0.5); }
.year-filter a:hover { color: var(--text); text-decoration: none; background: rgba(255, 255, 255, 0.85); }
.year-filter a.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 2px 8px rgba(76, 58, 140, 0.14); }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 52px 40px; padding: 12px 0 24px; }
.album-card { display: flex; flex-direction: column; gap: 18px; color: var(--text); }
.album-card:hover { text-decoration: none; color: var(--text); }
.stack { position: relative; height: 300px; }
.pol {
  position: absolute; padding: 12px 12px 44px; background: #fff; border-radius: 6px;
  box-shadow: 0 8px 22px rgba(76, 58, 140, 0.14); transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
}
.pol img, .pol-blank { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; background: linear-gradient(135deg, #EDE9FE, #E6F6F4); }
.pol-3 { inset: 18px 40px 12px 18px; transform: rotate(-8deg) translateX(-4px); }
.pol-2 { inset: 14px 16px 14px 42px; transform: rotate(7deg) translateX(6px); }
.pol-1 { inset: 10px 30px 18px 30px; box-shadow: 0 14px 34px rgba(76, 58, 140, 0.2); }
.pol-date { position: absolute; left: 14px; right: 14px; bottom: 12px; font-size: 13px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pol-count { position: absolute; right: 4px; top: 0; z-index: 2; font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(109, 40, 217, .3); }
.album-card:hover .pol-3, .album-card:focus-visible .pol-3 { transform: rotate(-13deg) translate(-20px, 6px); }
.album-card:hover .pol-2, .album-card:focus-visible .pol-2 { transform: rotate(12deg) translate(22px, 4px); }
.album-card:hover .pol-1, .album-card:focus-visible .pol-1 { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(76, 58, 140, 0.26); }
.album-info { padding: 0 16px; }
.album-info h2 { margin: 0 0 2px; font-size: 19px; }
.album-info p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- 相册详情 ---------- */
.back-link { margin: 24px 0 8px; font-size: 14px; }
.album-head { margin-bottom: 24px; }
.album-head h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 40px); }
.album-head .meta a { color: var(--teal); }
.album-desc { margin: 10px 0 0; color: var(--muted); font-size: 16px; max-width: 720px; }
/* 照片墙：等高行排布（由 lightbox.js 按照片比例设置宽度）；无 JS 时退化为整齐网格 */
.photo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding-bottom: 24px; }
.photo-wall.justified { display: flex; flex-wrap: wrap; }
.photo-wall.justified::after { content: ""; flex-grow: 999999; }
.pw-item { position: relative; margin: 0; min-width: 0; }
.pw-link { display: block; overflow: hidden; border-radius: 12px; cursor: zoom-in; background: #EDE9FE; box-shadow: var(--shadow); }
.pw-link img { display: block; width: 100%; height: auto; transition: transform .4s; }
.photo-wall:not(.justified) .pw-link img { aspect-ratio: 1 / 1; object-fit: cover; }
.pw-link:hover img { transform: scale(1.04); }
.pw-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px 11px;
  font-size: 15px; line-height: 1.55; color: #fff; overflow-wrap: anywhere;
  background: rgba(20, 16, 40, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 0 0 12px 12px; pointer-events: none;   /* 点在文字上也能打开大图 */
}

/* 全屏查看 */
html.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: rgba(20, 16, 40, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lb[hidden] { display: none; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 56px 72px 8px; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); transition: opacity .2s; }
.lb.loading .lb-img { opacity: .3; }
.lb-spin { position: absolute; width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: lb-spin .8s linear infinite; opacity: 0; }
.lb.loading .lb-spin { opacity: 1; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lb-bar { display: flex; gap: 16px; align-items: baseline; justify-content: center; padding: 12px 24px 20px; color: rgba(255, 255, 255, .85); }
.lb-count { font-family: var(--mono); font-size: 13px; color: rgba(255, 255, 255, .6); }
.lb-cap { margin: 0; font-size: 15px; }
.lb button { position: absolute; min-height: 0; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; font-weight: 300; line-height: 1; }
.lb button:hover { background: rgba(255, 255, 255, .25); transform: none; box-shadow: none; }
.lb-close { top: 14px; right: 16px; width: 44px; height: 44px; font-size: 28px; }
.lb-prev, .lb-next { top: 50%; width: 52px; height: 52px; margin-top: -40px; font-size: 36px; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-prev[hidden], .lb-next[hidden] { display: none; }

/* ---------- 后台 ---------- */
.login-box {
  max-width: 400px; margin: 64px auto; padding: 32px 32px 28px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r);
  box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.login-box h1 { margin: 0 0 20px; font-size: 24px; }
.login-box label, .post-form label { display: block; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.login-box label input, .post-form label input, .post-form label select { margin-top: 6px; }
.login-box button { width: 100%; margin-top: 4px; }

body.admin main.wrap h1 { font-size: 26px; margin: 28px 0 12px; }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, 0.5); }
.filters a.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 2px 8px rgba(76, 58, 140, 0.12); }
.filters a:hover { text-decoration: none; color: var(--text); }

.grid {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--shadow);
}
/* 不用 overflow:hidden 裁圆角，否则单元格内的 tooltip 会被切掉；改由四角单元格承接圆角 */
.grid > thead > tr:first-child > th:first-child { border-top-left-radius: var(--r); }
.grid > thead > tr:first-child > th:last-child { border-top-right-radius: var(--r); }
.grid > tbody > tr:last-child > td:first-child { border-bottom-left-radius: var(--r); }
.grid > tbody > tr:last-child > td:last-child { border-bottom-right-radius: var(--r); }
.grid th, .grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid th { background: rgba(255, 255, 255, 0.6); color: var(--muted); font-weight: 600; font-size: 13px; }
.grid tbody tr:hover td { background: rgba(255, 255, 255, 0.6); }
.grid td a { color: var(--text); }
.grid td a:hover { color: var(--violet); }
.grid tr.off td { color: #8A85A6; }
.grid .num { text-align: right; font-family: var(--mono); }
.grid .ops { white-space: nowrap; }
/* 后台文章列表：固定关键列宽，避免内容被挤压换行 */
.grid .col-views, .grid .col-status, .grid .col-date { white-space: nowrap; }
.grid .col-views { min-width: 72px; }
.grid .col-status { min-width: 68px; }
.grid .col-date { min-width: 150px; }
.admin-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 180px;
  max-width: 180px;
}
.admin-post-tag {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(91, 86, 119, 0.08);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.admin-tags-more { position: relative; padding: 2px 8px; color: var(--teal); cursor: help; }
.admin-tags-more:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.admin-tags-tooltip {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: 0;
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  width: 260px;
  max-width: 70vw;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  cursor: default;
}
.admin-tags-more:hover .admin-tags-tooltip,
.admin-tags-more:focus .admin-tags-tooltip { display: flex; }
.grid .ops a, .grid .ops .linkbtn { margin-right: 12px; color: var(--teal); }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.badge.ok { background: rgba(15, 118, 110, 0.12); color: #115E59; }
.badge.no { background: rgba(91, 86, 119, 0.12); color: #4B4766; }

.post-form {
  padding: 26px 28px; background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: var(--r); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.post-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-form .check { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--text); }
.post-form .check input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--violet); }
.actions { margin-top: 20px; display: flex; gap: 18px; align-items: center; }
.editor { border: 1px solid rgba(109, 40, 217, 0.18); border-radius: var(--r-s); overflow: hidden; background: #fff; }
.toolbar { background: rgba(247, 245, 255, 0.95); padding: 8px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.toolbar button {
  min-height: 34px; padding: 0 10px; font-size: 13px; font-weight: 500; border-radius: 8px;
  background: #fff; color: var(--text); border: 1px solid rgba(109, 40, 217, 0.15); box-shadow: none;
}
.toolbar button:hover { background: rgba(109, 40, 217, 0.08); transform: none; box-shadow: none; color: var(--violet-deep); }
.toolbar .sep { width: 1px; height: 20px; background: rgba(109, 40, 217, 0.2); margin: 0 4px; }
.editor-area { min-height: 380px; padding: 16px 20px; outline: none; background: #fff; overflow-wrap: anywhere; line-height: 1.8; }
.editor-area img { max-width: 100%; }
.editor-area pre { background: #F3F0FF; padding: 10px 12px; border-radius: 8px; }
.editor-area blockquote { border-left: 4px solid #A78BFA; margin: 0; padding: 4px 16px; color: var(--muted); background: rgba(109, 40, 217, 0.05); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero { padding-top: 32px; }
  .about-hero { grid-template-columns: 1fr; padding-top: 32px; }
  .memorial { grid-template-columns: 1fr; gap: 24px; }
  .memorial-photo { max-width: 360px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .topbar .logo img { --h: 28px; }
  .card-body { padding: 18px; }
  .post { padding: 24px 18px; margin-top: 16px; }
  .content img { max-width: 100%; }
  .post-form { padding: 18px; }
  .post-form .row { grid-template-columns: 1fr; }
  .back-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
  .grid { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .cloud-card::before { animation: none; }
}

/* ---------- 后台：标签输入框 ---------- */
.post-form .field { margin-bottom: 16px; }
.post-form .field > label { margin-bottom: 6px; }
.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; cursor: text;
  background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(109, 40, 217, 0.18); border-radius: var(--r-s);
  transition: border-color .15s, box-shadow .15s;
}
.tag-input:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12); }
.tag-input .tag-entry {
  flex: 1 1 140px; min-width: 100px; width: auto; min-height: 30px; padding: 0 4px;
  border: 0; background: transparent; box-shadow: none;
}
.tag-input .tag-entry:focus { box-shadow: none; }
.tag-input .tag-entry:disabled { cursor: not-allowed; }
.tag-input .chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 1px 6px 1px 10px; border-radius: 999px; font-size: 13px; line-height: 1.7;
  background: rgba(109, 40, 217, 0.10); color: var(--violet-deep);
}
.chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-input .chip-x {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--violet-deep); opacity: .6;
  font: 400 13px/1 var(--font); box-shadow: none; transform: none; cursor: pointer;
}
.tag-input .chip-x:hover, .tag-input .chip-x:focus-visible { opacity: 1; background: rgba(109, 40, 217, 0.18); transform: none; box-shadow: none; color: var(--violet); }
.tag-input .chip.dup { animation: chip-dup .6s ease; }
@keyframes chip-dup { 0%, 100% { background: rgba(109, 40, 217, 0.10); } 30% { background: rgba(219, 39, 119, 0.28); } }


/* ---------- 后台：相册管理 ---------- */
.post-form textarea { resize: vertical; min-height: 70px; line-height: 1.6; margin-top: 6px; }
.admin-cover { display: block; width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.empty-cover { background: linear-gradient(135deg, #EDE9FE, #E6F6F4); }
.grid .ops .danger-link, .danger-link { color: #BE123C; }
.album-form { margin-bottom: 24px; }
.photo-manager h2 { margin: 0; font-size: 20px; }
.pm-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 16px; }
.pm-tip { font-size: 13px; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 130px; padding: 20px; border: 2px dashed rgba(109, 40, 217, 0.3); border-radius: 16px;
  background: rgba(255, 255, 255, 0.6); text-align: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--violet); background: rgba(237, 233, 254, 0.7); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; min-height: 0; }
.dropzone:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }
.post-form .dropzone { display: flex; color: var(--text); margin-bottom: 0; }
.dz-title { font-weight: 600; font-size: 16px; color: var(--violet-deep); }
.dz-sub { font-size: 13px; color: var(--muted); }
.upload-queue { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-queue li { display: grid; grid-template-columns: minmax(0, 1fr) 160px 72px; gap: 12px; align-items: center; font-size: 13px; padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, .7); }
.uq-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq-bar { height: 6px; border-radius: 3px; background: rgba(109, 40, 217, .12); overflow: hidden; }
.uq-fill { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.uq-status { text-align: right; color: var(--muted); }
.upload-queue li.ok .uq-status { color: var(--teal); }
.upload-queue li.err { background: rgba(255, 241, 242, .9); }
.upload-queue li.err .uq-status { color: #BE123C; }
.photo-grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.photo-item { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: #fff; border: 2px solid transparent; box-shadow: 0 4px 14px rgba(76, 58, 140, .08); }
.photo-item.is-cover { border-color: #A78BFA; }
.pi-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: #F3F0FF; }
.pi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-badge { display: none; position: absolute; left: 8px; top: 8px; font-size: 12px; font-weight: 600; padding: 1px 10px; border-radius: 999px; background: var(--grad); color: #fff; }
.photo-item.is-cover .cover-badge { display: inline-block; }
.photo-item.is-cover .pi-cover-btn { visibility: hidden; }
.pi-cap { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.pi-cap.saved { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
.pi-ops { display: flex; gap: 4px; flex-wrap: wrap; }
.pi-ops button { min-height: 30px; padding: 0 9px; font-size: 12px; font-weight: 500; border-radius: 8px; background: #F5F3FF; color: var(--text); box-shadow: none; border: 1px solid rgba(109, 40, 217, .12); }
.pi-ops button:hover { background: rgba(109, 40, 217, .1); color: var(--violet-deep); transform: none; box-shadow: none; }
.pi-ops .pi-del { margin-left: auto; color: #BE123C; }
.photo-item.busy .pi-thumb img { opacity: .4; }
.pi-ops button[data-op=cw], .pi-ops button[data-op=ccw] { font-size: 15px; padding: 0 8px; }
.pi-ops .pi-del:hover { background: rgba(190, 18, 60, .08); color: #9F1239; }
@media (max-width: 640px) {
  .upload-queue li { grid-template-columns: minmax(0, 1fr) 70px; }
  .uq-bar { display: none; }
  .lb-stage { padding: 56px 8px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; margin: 0; width: 44px; height: 44px; font-size: 30px; }
  .stack { height: 270px; }
}


/* ---------- 后台：导入文章 ---------- */
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-ghost { background: rgba(255, 255, 255, 0.85); color: var(--violet-deep); border: 1px solid rgba(109, 40, 217, 0.25); box-shadow: 0 4px 14px rgba(76, 58, 140, 0.1); }
.btn-ghost:hover { background: #fff; color: var(--violet); box-shadow: 0 6px 18px rgba(76, 58, 140, 0.16); }
.badge.err { background: rgba(190, 18, 60, 0.1); color: #9F1239; }
.import-form .imp-guide { margin-bottom: 16px; font-size: 14px; }
.import-form .imp-guide p { margin: 0 0 6px; }
.import-form code, .imp-summary code { font-family: var(--mono); background: rgba(109, 40, 217, 0.08); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.import-form .dropzone { margin-bottom: 8px; }
.import-form .check { margin-top: 10px; }
.imp-summary { padding: 20px 24px; margin-bottom: 18px; }
.imp-title { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
.imp-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 14px; }
.imp-stats b { font-size: 22px; color: var(--text); margin-right: 4px; font-family: var(--mono); }
.imp-stats .bad b, .imp-imgs .bad { color: #BE123C; }
.imp-summary .actions { margin-top: 16px; }
.imp-table td { vertical-align: top; }
.imp-table .tag { font-size: 12px; padding: 0 9px; }
.imp-cat { display: inline-block; font-size: 12px; padding: 0 9px; margin: 2px 6px 2px 0; border-radius: 999px; background: rgba(15, 118, 110, 0.1); color: var(--teal); }
.imp-note { font-size: 12px; }
.imp-missing { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: #9F1239; overflow-wrap: anywhere; }
.imp-table .badge, .imp-table td.num, .imp-table td.imp-imgs { white-space: nowrap; }
.imp-table th:first-child, .imp-table td:first-child { width: 1%; }
