/* ============================================================
   user.css - 用户端样式（首页/分类/详情/认证页）
   ============================================================ */

/* ---------- 站点头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: #fff;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--gradient-main);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.5);
}
.header-search {
  flex: 1; max-width: 420px; position: relative;
}
.header-search input {
  width: 100%; height: 40px; border: none; border-radius: 12px;
  background: rgba(255,255,255,.12); color: #fff; padding: 0 42px 0 16px; font-size: 14px; outline: none;
  transition: background .2s;
}
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search input:focus { background: rgba(255,255,255,.2); }
.header-search .search-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.6); font-size: 16px; cursor: pointer;
  transition: color .18s;
}
.header-search .search-icon:hover { color: rgba(255,255,255,.95); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-user { color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.header-user .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gradient-main); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
}
.header-link { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500; cursor: pointer; }
.header-link:hover { color: #fff; }
.header-btn {
  height: 36px; padding: 0 16px; border-radius: 10px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .18s;
}
.header-btn.login { background: rgba(255,255,255,.14); color: #fff; }
.header-btn.login:hover { background: rgba(255,255,255,.22); }
.header-btn.register { background: var(--gradient-main); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.4); }
.header-btn.register:hover { filter: brightness(1.1); }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  background: radial-gradient(1200px 500px at 20% -10%, #4f46e5 0%, transparent 60%),
              radial-gradient(1000px 480px at 90% 0%, #d946ef 0%, transparent 55%),
              linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #fff; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 26px 26px;
}
.hero-inner {
  position: relative; max-width: 1120px; margin: 0 auto; padding: 64px 20px 56px;
}
.hero h1 { font-size: 34px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; }
.hero h1 .grad { background: linear-gradient(90deg, #a5b4fc, #f0abfc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: rgba(255,255,255,.72); font-size: 16px; max-width: 620px; margin-bottom: 26px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat .num { font-size: 26px; font-weight: 800; }
.hero-stat .label { color: rgba(255,255,255,.6); font-size: 13px; }

/* ---------- 公告 ---------- */
.notice-bar {
  max-width: 1120px; margin: -26px auto 0; padding: 0 20px; position: relative; z-index: 5;
}
.notice-card {
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-radius: var(--radius-lg); padding: 18px 22px;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.5);
  display: flex; gap: 16px; align-items: flex-start;
}
.notice-card .notice-label {
  flex-shrink: 0; background: var(--gradient-brand); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-top: 3px;
}
.notice-card .notice-content { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.notice-card .notice-content strong { color: var(--text-1); }

/* ---------- 页面主体容器 ---------- */
.page-container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }

.section-title {
  font-size: 22px; font-weight: 800; color: var(--text-1); margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ''; width: 5px; height: 22px; border-radius: 3px; background: var(--gradient-main);
}

/* ---------- 分类网格 ---------- */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.category-card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; transition: transform .2s, box-shadow .2s; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.category-cover { height: 130px; overflow: hidden; position: relative; }
.category-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.category-card:hover .category-cover img { transform: scale(1.05); }
.category-cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
}
.category-cover-fallback span { font-size: 44px; font-weight: 800; color: rgba(255,255,255,.95); }
.category-body { padding: 14px 16px 16px; }
.category-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.category-name .count { font-size: 12px; color: var(--primary); background: var(--bg-soft); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.category-desc { font-size: 13px; color: var(--text-3); line-height: 1.6; min-height: 40px; }

/* ---------- 列表页顶部信息区 ---------- */
.list-banner {
  position: relative; overflow: hidden;
  background:
    radial-gradient(600px 220px at 85% -40%, #d946ef55 0%, transparent 60%),
    radial-gradient(500px 200px at 0% 0%, #6366f155 0%, transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4c1d95 100%);
  border-radius: var(--radius-lg);
  padding: 26px 30px; margin-bottom: 26px; color: #fff;
  box-shadow: var(--shadow-lg);
}
.list-banner::before {
  content: ''; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 22px 22px;
}
.list-banner > * { position: relative; }
.list-title { font-size: 26px; font-weight: 800; margin-bottom: 10px; letter-spacing: .5px; }
.list-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-chip {
  background: rgba(255,255,255,.14); color: rgba(255,255,255,.92);
  font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 999px;
  backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.16);
}

/* ---------- 文章卡片（列表页） ---------- */
.article-list { display: flex; flex-direction: column; gap: 18px; }
.article-card {
  display: flex; gap: 20px; align-items: stretch;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  cursor: pointer; overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
  border-color: rgba(99,102,241,.35);
}
.article-cover {
  position: relative; flex: 0 0 176px; max-width: 176px;
  min-height: 132px; overflow: hidden; background: #eef2ff;
}
.article-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.article-card:hover .article-cover img { transform: scale(1.06); }
.cover-fallback {
  width: 100%; height: 100%; min-height: 132px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.cover-letter { font-size: 40px; font-weight: 800; color: rgba(255,255,255,.96); text-shadow: 0 2px 8px rgba(0,0,0,.2); }
.cover-glyph { font-size: 20px; opacity: .85; }
.cover-badge {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(15,23,42,.55); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; backdrop-filter: blur(6px);
  max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.article-card-body { flex: 1; padding: 18px 20px 16px; display: flex; flex-direction: column; min-width: 0; }
.article-card-title {
  font-size: 18px; font-weight: 700; color: var(--text-1); line-height: 1.45;
  margin-bottom: 8px; transition: color .18s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card:hover .article-card-title { color: var(--primary); }
.article-card-summary {
  color: var(--text-2); font-size: 13.5px; line-height: 1.75; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.article-card-meta {
  margin-top: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--text-3); font-size: 12.5px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.article-card-meta .read-more {
  margin-left: auto; color: var(--primary); font-weight: 600;
  opacity: 0; transform: translateX(-4px); transition: all .2s ease;
}
.article-card:hover .read-more { opacity: 1; transform: none; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-pill {
  background: var(--gradient-soft); color: var(--primary-3); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
}
.pill {
  background: #f1f5f9; color: var(--text-2); border-radius: 999px;
  padding: 3px 10px; font-size: 12px;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px; margin-bottom: 16px;
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span:last-child { color: var(--text-2); font-weight: 600; }

/* ---------- 通用内容卡片 ---------- */
.content-card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: 24px 26px; margin-bottom: 22px;
}
.content-card > h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 800; color: var(--text-1);
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.content-card > h2 .sec-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--gradient-soft); display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.content-card > h2 .sec-count {
  margin-left: auto; color: var(--primary); background: var(--bg-soft);
  font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px;
}

/* ---------- 文章详情 ---------- */
.detail-header { margin-bottom: 24px; }
.detail-header h1 { font-size: 28px; font-weight: 800; line-height: 1.35; margin-bottom: 14px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-3); font-size: 14px; align-items: center; }
.detail-meta .cat {
  color: var(--primary); background: var(--bg-soft); padding: 3px 12px; border-radius: 999px; font-weight: 600;
}
.detail-cover { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 26px; box-shadow: var(--shadow-md); }
.detail-cover img { width: 100%; }

/* 文章头部（article.js 生成） */
.article-head { margin-bottom: 22px; padding: 6px 0 20px; border-bottom: 1px solid var(--border); }
.article-head h1 { font-size: 27px; font-weight: 800; line-height: 1.4; margin-bottom: 14px; }
.meta-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px;
}
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.article-tags { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.article-tag {
  background: var(--gradient-soft); color: var(--primary-3);
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  transition: all .15s;
}
.article-tag:hover { filter: brightness(.96); }

.article-content {
  font-size: 15.5px; color: var(--text-1); line-height: 2;
}
.article-content h1, .article-content h2, .article-content h3, .article-content h4 {
  margin: 26px 0 12px; line-height: 1.45; color: var(--text-1);
  position: relative;
}
.article-content h1 { font-size: 25px; } .article-content h2 { font-size: 22px; }
.article-content h3 { font-size: 18.5px; } .article-content h4 { font-size: 16px; }
.article-content h2, .article-content h3 { padding-left: 12px; }
.article-content h2::before, .article-content h3::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px;
  border-radius: 3px; background: var(--gradient-main);
}
.article-content p { margin-bottom: 15px; }
.article-content img { border-radius: 14px; margin: 16px 0; box-shadow: var(--shadow-md); }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content ul, .article-content ol { margin: 12px 0 15px 24px; }
.article-content ul { list-style: disc; } .article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 7px; line-height: 1.8; }
.article-content blockquote {
  border-left: 4px solid var(--primary); background: var(--bg-soft);
  padding: 14px 18px; border-radius: 0 14px 14px 0; margin: 18px 0; color: var(--text-2);
  font-style: italic;
}
.article-content pre {
  background: #0f172a; color: #e2e8f0; padding: 18px; border-radius: 14px;
  overflow-x: auto; font-size: 13.5px; margin: 18px 0; box-shadow: var(--shadow-md);
}
.article-content code { font-family: "SFMono-Regular", Consolas, monospace; }
.article-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 9px 12px; }
.article-content th { background: var(--bg-soft); font-weight: 700; }

/* 资源链接（按钮网格卡片） */
.link-section { margin: 20px 0 14px; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.link-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(99,102,241,.4); }
.link-card-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  background: var(--gradient-main); color: #fff; font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.link-card-info { flex: 1 1 180px; min-width: 180px; }
.link-card-name { font-weight: 700; font-size: 14.5px; color: var(--text-1); margin-bottom: 3px; }
.link-card-url {
  font-size: 12px; color: var(--text-3); word-break: break-all; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.link-card-code {
  display: inline-block; margin-top: 5px; color: var(--warning);
  background: rgba(245,158,11,.12); font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.link-card-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }
.link-card-actions .btn { height: 32px; padding: 0 9px; font-size: 12px; }

/* 操作栏（收藏/评论/分享） */
.action-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px;
  padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.action-row .btn { min-width: 110px; height: 42px; }

/* 评论区 */
.comment-section { margin-top: 14px; }
.comment-input-wrap {
  display: flex; gap: 12px; align-items: flex-end; margin-bottom: 18px;
  background: var(--bg); border-radius: var(--radius); padding: 14px;
}
.comment-input-wrap textarea {
  flex: 1; min-height: 44px; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; line-height: 1.6; outline: none;
  resize: none; overflow: hidden; background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.comment-input-wrap textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.1); }
.comment-input-wrap .btn { height: 38px; padding: 0 16px; flex-shrink: 0; }
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; transition: box-shadow .18s;
}
.comment-item:hover { box-shadow: var(--shadow-sm); }
.comment-avatar {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-main); color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.comment-main { flex: 1; min-width: 0; }
/* 头行紧凑：昵称 + "回复 @xxx" 用极小 column-gap 紧贴成一组，时间靠 margin-left:auto 推到最右 */
.comment-head {
  display: flex; align-items: center; flex-wrap: wrap;
  column-gap: 6px; row-gap: 2px; margin-bottom: 2px; line-height: 1.4;
}
.comment-user { font-weight: 700; font-size: 13px; color: var(--text-1); word-break: break-all; }
.comment-time { color: var(--text-3); font-size: 12px; flex-shrink: 0; margin-left: auto; }
.comment-body { color: var(--text-2); font-size: 14px; line-height: 1.6; word-break: break-word; }

/* 回复列表：仅顶级评论下的第一级做一次左侧缩进（拉平处理），
   所有更深层级回复不再逐层嵌套缩进、不再有层级连接线，与一级回复平级展示 */
.comment-replies {
  margin-top: 8px; padding-left: 14px;
  border-left: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
/* 回复条目：紧凑两行式（第一行 头像+昵称+回复@xxx+时间，第二行 内容），
   无独立"回复"按钮，点击内容区即可回复 */
.comment-item--reply {
  border: none; border-radius: var(--radius);
  background: var(--bg); padding: 6px 10px; gap: 8px;
}
/* 回复折叠/展开按钮 */
.toggle-replies-row { margin-top: 4px; }
.toggle-replies-btn {
  border: none; background: none; cursor: pointer;
  color: var(--primary); font-size: 13px; font-weight: 600;
  padding: 4px 6px; border-radius: 6px; transition: all .15s;
}
.toggle-replies-btn:hover { background: var(--bg-soft); text-decoration: underline; }
.comment-item--reply .comment-avatar { width: 26px; height: 26px; font-size: 12px; }
.comment-item--reply .comment-avatar-img { object-fit: cover; }
/* 回复内容：第二行紧凑展示，光标提示可点击回复 */
.comment-item--reply .comment-body { font-size: 13.5px; line-height: 1.5; cursor: pointer; }
/* "回复 @xxx" 紧跟昵称：无额外 margin，由 .comment-head 的 column-gap 控制极小间距 */
.reply-to-label { font-size: 12px; color: var(--primary); word-break: break-all; white-space: nowrap; }
.reply-input-wrap {
  margin-top: 12px; background: var(--bg); border-radius: var(--radius);
  padding: 12px 14px;
}
.reply-input-wrap textarea {
  width: 100%; min-height: 40px; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; line-height: 1.6; outline: none;
  resize: none; overflow: hidden; background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.reply-input-wrap textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.1); }
.reply-input-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- 认证页（登录/注册/忘记密码） ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 600px at 20% 0%, #4f46e5 0%, transparent 55%),
              radial-gradient(800px 500px at 90% 100%, #d946ef 0%, transparent 50%),
              linear-gradient(135deg, #0f172a, #1e1b4b);
  padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 420px; background: rgba(255,255,255,.96);
  border-radius: var(--radius-xl); padding: 36px 32px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}
.auth-card .auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; justify-content: center; }
.auth-card .auth-brand .logo {
  width: 40px; height: 40px; border-radius: 12px; background: var(--gradient-main);
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}
.auth-card h2 { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-card .auth-sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 26px; }
.auth-card .auth-sub a { color: var(--primary); font-weight: 600; }
.auth-card .btn { width: 100%; height: 46px; font-size: 15px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-3); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-row .btn { width: auto; flex: 0 0 auto; height: 46px; padding: 0 16px; font-size: 14px; }
.code-btn {
  height: 46px; padding: 0 14px; border: 1px solid var(--primary); background: var(--bg-soft);
  color: var(--primary); border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: all .18s;
}
.code-btn:disabled { opacity: .5; cursor: not-allowed; }
.code-btn:not(:disabled):hover { background: var(--primary); color: #fff; }
.back-home { text-align: center; margin-top: 16px; }
.back-home a { color: var(--text-3); font-size: 13px; }
.back-home a:hover { color: var(--primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .site-header .header-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  /* 手机端搜索框恢复显示：换行到第二行并占满整行宽度 */
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  /* 移动端仅保留 logo 方块、隐藏品牌文字，避免与返回/登录按钮同行折叠 */
  .site-header .brand span:last-child { display: none; }
  /* 详情页返回按钮禁止压缩/换行 */
  .header-btn.back { flex-shrink: 0; white-space: nowrap; padding: 0 12px; }
  .hero-inner { padding: 44px 18px 40px; }
  .hero h1 { font-size: 26px; }
  .category-grid { grid-template-columns: 1fr; }
  .detail-header h1 { font-size: 22px; }
  .article-head h1 { font-size: 22px; }
  .notice-bar { margin-top: -18px; }
  .link-grid { grid-template-columns: 1fr; }
  .link-card { flex-wrap: wrap; }
  .link-card-actions { width: 100%; justify-content: flex-end; }
  .list-banner { padding: 20px 18px; }
  .list-title { font-size: 21px; }
  .article-card { flex-direction: column; gap: 0; }
  .article-cover { flex: none; max-width: none; width: 100%; min-height: 0; height: 150px; }
  .cover-fallback { min-height: 150px; }
  .article-card-body { padding: 16px; }
  .article-card-meta .read-more { opacity: 1; transform: none; }
  .content-card { padding: 18px 16px; }
  .action-row .btn { flex: 1; min-width: 0; }
  .page-container { padding: 20px 14px 48px; }
}

/* ---------- 分页 / 摘要 / 空文本 ---------- */
.pagination {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 28px 0 12px;
}
.pagination .page-btn, .pagination .page-info {
  min-width: 38px; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .18s;
}
.pagination .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn.active { background: var(--gradient-main); color: #fff; border-color: transparent; }
.pagination .page-info { cursor: default; }

.summary-text {
  background: var(--bg-soft); border-left: 4px solid var(--primary);
  padding: 16px 18px; border-radius: 0 12px 12px 0; color: var(--text-2); font-size: 15px; line-height: 1.8;
}
.empty-text {
  text-align: center; color: var(--text-3); font-size: 14px; padding: 18px 0;
}

/* ---------- 用户模块：头部下拉菜单 ---------- */
.header-user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .18s; position: relative;
}
.header-user-btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); }
.header-user-btn .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--gradient-main); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
}
.header-user-btn .caret { font-size: 10px; opacity: .7; transition: transform .18s; }
.header-user-btn.open .caret { transform: rotate(180deg); }
.header-user-menu-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 100;
  min-width: 208px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.14);
  padding: 6px; display: none;
}
.user-menu.open { display: block; animation: menuIn .16s ease; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.user-menu-user {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.user-menu-user .avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--gradient-main); display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.user-menu-user-name { font-weight: 700; color: var(--text-1); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-user-email { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 8px; border: none; background: transparent;
  color: var(--text-2); font-size: 14px; cursor: pointer; text-align: left; transition: background .15s;
}
.user-menu-item:hover { background: var(--bg-soft); color: var(--primary); }
.user-menu-item.quit:hover { color: #ef4444; background: rgba(239,68,68,.06); }
.user-menu-item .umi-icon { width: 20px; text-align: center; flex: none; }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 6px; }

/* ---------- 用户模块：子页面 ---------- */
.user-page-head { margin: 4px 0 20px; }
.user-page-head .list-title { font-size: 22px; margin: 0; }
.user-profile-form { max-width: 640px; }
.user-profile-form .content-card { margin-bottom: 18px; }
.user-profile-form h2 { margin-bottom: 18px; }
.field-label { display: block; font-weight: 600; color: var(--text-2); margin-bottom: 8px; font-size: 14px; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.user-profile-form .input[disabled] { background: var(--bg-soft); color: var(--text-3); cursor: not-allowed; }

/* ---------- 用户模块：我的评论 ---------- */
.user-comment-item {
  display: flex; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; margin-bottom: 12px; cursor: pointer; transition: all .18s;
}
.user-comment-item:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(99,102,241,.08); }
.user-comment-item .comment-main { flex: 1; min-width: 0; }
.comment-article { margin-top: 8px; font-size: 13px; color: var(--text-3); }
.comment-article a { color: var(--primary); font-weight: 600; }
.comment-actions { margin-top: 8px; text-align: right; }
.comment-del-btn {
  display: inline-block; border: none; background: none; cursor: pointer;
  font-size: 13px; color: #ef4444; padding: 2px 8px; border-radius: 6px;
  transition: background .2s;
}
.comment-del-btn:hover { background: rgba(239, 68, 68, .1); color: #dc2626; }

/* ===== 头像增强（真实头像图 / 评论区头像 / 资料页头像上传） ===== */
/* 头部真实头像图：填满 .avatar 圆形容器 */
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
/* 评论区头像图：覆盖 .comment-avatar 占位容器 */
.comment-avatar-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--gradient-main);
}
/* 资料页头像上传 */
.avatar-uploader {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gradient-main);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.avatar-upload-actions .input {
  width: 100%;
}

/* ---------- 用户模块：消息中心 ---------- */
/* 头部未读红点徽标（用户菜单"消息"入口） */
.msg-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 5px;
  margin-left: 6px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  text-align: center;
  vertical-align: middle;
}
.user-menu-item .msg-badge { flex: none; }

/* 消息页头部：标题 + 全部已读 */
.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.msg-read-all {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .18s;
}
.msg-read-all:hover { border-color: var(--primary); color: var(--primary); }

/* 类型标签 */
.msg-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.msg-tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .18s;
}
.msg-tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.msg-tab-btn.active {
  background: var(--gradient-main, linear-gradient(135deg, #6366f1, #8b5cf6));
  color: #fff;
  border-color: transparent;
}

/* 消息列表 */
.user-msg-list { min-height: 80px; }
.msg-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all .18s;
}
.msg-item:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(99,102,241,.08);
}
.msg-item.unread {
  background: #f5f4ff;
  border-color: rgba(99,102,241,.35);
}
.msg-item-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.msg-item.unread .msg-item-icon {
  background: rgba(99,102,241,.12);
}
.msg-item-main { flex: 1; min-width: 0; }
.msg-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.msg-item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.msg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex: none;
}
.msg-item-type {
  font-size: 11px;
  color: var(--primary);
  background: rgba(99,102,241,.1);
  padding: 2px 8px;
  border-radius: 10px;
  flex: none;
}
.msg-item-content {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  word-break: break-word;
}
.msg-item-time {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* 加载更多 */
.msg-more-wrap { text-align: center; margin: 6px 0 10px; }
.msg-load-more {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  padding: 8px 26px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .18s;
}
.msg-load-more:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 600px) {
  .msg-item { padding: 14px; }
  .msg-item-icon { width: 36px; height: 36px; font-size: 17px; }
}

/* ---------- 用户模块：邮箱通知开关 ---------- */
.notify-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background .2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .2);
}
.switch input:checked + .switch-slider {
  background: var(--gradient-main, linear-gradient(135deg, #6366f1, #8b5cf6));
}
.switch input:checked + .switch-slider::before { transform: translateX(22px); }
.auth-foot { text-align: center; margin-top: 22px; }
.auth-tip { margin: 0 0 10px; font-size: 14px; color: var(--text-3); }
.auth-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.auth-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 22px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--primary);
  background: var(--bg-soft); border: 1px solid var(--border);
  transition: all .18s;
}
.auth-link:hover { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.auth-link + .auth-link { margin-left: 0; }

