/* ============ 设计令牌 ============ */
:root {
  --bg:        #05070d;
  --bg-soft:   #0a0e18;
  --panel:     rgba(14, 20, 34, .72);
  --panel-solid:#0c1120;
  --border:    rgba(90, 160, 255, .14);
  --border-hot:rgba(0, 229, 255, .45);

  --fg:        #dbe6f5;
  --fg-dim:    #7d8ba3;
  --fg-faint:  #4a5568;

  --accent:    #00e5ff;
  --accent-2:  #7c5cff;
  --accent-3:  #00ffa3;
  --danger:    #ff4d6d;

  --radius:    14px;
  --radius-sm: 9px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --shadow: 0 8px 32px rgba(0,0,0,.5);
  --glow: 0 0 24px rgba(0,229,255,.25);
  --topbar-bg: rgba(5,7,13,.78);
  --sel-bg: rgba(0,229,255,.28);
  --sel-fg: #eaf6ff;
}

/* ============ 浅色模式 ============ */
:root[data-mode="light"] {
  --bg:        #f6f8fc;
  --bg-soft:   #eef2f9;
  --panel:     rgba(255,255,255,.82);
  --panel-solid:#ffffff;
  --border:    rgba(30, 70, 140, .16);
  --border-hot:rgba(0, 130, 200, .5);

  --fg:        #10192b;
  --fg-dim:    #53617a;
  --fg-faint:  #8b97ac;

  --accent:    #0077c2;
  --accent-2:  #6d3ff0;
  --accent-3:  #00966b;
  --danger:    #d92d4b;

  --shadow: 0 8px 28px rgba(20,40,90,.13);
  --glow: 0 0 22px rgba(0,119,194,.18);
  --topbar-bg: rgba(255,255,255,.82);
  --sel-bg: rgba(0,119,194,.22);
  --sel-fg: #0b1524;
}
:root[data-mode="light"][data-theme="magenta"] {
  --accent:   #d6237a;
  --accent-2: #7c3aed;
  --accent-3: #b45309;
  --border-hot: rgba(214,35,122,.45);
  --glow: 0 0 22px rgba(214,35,122,.18);
}
:root[data-mode="light"][data-theme="lime"] {
  --accent:   #0a8f5f;
  --accent-2: #0369a1;
  --accent-3: #a16207;
  --border-hot: rgba(10,143,95,.45);
  --glow: 0 0 22px rgba(10,143,95,.18);
}

/* 浅色模式下背景装饰收敛，否则文字读不清 */
:root[data-mode="light"] .bg-grid      { opacity: .30; }
:root[data-mode="light"] .bg-glow      { opacity: .22; }
:root[data-mode="light"] .bg-particles { opacity: .28; }

/* 备用配色（点击 ◐ 切换） */
:root[data-theme="magenta"] {
  --accent:   #ff2d95;
  --accent-2: #a855f7;
  --accent-3: #fbbf24;
  --border-hot: rgba(255,45,149,.45);
  --glow: 0 0 24px rgba(255,45,149,.25);
}
:root[data-theme="lime"] {
  --accent:   #00ffa3;
  --accent-2: #00d4ff;
  --accent-3: #ffe600;
  --border-hot: rgba(0,255,163,.45);
  --glow: 0 0 24px rgba(0,255,163,.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ 背景层 ============ */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(90,160,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90,160,255,.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(0,229,255,.13), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(124,92,255,.10), transparent 70%);
}

.bg-particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, env(safe-area-inset-left));
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--fg);
  font-weight: 650; letter-spacing: .02em; font-size: 1.05rem;
}
.brand-mark {
  color: var(--accent); font-size: 1.3rem;
  text-shadow: var(--glow);
  animation: brandSpin 9s linear infinite;
  display: inline-block;
}
@keyframes brandSpin { to { transform: rotate(360deg); } }

.nav { display: flex; align-items: center; gap: 6px; }
.nav-item {
  padding: 7px 13px; border-radius: var(--radius-sm);
  color: var(--fg-dim); text-decoration: none; font-size: .92rem;
  border: 1px solid transparent; background: none; cursor: pointer;
  font-family: inherit;
  transition: color .18s, border-color .18s, background .18s;
}
.nav-item:hover { color: var(--accent); border-color: var(--border-hot); background: rgba(0,229,255,.05); }
.theme-btn { font-size: 1.05rem; line-height: 1; }

/* ============ 容器 ============ */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px max(20px, env(safe-area-inset-left)) 80px;
  animation: fadeUp .5s cubic-bezier(.16,1,.3,1);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

/* ============ 首页头图 ============ */
.hero { margin-bottom: 44px; }
.hero-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 750; letter-spacing: -.02em; line-height: 1.15;
  margin: 0 0 12px;
  background: linear-gradient(100deg, var(--fg) 10%, var(--accent) 55%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--fg-dim); font-family: var(--mono); font-size: .88rem; margin: 0; }
.hero-sub::before { content: "$ "; color: var(--accent-3); }

/* ============ 文章卡片 ============ */
.post-list { display: flex; flex-direction: column; gap: 14px; }

.post-card {
  position: relative;
  display: block; text-decoration: none; color: inherit;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .22s cubic-bezier(.16,1,.3,1), border-color .22s, box-shadow .22s;
  overflow: hidden;
}
.post-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0; transition: opacity .22s;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hot);
  box-shadow: var(--shadow), var(--glow);
}
.post-card:hover::before { opacity: 1; }

.post-card h2 {
  margin: 0 0 8px; font-size: 1.22rem; font-weight: 650; letter-spacing: -.01em;
}
.post-card .summary { margin: 0 0 14px; color: var(--fg-dim); font-size: .94rem; }

.post-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .76rem; color: var(--fg-faint);
}
.tag {
  padding: 2px 8px; border-radius: 5px;
  background: rgba(0,229,255,.08); color: var(--accent);
  border: 1px solid rgba(0,229,255,.2);
}
.meta-comments { color: var(--accent-3); }

/* ============ 文章详情 ============ */
.article-head { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article-head h1 {
  font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 720; letter-spacing: -.02em;
  margin: 0 0 14px; line-height: 1.25;
}
.article-body { font-size: 1.02rem; }
.article-body p { margin: 0 0 18px; }
.article-body strong { color: var(--accent); font-weight: 640; }
.article-body code {
  font-family: var(--mono); font-size: .88em;
  padding: 2px 6px; border-radius: 5px;
  background: rgba(0,229,255,.09); color: var(--accent-3);
  border: 1px solid rgba(0,229,255,.14);
}
.article-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(0,229,255,.3); }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--fg-dim); text-decoration: none;
  font-family: var(--mono); font-size: .84rem;
  margin-bottom: 22px; transition: color .18s;
}
.back-link:hover { color: var(--accent); }

/* ============ 评论 ============ */
.comments-section { margin-top: 56px; }
.comments-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.comments-head h3 { margin: 0; font-size: 1.1rem; font-weight: 650; }
.comments-count {
  font-family: var(--mono); font-size: .8rem; color: var(--accent);
  padding: 2px 9px; border-radius: 20px;
  background: rgba(0,229,255,.1); border: 1px solid rgba(0,229,255,.22);
}

/* 评论表单 */
.comment-form {
  padding: 18px; margin-bottom: 30px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.comment-form input[type="text"],
.comment-form textarea {
  width: 100%; padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg); font-family: inherit; font-size: .94rem;
  transition: border-color .18s, box-shadow .18s;
  resize: vertical;
}
.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
  outline: none; border-color: var(--border-hot);
  box-shadow: 0 0 0 3px rgba(0,229,255,.09);
}
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--fg-faint); }
.comment-form textarea { min-height: 96px; margin-bottom: 12px; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-hint { font-family: var(--mono); font-size: .74rem; color: var(--fg-faint); }

.btn {
  padding: 10px 22px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-hot);
  background: linear-gradient(100deg, rgba(0,229,255,.14), rgba(124,92,255,.14));
  color: var(--accent); font-family: inherit; font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: all .18s;
}
.btn:hover:not(:disabled) {
  background: linear-gradient(100deg, rgba(0,229,255,.24), rgba(124,92,255,.24));
  box-shadow: var(--glow); transform: translateY(-1px);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost {
  background: none; border-color: var(--border); color: var(--fg-dim);
  padding: 6px 14px; font-size: .84rem;
}
.btn-ghost:hover { border-color: var(--border-hot); color: var(--accent); }

/* 评论列表 */
.comment-list { display: flex; flex-direction: column; gap: 4px; }

.comment {
  display: flex; gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(90,160,255,.07);
  animation: fadeUp .35s cubic-bezier(.16,1,.3,1);
}
.comment:last-child { border-bottom: none; }

.avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: .95rem;
  background: linear-gradient(135deg, rgba(0,229,255,.18), rgba(124,92,255,.18));
  border: 1px solid var(--border-hot);
  color: var(--accent);
  font-family: var(--mono);
}

.comment-main { flex: 1; min-width: 0; }
.comment-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.comment-author { font-weight: 640; font-size: .95rem; color: var(--fg); }
.comment-time { font-family: var(--mono); font-size: .72rem; color: var(--fg-faint); }
.comment-body { margin: 0 0 8px; font-size: .95rem; color: var(--fg-dim); white-space: pre-wrap; word-break: break-word; }

.reply-btn {
  background: none; border: none; padding: 0;
  color: var(--fg-faint); font-family: var(--mono); font-size: .74rem;
  cursor: pointer; transition: color .18s;
}
.reply-btn:hover { color: var(--accent); }

/* 嵌套回复 */
.comment-children {
  margin-top: 6px; padding-left: 18px;
  border-left: 2px solid rgba(0,229,255,.14);
}

.reply-form-wrap { margin-top: 12px; }
.reply-form-wrap .comment-form { padding: 14px; margin-bottom: 0; }

/* ============ 状态 ============ */
.loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 80px 0; color: var(--fg-faint);
  font-family: var(--mono); font-size: .86rem;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(0,229,255,.2);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 60px 0; color: var(--fg-faint); }
.empty-icon { font-size: 2.2rem; margin-bottom: 12px; opacity: .4; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 24px);
  padding: 12px 22px; border-radius: var(--radius-sm);
  background: var(--panel-solid);
  border: 1px solid var(--border-hot);
  color: var(--fg); font-size: .9rem;
  box-shadow: var(--shadow), var(--glow);
  opacity: 0; pointer-events: none;
  transition: opacity .26s, transform .26s cubic-bezier(.16,1,.3,1);
  z-index: 100; max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,77,109,.6); box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 22px rgba(255,77,109,.22); }

/* ============ 页脚 ============ */
.footer {
  max-width: 780px; margin: 0 auto;
  padding: 34px max(20px, env(safe-area-inset-left)) 46px;
  text-align: center; color: var(--fg-faint); font-size: .82rem;
}
.footer-line {
  height: 1px; margin-bottom: 22px;
  background: linear-gradient(90deg, transparent, var(--border-hot), transparent);
}
.footer p { margin: 5px 0; }
.mono { font-family: var(--mono); color: var(--fg-dim); }
.dim { opacity: .62; }

/* ============ 响应式 ============ */
@media (max-width: 560px) {
  .container { padding-top: 28px; }
  .post-card { padding: 17px 18px; }
  .comment-children { padding-left: 11px; }
  .avatar { flex-basis: 32px; width: 32px; height: 32px; font-size: .85rem; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .bg-particles { display: none; }
}

::selection { background: var(--sel-bg); color: var(--sel-fg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(90,160,255,.2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,229,255,.35); }

/* ============ 顶栏账号区 ============ */
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--fg-dim); border-radius: 10px; cursor: pointer;
  font-size: 1rem; transition: .18s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-hot); background: rgba(0,229,255,.06); }

.user-slot { display: flex; align-items: center; gap: 8px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121d; font-weight: 700; font-size: .88rem;
  border: 1px solid var(--border-hot); transition: .18s;
  user-select: none;
}
:root[data-mode="light"] .avatar { color: #fff; }
.avatar:hover { transform: scale(1.06); }

.btn {
  padding: 8px 16px; border-radius: 9px; cursor: pointer;
  font-size: .88rem; font-family: inherit; transition: .18s;
  border: 1px solid var(--border); background: var(--panel); color: var(--fg);
}
.btn:hover { border-color: var(--border-hot); color: var(--accent); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121d; border: none; font-weight: 650;
}
:root[data-mode="light"] .btn-primary { color: #fff; }
.btn-primary:hover { filter: brightness(1.1); color: #04121d; }
:root[data-mode="light"] .btn-primary:hover { color: #fff; }
.btn-danger { color: var(--danger); border-color: rgba(255,77,109,.35); }
.btn-danger:hover { background: rgba(255,77,109,.1); color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: .8rem; }

/* ============ 下拉菜单 ============ */
.menu {
  position: absolute; top: 56px; right: 24px; z-index: 60;
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 190px; padding: 7px; backdrop-filter: blur(14px);
}
.menu-head { padding: 9px 12px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.menu-head .mn { font-weight: 650; font-size: .92rem; }
.menu-head .mr { font-size: .74rem; color: var(--fg-faint); font-family: var(--mono); margin-top: 2px; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  background: none; border: none; color: var(--fg); cursor: pointer;
  border-radius: 8px; font-size: .88rem; font-family: inherit; transition: .14s;
}
.menu-item:hover { background: rgba(0,229,255,.09); color: var(--accent); }

/* ============ 分类导航条 ============ */
.cat-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.cat-chip {
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--fg-dim); font-size: .84rem; text-decoration: none; transition: .18s;
}
.cat-chip:hover { color: var(--accent); border-color: var(--border-hot); }
.cat-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121d; border-color: transparent; font-weight: 600;
}
:root[data-mode="light"] .cat-chip.active { color: #fff; }
.cat-chip .cnt { opacity: .62; font-size: .76rem; margin-left: 5px; }

/* ============ 表单 ============ */
.form-wrap { max-width: 460px; margin: 20px auto 60px; }
.form-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px; backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.form-title { margin: 0 0 6px; font-size: 1.45rem; }
.form-sub { margin: 0 0 24px; color: var(--fg-dim); font-size: .88rem; }

.field { margin-bottom: 17px; }
.field label {
  display: block; margin-bottom: 7px; font-size: .84rem;
  color: var(--fg-dim); font-family: var(--mono);
}
.field label .opt { color: var(--fg-faint); font-size: .76rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; font-size: .94rem; font-family: inherit;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--fg); transition: .18s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,229,255,.13);
}
:root[data-mode="light"] .field input:focus,
:root[data-mode="light"] .field textarea:focus { box-shadow: 0 0 0 3px rgba(0,119,194,.15); }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.65; }
.field .hint { margin-top: 6px; font-size: .76rem; color: var(--fg-faint); }

.form-foot { margin-top: 24px; display: flex; gap: 10px; align-items: center; }
.form-switch { margin-top: 18px; text-align: center; font-size: .86rem; color: var(--fg-dim); }
.form-switch a { color: var(--accent); cursor: pointer; text-decoration: none; }
.form-switch a:hover { text-decoration: underline; }

/* ============ 写作页 ============ */
.write-wrap { max-width: 860px; margin: 0 auto 70px; }
.write-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.write-title-input {
  width: 100%; padding: 14px 0; font-size: 1.75rem; font-weight: 680;
  background: none; border: none; border-bottom: 2px solid var(--border);
  color: var(--fg); font-family: inherit; transition: .2s;
}
.write-title-input:focus { outline: none; border-bottom-color: var(--accent); }
.write-title-input::placeholder { color: var(--fg-faint); }
.write-body-input {
  width: 100%; min-height: 400px; margin-top: 18px; padding: 18px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg); font-size: .98rem;
  line-height: 1.85; font-family: inherit; resize: vertical; transition: .18s;
}
.write-body-input:focus { outline: none; border-color: var(--accent); }
.write-meta { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.write-meta .field { flex: 1; min-width: 170px; margin-bottom: 0; }
.write-actions { display: flex; gap: 10px; margin-top: 22px; align-items: center; flex-wrap: wrap; }
.counter { margin-left: auto; font-family: var(--mono); font-size: .78rem; color: var(--fg-faint); }

/* ============ 文章正文增强 ============ */
.post-body { white-space: pre-wrap; line-height: 1.9; font-size: 1.02rem; word-break: break-word; }
.post-meta-line { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--fg-faint); font-family: var(--mono); font-size: .8rem; margin-bottom: 26px; }
.post-meta-line .author { color: var(--accent); }
.tag-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(0,229,255,.09); color: var(--accent);
  font-family: var(--mono); font-size: .74rem; text-decoration: none;
}
.post-actions { display: flex; gap: 9px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ============ 作者徽标 ============ */
.byline-op { color: var(--accent-3); font-family: var(--mono); font-size: .72rem; }

/* ============ 空状态 ============ */
.empty {
  text-align: center; padding: 70px 20px; color: var(--fg-dim);
}
.empty .big { font-size: 2.6rem; margin-bottom: 14px; opacity: .55; }
.empty p { margin: 6px 0; font-size: .94rem; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; top: 76px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px; pointer-events: none;
}
.toast {
  padding: 12px 18px; border-radius: 11px; font-size: .89rem;
  background: var(--panel-solid); border: 1px solid var(--border);
  box-shadow: var(--shadow); animation: toastIn .26s ease;
  max-width: 330px; backdrop-filter: blur(14px);
}
.toast.ok  { border-color: rgba(0,255,163,.45); color: var(--accent-3); }
.toast.err { border-color: rgba(255,77,109,.45); color: var(--danger); }
.toast.out { animation: toastOut .26s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(26px); } }

/* ============ 评论身份标识 ============ */
.cmt-mine { border-left: 2px solid var(--accent) !important; }
.cmt-badge {
  font-size: .68rem; padding: 2px 7px; border-radius: 999px;
  background: rgba(0,229,255,.12); color: var(--accent);
  font-family: var(--mono); margin-left: 7px;
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .brand-text { display: none; }
  .nav { gap: 3px; }
  .nav-item { padding: 7px 10px; font-size: .85rem; }
  .menu { right: 12px; left: 12px; min-width: 0; }
  .form-card { padding: 22px; }
  .write-title-input { font-size: 1.4rem; }
  .toast-wrap { right: 12px; left: 12px; }
  .toast { max-width: none; }
}

/* ============ 文章详情 ============ */
.post { max-width: 780px; margin: 34px auto 0; }
.post-head { margin-bottom: 8px; }
.post-title {
  font-size: clamp(1.6rem, 4.2vw, 2.3rem); line-height: 1.28;
  margin: 0 0 16px; font-weight: 700; letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
/* .post-body 已在上面定义，此处补齐段落间距 */
.post-body { color: var(--fg); }

/* ============ 评论区 ============ */
.comments { max-width: 780px; margin: 60px auto 70px; }
.csec-title {
  font-size: 1.1rem; font-weight: 660; margin: 0 0 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.csec-title .cnt { color: var(--fg-faint); font-family: var(--mono); font-size: .86rem; font-weight: 400; }

.cmt-form-wrap { margin-bottom: 30px; }
.cmt-form {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; backdrop-filter: blur(12px);
}
.cmt-as { font-size: .86rem; color: var(--fg-dim); margin-bottom: 11px; }
.cmt-as b { color: var(--accent); }

.cmt-input {
  width: 100%; padding: 10px 13px; font-size: .93rem; font-family: inherit;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--fg);
  transition: .18s; margin-bottom: 10px; resize: vertical; line-height: 1.6;
}
.cmt-input:focus { outline: none; border-color: var(--accent); }
.cmt-input::placeholder { color: var(--fg-faint); }
textarea.cmt-input { min-height: 88px; }

.cmt-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cmt-hint { font-size: .78rem; color: var(--fg-faint); }

.cmt-list { display: flex; flex-direction: column; gap: 2px; }
.cmt-empty { color: var(--fg-faint); font-size: .9rem; text-align: center; padding: 26px 0; }

.cmt { padding: 15px 16px; border-bottom: 1px solid var(--border); }
.cmt:last-child { border-bottom: none; }
.cmt-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cmt-author { font-weight: 640; font-size: .94rem; color: var(--fg); }
.cmt-time { font-family: var(--mono); font-size: .72rem; color: var(--fg-faint); }
.cmt-reply {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--fg-faint); font-size: .78rem; font-family: inherit;
  padding: 2px 7px; border-radius: 6px; transition: .15s;
}
.cmt-reply:hover { color: var(--accent); background: rgba(0,229,255,.08); }
.cmt-body { font-size: .95rem; color: var(--fg-dim); white-space: pre-wrap; word-break: break-word; line-height: 1.75; }

/* ============ 首页卡片补充 ============ */
.post-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.post-card-date { margin-left: auto; font-family: var(--mono); font-size: .74rem; color: var(--fg-faint); }
.post-card-foot { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .76rem; color: var(--fg-faint); flex-wrap: wrap; }
.dot { opacity: .5; }

@media (max-width: 640px) {
  .comment, .cmt { padding: 13px 4px; }
  .cmt[style*="margin-left"] { margin-left: 0 !important; }
}
