:root {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --accent: #007aff;
  --accent-soft: #0a84ff;
  --card: #ffffff;
  --code-bg: #f0f0f2;
  --radius: 14px;
  --btn-radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.10), 0 6px 18px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 10px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.10);
  --accent-grad: linear-gradient(180deg, #0a84ff, #007aff);
  --accent-shadow: 0 1px 2px rgba(0,122,255,.35);
  --topbar-bg: rgba(255,255,255,0.72);
  --winbar: #e8e8ed;
  --win-bg: rgba(255,255,255,0.66);
  --aur-1: #5ac8fa;
  --aur-2: #0a84ff;
  --aur-3: #bf5af2;
  --name-grad: linear-gradient(100deg, #007aff, #5ac8fa, #0a84ff, #5ac8fa, #007aff);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #98989d;
    --line: #3a3a3c;
    --accent: #0a84ff;
    --accent-soft: #409cff;
    --card: #2c2c2e;
    --code-bg: #1c1c1e;
    --shadow: 0 1px 3px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.35);
    --shadow-lg: 0 4px 10px rgba(0,0,0,.55), 0 12px 32px rgba(0,0,0,.45);
    --accent-grad: linear-gradient(180deg, #409cff, #0a84ff);
    --accent-shadow: 0 1px 3px rgba(10,132,255,.5);
    --topbar-bg: rgba(28,28,30,0.7);
    --winbar: #3a3a3c;
    --win-bg: rgba(44,44,46,0.6);
    --aur-1: #0a84ff;
    --aur-2: #5e5ce6;
    --aur-3: #bf5af2;
    --name-grad: linear-gradient(100deg, #0a84ff, #64d2ff, #409cff, #64d2ff, #0a84ff);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 60px; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px 60px; }

/* macOS 风：毛玻璃吸顶导航 + 窗口式标题栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav { display: flex; gap: 20px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; transition: color .15s; }
.nav a:hover { color: var(--accent); }

.window {
  position: relative; z-index: 1;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--win-bg); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  animation: winIn .7s cubic-bezier(.2,.7,.2,1) both;
}
/* 首屏窗口探照灯：跟随鼠标的柔光高亮（--mx/--my 由 app.js 写入） */
.window::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              rgba(10,170,255,.55), rgba(10,132,255,.22) 40%, transparent 68%);
  opacity: 0; transition: opacity .35s ease;
}
.window:hover::after { opacity: 1; }
@media (prefers-color-scheme: dark) {
  .window::after, .proj-card::after { mix-blend-mode: screen; }
}
@media (prefers-reduced-motion: reduce) {
  .window::after { transition: none; }
}
.win-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 15px; background: transparent;
  border-bottom: 1px solid var(--line);
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.win-body { padding: 26px 24px 30px; position: relative; }

/* Hero：极光流动 + 磨砂窗口 */
.hero { position: relative; padding: 72px 0 28px; isolation: isolate; }
.hero-aurora {
  position: absolute; inset: -12px -24px -48px; z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 45% at 18% 22%, rgba(94,52,235,.34), transparent 62%),
    radial-gradient(42% 48% at 82% 18%, rgba(10,132,255,.32), transparent 62%),
    radial-gradient(40% 50% at 28% 82%, rgba(6,182,212,.24), transparent 62%),
    radial-gradient(46% 52% at 76% 78%, rgba(168,85,247,.30), transparent 62%);
  background-size: 200% 200%;
  filter: blur(40px) saturate(1.25);
  opacity: .9;
  animation: meshDrift 32s ease-in-out infinite alternate;
}
.hero.small { padding: 40px 0 0; }
.hero h1 {
  position: relative; z-index: 1;
  font-size: 30px; font-weight: 700; letter-spacing: -0.5px; margin: 0;
  background: var(--name-grad); background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: nameShimmer 7s linear infinite;
}
.tagline { position: relative; z-index: 1; color: var(--muted); margin: 10px 0 0; font-size: 15px; }

@keyframes meshDrift {
  0%   { background-position: 0% 50%, 100% 50%, 50% 0%, 50% 100%; }
  50%  { background-position: 60% 40%, 40% 60%, 30% 70%, 70% 30%; }
  100% { background-position: 0% 50%, 100% 50%, 50% 0%, 50% 100%; }
}
@keyframes nameShimmer { to { background-position: 220% center; } }
@keyframes winIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-aurora, .hero h1, .window { animation: none !important; }
  .hero h1 { color: var(--ink); background: none; -webkit-background-clip: border-box; }
}

/* Sections */
.block { margin-top: 44px; }
.sec {
  font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line);
  padding-bottom: 8px; margin: 0 0 18px;
}

/* Prose */
.prose p { margin: 0 0 14px; }
.prose h1, .prose h2, .prose h3 { line-height: 1.3; margin: 26px 0 10px; }
.prose pre {
  background: var(--code-bg); padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; font-size: 14px;
}
.prose code { background: var(--code-bg); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--line); margin: 0; padding: 4px 0 4px 16px; color: var(--muted); }
.prose a { color: var(--accent); }

/* Posts list */
.post-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.post-title { font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; }
.post-title:hover { color: var(--accent); }
.post-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.post-excerpt { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.tag { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 12px; }

/* Projects grid */
.proj-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .proj-grid { grid-template-columns: 1fr; } }
.proj-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.proj-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
/* 应用卡片探照灯：鼠标位置柔光（跟随 --mx/--my，由 app.js 写入） */
.proj-card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%),
              rgba(10,170,255,.45), rgba(10,132,255,.18) 38%, transparent 66%);
  opacity: 0; transition: opacity .35s ease;
}
.proj-card:hover::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .proj-card::after { transition: none; }
}
.proj-main { display: flex; gap: 14px; align-items: flex-start; }
.proj-ico { font-size: 30px; line-height: 1; flex: 0 0 auto; }
.proj-body { min-width: 0; }
.proj-name { display: block; font-size: 17px; font-weight: 650; color: var(--ink); text-decoration: none; }
.proj-name:hover { color: var(--accent); }
.proj-desc { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.proj-stars { margin-top: 6px; color: #e0a800; font-size: 13px; }
.proj-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.proj-detail { text-align: center; font-size: 13px; color: var(--muted); text-decoration: none; }
.proj-detail:hover { color: var(--accent); }

/* Post / Project detail */
.post-h { font-size: 26px; margin: 18px 0 6px; }
.proj-h { font-size: 24px; margin: 14px 0 6px; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--accent); }
.ext-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.rating-sum { margin-top: 12px; color: #e0a800; font-size: 14px; }

/* Comments */
.comments { margin-top: 48px; }
.cmt-list { list-style: none; margin: 14px 0 0; padding: 0; }
.cmt { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cmt-head { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.cmt-head b { color: var(--ink); }
.cmt-date { margin-left: auto; }
.cmt-stars { color: #e0a800; }
.cmt-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

.cmt-form { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.cmt-name, .cmt-text, .adm-form input, .adm-form textarea, .login-form input {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; width: 100%;
}
.cmt-text { resize: vertical; }
.cmt-actions { display: flex; gap: 10px; align-items: center; }
.cmt-msg, #post-msg, #proj-msg, #set-msg { font-size: 13px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  display: inline-block; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: var(--btn-radius); padding: 9px 18px; text-decoration: none;
  transition: filter .15s, background .15s;
}
.btn:hover { background: var(--accent-soft); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--card); }
.btn.launch {
  display: block; width: 100%; text-align: center;
  padding: 13px 18px; font-size: 15px; letter-spacing: .3px;
  border: none; border-radius: var(--btn-radius);
  background: var(--accent-grad); color: #fff; text-decoration: none;
  box-shadow: var(--accent-shadow);
}
.btn.launch:hover { filter: brightness(1.07); }
.btn.launch.sm { display: inline-block; width: auto; }

/* Star input */
.star-input { display: flex; flex-direction: row-reverse; gap: 2px; justify-content: flex-end; }
.star-input input { display: none; }
.star-input label { cursor: pointer; font-size: 22px; color: var(--line); line-height: 1; }
.star-input label span { transition: color .1s; }
.star-input label:hover span,
.star-input label:hover ~ label span,
.star-input input:checked ~ label span { color: #e0a800; }

/* Footer */
.foot { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.9; text-align: center; }
.foot a { color: var(--accent); text-decoration: none; }

/* Admin */
.admin { max-width: 860px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 18px 0 24px; }
.tabs a { color: var(--muted); text-decoration: none; padding-bottom: 10px; font-size: 14px; }
.tabs a.active { color: var(--ink); border-bottom: 2px solid var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.adm-form { display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.adm-form label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.ed-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .ed-split { grid-template-columns: 1fr; } }
.ed-preview { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--card); overflow: auto; max-height: 360px; font-size: 14px; }
.adm-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.adm-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.adm-table th, .adm-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.row-act a { color: var(--accent); text-decoration: none; margin-right: 10px; font-size: 13px; }
.row-act a:hover { text-decoration: underline; }
.login-form { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin-top: 20px; }
.err { color: #dc2626; }
.muted { color: var(--muted); }

/* ---------------- 视频能力展示 ---------------- */
.vid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .vid-grid { grid-template-columns: 1fr; gap: 14px; } }
.vid-card {
  display: flex; flex-direction: column; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; padding: 0; color: var(--ink); font: inherit;
  transition: border-color .15s, transform .12s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.vid-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.vid-thumb { position: relative; aspect-ratio: 9 / 16; background: #000; overflow: hidden; }
.vid-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(10,132,255,.9); color: #fff; font-size: 22px;
  box-shadow: 0 4px 18px rgba(0,0,0,.35); transition: transform .15s;
}
.vid-card:hover .vid-play { transform: scale(1.08); }
.vid-meta { padding: 12px 14px 14px; }
.vid-title { font-weight: 700; font-size: 15px; }
.vid-desc { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.vid-date { color: var(--muted); font-size: 12px; margin-top: 6px; opacity: .8; }

/* 视频 lightbox 弹层 */
.vid-lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.vid-lightbox.open { display: flex; }
.vid-lightbox video { max-height: 90vh; max-width: 100%; border-radius: 14px; background: #000; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.vid-lightbox .lb-close {
  position: absolute; top: 18px; right: 22px; width: 42px; height: 42px;
  border-radius: 50%; border: none; cursor: pointer; font-size: 18px; line-height: 1;
  background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.vid-lightbox .lb-close:hover { background: rgba(255,255,255,.3); }
