/* =========================================================
   蓝屿 · 写作社区
   纸感配色：纸白 / 墨蓝 / 雾蓝 / 珊瑚 / 金
   纸白 #f7f8fb / 墨蓝 #16213d / 蓝 #607aa9 / 雾蓝 #dfe8f5
   金 #b99a67 / 珊瑚 #f1c7c5
   ========================================================= */

:root {
  --ink: #16213d;
  --deep: #202d52;
  --blue: #607aa9;
  --blue-soft: #7d95bf;
  --mist: #dfe8f5;
  --paper: #f7f8fb;
  --white: #ffffff;
  --gold: #b99a67;
  --coral: #f1c7c5;
  --coral-deep: #e2a5a0;
  --line: rgba(22, 33, 61, 0.13);
  --muted: #73809a;
  --body-text: #3d4a66;
  --shadow-soft: 0 24px 48px -38px rgba(22, 33, 61, 0.6);
  --shadow-card: 0 18px 36px -30px rgba(22, 33, 61, 0.5);
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --round: "Zen Maru Gothic", "Yuanti SC", "YouYuan", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scrollbar-color: rgba(96, 122, 169, 0.5) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: rgba(96, 122, 169, 0.5);
  border: 3px solid var(--paper);
  border-radius: 999px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(223, 232, 245, 0.95), transparent 26rem),
    radial-gradient(circle at 92% 22%, rgba(241, 199, 197, 0.28), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(223, 232, 245, 0.5), transparent 30rem),
    var(--paper);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection { color: var(--deep); background: var(--coral); }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--round);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
p { margin: 0 0 1em; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--deep); }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code, pre { font-family: var(--mono); }

.wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  padding: 10px 16px; border-radius: 999px; background: var(--deep); color: var(--paper);
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

/* ---------- 通用件 ---------- */

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase;
}
.kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--coral-deep); box-shadow: 0 0 0 4px rgba(241, 199, 197, 0.35); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; background: transparent;
  font-family: var(--round); font-size: 14px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s, color 0.18s, border-color 0.18s;
}
.btn:active { transform: translate(1px, 1px) scale(0.99); }
.btn:focus-visible { outline: 3px solid rgba(96, 122, 169, 0.35); outline-offset: 2px; }
.btn-primary { background: var(--deep); color: #f7f8fb; box-shadow: 0 12px 24px -16px rgba(32, 45, 82, 0.9); }
.btn-primary:hover { background: #2a3a68; color: #fff; transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, 0.72); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #fff; color: var(--deep); transform: translateY(-1px); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--mist); color: var(--deep);
  font-size: 13px; font-weight: 600; line-height: 1.2;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.chip:hover { background: #cfdcef; color: var(--deep); transform: translateY(-1px); }
.chip-sm { padding: 4px 9px; font-size: 11.5px; }
.chip-active { background: var(--deep); color: var(--paper); }
.chip-active:hover { background: var(--deep); color: var(--paper); }
.chip-clear { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

.dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: rgba(22, 33, 61, 0.28); }

.avatar { border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--mist); }
.avatar-xs { width: 20px; height: 20px; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 52px; height: 52px; }
.avatar-xl { width: 96px; height: 96px; }
.avatar-fallback {
  display: inline-grid; place-items: center;
  background: linear-gradient(140deg, #cddcf1, #f3d9d7);
  color: #2a3a68; font-family: var(--round); font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(32, 45, 82, 0.06);
}
.badge-draft {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  background: var(--coral); color: #7c3f3a; font-size: 11px; font-weight: 700;
}
.badge-owner, .badge-admin {
  display: inline-flex; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
}
.badge-owner { background: rgba(185, 154, 103, 0.18); color: #7d6639; }
.badge-admin { background: rgba(96, 122, 169, 0.16); color: #3d5279; }

.input {
  width: 100%; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fbfcfe;
  font-size: 14px; line-height: 1.6; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(96, 122, 169, 0.13); }
.input-sm { padding: 6px 9px; font-size: 12.5px; border-radius: 9px; }
textarea.input { resize: vertical; }

.field { display: block; margin-bottom: 15px; }
.field > span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.switch-row { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 16px; font-size: 13px; cursor: pointer; }
.switch-row input { margin-top: 3px; accent-color: var(--deep); width: 16px; height: 16px; }
.switch-row small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.form-error {
  padding: 10px 13px; margin-bottom: 13px; border-radius: 10px;
  background: #fdeceb; color: #a3403a; font-size: 13px;
}
.notice { padding: 12px 16px; border-radius: 14px; font-size: 13.5px; margin-bottom: 18px; }
.notice-ok { background: rgba(120, 168, 133, 0.15); color: #356b45; }

/* ---------- 顶部导航 ---------- */

.topbar {
  position: sticky; top: 10px; z-index: 60;
  width: min(1120px, calc(100% - 32px)); margin: 14px auto 0;
  background: rgba(247, 248, 251, 0.8);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 16px 40px -34px rgba(22, 33, 61, 0.7);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}
.topbar-in {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 9px 12px 9px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: 0 0 auto; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; display: block; }
.site-mark { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--round); font-size: 17px; letter-spacing: 0.06em; }
.brand-text small { font-size: 9.5px; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav-links a {
  padding: 9px 13px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { color: var(--ink); background: rgba(223, 232, 245, 0.7); }
.nav-links a.active { color: var(--deep); background: var(--mist); }

.nav-right { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.nav-search input {
  width: 148px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.7);
  font-size: 12.5px; outline: none; transition: width 0.2s var(--ease), border-color 0.15s, background 0.15s;
}
.nav-search input::placeholder { color: #9aa5ba; }
.nav-search input:focus { width: 196px; border-color: var(--blue); background: #fff; }

.user-chip { position: relative; }
.user-chip-btn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 5px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.75);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.user-chip-btn:hover { background: #fff; border-color: rgba(96, 122, 169, 0.4); }
.user-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.caret { color: var(--muted); transition: transform 0.2s; }
.user-chip.open .caret { transform: rotate(180deg); }
.user-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 70;
  width: 184px; padding: 8px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 24px 50px -30px rgba(22, 33, 61, 0.6);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}
.user-chip.open .user-menu { opacity: 1; transform: none; pointer-events: auto; }
.user-menu a, .user-menu button {
  display: block; width: 100%; padding: 9px 12px; border: none; border-radius: 11px;
  background: none; text-align: left; font-size: 13px; color: var(--ink); cursor: pointer;
}
.user-menu a:hover, .user-menu button:hover { background: var(--mist); color: var(--deep); }
.user-menu button { color: #a3403a; }

.nav-toggle { display: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.nav-toggle span { display: block; width: 15px; height: 1.6px; margin: 3.5px auto; background: var(--ink); border-radius: 2px; }

/* ---------- Hero ---------- */

.hero { position: relative; padding: 62px 0 0; overflow: hidden; }
.hero-in {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  align-items: center; gap: clamp(24px, 4vw, 60px);
  min-height: 540px; padding-bottom: 90px;
}
.hero-copy h1 {
  margin: 16px 0 20px;
  font-size: clamp(46px, 6.4vw, 82px);
  line-height: 1.02; letter-spacing: 0.01em;
}
.hero-copy h1 em {
  position: relative; font-style: normal; color: var(--blue);
  background: linear-gradient(100deg, var(--blue), #40598c 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-copy h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M2 8c24-8 42 6 66-2s46 6 68-2 42 4 62-2' fill='none' stroke='%23f1c7c5' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.hero-lead { max-width: 30em; margin-bottom: 26px; font-size: 16.5px; line-height: 1.95; color: var(--body-text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; gap: 34px; margin: 34px 0 0; padding: 0; }
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats dt { font-family: var(--round); font-size: 27px; font-weight: 700; color: var(--deep); line-height: 1; }
.hero-stats dd { margin: 0; font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); }

.hero-art { position: relative; height: 460px; }
.hero-illustration { width: 100%; height: 100%; animation: bob 6s ease-in-out infinite; filter: drop-shadow(0 26px 30px rgba(96, 122, 169, 0.25)); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-0.6deg); } 50% { transform: translateY(-12px) rotate(0.6deg); } }
.hero-bubble {
  position: absolute; z-index: 2; padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-card);
  font-family: var(--round); font-size: 12px; color: var(--deep);
}
.hero-bubble.b1 { top: 18px; left: 4%; transform: rotate(-4deg); }
.hero-bubble.b2 { top: 74px; right: 2%; transform: rotate(3deg); background: #fff7f6; }
.hero-sticker {
  position: absolute; right: 2%; bottom: 30px; z-index: 2;
  width: 92px; padding: 12px 10px; transform: rotate(-9deg);
  background: var(--coral); border-radius: 6px;
  font-family: var(--round); font-size: 13px; font-weight: 700; line-height: 1.4;
  color: #6d3a37; text-align: center; box-shadow: var(--shadow-card);
}
.hero-sticker span { font-size: 11px; letter-spacing: 0.14em; opacity: 0.75; }
.hero-tape {
  position: absolute; top: 46%; left: -8%; width: 78px; height: 22px;
  background: rgba(241, 199, 197, 0.75); transform: rotate(-7deg);
  box-shadow: 0 2px 0 rgba(22, 33, 61, 0.05);
}
.hero-wave { position: absolute; left: 0; right: 0; bottom: -2px; height: 140px; opacity: 0.85; }
.hero-wave .wave-svg { width: 100%; height: 100%; }

/* ---------- 区块标题 / 标签栏 ---------- */

.wall { padding: 64px 0 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { margin: 10px 0 6px; font-size: clamp(28px, 3.4vw, 38px); }
.section-sub { font-size: 13px; color: var(--muted); margin: 0; }
.tagbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 28px; }

/* ---------- 文章卡片 ---------- */

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.postcard {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 26px;
  overflow: hidden; box-shadow: var(--shadow-card);
  transform: rotate(-0.22deg);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
}
.postcard:nth-child(2n) { transform: rotate(0.3deg); }
.postcard:hover {
  transform: translateY(-5px) rotate(0deg);
  box-shadow: 0 30px 55px -38px rgba(22, 33, 61, 0.6);
  border-color: rgba(96, 122, 169, 0.32);
}
.postcard-cover {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(150deg, #eaf0f9, #f7f8fb);
}
.postcard-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.postcard:hover .postcard-cover img { transform: scale(1.045); }
.cover-empty .wave-svg { position: absolute; inset: auto 0 0; width: 100%; height: 60%; }
.post-grid .postcard:nth-child(2n) .cover-empty { background: linear-gradient(150deg, #eef2f9, #f8f1ef); }
.post-grid .postcard:nth-child(3n) .cover-empty { background: linear-gradient(150deg, #e9eff9, #f2f6fb); }
.cover-tag {
  position: absolute; top: 14px; left: 14px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.82); color: var(--deep);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  backdrop-filter: blur(4px);
}
.cover-mark { position: absolute; right: 12px; bottom: 10px; width: 54px; opacity: 0.75; }
.postcard-body { display: flex; flex: 1; flex-direction: column; padding: 17px 20px 20px; }
.postcard-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.postcard h3 { margin: 9px 0 9px; font-size: 20px; line-height: 1.45; }
.postcard h3 a { color: var(--ink); }
.postcard h3 a:hover { color: var(--blue); }
.postcard-excerpt {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; margin: 0 0 16px;
  font-size: 13.5px; line-height: 1.85; color: var(--muted);
}
.postcard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 13px; border-top: 1px dashed var(--line);
}
.mini-author { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink); }
.mini-author:hover { color: var(--blue); }
.postcard-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

/* ---------- 分页 / 空态 ---------- */

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 40px 0 10px; }
.pager-now { font-size: 12.5px; color: var(--muted); }
.empty-state {
  padding: 64px 24px; text-align: center;
  background: rgba(255, 255, 255, 0.55); border: 2px dashed var(--line); border-radius: 28px;
}
.empty-mark { width: 64px; margin: 0 auto 14px; opacity: 0.7; }
.empty-state h3 { font-size: 22px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }

.join-banner { padding: 20px 0 76px; }
.join-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 32px 38px; border-radius: 30px;
  background: linear-gradient(115deg, rgba(223, 232, 245, 0.9), rgba(241, 199, 197, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}
.join-card h3 { font-size: 24px; margin-bottom: 6px; }
.join-card p { margin: 0; font-size: 13.5px; color: #4d5b78; max-width: 46em; }

/* ---------- 文章页 ---------- */

.article { max-width: 1120px; padding: 46px 0 80px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 24px; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs-now { color: var(--ink); font-weight: 600; }
.article-head { max-width: 840px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.article-head h1 {
  margin: 6px 0 16px;
  font-size: clamp(30px, 4.3vw, 48px); line-height: 1.18; letter-spacing: 0.005em;
}
.article-lead { font-size: 16.5px; line-height: 1.9; color: var(--body-text); max-width: 46em; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.article-meta .edit-link { margin-left: 8px; }
.article-cover { max-width: 980px; margin: 30px 0 6px; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-soft); }
.article-cover img { width: 100%; max-height: 480px; object-fit: cover; object-position: center 28%; display: block; }
.article-layout {
  display: grid; grid-template-columns: minmax(0, 760px) 280px;
  gap: clamp(24px, 4vw, 56px); margin-top: 38px; align-items: start;
}
.article-body { font-size: 16.5px; line-height: 1.95; color: #2f3b56; }
.article-body p { margin: 0 0 1.15em; }
.article-body h2 { margin: 1.7em 0 0.6em; font-size: 27px; color: var(--ink); }
.article-body h3 { margin: 1.4em 0 0.5em; font-size: 21px; color: var(--ink); }
.article-body h4 { margin: 1.2em 0 0.4em; font-size: 17px; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(96, 122, 169, 0.4); }
.article-body ul, .article-body ol { padding-left: 1.5em; margin: 0 0 1.1em; }
.article-body li { margin: 0.35em 0; }
.article-body blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--coral-deep);
  color: #5b6781; font-style: normal;
}
.article-body img { display: block; max-width: 100%; max-height: 640px; margin: 20px auto; border-radius: 20px; box-shadow: var(--shadow-card); }
.article-body code {
  padding: 2px 6px; border-radius: 6px; background: var(--mist);
  font-size: 0.86em; color: #2f4370;
}
.article-body pre {
  margin: 1.4em 0; padding: 18px 20px; border-radius: 16px;
  background: var(--ink); color: #dfe8f5; overflow-x: auto; line-height: 1.7;
}
.article-body pre code { padding: 0; background: none; color: inherit; font-size: 13px; }
.article-body hr { margin: 2em 0; border: none; border-top: 1px dashed var(--line); }
.article-body mark { background: linear-gradient(transparent 58%, #f6e3a8 58%); color: inherit; padding: 0 1px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 14px; }
.article-body .table-scroll { overflow-x: auto; margin: 1.4em 0; }
.article-body .table-scroll table { margin: 0; min-width: 100%; }
.article-body th, .article-body td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; }
.article-body th { background: rgba(223, 232, 245, 0.5); }

.article-tail { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 20px; border-top: 1px dashed var(--line); }
.article-tail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.author-card {
  display: flex; align-items: center; gap: 16px; margin-top: 26px; padding: 20px 22px;
  background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-card);
}
.author-card strong { font-family: var(--round); font-size: 16px; }
.author-card p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.author-card .btn { margin-left: auto; }

.article-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 92px; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-card); }
.side-card h3 { font-size: 15px; margin-bottom: 12px; }
.side-card h2 { font-size: 18px; margin-bottom: 14px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.side-list li:last-child { border-bottom: none; }
.side-list a { display: block; font-size: 13px; line-height: 1.6; color: var(--ink); }
.side-list a:hover { color: var(--blue); }
.side-list small { font-size: 11px; color: var(--muted); }
.side-empty { font-size: 12.5px; color: var(--muted); margin: 0; }
.side-cta { background: linear-gradient(150deg, #eaf0f9, #f9eeed); border-color: rgba(255, 255, 255, 0.8); }
.side-cta h3 { margin: 8px 0 6px; }
.side-cta p { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.side-tip h3 { font-size: 14px; }
.side-tip p { font-size: 12.5px; line-height: 1.8; color: var(--muted); margin: 0; }

/* ---------- 写作页 ---------- */

.write { padding: 44px 0 80px; }
.write-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.write-head h1 { font-size: clamp(28px, 3.4vw, 40px); margin-top: 8px; }
.write-actions { display: flex; align-items: center; gap: 9px; }
.save-state { font-size: 12px; color: var(--muted); margin-right: 4px; }
.write-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
.write-main { min-width: 0; }
.title-input {
  width: 100%; padding: 4px 2px 14px; margin-bottom: 14px;
  border: none; border-bottom: 2px dashed var(--line); background: transparent;
  font-family: var(--round); font-size: clamp(26px, 3.2vw, 38px); font-weight: 700;
  color: var(--ink); outline: none; transition: border-color 0.15s;
}
.title-input::placeholder { color: #a7b1c4; }
.title-input:focus { border-color: var(--blue); }

.editor-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
  padding: 7px 8px; border: 1px solid var(--line); border-bottom: none;
  border-radius: 14px 14px 0 0; background: #fff;
}
.editor-toolbar button {
  min-width: 31px; height: 30px; padding: 0 8px; border: none; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.editor-toolbar button:hover { background: var(--mist); color: var(--ink); }
.toolbar-gap { flex: 1; }
.editor-toolbar .toolbar-ai { background: rgba(223, 232, 245, 0.7); color: var(--deep); }
.editor-toolbar .toolbar-ai:hover { background: var(--mist); }

.editor {
  width: 100%; min-height: 58vh; padding: 20px 22px;
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 14px 14px;
  background: #fff; color: #2f3b56;
  font-family: var(--mono); font-size: 14px; line-height: 1.95;
  outline: none; resize: vertical;
}
.editor:focus { border-color: rgba(96, 122, 169, 0.5); }
.editor-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 10px 3px; font-size: 12px; color: var(--muted); }
.editor-foot b { color: var(--ink); }
.editor-foot-right { margin-left: auto; }
.preview-pane { margin-top: 18px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.preview-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.preview-head h3 { font-size: 15px; }
.preview-head span { font-size: 11.5px; color: var(--muted); }

.write-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }
.cover-drop {
  position: relative; display: block; aspect-ratio: 16 / 10; margin-bottom: 8px;
  border: 2px dashed var(--line); border-radius: 16px; overflow: hidden;
  background: linear-gradient(150deg, #f4f7fc, #fbf6f5); cursor: pointer;
  transition: border-color 0.15s;
}
.cover-drop:hover { border-color: var(--blue); }
.cover-drop img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty { display: grid; place-content: center; gap: 4px; height: 100%; text-align: center; color: var(--muted); }
.cover-empty span { font-size: 13px; font-weight: 600; color: var(--deep); }
.cover-empty small { font-size: 11px; }
.link-btn { padding: 0; border: none; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--deep); }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag-suggest .chip { border: none; cursor: pointer; }

/* ---------- 登录 / 注册 ---------- */

.auth { padding: 54px 0 84px; }
.auth-card {
  display: grid; grid-template-columns: 0.92fr 1.08fr;
  max-width: 940px; margin: 0 auto; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 32px;
  box-shadow: var(--shadow-soft);
}
.auth-art {
  position: relative; padding: 44px 40px;
  background: linear-gradient(155deg, #dfe8f5, #eef2f9 60%, #f9efee);
  overflow: hidden;
}
.auth-art-inner { position: relative; z-index: 2; max-width: 20em; }
.auth-art h2 { margin: 16px 0 14px; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.25; }
.auth-art p { font-size: 13.5px; line-height: 1.85; color: #55637f; }
.auth-mark { position: absolute; right: -12px; bottom: -6px; width: 132px; opacity: 0.85; }
.auth-tape {
  position: absolute; top: -10px; left: 42px; width: 92px; height: 26px;
  background: rgba(241, 199, 197, 0.85); transform: rotate(-6deg);
}
.auth-form { padding: 44px 46px; }
.auth-form h1 { font-size: 32px; margin-bottom: 8px; }
.auth-sub { font-size: 13px; line-height: 1.8; color: var(--muted); margin-bottom: 24px; }
.auth-form form { margin-bottom: 4px; }
.auth-form .btn-block { margin-top: 8px; }
.auth-alt { margin: 22px 0 0; font-size: 13px; color: var(--muted); }
.wechat-card { grid-template-columns: 1fr; max-width: 560px; }

/* ---------- 个人主页 ---------- */

.profile { padding: 50px 0 80px; }
.profile-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 22px;
  padding: 28px 30px; margin-bottom: 36px;
  background: #fff; border: 1px solid var(--line); border-radius: 30px;
  box-shadow: var(--shadow-soft);
}
.profile-info { flex: 1; min-width: 220px; }
.profile-name { display: flex; align-items: center; gap: 10px; }
.profile-name h1 { font-size: 32px; }
.profile-handle { margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); }
.profile-bio { margin: 0 0 10px; font-size: 14px; line-height: 1.8; color: var(--body-text); max-width: 46em; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.profile-actions { display: flex; gap: 9px; }

/* ---------- 设置 ---------- */

.settings { padding: 48px 0 84px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 10px 0 8px; font-size: clamp(30px, 4vw, 44px); }
.page-head p { margin: 0; font-size: 13.5px; color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.settings-main { display: flex; flex-direction: column; gap: 18px; }
.settings-side { display: flex; flex-direction: column; gap: 18px; }
.settings-card h2 { font-size: 19px; margin-bottom: 16px; }
.avatar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.avatar-edit { position: relative; width: 96px; height: 96px; flex: 0 0 auto; }
.avatar-edit img, .avatar-edit .avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.avatar-edit-btn {
  position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff;
  background: var(--deep); color: #fff; cursor: pointer; box-shadow: 0 6px 12px -6px rgba(32, 45, 82, 0.8);
}
.avatar-hint strong { display: block; font-family: var(--round); font-size: 17px; }
.avatar-hint small { display: block; margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.avatar-hint p { margin: 0; font-size: 12px; color: var(--muted); }

.wechat-row { display: flex; align-items: center; gap: 13px; margin-bottom: 10px; }
.wechat-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: #07c160; color: #fff; font-family: var(--round); font-weight: 700;
}
.wechat-row strong { display: block; font-size: 14px; }
.wechat-row small { font-size: 12px; color: var(--muted); }
.wechat-row .btn { margin-left: auto; }

.quota-card h2 { margin-bottom: 18px; }
.quota-block { margin-bottom: 15px; }
.quota-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.quota-label b { font-size: 12px; font-weight: 700; color: var(--ink); }
.quota-bar { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.quota-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--deep)); transition: width 0.4s var(--ease); }
.quota-unlimited strong { font-family: var(--round); font-size: 32px; color: var(--deep); }
.quota-unlimited p { margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }

.kv { margin: 0; }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv > div:last-child { border-bottom: none; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-size: 12.5px; text-align: right; }
.kv-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kv-row > div { flex-direction: column; align-items: flex-start; gap: 2px; border: none; padding: 0; }
.kv-row dd { font-family: var(--round); font-size: 22px; font-weight: 700; }
.kv-row .kv-text { font-family: var(--body); font-size: 14px; font-weight: 600; line-height: 1.9; }

/* ---------- 管理后台 ---------- */

.admin { padding: 48px 0 84px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-card); }
.stat-card span { font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); }
.stat-card strong { display: block; margin: 4px 0 2px; font-family: var(--round); font-size: 30px; color: var(--deep); }
.stat-card small { font-size: 11px; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-bottom: 22px; align-items: start; }
.admin-grid .settings-card { max-width: 640px; }
.key-state { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 14px; border-radius: 11px; background: var(--mist); font-size: 12px; color: var(--deep); }
.dot-state { width: 8px; height: 8px; border-radius: 50%; background: #d0615a; flex: 0 0 auto; }
.dot-state.on { background: #4c9a6a; }
.users-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.users-table th { padding: 8px 8px 10px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.users-table td { padding: 11px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.users-table tr.is-disabled { opacity: 0.55; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell strong { display: block; font-size: 13px; line-height: 1.4; }
.user-cell small { font-size: 11px; color: var(--muted); }
.usage-cell { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.quota-inputs { display: flex; flex-direction: column; gap: 5px; }
.quota-inputs label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.quota-inputs input { width: 84px; flex: 0 0 auto; }
.state-pill { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.state-pill.on { background: rgba(76, 154, 106, 0.14); color: #356b45; }
.state-pill.off { background: rgba(160, 90, 84, 0.14); color: #8f4b45; }
.role-text { font-size: 12px; }
.admin .side-card { margin-top: 0; }

.audit-card h2 { margin-bottom: 4px; }
.audit-card .field-hint code { padding: 1px 5px; border-radius: 5px; background: var(--mist); font-size: 11px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit-table th { padding: 8px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.audit-table td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.audit-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-event {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--mist); color: var(--deep); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.audit-detail {
  max-width: 360px; color: #4a5773;
  font-size: 12px; line-height: 1.7;
  overflow-wrap: anywhere;
}
.audit-ip { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.db-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 12px; }
.db-stats > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; }
.db-stats span { display: block; font-size: 10.5px; letter-spacing: 0.06em; color: var(--muted); }
.db-stats strong { display: block; margin-top: 4px; font-family: var(--round); font-size: 19px; color: var(--deep); }
.backup-card .field-hint { margin: 0 0 10px; }
.backup-card code { padding: 1px 5px; border-radius: 5px; background: var(--mist); font-size: 11px; }
.backup-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.backup-table th { padding: 8px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); }
.backup-table td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.backup-table td.audit-detail { white-space: normal; }
@media (max-width: 720px) {
  .db-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 项目 ---------- */

.projects-page { padding: 48px 0 84px; }
.projects-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.projects-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.project-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.2s;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 50px -38px rgba(22, 33, 61, 0.55);
  border-color: rgba(96, 122, 169, 0.3);
}
.project-cover {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(150deg, #eaf0f9, #f8f1ef);
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s var(--ease); }
.project-card:hover .project-cover img { transform: scale(1.04); }
.project-cover-empty { display: grid; place-items: center; }
.project-initial {
  position: relative; z-index: 1;
  font-family: var(--round); font-size: 46px; font-weight: 700;
  color: var(--blue); opacity: 0.7;
}
.project-cover-wave { position: absolute; inset: auto 0 0; width: 100%; height: 62%; opacity: 0.9; }
.project-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.project-title-row { display: flex; align-items: center; gap: 8px; }
.project-title-row h3 { margin: 0; font-size: 19px; line-height: 1.4; }
.project-title-row h3 a { color: var(--ink); }
.project-title-row h3 a:hover { color: var(--blue); }
.project-summary {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin: 0;
  font-size: 13px; line-height: 1.8; color: var(--muted);
}
.project-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.badge-pin {
  padding: 2px 8px; border-radius: 999px;
  background: rgba(185, 154, 103, 0.18); color: #7d6639;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.project-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line);
}
.repo-link { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--blue); }
.repo-link:hover { color: var(--deep); }
.repo-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.project-norepo { font-size: 11.5px; }

.project-page { padding: 42px 0 80px; }
.project-hero { max-width: 1000px; }
.project-hero-cover {
  max-height: 360px; margin: 0 0 26px; overflow: hidden;
  border-radius: 26px; box-shadow: var(--shadow-soft);
}
.project-hero-cover img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.project-hero-main h1 { margin: 8px 0 14px; font-size: clamp(32px, 4.2vw, 48px); }
.project-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 14px; }
.project-layout {
  display: grid; grid-template-columns: minmax(0, 760px) 280px;
  gap: clamp(24px, 4vw, 56px); margin-top: 34px; align-items: start;
}
.project-main { min-width: 0; }
.project-link-list li { font-size: 12.5px; }

.section-head-actions { display: flex; align-items: center; gap: 8px; }
.profile-projects-head { margin-top: 46px; }

.input-title { padding: 12px 14px; font-family: var(--round); font-size: 25px; font-weight: 700; }
.editor-short { min-height: 26vh; }
.project-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 1040px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .projects-head { flex-direction: column; align-items: flex-start; }
  .project-form-row { grid-template-columns: minmax(0, 1fr); }
  .project-hero-cover img { max-height: 220px; }
}

/* ---------- 关于 ---------- */

.about { padding: 48px 0 84px; }
.about-head { max-width: 760px; margin-bottom: 30px; }
.about-head h1 { margin: 10px 0 14px; font-size: clamp(34px, 4.6vw, 52px); }
.about-head .lead { font-size: 16px; line-height: 1.9; color: var(--body-text); }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.about-card h2 { font-size: 19px; margin-bottom: 12px; }
.about-card p { font-size: 13.5px; line-height: 1.9; color: var(--body-text); }
.feature-list { margin: 0; padding-left: 1.1em; font-size: 13.5px; line-height: 2; color: var(--body-text); }
.feature-list b { color: var(--ink); }
.about-stats { display: flex; gap: 28px; margin-bottom: 12px; }
.about-stats strong { display: block; font-family: var(--round); font-size: 30px; color: var(--deep); line-height: 1.1; }
.about-stats span { font-size: 11.5px; color: var(--muted); }
.about-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 24px; padding: 28px 34px; border-radius: 28px;
  background: linear-gradient(115deg, rgba(223, 232, 245, 0.9), rgba(241, 199, 197, 0.45));
}
.about-cta h2 { font-size: 23px; margin-bottom: 4px; }
.about-cta p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- 错误页 ---------- */

.error-page { padding: 80px 0 100px; }
.error-card {
  max-width: 520px; margin: 0 auto; padding: 48px 36px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 32px; box-shadow: var(--shadow-soft);
}
.error-mark { width: 84px; margin: 0 auto 10px; opacity: 0.9; }
.error-code { display: block; font-family: var(--round); font-size: 13px; letter-spacing: 0.3em; color: var(--muted); }
.error-card h1 { margin: 8px 0 8px; font-size: 28px; }
.error-card p { font-size: 13.5px; color: var(--muted); }
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }

/* ---------- 页脚 ---------- */

.footer { margin-top: 40px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.45); }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 0; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-mark { width: 44px; height: 44px; flex: 0 0 auto; }
.footer-brand strong { font-family: var(--round); font-size: 15px; }
.footer-brand p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); max-width: 32em; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 11.5px; color: var(--muted); }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ---------- 智能体 ---------- */

.agent { position: fixed; right: 22px; bottom: 22px; z-index: 90; }
.agent-toggle {
  position: relative; display: grid; place-items: center;
  width: 58px; height: 58px; padding: 0; border: none; border-radius: 50%;
  background: var(--deep); color: var(--mist); cursor: pointer;
  box-shadow: 0 18px 34px -16px rgba(32, 45, 82, 0.85);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.agent-toggle:hover { transform: translateY(-2px) scale(1.03); background: #2a3a68; }
.agent-toggle svg { width: 34px; height: 34px; }
.agent-pulse {
  position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--coral); box-shadow: 0 0 0 0 rgba(241, 199, 197, 0.8);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(241, 199, 197, 0.8); }
  70% { box-shadow: 0 0 0 10px rgba(241, 199, 197, 0); }
  100% { box-shadow: 0 0 0 0 rgba(241, 199, 197, 0); }
}
.agent-panel {
  position: absolute; right: 0; bottom: 72px;
  display: flex; flex-direction: column;
  width: min(404px, calc(100vw - 32px)); height: min(620px, calc(100vh - 130px));
  overflow: hidden; background: #fff;
  border: 1px solid var(--line); border-radius: 26px;
  box-shadow: 0 34px 70px -34px rgba(22, 33, 61, 0.65);
  opacity: 0; transform: translateY(14px) scale(0.985); pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.agent[data-open="true"] .agent-panel { opacity: 1; transform: none; pointer-events: auto; }
.agent[data-open="true"] .agent-toggle { display: none; }
.agent-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; background: linear-gradient(120deg, #dfe8f5, #f9ecea);
}
.agent-id { display: flex; align-items: center; gap: 9px; }
.agent-face { width: 38px; height: 38px; flex: 0 0 auto; }
.agent-id strong { display: block; font-family: var(--round); font-size: 15px; }
.agent-id small { font-size: 10.5px; color: #5d6b87; }
.agent-actions { display: flex; gap: 4px; }
.agent-actions button {
  padding: 5px 8px; border: none; border-radius: 8px; background: rgba(255, 255, 255, 0.5);
  color: #5d6b87; font-size: 11.5px; cursor: pointer;
}
.agent-actions button:hover { background: #fff; color: var(--ink); }
.agent-quota { padding: 9px 16px 10px; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.quota-row { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.quota-sub { margin-top: 7px; }
.agent-quota .quota-bar { height: 5px; }
.agent-quota .quota-bar-thin { height: 4px; }
.agent-msgs { flex: 1; display: flex; flex-direction: column; gap: 11px; overflow-y: auto; padding: 15px 16px; }
.agent-empty { margin: auto; padding: 20px; text-align: center; font-size: 12.5px; line-height: 2; color: var(--muted); }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.75; overflow-wrap: anywhere; }
.msg-user { align-self: flex-end; background: var(--deep); color: #f7f8fb; border-bottom-right-radius: 5px; }
.msg-user .md p:last-child { margin-bottom: 0; }
.msg-ai { align-self: flex-start; background: var(--mist); color: #223252; border-bottom-left-radius: 5px; }
.msg-ai .md p { margin: 0 0 0.6em; }
.msg-ai .md p:last-child { margin-bottom: 0; }
.msg-ai .md pre { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--mist); font-size: 12px; overflow-x: auto; }
.msg-ai .md code { font-size: 12px; background: rgba(255, 255, 255, 0.6); padding: 1px 5px; border-radius: 5px; }
.msg-ai .md pre code { background: none; padding: 0; color: inherit; }
.msg-ai .md ul, .msg-ai .md ol { margin: 4px 0; padding-left: 1.3em; }
.msg-ai .md h3, .msg-ai .md h2 { font-size: 14px; margin: 6px 0 4px; }
.msg-error { align-self: flex-start; background: #fdeceb; color: #a3403a; }
.msg-typing i {
  display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%;
  background: var(--blue); animation: blink 1.2s infinite;
}
.msg-typing i:nth-child(2) { animation-delay: 0.15s; }
.msg-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.agent-quick { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 9px; }
.agent-quick button {
  padding: 5px 10px; border: none; border-radius: 999px; background: var(--mist);
  color: var(--deep); font-size: 11px; cursor: pointer;
}
.agent-quick button:hover { background: #cfdcef; }
.agent-input { display: flex; align-items: flex-end; gap: 8px; padding: 11px 13px; border-top: 1px solid var(--line); background: #fff; }
.agent-input textarea {
  flex: 1; max-height: 120px; min-height: 34px; padding: 7px 4px;
  border: none; background: transparent; font-size: 13.5px; line-height: 1.6; resize: none; outline: none;
}
.agent-input button {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  border: none; border-radius: 50%; background: var(--deep); color: #fff; cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.agent-input button:hover { transform: translateY(-1px); }
.agent-input button:disabled { opacity: 0.45; cursor: default; transform: none; }

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

.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 300;
  padding: 10px 18px; border-radius: 999px;
  background: var(--deep); color: #f7f8fb; font-size: 13px;
  box-shadow: 0 18px 34px -18px rgba(22, 33, 61, 0.8);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */

@media (max-width: 1040px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .article-side .side-card { flex: 1 1 240px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-side { flex-direction: row; flex-wrap: wrap; }
  .settings-side .side-card { flex: 1 1 260px; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .write-grid { grid-template-columns: minmax(0, 1fr) 290px; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-search { display: none; }
  .nav-toggle { display: block; }
  .nav-open .nav-links {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); margin: 0;
    padding: 8px; border: 1px solid var(--line); border-radius: 20px;
    background: #fff; box-shadow: var(--shadow-soft);
  }
  .nav-open .nav-links a { padding: 11px 14px; }
  .hero-in { grid-template-columns: 1fr; min-height: 0; padding-bottom: 60px; }
  .hero-art { order: -1; height: 320px; max-width: 480px; margin: 0 auto; width: 100%; }
  .hero-copy h1 { font-size: clamp(40px, 10vw, 58px); }
  .hero-stats { gap: 26px; }
  .write-grid { grid-template-columns: minmax(0, 1fr); }
  .write-side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .topbar { width: calc(100% - 20px); top: 6px; margin-top: 8px; }
  .brand-text small { display: none; }
  .nav-write { display: none; }
  .hero { padding-top: 34px; }
  .hero-art { height: 260px; }
  .hero-wave { height: 78px; }
  .hero-bubble.b2 { display: none; }
  .wall { padding-top: 42px; }
  .section-head { align-items: flex-start; }
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .join-card { flex-direction: column; align-items: flex-start; padding: 26px; }
  .article { padding-top: 28px; }
  .article-head h1 { font-size: 32px; }
  .article-body { font-size: 15.5px; }
  .article-side { flex-direction: column; }
  .article-meta .edit-link { margin-left: 0; }
  .write-actions { width: 100%; justify-content: flex-end; }
  .write-side { grid-template-columns: minmax(0, 1fr); }
  .settings-side { flex-direction: column; }
  .kv-row { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { padding: 26px 0 60px; }
  .auth-form { padding: 32px 24px; }
  .profile-card { padding: 22px; }
  .profile-name h1 { font-size: 26px; }
  .agent { right: 14px; bottom: 14px; }
  .agent-panel { right: -2px; bottom: 68px; width: calc(100vw - 24px); height: min(560px, calc(100vh - 120px)); }
  .footer-in { flex-direction: column; align-items: flex-start; }
  .about-cta { padding: 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   单人博客布局（三栏）
   ========================================================= */

.guest-chip {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px;
  background: rgba(223, 232, 245, 0.8); color: var(--muted);
  font-size: 10.5px; letter-spacing: 0.04em; white-space: nowrap;
}

.home-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 286px;
  gap: clamp(24px, 3vw, 46px);
  padding: 46px 0 80px;
  align-items: start;
}

.home-profile {
  position: sticky; top: 92px;
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.profile-avatar-link { display: inline-block; margin-bottom: 12px; transition: transform 0.2s var(--ease); }
.profile-avatar-link:hover { transform: translateY(-2px); }
.profile-avatar-link .avatar { width: 104px; height: 104px; box-shadow: 0 14px 28px -18px rgba(22, 33, 61, 0.55); }
.home-name { margin: 0 0 10px; font-size: 22px; line-height: 1.3; }
.home-name a { color: var(--ink); }
.home-name a:hover { color: var(--blue); }
.github-card {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 8px 12px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--deep); font-size: 11.5px; font-weight: 600;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.github-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.github-card.is-empty { color: var(--muted); background: transparent; border-style: dashed; }
.home-bio { margin: 0 0 14px; font-size: 12.5px; line-height: 1.85; color: var(--muted); }
.home-contact { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.home-contact a { color: var(--blue); }
.home-shortcuts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--line); width: 100%; }
.home-shortcuts a { padding: 5px 10px; border-radius: 999px; font-size: 11.5px; color: var(--deep); background: var(--mist); }
.home-shortcuts a:hover { background: #cfdcef; }

.home-feed { min-width: 0; }
.feed-head { margin-bottom: 22px; }
.feed-head h2 { margin: 8px 0 6px; font-size: 27px; }
.feed-sub { margin: 0; font-size: 12.5px; color: var(--muted); }
.feed-sub a { color: var(--blue); }

.feed-list { display: flex; flex-direction: column; gap: 18px; }
.feed-item {
  width: calc(100% - 18px);
  padding: 20px 22px;
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 18px 34px -32px rgba(22, 33, 61, 0.55);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.2s;
}
.feed-item:nth-child(3n+2) { margin-left: 26px; transform: rotate(-0.25deg); }
.feed-item:nth-child(3n) { margin-left: 12px; transform: rotate(0.3deg); }
.feed-item:hover {
  transform: translateY(-3px) rotate(0);
  border-color: rgba(96, 122, 169, 0.32);
  box-shadow: 0 26px 44px -34px rgba(22, 33, 61, 0.55);
}
.feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: 11.5px; color: var(--muted); }
.feed-meta time { font-variant-numeric: tabular-nums; }
.feed-cat {
  padding: 2px 8px; border-radius: 999px;
  background: rgba(223, 232, 245, 0.75); color: #40567f;
  font-size: 11px; font-weight: 600;
}
.feed-cat:hover { background: #cfdcef; color: var(--deep); }
.feed-title { margin: 8px 0 6px; font-size: 21px; line-height: 1.5; }
.feed-title a { color: var(--ink); }
.feed-title a:hover { color: var(--blue); }
.feed-excerpt { margin: 0; font-size: 13px; line-height: 1.85; color: var(--muted); }
.feed-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.feed-tags a { font-size: 11.5px; color: var(--blue); }
.feed-tags a:hover { color: var(--deep); }

.deck {
  position: relative; display: block;
  margin: 28px 0 10px;
  padding-bottom: 26px;
  text-decoration: none;
  color: inherit;
}
.deck-layer {
  position: absolute; left: 30px; right: 30px; height: 46px;
  display: block;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 14px 24px -26px rgba(22, 33, 61, 0.5);
  transition: transform 0.22s var(--ease), bottom 0.22s var(--ease);
  pointer-events: none;
}
.deck-l3 { bottom: 0; z-index: 1; transform: rotate(-1.4deg); }
.deck-l2 { bottom: 9px; z-index: 2; transform: rotate(0.9deg); }
.deck-card {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 18px 20px;
  background: #fff;
  border: 1px dashed rgba(96, 122, 169, 0.4);
  border-radius: 22px;
  box-shadow: 0 18px 34px -32px rgba(22, 33, 61, 0.55);
  transition: border-color 0.18s, transform 0.22s var(--ease);
}
.deck:hover .deck-card { border-color: var(--blue); transform: translateY(-2px); }
.deck:hover .deck-l3 { transform: rotate(-2deg); bottom: -3px; }
.deck:hover .deck-l2 { transform: rotate(1.3deg); bottom: 13px; }
.deck-count { font-family: var(--round); font-size: 16px; font-weight: 700; color: var(--deep); }
.deck-hint { font-size: 11.5px; color: var(--muted); }

.home-stats { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.stat-panel {
  padding: 16px 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.stat-panel h3 { margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.stat-list { margin: 0; }
.stat-list > div { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stat-list > div:last-child { border-bottom: none; }
.stat-list dt { font-size: 12px; color: var(--muted); }
.stat-list dd { margin: 0; font-family: var(--round); font-size: 19px; font-weight: 700; color: var(--deep); }
.stat-list dd a { color: var(--deep); }
.uptime { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.uptime-lines { display: flex; flex-direction: column; gap: 2px; margin-top: 9px; }
.uptime-lines p { margin: 0; font-size: 11px; color: var(--muted); }
.stat-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.stat-chips .chip { padding: 4px 9px; font-size: 11px; background: rgba(223, 232, 245, 0.7); }
.stat-chips .chip b { font-weight: 700; color: var(--deep); opacity: 0.65; }
.activity-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.activity-list li { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11.5px; color: var(--body-text); }
.activity-kind {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--mist); color: var(--deep);
  font-family: var(--round); font-size: 10px; font-weight: 700;
}
.activity-kind.guest { background: rgba(241, 199, 197, 0.65); color: #7a4540; }
.activity-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-list time { margin-left: auto; flex: 0 0 auto; font-size: 10.5px; color: var(--muted); }

/* 归档 */
.archive-page { padding: 44px 0 84px; }
.archive-year { margin-bottom: 30px; }
.archive-year h2 { margin: 0 0 10px; font-size: 22px; color: var(--blue); }
.archive-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.archive-list li {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto;
  align-items: baseline; gap: 14px;
  padding: 12px 2px; border-bottom: 1px dashed var(--line);
}
.archive-list time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.archive-title { font-size: 15px; color: var(--ink); }
.archive-title:hover { color: var(--blue); }
.archive-cat { font-size: 11px; color: #40567f; background: rgba(223, 232, 245, 0.7); padding: 2px 8px; border-radius: 999px; }
.archive-tags { display: flex; gap: 6px; font-size: 11px; color: var(--muted); }

/* 留言 */
.guestbook-page { padding: 44px 0 84px; }
.guestbook-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 26px; align-items: start; }
.guest-form { position: sticky; top: 92px; }
.guest-form h2 { margin: 0 0 14px; font-size: 18px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.guest-list { display: flex; flex-direction: column; gap: 14px; }
.guest-item { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); }
.guest-item header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.guest-item strong { font-size: 13.5px; }
.guest-item time { font-size: 11px; color: var(--muted); }
.guest-ip { font-size: 10.5px; color: var(--muted); font-family: var(--mono); background: var(--mist); padding: 1px 6px; border-radius: 5px; }
.guest-item p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--body-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.guest-contact { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); }
.guest-del { margin-left: auto; }

/* 我的 */
.me-page { padding: 44px 0 84px; }
.me-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.me-avatar-card { position: sticky; top: 92px; text-align: center; }
.me-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 14px; }
.me-avatar-wrap strong { margin-top: 8px; font-family: var(--round); font-size: 17px; }
.me-avatar-wrap small { font-size: 11.5px; color: var(--muted); }
.me-avatar-card .github-card { margin-top: 4px; }
.me-side-links { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.me-side-links a { font-size: 12px; color: var(--muted); }
.me-side-links a:hover { color: var(--deep); }
.me-form-card h2 { margin: 0 0 14px; font-size: 18px; }
.me-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.me-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }

/* 链接 */
.links-page { padding: 44px 0 84px; }
.link-form { margin-bottom: 22px; }
.link-form h2 { margin: 0 0 12px; font-size: 17px; }
.link-form-row { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr auto; gap: 12px; align-items: end; }
.link-form-row .field { margin: 0; }
.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.link-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); }
.link-main { display: block; padding: 18px 18px 16px; }
.link-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--coral-deep); margin-right: 8px; }
.link-main strong { font-family: var(--round); font-size: 16px; color: var(--ink); }
.link-main p { margin: 7px 0 0; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.link-main small { display: block; margin-top: 8px; font-size: 11px; color: #9aa5ba; overflow-wrap: anywhere; }
.link-del { position: absolute; top: 12px; right: 14px; }

/* 下载 */
.downloads-page { padding: 44px 0 84px; }
.downloads-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.upload-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.file-pick { position: relative; overflow: hidden; cursor: pointer; }
.file-name { font-size: 11.5px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.file-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
}
.file-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--mist); color: var(--deep);
  font-family: var(--round); font-weight: 700; text-transform: uppercase;
}
.file-main { min-width: 0; flex: 1; }
.file-main strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main small { font-size: 11px; color: var(--muted); }
.file-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.file-name-input { max-width: 360px; margin: 2px 0 4px; }

/* 音乐 */
.music { position: fixed; left: 22px; bottom: 22px; z-index: 85; }
.music-btn {
  display: grid; place-items: center;
  width: 46px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); color: var(--deep);
  font-size: 20px; cursor: pointer; box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  transition: transform 0.18s var(--ease), background 0.18s;
}
.music-btn:hover { transform: translateY(-1px); background: #fff; }
.music.is-playing .music-btn { background: var(--deep); color: var(--mist); }
.music-box {
  position: absolute; left: 0; bottom: 58px; width: 250px;
  padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 26px 50px -30px rgba(22, 33, 61, 0.55);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.music-box.open { opacity: 1; transform: none; pointer-events: auto; }
.music-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); }
.music-head button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 11px; }
.music-title { display: block; font-family: var(--round); font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.music-controls { display: flex; align-items: center; gap: 10px; }
.music-play {
  height: 30px; padding: 0 14px; border: none; border-radius: 999px;
  background: var(--deep); color: #fff; font-size: 11.5px; cursor: pointer;
}
.music-controls input[type="range"] { flex: 1; accent-color: var(--blue); }
.music-box small { display: block; margin-top: 8px; font-size: 10.5px; color: var(--muted); }

.nav-search-mobile { display: none; }
@media (max-width: 900px) {
  .nav-open .nav-search-mobile { display: block; margin: 6px 0 2px; }
  .nav-search-mobile input {
    width: 100%; height: 38px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 999px;
    background: #fbfcfe; font-size: 13px; outline: none;
  }
}

@media (max-width: 1180px) {
  .home-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .home-stats { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-stats .stat-panel:first-child { grid-column: span 1; }
}
@media (max-width: 900px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 26px; }
  .home-profile { position: static; flex-direction: row; flex-wrap: wrap; text-align: left; align-items: center; gap: 14px; padding: 20px; }
  .profile-avatar-link { margin: 0; }
  .profile-avatar-link .avatar { width: 76px; height: 76px; }
  .home-name { width: auto; margin: 0; }
  .github-card { width: auto; margin: 0; }
  .home-bio, .home-contact, .home-shortcuts { width: 100%; }
  .home-bio { margin-bottom: 0; }
  .home-stats { grid-template-columns: minmax(0, 1fr); }
  .feed-item, .feed-item:nth-child(3n), .feed-item:nth-child(3n+2) { width: 100%; margin-left: 0; transform: none; }
  .guestbook-grid, .me-grid { grid-template-columns: minmax(0, 1fr); }
  .guest-form, .me-avatar-card { position: static; }
  .link-form-row { grid-template-columns: 1fr 1fr; }
  .link-grid { grid-template-columns: minmax(0, 1fr); }
  .archive-list li { grid-template-columns: 78px minmax(0, 1fr) auto; }
  .archive-tags { display: none; }
  .downloads-head { flex-direction: column; align-items: flex-start; }
  .file-row { flex-wrap: wrap; }
  .file-actions { margin-left: auto; }
  .music { left: 14px; bottom: 14px; }
  .music-box { width: min(250px, calc(100vw - 28px)); }
  .me-form-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .link-form-row { grid-template-columns: minmax(0, 1fr); }
  .home-stats .stat-panel { padding: 14px 16px; }
}
