:root {
  --brand: #ff6b4a;
  --brand-2: #ff9a5a;
  --brand-soft: #ffe3d6;
  --ink: #2d2a3a;
  --muted: #8a8798;
  --bg: #fff7f0;
  --card: #ffffff;
  --line: #f0e4da;
  --good: #34b27b;
  --shadow: 0 10px 30px rgba(255, 107, 74, 0.10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -10%, #ffe9dc 0%, transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255, 247, 240, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(255, 107, 74, 0.4);
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-name em { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.topbar-stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.topbar-stats b { color: var(--brand); font-size: 15px; }

/* ---------- 布局 ---------- */
main { max-width: 960px; margin: 0 auto; padding: 8px 20px 80px; }
.view[hidden] { display: none; }

/* ---------- 视图切换动画 ---------- */
.view {
  animation: viewIn .4s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 首页内容错落入场 */
.hero > * {
  animation: itemIn .5s cubic-bezier(.22, .61, .36, 1) both;
}
.hero > *:nth-child(1) { animation-delay: .05s; }
.hero > *:nth-child(2) { animation-delay: .12s; }
.hero > *:nth-child(3) { animation-delay: .2s; }
.hero > *:nth-child(4) { animation-delay: .28s; }

.stat-card {
  animation: itemIn .5s cubic-bezier(.22, .61, .36, 1) both;
}
.stats-row .stat-card:nth-child(1) { animation-delay: .05s; }
.stats-row .stat-card:nth-child(2) { animation-delay: .15s; }
.stats-row .stat-card:nth-child(3) { animation-delay: .25s; }

@keyframes itemIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 尊重系统「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  .view, .hero > *, .stat-card { animation: none; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 48px 12px 36px; }
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600;
}
.hero h1 { font-size: 46px; line-height: 1.15; margin: 18px 0 14px; letter-spacing: -1px; }
.hero .hl {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; cursor: pointer; font-size: 16px; font-weight: 600;
  padding: 13px 26px; border-radius: 999px; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 8px 20px rgba(255, 107, 74, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(255, 107, 74, 0.45); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; margin-top: 6px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- 统计条 ---------- */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 40px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  text-align: center; box-shadow: var(--shadow); border: 1px solid #fff;
}
.stat-card b { display: block; font-size: 30px; color: var(--brand); font-weight: 800; }
.stat-card span { color: var(--muted); font-size: 13px; }

/* ---------- 区块标题 ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 2px 16px; }
.section-head h2 { font-size: 20px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 接力列表 ---------- */
.chain-list { column-count: 2; column-gap: 14px; }
.chain-card {
  break-inside: avoid;
  margin-bottom: 14px;
  background: var(--card); border-radius: var(--radius); padding: 18px;
  cursor: pointer; border: 1.5px solid #fff; transition: transform .12s, border-color .12s, box-shadow .12s;
  box-shadow: var(--shadow);
}
.chain-card:hover { transform: translateY(-3px); border-color: var(--brand-2); }
.chain-card h3 { margin: 0 0 8px; font-size: 17px; }
.chain-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.chain-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.chain-meta .count { color: var(--good); font-weight: 700; }
.chain-meta .code { font-family: ui-monospace, monospace; background: var(--brand-soft); color: var(--brand); padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- 页面头 ---------- */
.page-head { display: flex; align-items: center; gap: 14px; padding: 20px 4px; }
.page-head h1 { font-size: 24px; margin: 0; }
.back {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-size: 14px; color: var(--ink);
}
.back:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 卡片与表单 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); border: 1px solid #fff; margin-bottom: 16px;
}
.form-card label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.form-card label:first-child { margin-top: 0; }
.form-card input, .form-card textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; color: var(--ink);
  transition: border-color .12s; resize: vertical;
}
.form-card input:focus, .form-card textarea:focus {
  outline: none; border-color: var(--brand);
}
.req { color: var(--brand); }

/* ---------- 接力码 ---------- */
.code-panel { text-align: center; }
.big-code {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 52px; font-weight: 800;
  letter-spacing: 8px; color: var(--brand); margin: 8px 0;
}
.code-title { font-size: 16px; font-weight: 600; margin: 0 0 18px; }
.row-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 心情选择 ---------- */
.mood-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-picker .mood {
  width: 44px; height: 44px; font-size: 22px; border-radius: 12px;
  background: var(--bg); border: 2px solid transparent; cursor: pointer;
  display: grid; place-items: center; transition: border-color .12s, transform .12s;
}
.mood-picker .mood:hover { transform: scale(1.1); }
.mood-picker .mood.active { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- 接力方向选择 ---------- */
.type-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.type-picker .type-opt {
  flex: 1; min-width: 92px; padding: 10px 12px; text-align: center;
  border-radius: 12px; border: 2px solid transparent;
  background: var(--bg); cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--muted); transition: all .12s;
}
.type-picker .type-opt:hover { transform: scale(1.03); }
.type-picker .type-opt.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* 接力节点方向标签 */
.node-type {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}

/* ---------- 善链可视化 ---------- */
.chain-head { text-align: center; padding: 8px 0 4px; }
.chain-head h2 { font-size: 24px; margin: 0 0 8px; }
.chain-head .desc { color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.6; }
.chain-head .code-chip {
  display: inline-block; margin-top: 12px; font-family: ui-monospace, monospace;
  background: var(--brand-soft); color: var(--brand); padding: 6px 16px; border-radius: 999px; font-weight: 700;
}

/* 详情页「我关心」 */
.support-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap; margin: 14px 0 2px;
}
.support-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 18px; font-family: inherit; font-size: 14px; color: var(--ink);
  cursor: pointer; transition: border-color .18s, background .18s, color .18s, transform .12s;
}
.support-btn:hover { border-color: var(--brand); color: var(--brand); }
.support-btn:active { transform: scale(.96); }
.support-btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.support-heart { font-size: 15px; line-height: 1; }
.support-btn.on .support-heart { animation: heartPop .36s ease; }
@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.support-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-avatars { display: flex; }
.sp-avatar {
  width: 24px; height: 24px; border-radius: 50%; margin-left: -6px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #ffb199, #ff8a65);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.support-avatars .sp-avatar:first-child { margin-left: 0; }
.sp-avatar.anon { background: var(--brand-soft); color: var(--brand); }
.support-names { font-size: 13px; color: var(--muted); }

.chain-timeline { position: relative; padding: 24px 0 8px; }
.chain-timeline::before {
  content: ""; position: absolute; left: 27px; top: 40px; bottom: 40px; width: 3px;
  background: linear-gradient(var(--brand-2), var(--brand)); border-radius: 2px;
}
.chain-node { display: flex; gap: 16px; position: relative; padding: 12px 0; }
.chain-node .dot {
  width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px; z-index: 1;
  background: #fff; border: 3px solid var(--brand-2);
}
.chain-node.creator .dot { border-color: var(--good); }
.chain-node.me .dot { box-shadow: 0 0 0 5px var(--brand-soft); border-color: var(--brand); }
.chain-node .body {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; flex: 1;
}
.chain-node .body .who { font-weight: 700; font-size: 15px; }
.chain-node .body .role { font-size: 12px; color: var(--muted); margin-left: 8px; }
.chain-node .body .deed { margin: 6px 0 8px; color: #555; line-height: 1.6; }
.chain-node .body .time { font-size: 12px; color: var(--muted); }
.badge-me {
  display: inline-block; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-left: 8px;
}

/* ---------- 节点评论 ---------- */
.node-comments { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.comment-list:empty { display: none; }
.comment-item {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  font-size: 13px; line-height: 1.6; padding: 3px 0;
}
.comment-author { font-weight: 700; }
.comment-author::after { content: "："; }
.comment-text { color: #555; flex: 1; min-width: 0; word-break: break-word; }
.comment-time { font-size: 11px; color: var(--muted); }
.comment-toggle {
  margin-top: 4px; padding: 4px 0; border: none; background: none;
  color: var(--brand); font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.comment-toggle:hover { text-decoration: underline; }
.comment-composer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.comment-composer[hidden] { display: none; }
.comment-composer input {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-family: inherit; font-size: 13px; color: var(--ink);
  outline: none; min-width: 0;
}
.comment-composer input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.comment-name { width: 100px; flex: none; }
.comment-text-input { flex: 1; min-width: 140px; }
.comment-send { flex: none; padding: 8px 16px; font-size: 13px; }

/* ---------- 分享卡片 ---------- */
.share-card {
  border-radius: 20px; padding: 22px; color: #fff; text-align: center;
  background: linear-gradient(140deg, #ff7a4a, #ff4d79);
  box-shadow: 0 16px 40px rgba(255, 77, 121, .35);
  position: relative; overflow: hidden;
}
.share-card::after {
  content: "🤝"; position: absolute; right: -12px; bottom: -18px; font-size: 110px; opacity: .14;
}
.share-card .sc-brand { font-size: 13px; letter-spacing: 2px; opacity: .9; }
.share-card .sc-title { font-size: 22px; font-weight: 800; margin: 10px 0 4px; }
.share-card .sc-desc { font-size: 13px; opacity: .92; min-height: 18px; }
.share-card .sc-code {
  display: inline-block; font-family: ui-monospace, monospace; font-size: 34px; font-weight: 800;
  letter-spacing: 5px; background: rgba(255,255,255,.2); padding: 8px 22px; border-radius: 14px; margin: 14px 0 8px;
}
.share-card .sc-count { font-size: 13px; opacity: .95; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 账号区 ---------- */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.account-menu-wrap { position: relative; }
.account-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--ink); font-family: inherit; cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.account-trigger:hover,
.account-trigger.open {
  background: #fff; border-color: var(--line);
  box-shadow: 0 6px 18px rgba(255, 107, 74, .12);
}
.account-trigger:focus-visible,
.acct-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.account-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.account-name {
  font-size: 14px; font-weight: 600; max-width: 96px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-caret { font-size: 10px; color: var(--muted); transition: transform .18s; }
.account-trigger.open .account-caret { transform: rotate(180deg); }

.account-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 232px; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(45, 42, 58, .16);
  padding: 6px; transform-origin: top right;
  animation: acctIn .18s cubic-bezier(.22, .61, .36, 1) both;
}
.account-dropdown[hidden] { display: none; }
@keyframes acctIn {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.acct-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; }
.acct-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 700;
}
.acct-meta { min-width: 0; }
.acct-nick {
  font-size: 14px; font-weight: 700; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-username {
  font-size: 12px; color: var(--muted); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-divider { height: 1px; background: var(--line); margin: 0 8px 6px; }
.acct-item {
  display: block; width: 100%; padding: 10px; border: none; border-radius: 10px;
  background: transparent; color: var(--ink); font-family: inherit; font-size: 14px;
  text-align: left; cursor: pointer; transition: background .15s, color .15s;
}
.acct-item:hover { background: var(--brand-soft); color: var(--brand); }
.account-login-btn {
  border: none; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40, 20, 10, .4);
  display: grid; place-items: center; z-index: 50; backdrop-filter: blur(4px);
}
.modal-mask[hidden] { display: none; }
.modal {
  position: relative; width: 360px; max-width: 92vw;
  background: #fff; border-radius: 20px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}
.modal-close {
  position: absolute; top: 12px; right: 16px; border: none; background: none;
  font-size: 26px; color: var(--muted); cursor: pointer; line-height: 1;
}
.modal-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.modal-tabs button {
  flex: 1; border: none; background: var(--bg); padding: 10px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; color: var(--muted);
}
.modal-tabs button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
}
.auth-form label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.auth-form input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font-size: 15px; font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--brand); }
.auth-form .btn-block { margin-top: 20px; }

/* ---------- 管理端 ---------- */
#admin-stats { grid-template-columns: repeat(4, 1fr); }
.admin-tabs { display: flex; gap: 8px; align-items: center; margin: 8px 0 16px; }
.admin-tabs button[data-atab] {
  border: none; background: var(--bg); padding: 10px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted);
}
.admin-tabs button.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.admin-logout {
  margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 16px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.admin-logout:hover { color: var(--brand); border-color: var(--brand); }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
  padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.admin-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .op-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 5px 10px; font-size: 12px; cursor: pointer; margin-right: 6px; color: var(--ink);
}
.admin-table .op-btn:hover { border-color: var(--brand); color: var(--brand); }
.admin-table .op-btn.danger:hover { border-color: #e5484d; color: #e5484d; }
.admin-table .code-cell { font-family: ui-monospace, monospace; font-weight: 700; color: var(--brand); }
.admin-table .code-cell[data-view] { cursor: pointer; }
.admin-table .code-cell[data-view]:hover { text-decoration: underline; }
.admin-table .comment-cell {
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 评论表列多，固定列宽避免把「操作」列挤到可视区外 */
#comments-table { table-layout: fixed; }
#comments-table th:nth-child(1) { width: 40px; }
#comments-table th:nth-child(3) { width: 84px; }
#comments-table th:nth-child(4) { width: 112px; }
#comments-table th:nth-child(5) { width: 104px; }
#comments-table th:nth-child(6) { width: 62px; }
.admin-empty { text-align: center; color: var(--muted); padding: 20px; }

/* ---------- 地图 / 位置 ---------- */
.loc-row { display: flex; gap: 8px; }
.loc-row input { flex: 1; min-width: 0; }
.btn-sm { padding: 10px 14px; font-size: 14px; }
.loc-map {
  height: 240px; border-radius: 14px; overflow: hidden;
  margin-top: 10px; border: 1.5px solid var(--line);
}
.loc-tip { margin: 8px 0 0; font-size: 13px; }
.loc-preview { margin: 16px 0 0; }
.loc-preview-map {
  height: 260px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
}
.loc-preview .muted { margin: 8px 2px 0; }
.loc-line { margin: 0 0 10px; color: var(--muted); font-size: 13px; }

/* ---------- 图片上传 ---------- */
.img-preview { position: relative; margin-top: 12px; display: inline-block; }
.img-preview img {
  max-width: 220px; max-height: 160px; border-radius: 12px;
  border: 1px solid var(--line); display: block; object-fit: cover;
}
.img-remove {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px;
  border-radius: 50%; border: none; background: var(--ink); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.img-remove:hover { background: #e5484d; }
.chain-img { width: 100%; height: 200px; object-fit: cover; display: block; border-radius: 12px; margin-bottom: 10px; }
.chain-img-preview { width: 100%; border-radius: 14px; margin-top: 4px; max-height: 360px; object-fit: cover; }

/* 发起页多图预览网格 */
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.img-item { position: relative; width: 92px; height: 92px; }
.img-item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); display: block;
}

/* 详情页图片网格 */
.chain-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.chain-img-item { width: 120px; height: 120px; cursor: zoom-in; }
.chain-img-item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line); display: block;
}
.chain-img-item img:hover { opacity: .9; }

/* 图片灯箱 */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .88); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; top: 20px; right: 24px; width: 42px; height: 42px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .2);
  color: #fff; font-size: 26px; cursor: pointer; line-height: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .35); }

@media (max-width: 640px) {
  .hero h1 { font-size: 34px; }
  .chain-list { column-count: 1; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #admin-stats { grid-template-columns: repeat(2, 1fr); }
  .big-code { font-size: 40px; letter-spacing: 5px; }
}

/* 小屏：顶栏只留头像，账号信息收进下拉菜单 */
@media (max-width: 520px) {
  .topbar { padding: 12px 14px; }
  .topbar-stats { display: none; }
  .account-name { display: none; }
  .account-trigger { padding-right: 8px; }
}
