/* ============================================================
   我的小站 · 样式
   ============================================================ */

:root {
  --bg: #0b0e14;
  --bg-soft: #0f141d;
  --card: #151b26;
  --card-hover: #1a2230;
  --border: #243044;
  --text: #e7edf7;
  --muted: #93a0b5;
  --accent: #6ea8fe;
  --accent-2: #a78bfa;
  --danger: #ff6b81;
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(110, 168, 254, 0.16), transparent 60%),
    radial-gradient(900px 520px at 108% 8%, rgba(167, 139, 250, 0.14), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(110, 168, 254, 0.35);
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease;
  background: var(--card);
  color: var(--text);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  background: linear-gradient(135deg, #6ea8fe, #8f7bff);
  color: #08101f;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: #33415c;
  background: var(--card-hover);
}

.btn-danger {
  background: rgba(255, 107, 129, 0.14);
  border-color: rgba(255, 107, 129, 0.35);
  color: #ff9aa8;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 107, 129, 0.22);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

/* ---------------- 表单 ---------------- */

.input,
.textarea {
  width: 100%;
  background: #0f141d;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: 0.18s ease;
}

.input:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.15);
}

.textarea {
  resize: vertical;
  line-height: 1.7;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field {
  margin-bottom: 14px;
}

.form-feedback {
  min-height: 20px;
  margin: 4px 0 10px;
  font-size: 13px;
  color: var(--danger);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

/* ---------------- 标签页 ---------------- */

.tabs {
  display: flex;
  gap: 6px;
  background: #0f141d;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: 0.18s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* ---------------- 顶栏 ---------------- */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px clamp(16px, 4vw, 40px);
  background: rgba(11, 14, 20, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0e14;
  font-size: 16px;
  flex: none;
}

.brand-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: 0.18s ease;
}

.nav-link:hover {
  background: var(--card-hover);
  color: var(--text);
}

.nav-link.is-active {
  background: rgba(110, 168, 254, 0.14);
  color: var(--accent);
}

.userbox {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 14px;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(110, 168, 254, 0.3), rgba(167, 139, 250, 0.3));
  color: #cfe0ff;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

/* ---------------- 主体 ---------------- */

.main {
  flex: 1;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 24px) 64px;
}

.footer {
  padding: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head h2 {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.page-head p {
  margin: 0;
}

/* ---------------- 公告 / 提示 ---------------- */

.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  color: #f5d489;
  font-size: 14px;
  line-height: 1.6;
}

.notice-banner .notice-icon {
  flex: none;
}

/* ---------------- 帖子 ---------------- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.18s ease;
}

.post-card:hover {
  background: var(--card-hover);
  border-color: #31415c;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.post-card.is-pinned {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.07), var(--card) 60%);
}

.post-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.post-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.post-badges {
  display: flex;
  gap: 6px;
  flex: none;
  padding-top: 4px;
}

.post-preview {
  margin: 0 0 12px;
  color: #b8c3d6;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.post-meta .meta-name {
  color: #b8c3d6;
  font-weight: 600;
}

.dot {
  opacity: 0.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-pin {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
}

.badge-lock {
  background: rgba(147, 160, 181, 0.14);
  color: #aab6c9;
}

.badge-admin {
  background: rgba(110, 168, 254, 0.14);
  color: #8db9ff;
}

.badge-good {
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
}

.badge-bad {
  background: rgba(255, 107, 129, 0.14);
  color: #ff9aa8;
}

.badge-mute {
  background: rgba(147, 160, 181, 0.12);
  color: var(--muted);
}

/* ---------------- 帖子详情 ---------------- */

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  color: var(--text);
}

.post-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
}

.post-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.post-detail h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.post-content {
  margin: 18px 0 22px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dbe4f2;
  font-size: 15.5px;
  line-height: 1.85;
}

.post-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------------- 评论 ---------------- */

.comments {
  margin-top: 22px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 17px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment {
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--border);
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.comment-head .meta-name {
  color: #c3cdde;
  font-weight: 600;
}

.comment-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  color: #d6dfee;
}

.comment-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.comment-form {
  margin-top: 16px;
}

.comment-form .textarea {
  margin-bottom: 10px;
}

.form-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------------- 留言板 ---------------- */

.message-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 22px;
}

.message-form .textarea {
  margin-bottom: 10px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-card {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}

.message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.message-head .meta-name {
  color: #c3cdde;
  font-weight: 600;
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  color: #d6dfee;
}

.message-foot {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

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

.admin-body {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.panel {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
}

.panel .section-title {
  margin-bottom: 12px;
}

.panel-form .field:last-of-type {
  margin-bottom: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.url-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.url-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 13.5px;
}

.url-list code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  color: #a9c8ff;
  word-break: break-all;
}

.code-highlight {
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(110, 168, 254, 0.14), rgba(167, 139, 250, 0.12));
  border: 1px solid rgba(110, 168, 254, 0.36);
}

.code-highlight-title {
  font-size: 13px;
  color: #bcd2ff;
  margin-bottom: 8px;
}

.code-value {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #eaf2ff;
  word-break: break-all;
  margin-bottom: 14px;
}

.code-highlight-actions {
  display: flex;
  gap: 8px;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.code-row-main {
  flex: 1;
  min-width: 200px;
}

.code-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.code-row-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.code-row-actions {
  display: flex;
  gap: 6px;
}

/* ---------------- 空状态 ---------------- */

.empty {
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(21, 27, 38, 0.5);
}

.empty-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

/* ---------------- 弹窗 ---------------- */

.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-form {
  padding: 24px;
}

.dialog-title {
  margin: 0 0 16px;
  font-size: 19px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.dialog .muted {
  margin-bottom: 4px;
}

/* ---------------- 轻提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  padding: 11px 20px;
  border-radius: 12px;
  background: #1d2635;
  border: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-success {
  border-color: rgba(52, 211, 153, 0.4);
  color: #b8f5dd;
}

.toast-error {
  border-color: rgba(255, 107, 129, 0.4);
  color: #ffc3cb;
}

/* ---------------- 进入页 ---------------- */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  position: relative;
  overflow: hidden;
}

.gate::before,
.gate::after {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.32;
  pointer-events: none;
}

.gate::before {
  background: #2f6bd8;
  top: -240px;
  left: -170px;
}

.gate::after {
  background: #6d4bd8;
  bottom: -260px;
  right: -150px;
}

.gate-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: rgba(21, 27, 38, 0.84);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.gate-brand {
  text-align: center;
  margin-bottom: 22px;
}

.gate-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a1020;
  box-shadow: 0 10px 26px rgba(110, 168, 254, 0.28);
}

.gate-brand h1 {
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.gate-brand p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.gate-form {
  margin-top: 18px;
}

.gate-hint {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.gate-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0f141d;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

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

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }

  .brand-name {
    max-width: 120px;
  }

  .nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 2px;
  }

  .nav-link {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    font-size: 13px;
  }

  .userbox {
    gap: 8px;
  }

  .user-name {
    max-width: 80px;
    font-size: 13px;
  }

  .main {
    padding-top: 20px;
  }

  .page-head {
    align-items: center;
  }

  .page-head h2 {
    font-size: 21px;
  }

  .post-detail {
    padding: 20px 18px;
  }

  .post-detail h1 {
    font-size: 21px;
  }

  .gate-card {
    padding: 26px 20px;
  }
}

/* ---------------- 扩展页面 / 数据备份 ---------------- */

.ext-frame {
  width: 100%;
  min-height: 78vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: block;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.hidden-file {
  display: none;
}

.data-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.data-info code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  color: #a9c8ff;
  word-break: break-all;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.backup-name {
  flex: 1;
  min-width: 180px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: #cfe0ff;
  word-break: break-all;
}

.ext-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ext-card {
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.ext-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ext-id {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  background: #0f141d;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
}

.ext-card p {
  margin: 6px 0 8px;
}

.ext-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ============================================================
   v2.0 新增：头像 / 用户 / 图片 / IP / 邀请 / 指南
   ============================================================ */

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.avatar-xl {
  width: 76px;
  height: 76px;
  font-size: 28px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 10px;
}

.user-chip:hover {
  background: var(--card-hover);
}

.ip-loc {
  color: #8fb3d9;
}

/* 图片 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 6px 0 12px;
}

.image-link {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  aspect-ratio: 4 / 3;
}

.image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-grid.editable {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.image-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 15px;
}

/* 注册头像 */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-upload-field .avatar {
  width: 54px;
  height: 54px;
}

/* 个人中心 */
.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 管理后台 tab 换行 */
.admin-tabs {
  flex-wrap: wrap;
}

.admin-tabs .tab {
  flex: 1 1 auto;
  min-width: 84px;
}

/* 用户列表 */
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.user-row:last-child {
  border-bottom: 0;
}

.user-row.is-disabled {
  opacity: 0.55;
}

.user-main {
  flex: 1;
  min-width: 200px;
}

.user-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 邀请码 */
.invite-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* IP 记录 */
.ip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ip-row {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.ip-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.ip-row-body {
  margin: 5px 0;
  font-size: 13.5px;
  color: #d6dfee;
  word-break: break-word;
}

.ip-row-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.ip-row-foot code {
  color: #a9c8ff;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* 密钥展示 */
.secret-box {
  padding: 14px;
  margin: 10px 0;
  border-radius: 12px;
  background: #0f141d;
  border: 1px solid rgba(110, 168, 254, 0.4);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: clamp(16px, 3vw, 22px);
  letter-spacing: 0.08em;
  color: #cfe0ff;
  word-break: break-all;
  text-align: center;
}

/* 指南 */
.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.guide-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-editor {
  min-height: 300px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.guide-editor-form {
  max-height: 85vh;
  overflow-y: auto;
}

.guide-category {
  margin: 18px 0 8px;
  font-size: 14px;
  color: var(--muted);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.guide-card {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-card:hover,
.guide-card.is-active {
  border-color: var(--accent);
  background: var(--card-hover);
}

.guide-view {
  margin-top: 18px;
}

/* Markdown 渲染 */
.md {
  font-size: 14.5px;
  line-height: 1.8;
  color: #dbe4f2;
  word-break: break-word;
}

.md h2,
.md h3,
.md h4,
.md h5,
.md h6 {
  margin: 18px 0 8px;
  color: var(--text);
}

.md h2 {
  font-size: 20px;
}

.md h3 {
  font-size: 17px;
}

.md p {
  margin: 8px 0;
}

.md ul,
.md ol {
  margin: 8px 0;
  padding-left: 24px;
}

.md li {
  margin: 3px 0;
}

.md blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 6px;
  color: var(--muted);
}

.md-code {
  background: #0f141d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

.md code {
  background: #0f141d;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13.5px;
}

.md-table th,
.md-table td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}

.md-table th {
  background: var(--bg-soft);
}

.md hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.small {
  font-size: 12.5px;
}

/* ============================================================
   v2.1：成员 / 私聊 / 社区数据库 / 审核通知
   ============================================================ */

.nav-badge {
  display: none;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  vertical-align: top;
}

.nav-badge.is-on {
  display: inline-block;
}

.online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.online .dot-ico {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b6577;
}

.online.is-online {
  color: #34d399;
}

.online.is-online .dot-ico {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.member-search-panel {
  padding: 14px;
}

.member-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-search-row .search-icon {
  font-size: 15px;
  opacity: 0.7;
}

.member-search-row .input {
  border: 0;
  background: transparent;
}

.member-search-row .input:focus {
  box-shadow: none;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.member-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.member-main {
  flex: 1;
  min-width: 200px;
}

.member-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
}

.member-meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.member-bio {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: #c3cdde;
  white-space: pre-wrap;
  word-break: break-word;
}

.member-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.tag-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(110, 168, 254, 0.12);
  border: 1px solid rgba(110, 168, 254, 0.24);
  color: #9cc2ff;
  font-size: 11.5px;
}

.member-profile {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.member-profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.member-profile-head .avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.birthday-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(255, 107, 129, 0.12));
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #ffe1a6;
  font-size: 14px;
  flex-wrap: wrap;
}

/* 私聊 */
.chat-threads {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-thread {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.chat-thread:hover {
  background: var(--card-hover);
}

.chat-thread-main {
  flex: 1;
  min-width: 160px;
}

.chat-thread-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-thread-last {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11.5px;
  line-height: 18px;
  text-align: center;
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.chat-head-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.chat-messages {
  min-height: 320px;
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 2px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.chat-msg.is-mine {
  align-items: flex-end;
}

.chat-bubble {
  max-width: 76%;
  padding: 9px 13px;
  border-radius: 14px;
  background: #1b2330;
  border: 1px solid var(--border);
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg.is-mine .chat-bubble {
  background: linear-gradient(135deg, #3d6fd0, #6b57d6);
  border-color: transparent;
  color: #f3f7ff;
}

.chat-time {
  font-size: 11px;
  color: var(--muted);
}

.chat-form {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* 社区数据库 */
.db-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.db-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  align-items: flex-start;
}

.db-card:hover {
  background: var(--card-hover);
}

.db-card-cover {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.db-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.db-card-main {
  flex: 1;
  min-width: 0;
}

.db-card-main h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.db-card-preview {
  margin: 0 0 8px;
  color: #b8c3d6;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.db-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.db-entry {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.db-entry-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.db-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.85;
  color: #dbe4f2;
  font-size: 15px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.vote-row {
  display: flex;
  gap: 8px;
}

/* 审核 / 通知 */
.application-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.application-row:last-child {
  border-bottom: 0;
}

.notification-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.notification-row:last-child {
  border-bottom: 0;
}

.notification-row.is-read {
  opacity: 0.55;
}

.form-feedback.is-success {
  color: var(--success);
}

/* 首页 */
.home-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 18px;
  border-radius: 20px;
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(110, 168, 254, 0.18), transparent 70%),
    radial-gradient(520px 220px at 100% 100%, rgba(167, 139, 250, 0.16), transparent 70%),
    var(--card);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.home-hero-main {
  flex: 1;
  min-width: 260px;
}

.home-hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 10px;
  align-content: center;
}

.home-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(11, 14, 20, 0.5);
  border: 1px solid var(--border);
  text-align: center;
}

.home-guide {
  margin-bottom: 18px;
}

.home-placeholders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.home-placeholder {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(21, 27, 38, 0.4);
}




