:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --ink: #1f2430;
  --ink-soft: #5b6472;
  --muted: #9aa3af;
  --line: #ececf1;
  --brand: #4f7cff;
  --brand-soft: #eaf0ff;
  --accent: #b07cff;
  --danger: #ef5350;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(31, 36, 48, 0.06);
  --maxw: 920px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav a.btn { color: #fff; background: var(--brand); padding: 6px 14px; border-radius: 999px; }
.nav a.btn:hover { opacity: .92; }

/* ---------- Hero ---------- */
.hero { padding: 54px 0 30px; text-align: center; }
.hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: .5px; }
.hero p { color: var(--ink-soft); margin: 0; font-size: 16px; }

/* ---------- 标签筛选 ---------- */
.tagbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0 26px; justify-content: center; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  padding: 6px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 文章列表 ---------- */
.posts { display: grid; gap: 18px; padding-bottom: 50px; }
.card {
  display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: .18s;
  cursor: pointer; align-items: stretch;
}
.card:hover { transform: translateY(-2px); border-color: #d9e0ff; }
.card .cover { width: 130px; min-width: 130px; height: 110px; border-radius: 10px; background-size: cover; background-position: center; background: linear-gradient(135deg,#dfe7f5,#f3e9f7); }
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.card .excerpt { color: var(--ink-soft); font-size: 14px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.tag { background: var(--brand-soft); color: var(--brand); padding: 2px 10px; border-radius: 999px; font-size: 12px; }

/* ---------- 文章详情 ---------- */
.post-hero { height: 240px; border-radius: var(--radius); background-size: cover; background-position: center; background: linear-gradient(135deg,#dfe7f5,#f3e9f7); margin-bottom: 22px; }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 40px; box-shadow: var(--shadow); }
.article h1 { font-size: 28px; margin: 0 0 12px; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 22px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.markdown { font-size: 16px; color: #2c3340; }
.markdown h1, .markdown h2, .markdown h3 { margin: 1.4em 0 .6em; line-height: 1.3; }
.markdown h2 { font-size: 22px; border-left: 4px solid var(--brand); padding-left: 10px; }
.markdown p { margin: .8em 0; }
.markdown img { max-width: 100%; border-radius: 10px; margin: 12px 0; display: block; }
.markdown blockquote { margin: 1em 0; padding: 10px 16px; background: var(--brand-soft); border-left: 4px solid var(--brand); color: var(--ink-soft); border-radius: 0 8px 8px 0; }
.markdown code { background: #f3f4f8; padding: 2px 6px; border-radius: 5px; font-size: 90%; }
.markdown pre { background: #1f2430; color: #e6e9f0; padding: 14px 16px; border-radius: 10px; overflow: auto; }
.markdown pre code { background: none; color: inherit; padding: 0; }
.markdown ul, .markdown ol { padding-left: 22px; }
.markdown a { color: var(--brand); }
.locked-img { opacity: .9; }

.attachments { margin-top: 26px; border-top: 1px dashed var(--line); padding-top: 16px; }
.attachments h4 { margin: 0 0 10px; font-size: 15px; color: var(--ink-soft); }
.attachments ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.attachments li { display: flex; align-items: center; gap: 8px; }
.attachments .file-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; color: var(--ink); font-size: 14px; }
.attachments .file-btn:hover { border-color: var(--brand); text-decoration: none; color: var(--brand); }

/* ---------- 关于页 ---------- */
.page-article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }

/* ---------- 表单 / 认证 / 后台 ---------- */
.panel { max-width: 460px; margin: 60px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 18px; text-align: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff; outline: none; transition: .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea { min-height: 220px; resize: vertical; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.6; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs .tab { flex: 1; text-align: center; padding: 9px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--ink-soft); border: 1px solid var(--line); }
.tabs .tab.active { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none; padding: 11px 18px; border-radius: 10px;
  font-size: 15px; cursor: pointer; transition: .15s; font-family: inherit;
}
.btn:hover { opacity: .92; text-decoration: none; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.linkbtn { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 14px; padding: 0; }
.muted { color: var(--muted); font-size: 13px; text-align: center; margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

/* ---------- 后台列表 ---------- */
.admin-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 40px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.admin-row .t { font-weight: 600; }
.admin-row .s { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.admin-row .s.pub { background: #e7f8ee; color: #1f9d57; }
.admin-row .s.draft { background: #fff4e5; color: #d9870a; }
.admin-actions { display: flex; gap: 8px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
.section-title h2 { margin: 0; font-size: 22px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: #1f2430; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #c0392b; }
.toast.ok { background: #1f9d57; }

/* ---------- 社交：频道 / 评论 ---------- */
.tabs { max-width: 420px; margin: 0 auto 10px; }
input.field, textarea.field {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
input.field:focus, textarea.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row .field { margin-bottom: 0; }

.btn.primary { background: var(--brand); }
.btn.ghost.primary { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment:first-child { border-top: none; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.comment-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.comment-time { font-size: 12px; }
.comment-body { margin-top: 4px; font-size: 15px; color: #2c3340; white-space: pre-wrap; word-break: break-word; }

/* ---------- 头像 / 作者 ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; flex: none; line-height: 1;
  background: #eef1f5; color: #fff; font-weight: 600; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.author-tag {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-size: 14px; max-width: 100%;
}
.author-tag:hover { text-decoration: none; }
.author-tag:hover .author-tag-name { color: var(--brand); }
.author-tag-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 文章顶部的作者栏 */
.author-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--brand-soft); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 20px;
}
.author-bar .author-info { display: flex; flex-direction: column; min-width: 0; }
.author-bar .author-name { font-weight: 600; color: var(--ink); font-size: 15px; }
.author-bar .author-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 信息流卡片底部的作者行 */
.card-author { margin-top: 10px; display: flex; align-items: center; min-width: 0; }

/* 头像选择器 */
.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.avatar-picker .opt {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent;
  background: #f3f4f8; display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer; padding: 0; line-height: 1;
}
.avatar-picker .opt.sel { border-color: var(--brand); }

/* 关注 / 粉丝列表 */
.people { display: flex; flex-wrap: wrap; gap: 10px; }
.person {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 14px 4px 4px; font-size: 14px; color: var(--ink);
}
.person:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

.empty { text-align: center; color: var(--muted); padding: 50px 0; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0 40px; border-top: 1px solid var(--line); margin-top: 20px; }

/* ---------- 首页唱片 ---------- */
.vinyl-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px auto 16px; }
.vinyl {
  position: relative; width: 92px; height: 92px; flex: none; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 50% 50%, #2b2b31 0 17%, #14141a 18% 100%);
  box-shadow: 0 8px 20px rgba(20, 20, 26, .28), inset 0 0 0 1px rgba(255, 255, 255, .07);
  transition: box-shadow .2s;
}
.vinyl:hover { box-shadow: 0 10px 26px rgba(20, 20, 26, .36), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.vinyl::before {
  content: ""; position: absolute; inset: 7px; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .06) 0 1px, rgba(0, 0, 0, 0) 1px 4px);
}
.vinyl::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 34%; height: 34%;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}
.vinyl .hole {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; z-index: 3;
  transform: translate(-50%, -50%); border-radius: 50%; background: #0e0e13;
}
.vinyl.spinning { animation: vinyl-spin 6s linear infinite; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
.vinyl-meta { font-size: 12px; color: var(--muted); line-height: 1.6; }
.vinyl-meta b { display: block; color: var(--ink-soft); font-size: 13px; font-weight: 600; }

/* ---------- 进站动画 ---------- */
.intro-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: var(--bg, #fbfbfd); transition: opacity .6s ease;
}
.intro-overlay.out { opacity: 0; pointer-events: none; }
.intro-inner { text-align: center; animation: intro-rise .75s cubic-bezier(.2, .8, .2, 1) both; }
.intro-ring {
  width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  animation: intro-pop .75s cubic-bezier(.2, .8, .2, 1) both;
}
.intro-name { font-size: 26px; font-weight: 700; letter-spacing: 2px; color: var(--ink); }
.intro-slogan { margin-top: 6px; font-size: 14px; color: var(--muted); }
@keyframes intro-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes intro-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* ---------- 外观设置面板 ---------- */
#fx-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 120; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
}
#fx-panel {
  position: fixed; right: 18px; bottom: 72px; z-index: 121; width: 286px; max-height: 72vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px; opacity: 0; transform: translateY(10px) scale(.98); pointer-events: none; transition: .18s;
}
#fx-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.fx-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
#fx-close { cursor: pointer; font-style: normal; color: var(--muted); font-size: 20px; line-height: 1; }
.fx-sec { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.fx-t { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.fx-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-swatches .sw { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.fx-swatches .sw.sel { border-color: var(--brand); }
.fx-caps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: var(--muted); }
.fx-fonts, .fx-tracks { display: flex; flex-wrap: wrap; gap: 8px; }
.fbtn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.fbtn.sel { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.fx-vol { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.fx-vol input { flex: 1; min-width: 0; }
.fx-local { margin-top: 8px; font-size: 12px; }
.fx-note { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }

@media (max-width: 640px) {
  .card { flex-direction: column; }
  .card .cover { width: 100%; min-width: 0; height: 150px; }
  .article, .page-article { padding: 22px; }
  .nav { gap: 12px; font-size: 14px; }
}
