:root {
  --bg: #f4f5f7;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef0f3;
  --text: #17181a;
  --text-muted: #6b7280;
  --border: #e4e6ea;
  --accent: #17181a;
  --accent-contrast: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --overlay: rgba(244, 245, 247, 0.92);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1180px;
  --hero-height: min(92vh, 860px);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.93);
  --hero-overlay: linear-gradient(180deg, rgba(12, 25, 55, 0.18), rgba(12, 25, 55, 0.48));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --bg-elevated: #1a1c20;
    --bg-subtle: #232529;
    --text: #e6e8eb;
    --text-muted: #9aa1aa;
    --border: #2a2d33;
    --accent: #f1f3f5;
    --accent-contrast: #14161a;
    --overlay: rgba(16, 17, 20, 0.9);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --glass: rgba(29, 34, 45, 0.82);
    --glass-strong: rgba(31, 36, 47, 0.94);
    --hero-overlay: linear-gradient(180deg, rgba(5, 13, 28, 0.2), rgba(5, 13, 28, 0.55));
  }
}

html[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-elevated: #ffffff;
  --text: #34363b;
  --text-muted: #6b6f78;
  --border: #e1e3e8;
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.94);
}

html[data-theme="dark"] {
  --bg: #1d222d;
  --bg-elevated: #252b37;
  --bg-subtle: #303746;
  --text: #f0f2f5;
  --text-muted: #b2b8c2;
  --border: #414957;
  --glass: rgba(29, 34, 45, 0.84);
  --glass-strong: rgba(31, 36, 47, 0.95);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg) fixed;
  min-height: 100vh;
  position: relative;
}

/* Reuse the navigation page background image as an overall backdrop. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../../static/images/bg.jpg");
  background-size: cover;
  background-position: center;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: -1;
}

body.home-page { background: var(--bg); }
body.home-page::before { background-position: center top; opacity: .98; background-attachment: fixed; }
body.home-page::after { background: rgba(245, 247, 250, .16); }
html[data-theme="dark"] body.home-page::after { background: rgba(17, 23, 34, .22); }

.icon { width: 1em; height: 1em; vertical-align: -.12em; flex: 0 0 auto; }
.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; color: #fff; transition: background .3s ease, color .3s ease, box-shadow .3s ease; }
.site-nav.scrolled { background: var(--glass-strong); color: var(--text); box-shadow: 0 1px 12px rgba(20, 30, 45, .12); backdrop-filter: blur(18px); }
.site-nav.nav-hidden { transform: translateY(-105%); }
.nav-inner { max-width: 1180px; min-height: 72px; margin: auto; padding: 0 20px; display: flex; align-items: center; gap: 34px; }
.site-mark { display: inline-flex; align-items: center; color: inherit; font-size: 25px; letter-spacing: -.04em; white-space: nowrap; margin-left: 0; }
.active-link { color: #49b1f5 !important; }
.mark-grid { width: 28px; height: 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(45deg); }
.mark-grid i { display: block; border: 3px solid currentColor; border-radius: 5px; }
.desktop-nav { flex: 1; display: flex; justify-content: center; gap: 30px; }
.desktop-nav a, .mobile-nav a { color: inherit; font-weight: 600; font-size: 16px; padding: 8px 0; }
.desktop-nav a:hover, .mobile-nav a:hover { opacity: .7; }
.desktop-nav a { position: relative; transition: color .2s ease, transform .2s ease; }
.desktop-nav a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 0; height: 3px; border-radius: 3px; background: #49b1f5; transition: left .22s ease, right .22s ease, transform .22s ease; }
.desktop-nav a:hover, .desktop-nav a:focus-visible { color: #49b1f5; transform: translateY(-2px); opacity: 1; outline: none; }
.desktop-nav a:hover::after, .desktop-nav a:focus-visible::after { left: 0; right: 0; }
.nav-tools { display: flex; align-items: center; gap: 9px; }
.home-auth-area { display: flex; align-items: center; }
.home-auth-area .btn { color: inherit; border-color: currentColor; background: transparent; }
.home-auth-area .auth-user { color: inherit; }
.icon-button { width: 34px; height: 34px; border: 0; background: transparent; color: inherit; font-size: 25px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.icon-button:hover, .icon-button:focus-visible { background: rgba(255,255,255,.2); outline: none; }
.scrolled .icon-button:hover, .scrolled .icon-button:focus-visible { background: var(--bg-subtle); }
.menu-toggle { display: none; }
.search-panel { position: absolute; top: 70px; right: 20px; width: min(620px, calc(100vw - 40px)); max-width: 620px; margin: 0; padding: 12px 20px; display: flex; align-items: center; gap: 14px; background: var(--glass-strong); color: var(--text); border: 1px solid var(--border); border-radius: 8px; backdrop-filter: blur(18px); box-shadow: 0 14px 35px rgba(0,0,0,.18); animation: search-in .2s ease both; }
.search-panel[hidden] { display: none !important; }
@keyframes search-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.search-panel label { font-weight: 600; white-space: nowrap; }
.search-panel input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); padding: 8px 2px; outline: 0; }
.mobile-nav { display: none; }

.hero { min-height: var(--hero-height); position: relative; display: grid; place-items: center; overflow: hidden; color: #fff; background: transparent; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 65%, var(--bg) 100%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; text-align: center; padding: 100px 20px 60px; text-shadow: 0 3px 14px rgba(0,0,0,.4); }
.hero-kicker { letter-spacing: .28em; font-size: 12px; opacity: .86; margin: 0 0 14px; }
.hero h1 { margin: 0; font-size: clamp(42px, 7vw, 76px); letter-spacing: .04em; line-height: 1.15; }
.hero-copy > p:last-child { font-size: clamp(17px, 2.4vw, 27px); margin: 18px 0 0; letter-spacing: .08em; }
.scroll-cue { position: absolute; z-index: 2; bottom: 30px; left: 50%; color: #fff; font-size: 34px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(8px); } }

.home-content { max-width: 1180px; margin: -48px auto 0; padding: 0 20px 80px; position: relative; z-index: 3; }
.home-content::before { content: ""; position: absolute; z-index: -1; top: -18px; bottom: 0; left: 0; right: 0; border: 1px solid rgba(255,255,255,.55); border-radius: 12px; background: var(--glass); backdrop-filter: blur(18px); box-shadow: 0 18px 60px rgba(13, 27, 48, .16); }
.notice-bar { min-height: 54px; padding: 0 20px; display: flex; align-items: center; gap: 16px; justify-content: space-between; background: var(--glass-strong); color: var(--text-muted); border: 1px solid rgba(255,255,255,.4); border-radius: 7px; backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.notice-bar span:nth-child(2) { flex: 1; text-align: center; }
.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .95fr); gap: 20px; margin-top: 24px; align-items: start; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 0 15px; color: var(--text); }
.section-heading h2 { margin: 2px 0 0; font-size: 28px; }
.eyebrow { color: #49aee8; letter-spacing: .18em; font-size: 11px; font-weight: 700; }
.muted { color: var(--text-muted); font-size: 13px; }
.masonry-feed { columns: 2 300px; column-gap: 20px; }
.post-card { display: inline-block; width: 100%; margin: 0 0 20px; overflow: hidden; color: var(--text); text-decoration: none; transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease; }
.post-card:hover, .post-card:focus-visible { transform: translateY(-6px) scale(1.012); box-shadow: 0 16px 36px rgba(20, 30, 45, .18); border-color: #58b7eb; outline: none; }
.post-cover { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-subtle); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.post-card:hover .post-cover img { transform: scale(1.04); }
.post-content { padding: 22px 24px 20px; }
.post-content h3 { margin: 0 0 12px; font-size: 24px; line-height: 1.42; font-weight: 500; overflow-wrap: anywhere; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.post-content p { color: var(--text-muted); margin: 12px 0 14px; font-size: 15px; line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-tags, .post-reading-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.post-tag { color: #429fd7; font-size: 12px; }
.post-reading-meta { color: var(--text-muted); font-size: 12px; margin: 8px 0 12px; }
.read-more { color: #44a9e5; font-size: 13px; font-weight: 700; }
.glass-panel { background: var(--glass); border: 1px solid rgba(255,255,255,.5); border-radius: 7px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.side-column { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 92px; }
.profile-panel { padding: 28px 24px 20px; text-align: center; }
.profile-avatar { width: 112px; height: 112px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 40px; background: linear-gradient(135deg, #84c4eb, #456ba3); border: 5px solid rgba(255,255,255,.74); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.profile-panel h2 { margin: 4px 0; font-size: 30px; font-weight: 500; }
.profile-panel p { margin: 0 0 22px; color: var(--text-muted); }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 14px 0; margin-bottom: 18px; }
.profile-stats span { display: flex; flex-direction: column; gap: 3px; }
.profile-stats b { font-size: 20px; font-weight: 500; }.profile-stats small { color: var(--text-muted); }
.subscribe-button { display: block; padding: 11px; color: #fff; background: #48afe9; border-radius: 5px; font-weight: 700; }
.subscribe-button:hover { background: #319cda; }
.social-row { display: flex; justify-content: center; gap: 24px; margin-top: 20px; font-size: 23px; }.social-row a:hover { color: #42aeea; }
.announcement, .side-links { padding: 22px 24px; color: var(--text); }.announcement h3, .side-links h3 { margin: 0 0 16px; font-size: 19px; }.announcement p { color: var(--text-muted); margin: 0 0 4px; }.announcement strong, .announcement em { display: block; font-style: normal; }.announcement em { color: #f05b5b; margin-top: 10px; }
.side-links a { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); color: var(--text-muted); }.side-links a:hover { color: #42aeea; }
.sub-page-content { max-width: 980px; margin: 0 auto; padding: 132px 20px 80px; position: relative; z-index: 2; }
.sub-heading { color: var(--text); margin-bottom: 24px; }.sub-heading h1 { margin: 5px 0; font-size: clamp(30px, 5vw, 52px); }.sub-heading p { color: var(--text-muted); }
.archive-list, .tag-articles, .message-list { display: flex; flex-direction: column; gap: 12px; }.archive-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; color: var(--text); transition: transform .2s ease, border-color .2s ease; }.archive-row:hover { transform: translateX(5px); border-color: #49b1f5; }.archive-row small { color: var(--text-muted); white-space: nowrap; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px; padding: 24px; margin-bottom: 20px; }.cloud-tag { border: 1px solid rgba(73,177,245,.35); border-radius: 999px; background: rgba(73,177,245,.12); color: #3298d4; padding: 8px 15px; cursor: pointer; transition: transform .2s ease, background .2s ease; }.cloud-tag:hover, .cloud-tag:focus-visible { transform: translateY(-3px); background: rgba(73,177,245,.25); outline: none; }
.message-box { padding: 24px; margin-bottom: 20px; }.message-box textarea { width: 100%; min-height: 130px; resize: vertical; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); border-radius: 7px; padding: 12px; font: inherit; margin: 12px 0; }.message-box p { color: var(--text-muted); }.message-box a { color: #3ca6e1; }.message-item { display: flex; gap: 14px; padding: 18px 22px; }.message-item > div { min-width: 0; }.message-item small { display: block; color: var(--text-muted); margin-top: 3px; }.message-item p { white-space: pre-wrap; overflow-wrap: anywhere; }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 28px; gap: 15px; text-align: center; }.about-stats div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }.about-stats b { font-size: 24px; color: #3da7e2; overflow-wrap: anywhere; }.about-stats small { color: var(--text-muted); }.about-copy { padding: 28px; margin-top: 20px; color: var(--text); }.about-copy p { color: var(--text-muted); line-height: 2; }
.loading, .empty-state { padding: 50px 20px; text-align: center; color: var(--text-muted); break-inside: avoid; }.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.12em; } @keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) { body.home-page::before { background-image: url("https://typemylife.xyz/static/images/mbg.jpg"); background-position: 50% 50%; background-size: cover; background-attachment: scroll; } .desktop-nav { display: none; }.menu-toggle { display: inline-flex; }.nav-inner { min-height: 62px; padding: 0 15px; gap: 10px; }.site-mark { font-size: 21px; }.nav-tools { margin-left: auto; }.mobile-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 12px 20px 16px; background: var(--glass-strong); color: var(--text); backdrop-filter: blur(18px); }.mobile-nav a { font-size: 14px; }.hero { min-height: 74vh; }.hero-copy { padding-top: 110px; }.home-content { margin-top: -28px; padding: 0 13px 50px; }.home-grid { display: block; }.side-column { position: static; margin-top: 20px; }.masonry-feed { columns: 1; }.post-content h3 { font-size: 21px; }.search-panel { margin: 0; border-radius: 0; }.about-stats { grid-template-columns: repeat(2, 1fr); padding: 20px 12px; gap: 18px 8px; }.about-stats b { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

a {
  color: inherit;
  text-decoration: none;
}

/* ---- layout -------------------------------------------------------------- */

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* ---- top navigation ------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.sub-page .site-nav { background: var(--glass-strong); color: var(--text); box-shadow: 0 1px 12px rgba(20,30,45,.12); backdrop-filter: blur(18px); }

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand .fa {
  font-size: 16px;
  color: var(--text-muted);
}

.topbar .spacer {
  flex: 1 1 auto;
}

.back-link {
  color: var(--text-muted);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

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

/* ---- auth area ----------------------------------------------------------- */

#auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--text-muted);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.btn-primary:hover {
  border-color: var(--accent);
  opacity: 0.9;
}

.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.auth-user:hover {
  background: var(--bg-subtle);
}

.auth-nick {
  font-size: 14px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 30;
}

.auth-menu.open {
  display: block;
}

.auth-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.auth-menu button:hover {
  background: var(--bg-subtle);
}

/* ---- avatar -------------------------------------------------------------- */

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}

.avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.avatar-fallback {
  text-transform: uppercase;
}

/* ---- page headings ------------------------------------------------------- */

.page-head {
  padding: 28px 0 8px;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- cards / articles ---------------------------------------------------- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.article-item {
  display: block;
  padding: 20px 22px;
  transition: border-color 0.15s ease;
}

.article-item:hover {
  border-color: var(--text-muted);
}

.article-item h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.article-meta .avatar {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.article-excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  overflow-wrap: break-word;
}

/* ---- article detail ------------------------------------------------------ */

.article-detail {
  margin-top: 20px;
  padding: 28px 26px;
}

.article-reading {
  max-width: 960px;
  margin: 92px auto 0;
  border-radius: 8px;
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
}

.article-reading h1 {
  font-size: clamp(28px, 4vw, 48px);
  text-align: center;
  letter-spacing: .01em;
}

.article-reading > .article-meta {
  justify-content: center;
  font-size: 13px;
}

.article-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}

.article-tag {
  color: #3b9ed8;
  background: rgba(73, 177, 245, .12);
  border: 1px solid rgba(73, 177, 245, .28);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.article-tag:hover { background: rgba(73, 177, 245, .22); }
.muted-tag { color: var(--text-muted); background: var(--bg-subtle); border-color: var(--border); }
.reading-progress { height: 3px; margin: 20px 0 26px; background: var(--bg-subtle); overflow: hidden; }
.reading-progress span { display: block; width: 0; height: 100%; background: #49b1f5; transition: width .1s linear; }

.article-detail h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.article-body {
  margin-top: 20px;
  font-size: 16px;
  overflow-wrap: break-word;
}

.article-body p {
  margin: 0 0 16px;
  white-space: pre-wrap;
}

.article-body .media {
  margin: 0 0 20px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

.article-body video {
  max-width: 100%;
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  background: #000;
}

.article-body figcaption {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

/* ---- comments ------------------------------------------------------------ */

.comments {
  margin-top: 20px;
}

.comments .card {
  padding: 22px;
}

.comments-title {
  font-size: 18px;
  margin: 0 0 16px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.comment-reply { margin-left: 52px; padding-top: 10px; padding-bottom: 10px; border-top: 0; }
.comment-reply .avatar { width: 26px; height: 26px; }

.comment-item:first-of-type {
  border-top: none;
}

.comment-body {
  flex: 1 1 auto;
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-nick {
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: break-word;
}

.comment-time {
  color: var(--text-muted);
  font-size: 12px;
}

.comment-content {
  margin: 4px 0 0;
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.comment-actions { display: flex; gap: 12px; margin-top: 6px; }
.comment-actions button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 2px 0; font-size: 12px; }
.comment-actions button:hover { color: #49b1f5; }

.comment-form {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* ---- forms --------------------------------------------------------------- */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}
.article-options label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.article-options input { width: auto; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text-muted);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---- auth card ----------------------------------------------------------- */

.auth-card {
  max-width: 420px;
  margin: 48px auto 0;
  padding: 28px;
}

.auth-card h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0 20px;
  border-bottom: 1px solid var(--border);
}

.auth-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* avatar upload preview */
.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 24px;
  overflow: hidden;
}

/* ---- editor -------------------------------------------------------------- */

.editor-title input {
  font-size: 20px;
  font-weight: 600;
}

.block-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.block-item {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.block-item .block-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.block-item .block-remove {
  margin-left: auto;
}

.block-preview img,
.block-preview video {
  max-width: 100%;
  max-height: 320px;
  border-radius: 6px;
  display: block;
  margin-bottom: 10px;
}

.block-preview video {
  width: 100%;
}

.editor-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ---- states -------------------------------------------------------------- */

.state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 20px;
}

.state .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.state p {
  margin: 0;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

/* ---- pagination ---------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.pagination .page-info {
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- toast --------------------------------------------------------------- */

#toast-box {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: var(--accent-contrast);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

.toast.success {
  background: var(--success);
  color: #fff;
}

/* ---- icons --------------------------------------------------------------- */

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex: 0 0 auto;
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -0.125em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  .topbar-inner {
    gap: 8px;
  }
  .brand {
    font-size: 16px;
  }
  .auth-nick {
    display: none;
  }
  .article-detail {
    padding: 20px 18px;
  }
  .article-detail h1 {
    font-size: 23px;
  }
  .article-item {
    padding: 16px 18px;
  }
  .article-reading { padding: 20px 16px; margin-top: 74px; }
  .article-reading > .article-meta { justify-content: flex-start; }
}
