/* ============================================================
   Hongqian 工坊 · 深色科技感设计系统
   ============================================================ */
:root {
  /* 色板 */
  --bg: #070b12;
  --bg-2: #0b1120;
  --bg-3: #111a2c;
  --surface: rgba(148, 163, 184, 0.06);
  --surface-2: rgba(148, 163, 184, 0.1);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text: #e6edf7;
  --text-2: #a7b4c8;
  --text-3: #6b7a92;

  --accent: #4ade80;        /* Minecraft 绿 */
  --accent-2: #22d3ee;      /* 科技青 */
  --accent-3: #a78bfa;      /* 紫 */
  --danger: #f87171;
  --warning: #fbbf24;

  --accent-glow: rgba(74, 222, 128, 0.35);
  --accent2-glow: rgba(34, 211, 238, 0.3);

  /* 字体 */
  --font-display: 'Orbitron', 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  /* 尺寸 */
  --radius: 14px;
  --radius-sm: 9px;
  --nav-h: 64px;
  --maxw: 1200px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(74, 222, 128, 0.25), 0 0 30px rgba(74, 222, 128, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* 背景氛围：网格 + 光晕 + 噪点 */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(74, 222, 128, 0.07), transparent 55%),
    linear-gradient(180deg, #070b12 0%, #0a0f1a 50%, #070b12 100%);
}
.bg-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}
.bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(74, 222, 128, 0.06), transparent 70%);
}

/* 通用容器 */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ============ 顶部导航 ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 18, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.nav-logo .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06281a;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 0 18px var(--accent-glow);
}
.nav-logo .logo-text { font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  position: relative;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--accent); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #34d399);
  color: #052e1c;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 26px var(--accent-glow); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 9px 12px; }
.btn-danger { border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }

/* 用户菜单 */
.user-menu { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s;
}
.user-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06281a;
  font-weight: 700;
  font-size: 13px;
}
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s;
  z-index: 200;
}
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown .dd-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.dropdown .dd-name { font-weight: 600; font-size: 14px; }
.dropdown .dd-sub { color: var(--text-3); font-size: 12px; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(248, 113, 113, 0.1); }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 88px 0 60px;
  text-align: center;
  overflow: hidden;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 22px;
}
.hero-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero .sub {
  color: var(--text-2);
  font-size: clamp(15px, 2vw, 18px);
  max-width: 620px;
  margin: 0 auto 34px;
}

/* 搜索框 */
.hero-search {
  max-width: 560px;
  margin: 0 auto 26px;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: 15px 52px 15px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.8);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: all 0.25s;
}
.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15), 0 0 24px rgba(74, 222, 128, 0.1);
}
.hero-search .search-ico {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

/* 统计条 */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 44px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.stat { text-align: center; }
.stat .num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}
.stat .num em { font-style: normal; color: var(--accent); }
.stat .lbl { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* 滚动提示 */
.scroll-hint {
  margin-top: 44px;
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0.2em;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ============ 分类区块 ============ */
.section { padding: 56px 0 20px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.section-head .kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.section-head h2 { font-size: 26px; font-weight: 700; letter-spacing: 0.01em; }
.section-head .count { color: var(--text-3); font-size: 14px; }

/* 分类导航胶囊 */
.cat-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.22s;
}
.cat-tab:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.cat-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(74, 222, 128, 0.1);
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.12);
}
.cat-tab .n { font-family: var(--font-mono); font-size: 12px; opacity: 0.7; }

/* 工具卡片网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.06), rgba(148, 163, 184, 0.02));
  text-decoration: none;
  color: var(--text);
  transition: all 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at var(--mx, 50%) 0%, var(--card-glow, rgba(74,222,128,0.12)), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border, var(--accent));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--card-glow, rgba(74,222,128,0.12));
}
.tool-card:hover::before { opacity: 1; }
.tool-card .tc-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.tool-card .tc-icon {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: transform 0.3s;
}
.tool-card:hover .tc-icon { transform: scale(1.08) rotate(-3deg); }
.tool-card .tc-badges { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tool-card .tc-cat {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.12);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.tool-card .tc-dl {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.25);
  display: none;
}
.tool-card.has-dl .tc-dl { display: inline-block; }
.tool-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.tool-card .tc-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.6; flex: 1; }
.tool-card .tc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tool-card .tc-tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.tool-card .tc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.tool-card .tc-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
}
.tool-card .tc-go svg { transition: transform 0.25s; }
.tool-card:hover .tc-go svg { transform: translateX(4px); }
.tool-card .tc-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-3);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.2s;
}
.tool-card .tc-like:hover { color: var(--danger); }
.tool-card .tc-like.liked { color: var(--danger); }

/* 空状态 */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-3);
}
.empty .empty-ico { font-size: 44px; margin-bottom: 14px; opacity: 0.6; }
.empty h3 { color: var(--text-2); font-size: 17px; margin-bottom: 6px; }

/* ============ 详情页 ============ */
.detail-hero {
  padding: 52px 0 30px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.04), transparent);
}
.detail-hero .crumbs { color: var(--text-3); font-size: 13px; margin-bottom: 22px; }
.detail-hero .crumbs a { color: var(--text-3); text-decoration: none; }
.detail-hero .crumbs a:hover { color: var(--accent); }
.detail-head { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.detail-icon {
  width: 76px; height: 76px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-title { flex: 1; min-width: 240px; }
.detail-title h1 { font-size: 30px; font-weight: 700; margin-bottom: 10px; }
.detail-title .dt-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-title .dt-tag {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-actions .btn { min-width: 108px; }

.detail-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 34px;
  padding: 40px 0 60px;
}
.detail-main { min-width: 0; }
.detail-main h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 30px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-main h2::before {
  content: '';
  width: 4px; height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.detail-main p { color: var(--text-2); font-size: 15px; line-height: 1.8; }

.feature-list { list-style: none; display: grid; gap: 10px; }
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
}
.feature-list li .chk { color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* 侧栏 */
.detail-side { display: flex; flex-direction: column; gap: 16px; }
.side-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.side-card h4 {
  font-size: 13px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}
.side-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.side-row .k { color: var(--text-3); }
.side-row .v { color: var(--text); }

/* 点赞 / 收藏按钮组 */
.like-fav { display: flex; gap: 10px; }
.like-fav .btn { flex: 1; }
.like-fav .btn.liked { border-color: var(--danger); color: var(--danger); background: rgba(248, 113, 113, 0.08); }
.like-fav .btn.faved { border-color: var(--warning); color: var(--warning); background: rgba(251, 191, 36, 0.08); }

/* 相关工具 */
.related { padding: 10px 0 60px; }
.related h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* ============ 登录弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}
.modal-mask.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%;
  max-width: 430px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal-mask.open .modal { transform: translateY(0) scale(1); }
.modal .m-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.modal .m-close:hover { color: var(--text); background: var(--surface); }
.modal h3 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.modal .m-sub { color: var(--text-3); font-size: 13px; margin-bottom: 22px; }

.auth-tabs { display: flex; gap: 6px; margin-bottom: 22px; background: var(--surface); padding: 5px; border-radius: 11px; }
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active { background: var(--bg-3); color: var(--accent); font-weight: 600; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
.form-group .input-wrap { position: relative; }
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.8);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12); }
.form-group .input-wrap .btn {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 7px;
}
.form-err {
  color: var(--danger);
  font-size: 13px;
  margin: -6px 0 12px;
  min-height: 0;
}
.form-hint {
  color: var(--warning);
  font-size: 12.5px;
  margin: -4px 0 12px;
  line-height: 1.5;
}
.form-group .btn-block { width: 100%; padding: 13px; font-size: 15px; margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-3); }
.auth-switch a { color: var(--accent); cursor: pointer; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* 验证码输入格 */
.code-row { display: flex; gap: 8px; }
.code-cell {
  width: 44px; height: 48px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.8);
  color: var(--text);
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s;
}
.code-cell:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12); }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 20px;
  border-radius: 11px;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.28s;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: rgba(74, 222, 128, 0.5); }
.toast.success .t-ico { color: var(--accent); }
.toast.error { border-color: rgba(248, 113, 113, 0.5); }
.toast.error .t-ico { color: var(--danger); }
.toast.info .t-ico { color: var(--accent-2); }

/* ============ 收藏 / 发布页 ============ */
.page-head { padding: 56px 0 10px; }
.page-head .kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.page-head h1 { font-size: 32px; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: 8px; max-width: 560px; }

/* 发布页（预留） */
.coming-soon {
  text-align: center;
  padding: 90px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  margin: 40px 0 60px;
  background: var(--surface);
}
.coming-soon .cs-ico { font-size: 54px; margin-bottom: 18px; }
.coming-soon h2 { font-size: 24px; margin-bottom: 10px; }
.coming-soon p { color: var(--text-2); max-width: 420px; margin: 0 auto 24px; }

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  margin-top: 40px;
  background: rgba(7, 11, 18, 0.6);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer .f-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.footer .f-brand .logo-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06281a;
  font-size: 12px;
  font-weight: 800;
}
.footer .f-copy { color: var(--text-3); font-size: 13px; }
.footer .f-links { display: flex; gap: 18px; }
.footer .f-links a { color: var(--text-3); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer .f-links a:hover { color: var(--accent); }

/* ============ 动画 ============ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-fade { animation: fadeUp 0.55s ease both; }
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.18s; }
.d4 { animation-delay: 0.24s; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* 响应式 */
@media (max-width: 900px) {
  .detail-body { grid-template-columns: 1fr; }
  .detail-side { order: 2; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 60px 0 40px; }
  .hero-stats { gap: 26px; }
  .tool-grid { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  .code-cell { width: 38px; height: 44px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   新增组件样式：评论 / 发布 / 个人主页 / 管理后台
   ============================================================ */

/* ---------- 通用补充 ---------- */
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.8);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  resize: vertical;
  transition: all 0.2s;
}
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12); }
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 0; }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); box-shadow: 0 0 20px rgba(248, 113, 113, 0.15); }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* ---------- 评论 ---------- */
.cmt-count { color: var(--accent); font-size: 15px; vertical-align: middle; }
.cmt-form { margin: 14px 0 22px; }
.cmt-input-row { display: flex; gap: 10px; align-items: flex-end; }
.cmt-input-row textarea { flex: 1; }
.cmt-login-hint {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border: 1px dashed var(--border-strong);
  border-radius: 12px; color: var(--text-2); font-size: 14px;
}
.cmt-list { display: flex; flex-direction: column; gap: 14px; }
.cmt-loading, .cmt-empty { color: var(--text-3); font-size: 14px; padding: 18px 0; }
.cmt-item { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cmt-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(34, 211, 238, 0.25));
  color: var(--accent); font-weight: 700; font-size: 16px;
}
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cmt-name { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.cmt-name:hover { text-decoration: underline; }
.cmt-time { color: var(--text-3); font-size: 12px; }
.cmt-del { margin-left: auto; background: none; border: none; color: var(--text-3); font-size: 12px; cursor: pointer; }
.cmt-del:hover { color: var(--danger); }
.cmt-text { color: var(--text-2); font-size: 14px; line-height: 1.7; word-break: break-word; }

/* ---------- 发布页 ---------- */
.upload-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 30px 0 60px; align-items: start; }
.upload-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; background: var(--surface); }
.up-type { display: flex; gap: 8px; margin-bottom: 20px; }
.up-type-btn {
  flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-2); font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.up-type-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(74, 222, 128, 0.08); }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-2); font-size: 18px; cursor: pointer; transition: all 0.15s;
}
.emoji-btn:hover { transform: scale(1.08); }
.emoji-btn.sel { border-color: var(--accent); background: rgba(74, 222, 128, 0.12); box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2); }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; transition: all 0.15s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }
.upload-mine { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--surface); }
.upload-mine h3 { font-size: 16px; margin-bottom: 16px; }
.mine-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mine-item:last-child { border-bottom: none; }
.mi-icon { font-size: 22px; }
.mi-info { flex: 1; min-width: 0; }
.mi-name { font-weight: 600; font-size: 14px; }
.mi-type { font-size: 11px; color: var(--accent); border: 1px solid rgba(74, 222, 128, 0.3); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.mi-type.removed { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.mi-meta { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.mi-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- 个人主页 ---------- */
.profile-hero { padding: 50px 0 10px; }
.profile-card {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; background: var(--surface); position: relative; overflow: hidden;
}
.profile-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 200px at 20% 0%, rgba(74, 222, 128, 0.08), transparent);
}
.pf-avatar {
  width: 84px; height: 84px; border-radius: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800; color: #07130b;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.3);
}
.pf-info { flex: 1; min-width: 220px; position: relative; }
.pf-name { font-size: 24px; font-weight: 700; }
.pf-admin { font-size: 12px; color: #07130b; background: var(--warning); border-radius: 6px; padding: 2px 8px; margin-left: 8px; vertical-align: 3px; }
.pf-uid { color: var(--text-3); font-size: 13px; margin-top: 4px; font-family: var(--font-mono); }
.pf-bio { color: var(--text-2); font-size: 14px; margin-top: 10px; }
.pf-meta { color: var(--text-3); font-size: 12px; margin-top: 10px; }
.pf-edit { display: flex; gap: 8px; margin-top: 12px; }
.pf-edit input {
  flex: 1; max-width: 320px; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: 13px; outline: none;
}
.pf-edit input:focus { border-color: var(--accent); }
.profile-items { padding: 30px 0 60px; }

/* ---------- 管理后台 ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.astat {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  background: var(--surface); text-align: center;
}
.astat .num { font-size: 30px; font-weight: 800; color: var(--accent); font-family: var(--font-display); }
.astat .lbl { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.admin-tab {
  padding: 9px 20px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-2); font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.admin-tab.active { border-color: var(--accent); color: var(--accent); background: rgba(74, 222, 128, 0.08); }
.admin-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px 18px; margin-bottom: 60px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.admin-row:last-child { border-bottom: none; }
.role-select {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: 13px; outline: none; cursor: pointer;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .upload-wrap { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .profile-card { flex-direction: column; text-align: center; }
  .pf-edit { justify-content: center; }
}

/* ---------- 头像图片 ---------- */
.user-avatar.img {
  object-fit: cover; width: 30px; height: 30px;
  border-radius: 50%; display: block;
}
.dropdown .dd-head { display: flex; align-items: center; gap: 10px; }
.dropdown .dd-head .user-avatar.img { width: 36px; height: 36px; }

/* 个人主页头像上传 */
.pf-avatar-wrap { position: relative; flex-shrink: 0; }
.pf-avatar.img {
  object-fit: cover; width: 84px; height: 84px;
  border-radius: 22px; display: block;
}
.pf-avatar-edit {
  position: absolute; right: -6px; bottom: -6px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--bg-2); background: var(--accent);
  color: #07130b; font-size: 14px; cursor: pointer;
  display: grid; place-items: center; transition: transform 0.15s;
}
.pf-avatar-edit:hover { transform: scale(1.12); }
.pf-avatar-hint {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 10px; color: var(--text-3);
  margin-top: 6px; pointer-events: none;
}

/* 管理后台头像状态标签 */
.av-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 5px; font-size: 11px; }
.av-tag.ok { background: rgba(74, 222, 128, 0.15); color: var(--accent); }
.av-tag.off { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.mi-actions { display: flex; gap: 8px; align-items: center; }
