:root {
  --bg: #F8F5F0;
  --bg-card: #ffffff;
  --text: #333333;
  --text-soft: #666666;
  --text-faint: #9aa0a6;
  --border: #efe7dc;
  --accent: #FF9A56;        /* 主色 暖橙 */
  --accent-strong: #FF7F50; /* 强调 珊瑚粉 */
  --accent-soft: #FFF1E8;
  --success: #52C41A;
  --error: #FF4D4F;
  --warning: #FAAD14;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);
  --shadow-hover: 0 6px 16px rgba(255,127,80,.12), 0 16px 40px rgba(0,0,0,.06);
  --radius: 16px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Emoji",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
          Arial, "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 800; font-size: 20px; color: var(--text); white-space: nowrap; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 18px; align-items: center; margin-left: auto; }
.nav-row { display: flex; gap: 18px; align-items: center; }
.nav-links > a, .nav-row > a { color: var(--text-soft); font-size: 15px; padding: 4px 2px; transition: .15s; }
.nav-links > a:hover, .nav-links > a.active, .nav-row > a:hover, .nav-row > a.active { color: var(--accent-strong); text-decoration: none; }
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); margin-left: auto; }

.nav-search input {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 7px 16px; font-size: 14px; width: 190px; outline: none; transition: .15s;
}
.nav-search input:focus { border-color: var(--accent); width: 220px; }

.bell { position: relative; font-size: 19px; line-height: 1; }
.bell .badge {
  position: absolute; top: -7px; right: -9px; background: var(--error); color: #fff;
  font-size: 11px; min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.avatar-menu { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 4px; background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 8px;
  cursor: pointer; font-size: 18px;
}
.avatar-btn .caret { font-size: 10px; color: var(--text-faint); }
.dropdown {
  position: absolute; right: 0; top: 46px; min-width: 180px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-hover);
  padding: 6px; display: none; z-index: 60; max-height: calc(100vh - 80px); overflow-y: auto;
}
.dropdown.show { display: block; animation: pop .18s var(--ease); }
.dropdown .dd-head { padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown .dd-head small { display: block; font-weight: 400; color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.dropdown a:hover { background: var(--accent-soft); text-decoration: none; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 9px 18px; border-radius: 999px; font-size: 15px; cursor: pointer;
  font-family: inherit; transition: transform .15s var(--ease), box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:hover { transform: scale(1.02); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(255,154,86,.3); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 14px; font-size: 14px; }
.btn.danger { background: #fff; border-color: var(--error); color: var(--error); }
.btn.danger:hover { background: var(--error); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ===== 布局 ===== */
.container { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 80px; }
.hero {
  position: relative; border-radius: 22px; overflow: hidden; margin: 18px 0 22px;
  padding: 56px 40px; color: #fff;
  background: linear-gradient(120deg, #FF9A56 0%, #FF7F50 45%, #FFB07C 100%);
  box-shadow: var(--shadow-hover);
}
.hero::after { content:""; position:absolute; right:-40px; top:-40px; width:240px; height:240px;
  background: rgba(255,255,255,.18); border-radius: 50%; }
.hero::before { content:""; position:absolute; right:120px; bottom:-60px; width:180px; height:180px;
  background: rgba(255,255,255,.12); border-radius: 50%; }
.hero h1 { position: relative; font-size: 36px; margin: 0 0 10px; font-weight: 800; }
.hero p { position: relative; font-size: 17px; margin: 0 0 22px; opacity: .95; }
.hero .hero-actions { position: relative; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn { background: rgba(255,255,255,.95); color: var(--accent-strong); border: none; }
.hero .btn:first-child { background: #fff; }

/* ===== 首页专栏 ===== */
.columns-section { margin: 0 0 32px; }
.columns-section .sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.columns-section .sec-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.columns-section .sec-head p { margin: 0; font-size: 14px; color: var(--text-faint); }
.columns-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.column-card {
  position: relative; border-radius: var(--radius); overflow: hidden; height: 170px;
  background-size: cover; background-position: center; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  text-decoration: none;
}
.column-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.55) 100%);
  transition: background .25s;
}
.column-card:hover { transform: translateY(-5px) scale(1.01); box-shadow: var(--shadow-hover); }
.column-card:hover::before { background: linear-gradient(180deg, rgba(0,0,0,.22) 0%, rgba(0,0,0,.68) 100%); }
.column-card .col-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 20px;
  color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,.35); z-index: 2;
}
.column-card .col-count {
  position: absolute; top: 14px; right: 16px; background: rgba(255,255,255,.9);
  color: var(--text); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; z-index: 2;
}
@media (max-width: 1023px) { .columns-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .columns-grid { grid-template-columns: 1fr; } .column-card { height: 150px; } }

/* ===== 公告 Banner ===== */
.ann-bar {
  background: #fff7eb; border: 1px solid #ffe0b3; border-radius: 14px; padding: 4px 16px; margin: 0 0 22px;
}
.ann-bar .ann { padding: 9px 0; border-bottom: 1px dashed #ffd9a6; display: flex; gap: 10px; align-items: flex-start; }
.ann-bar .ann:last-child { border-bottom: none; }
.ann-bar .ann .ic { font-size: 16px; }
.ann-bar .ann .tx { flex: 1; }
.ann-bar .ann .t { font-weight: 600; color: #b45309; }
.ann-bar .ann .c { color: var(--text-soft); font-size: 14px; margin-top: 2px; }
.ann-bar .ann .m { color: var(--text-faint); font-size: 12px; margin-top: 2px; }

/* ===== 筛选条 ===== */
.filters { margin: 0 0 22px; display: flex; flex-direction: column; gap: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.filter-row .lbl { font-size: 13px; color: var(--text-faint); margin-right: 4px; flex: 0 0 auto; }
.chip {
  display: inline-block; padding: 5px 14px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 1px solid var(--border); color: var(--text-soft); font-size: 14px; transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.sort-tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.sort-tabs .st { font-size: 14px; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--text-soft); border: 1px solid transparent; }
.sort-tabs .st.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* ===== 文章卡片网格 ===== */
.post-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  animation: fadeUp .4s var(--ease) both;
  cursor: pointer;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-card .cover { height: 170px; background: #eee; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card h2 { margin: 0; font-size: 19px; line-height: 1.4; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent-strong); text-decoration: none; }
.post-card:hover h2 a { color: var(--accent-strong); }
.post-card .meta { color: var(--text-faint); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.post-card .meta .av { width: 18px; height: 18px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: 0 0 18px; }
.post-card .excerpt { color: var(--text-soft); margin: 0; font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .tags { margin-top: auto; }
.post-card .stats { display: flex; gap: 14px; color: var(--text-faint); font-size: 13px; }

/* ===== 标签 ===== */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; font-size: 13px; padding: 3px 11px; border-radius: 999px;
  cursor: pointer; transition: .15s; border: 1px solid transparent;
}

/* ===== 文章详情 ===== */
.post-header { margin-bottom: 18px; }
.post-header h1 { font-size: 30px; margin: 0 0 12px; line-height: 1.35; }
.post-header .meta { color: var(--text-faint); font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.post-header .author { display: inline-flex; gap: 6px; align-items: center; color: var(--text-soft); }
.post-header .author .av { width: 22px; height: 22px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: 0 0 22px; }
.cover-banner { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; }
.article {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px 38px; box-shadow: var(--shadow); font-size: 16px;
}
.article h1, .article h2, .article h3 { margin-top: 1.6em; line-height: 1.35; }
.article h2 { border-left: 4px solid var(--accent); padding-left: 12px; }
.article p { margin: 1em 0; }
.article img { max-width: 100%; border-radius: 10px; }
.article blockquote { margin: 1.2em 0; padding: 10px 18px; border-left: 4px solid var(--accent);
  background: var(--accent-soft); color: var(--text-soft); border-radius: 0 8px 8px 0; }
.article pre { background: #f6f8fa; border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow: auto; font-size: 14px; }
.article code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .92em; }
.article :not(pre) > code { background: #eef1f5; padding: 2px 6px; border-radius: 5px; color: #c7254e; }
.article table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 15px; }
.article th, .article td { border: 1px solid var(--border); padding: 8px 12px; }
.article th { background: #f6f8fa; }
.article ul, .article ol { padding-left: 1.4em; }
.article .blk-img { margin: 18px 0; text-align: center; }
.article .blk-img img { max-width: 100%; border-radius: 10px; }
.article .blk-video { margin: 18px 0; position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.article .blk-video video, .article .blk-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article .blk-text { margin: 14px 0; }
.article .blk-text p { margin: .6em 0; }

/* 互动栏 */
.interact-bar { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.interact-bar .act {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 15px; color: var(--text-soft);
  transition: .15s;
}
.interact-bar .act:hover { border-color: var(--accent); color: var(--accent-strong); }
.interact-bar .act.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

/* 作者卡片 */
.author-card {
  display: flex; gap: 14px; align-items: center; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin: 26px 0; box-shadow: var(--shadow);
}
.author-card .av { font-size: 40px; width: 60px; height: 60px; border-radius: 50%; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; flex: 0 0 60px; overflow: hidden; }
.author-card h3 { margin: 0 0 4px; font-size: 17px; }
.author-card .bio { color: var(--text-soft); font-size: 14px; margin: 0; }
.author-card .mini-arts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.author-card .mini-arts a { font-size: 13px; color: var(--text-soft); }
.author-card .mini-arts .mini-arts-label { font-size: 13px; color: var(--text-faint); margin-right: 4px; }

/* ===== 评论区 ===== */
.comments { margin-top: 30px; }
.comments h3 { font-size: 19px; margin: 0 0 14px; }
.comment-sort { display: flex; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--text-faint); }
.comment-sort span { cursor: pointer; padding: 3px 10px; border-radius: 999px; }
.comment-sort span.active { background: var(--accent-soft); color: var(--accent-strong); }
.comment-box { display: flex; gap: 10px; margin-bottom: 20px; }
.comment-box .av { font-size: 26px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; flex: 0 0 40px; overflow: hidden; }
.comment-box textarea { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  font-family: inherit; font-size: 14px; resize: vertical; min-height: 44px; outline: none; }
.comment-box textarea:focus { border-color: var(--accent); }
.comment-item { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-item .av { font-size: 24px; width: 38px; height: 38px; border-radius: 50%; background: #f0ece6;
  display: flex; align-items: center; justify-content: center; flex: 0 0 38px; overflow: hidden; }
.comment-item .co-body { flex: 1; min-width: 0; }
.comment-item .co-head { display: flex; gap: 8px; align-items: baseline; }
.comment-item .co-name { font-weight: 600; font-size: 14px; }
.comment-item .co-time { color: var(--text-faint); font-size: 12px; }
.comment-item .co-text { margin: 4px 0; font-size: 14px; word-break: break-word; }
.comment-item .co-ops { display: flex; gap: 14px; font-size: 12px; color: var(--text-faint); }
.comment-item .co-ops span { cursor: pointer; }
.comment-item .co-ops span:hover { color: var(--accent-strong); }
.comment-item.comment-highlight { animation: commentPulse 2.5s ease; border-radius: 12px; }
@keyframes commentPulse {
  0% { background: rgba(255, 127, 80, 0.28); box-shadow: 0 0 0 4px rgba(255, 127, 80, 0.15); }
  60% { background: rgba(255, 127, 80, 0.08); box-shadow: 0 0 0 2px rgba(255, 127, 80, 0.08); }
  100% { background: transparent; box-shadow: none; }
}
.comment-replies { margin-left: 48px; margin-top: 8px; }
.comment-replies .comment-item { border-bottom: none; padding: 8px 0; }

/* ===== 通用列表（草稿/收藏） ===== */
.mini-list { display: flex; flex-direction: column; gap: 12px; }
.mini-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow);
}
.mini-card .info { min-width: 0; }
.mini-card .info h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.mini-card .info h3 .av { width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 24px; }
.mini-card .info h3 a { color: var(--text); }
.mini-card .info .meta { color: var(--text-faint); font-size: 13px; }
.mini-card .ops { display: flex; gap: 8px; flex: 0 0 auto; }
.mini-card .ops .btn { padding: 6px 12px; font-size: 13px; }

/* ===== 个人中心 ===== */
.profile-head { display: flex; gap: 20px; align-items: center; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 22px; }
.profile-head .avatar { font-size: 54px; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border-radius: 50%; flex: 0 0 84px; overflow: hidden; }
.profile-head h2 { margin: 0 0 6px; }
.profile-head .role { color: var(--accent-strong); font-size: 13px; }
.profile-head .uid { color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.profile-head .bio { color: var(--text-soft); margin: 6px 0 0; }
.profile-info { min-width: 0; }
@media (max-width: 600px) {
  .profile-head { flex-direction: column; text-align: center; gap: 14px; padding: 22px 16px; border-radius: 18px; }
  .profile-head .avatar { width: 96px; height: 96px; flex-basis: 96px; font-size: 60px; }
  .profile-head h2 { font-size: 20px; margin: 0 0 8px; }
  .profile-head .role { font-size: 13px; }
  .profile-head .uid { font-size: 12px; }
  .profile-head .bio { font-size: 14px; margin-top: 8px; line-height: 1.6; }
  .tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; border-bottom: none; margin-bottom: 16px; }
  .tabs .tab { padding: 12px 8px; font-size: 15px; text-align: center; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabs .tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
  .form-card { padding: 22px 18px; border-radius: 16px; }
  .section-title { font-size: 16px; }
  .avatar-pick { gap: 12px; }
  .avatar-pick .hint { font-size: 12px; line-height: 1.5; }
}
/* 头像渲染：图片或文字头像都填满容器并保持圆形 */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar-text { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  border-radius: inherit; color: #fff; font-weight: 700; }
/* 角色与身份列表中的统一皇冠图标（无右下角橙色半圆） */
.role-avatar { display: inline-flex; width: 32px; height: 32px; vertical-align: middle; margin-right: 0; flex: 0 0 32px; }
.role-avatar svg { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avatar-preview { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: var(--accent-soft);
  font-size: 38px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.avatar-btn .avatar-img, .avatar-btn .avatar-text { width: 28px; height: 28px; border-radius: 50%; font-size: 13px; }
.dd-head .avatar-img, .dd-head .avatar-text { width: 32px; height: 32px; border-radius: 50%; font-size: 14px; flex: 0 0 auto; }

/* 圆形头像可点击更换 + 相机角标 */
.avatar-edit { cursor: pointer; position: relative; }
.avatar-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar-pick { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-pick .avatar-preview { margin: 0; }

/* 头像裁剪器（圆形视口 + 拖动/缩放） */
.av-cropper-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center;
  justify-content: center; z-index: 200; padding: 16px; }
.av-cropper { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-hover); }
.av-cropper-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; text-align: center; }
.av-stage { position: relative; width: 360px; height: 360px; margin: 0 auto; border-radius: 12px;
  overflow: hidden; background: #f1f3f5; touch-action: none; user-select: none; cursor: grab; }
.av-stage.grabbing { cursor: grabbing; }
.av-img-wrap { position: absolute; top: 0; left: 0; will-change: transform; }
.av-img-wrap img { display: block; width: 100%; height: 100%; object-fit: cover;
  -webkit-user-drag: none; user-select: none; pointer-events: none; }
.av-mask { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.5); pointer-events: none; }
.av-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 14px; pointer-events: none; }
.av-stage.has-img .av-empty { display: none; }
.av-row { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; }
.av-row .btn { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }
.av-zoom { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); min-width: 0; }
.av-zoom input { flex: 1; min-width: 0; }
.av-actions { display: flex; gap: 10px; }
.av-actions .btn { flex: 1; padding: 11px; }
@media (max-width: 480px) {
  .av-cropper { padding: 16px; max-width: 96vw; }
  .av-stage { width: 86vw; height: 86vw; max-width: 360px; max-height: 360px; }
  .av-row { gap: 8px; }
  .av-row .btn { padding: 6px 10px; }
}
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tabs .tab { padding: 10px 18px; cursor: pointer; color: var(--text-soft); border-bottom: 2px solid transparent; }
.tabs .tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); font-weight: 600; }

/* ===== 表单 ===== */
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); max-width: 560px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-soft); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  font-size: 15px; font-family: inherit; outline: none; background: #fff; color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }
.check-row a { color: var(--accent-strong); }

/* ===== 页脚 / 通用 ===== */
.site-footer { border-top: 1px solid var(--border); color: var(--text-faint); text-align: center; padding: 30px 24px; font-size: 13px; }
.site-footer a { color: var(--text-faint); margin: 0 4px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--text-soft); font-size: 14px; }
.empty { color: var(--text-faint); text-align: center; padding: 60px 0; }
.section-title { font-size: 18px; margin: 8px 0 14px; }

/* ===== 浮动写文章按钮（移动端） ===== */
.fab { position: fixed; right: 20px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 26px; border: none; box-shadow: 0 6px 18px rgba(255,127,80,.4);
  cursor: pointer; z-index: 40; display: none; }

/* ===== Toast ===== */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: #333; color: #fff; padding: 11px 22px; border-radius: 999px; font-size: 14px; z-index: 999;
  opacity: 0; transition: transform .25s var(--ease), opacity .25s; box-shadow: 0 8px 24px rgba(0,0,0,.2); pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* ===== 模态框 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 998; }
.modal { background: #fff; border-radius: 16px; padding: 26px 28px; max-width: 380px; width: 90%; box-shadow: var(--shadow-hover); }
.modal h3 { margin: 0 0 10px; }
.modal p { color: var(--text-soft); margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== 搜索/通知页 ===== */
.search-head { display: flex; gap: 10px; margin-bottom: 18px; }
.search-head input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 11px 18px; font-size: 15px; outline: none; }
.search-head input:focus { border-color: var(--accent); }
.seg { display: flex; gap: 6px; margin-bottom: 16px; }
.seg span { padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--text-soft); }
.seg span.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
mark { background: #fff2a8; padding: 0 2px; border-radius: 3px; }
.noti-item { display: flex; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 10px; }
.noti-item.unread { border-color: var(--accent); background: #fffdf9; }
.noti-item .ic { font-size: 20px; }
.noti-item .tx { flex: 1; }
.noti-item .tx .c { font-size: 14px; }
.noti-item .tx .t { color: var(--text-faint); font-size: 12px; margin-top: 3px; }

/* ===== 管理后台 ===== */
.admin-grid { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.admin-side { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); position: sticky; top: 86px; }
.admin-side .as { padding: 10px 14px; border-radius: 10px; cursor: pointer; color: var(--text-soft); font-size: 14px; }
.admin-side .as.active, .admin-side .as:hover { background: var(--accent-soft); color: var(--accent-strong); }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .n { font-size: 28px; font-weight: 700; color: var(--accent-strong); }
.stat-card .l { color: var(--text-faint); font-size: 13px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 11px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
.table th { background: #faf6f1; color: var(--text-soft); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table .av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: 0 0 28px;
  vertical-align: middle; margin-right: 4px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.pill.pending { background: #fff7e6; color: #d48806; }
.pill.approved { background: #f6ffed; color: #389e0d; }
.pill.rejected { background: #fff1f0; color: #cf1322; }
.pill.deleted { background: #f5f5f5; color: #999; }
.role-select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; }
/* 角色与身份表格：头像列居中 */
.roles-table td:first-child,
.roles-table th:first-child { text-align: center; width: 56px; }
.roles-table td:first-child { padding-left: 8px; padding-right: 8px; }

/* ===== 登录/注册 ===== */
.auth-wrap { max-width: 420px; margin: 48px auto; padding: 34px 32px; background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-hover); }
.auth-wrap h1 { font-size: 24px; margin: 0 0 6px; text-align: center; }
.auth-wrap .sub { text-align: center; color: var(--text-faint); margin: 0 0 22px; }
.auth-wrap .btn { width: 100%; margin-top: 14px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-soft); }
.demo-accounts { margin-top: 20px; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; font-size: 13px; color: var(--text-soft); }
.demo-accounts code { background: #fff; padding: 1px 6px; border-radius: 5px; color: var(--accent-strong); }

/* ===== 动画 ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 响应式 ===== */
@media (max-width: 1023px) { .post-list { grid-template-columns: repeat(2, 1fr); } .admin-grid { grid-template-columns: 1fr; } .admin-side { position: static; display: flex; gap: 6px; flex-wrap: wrap; } }
@media (max-width: 860px) {
  .hamburger { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column;
    padding: 12px 16px; gap: 10px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-row { width: 100%; gap: 8px; justify-content: space-between; }
  .nav-main { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .nav-main > a { text-align: center; font-size: 14px; padding: 8px 2px; border-radius: 8px; }
  .nav-main > a.active { background: var(--accent-soft); color: var(--accent-strong); }
  .nav-search input { width: 100%; font-size: 15px; padding: 9px 14px; }
  .nav-search input:focus { width: 100%; }
  .nav-search { width: 100%; }
  .nav-actions { display: flex; gap: 8px; align-items: center; justify-content: space-around; width: 100%; }
  .nav-actions > * { flex: 1 1 auto; display: flex; justify-content: center; }
  .nav-actions .bell { font-size: 22px; padding: 6px; }
  .nav-actions .avatar-btn { padding: 3px 8px; }
  .nav-actions .btn { padding: 7px 8px; font-size: 13px; white-space: nowrap; }
  .nav-actions .btn.ghost { border-color: var(--border); }
  .nav-actions .avatar-menu .dropdown { right: auto; left: 50%; transform: translateX(-50%); top: 44px; min-width: 170px; }
  .article { padding: 24px 20px; }
  .hero { padding: 40px 24px; border-radius: 18px; }
  .hero h1 { font-size: 28px; }
}
@media (max-width: 600px) {
  .post-list { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .fab { display: flex; align-items: center; justify-content: center; }
  .container { padding: 18px 16px 80px; }
}

/* ===== 无障碍（WCAG）：跳转链接 + 键盘焦点可见 ===== */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: #fff; color: #e0560e; padding: 10px 16px; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); font-weight: 600;
}
.skip-link:focus { left: 10px; top: 10px; }
:focus-visible { outline: 3px solid #ff9a56; outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

/* ===== 用户列表（F06） ===== */
.section-head { margin: 8px 0 18px; }
.section-head h1 { margin: 0 0 6px; font-size: 26px; color: var(--text); }
.section-head .sub { margin: 0; color: var(--text-soft); font-size: 14px; }
.user-toolbar { margin: 0 0 18px; }
.user-toolbar input {
  width: 100%; max-width: 360px; padding: 10px 14px; border: 1px solid var(--border, #e7ded2);
  border-radius: 10px; font-size: 14px; background: #fff; color: var(--text);
}
.user-toolbar input:focus { outline: none; border-color: var(--accent-strong, #e8651e); }
.user-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px;
}
.user-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: #fff; border: 1px solid var(--border, #efe7db); border-radius: 14px; padding: 18px 12px;
  text-decoration: none; color: var(--text); transition: transform .15s ease, box-shadow .15s ease;
}
.user-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--accent-strong, #e8651e); }
.uc-avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; font-size: 30px; }
.uc-avatar .avatar-img, .uc-avatar .avatar-text { width: 100%; height: 100%; border-radius: 50%; }
.uc-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.uc-pos { font-size: 12px; color: var(--accent-strong, #e8651e); }
.uc-role { font-size: 12px; color: var(--text-faint); }
.uc-count { margin-top: 2px; font-size: 13px; color: var(--text-soft); }
.uc-count b { color: var(--accent-strong, #e8651e); font-size: 15px; }
/* 用户分组布局 */
.user-group { margin-bottom: 34px; }
.group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(90deg, var(--accent-soft, #fff1e9), #fff);
  border-left: 4px solid var(--accent-strong, #e8651e); }
.group-title { margin: 0; font-size: 19px; font-weight: 700; color: var(--accent-strong, #e8651e); }
.group-hint { font-size: 13px; color: var(--text-soft); }
.group-count { margin-left: auto; font-size: 13px; color: var(--text-faint);
  background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 2px 12px; }
.sub-head { margin: 22px 0 16px; font-size: 20px; color: var(--text); }
