Back to mini-nostr-saf
SOURCE / PINNED RELEASE

Made of little things.

mini-nostr-saf

Release
72c0506a4a1b…
Author-recorded commit
cec3876ccbdc…
License
LICENSE
Author’s source reference
nostr://npub1whs094x2p7qshzqn77uwm0kx0826f8xdad5ppqet7w9jr6ay5scs99c7wj/wss%3A%2F%2Fgit.napplet.soy%2F/n-599618f6842

Archive hash verified: e3147c802508002b…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

src/theme.css
@import "tailwindcss";

@theme {
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
}

:root {
  color-scheme: light dark;
  --bg: #eef3ef;
  --surface: #f9fcfa;
  --surface-raised: #ffffff;
  --text: #101512;
  --dim: #68776e;
  --border: #cdd7d0;
  --accent: #08734d;
  --accent-soft: #d2f3e2;
  --danger: #c4433b;
  --warning: #8a5b00;
  --radius: 14px;
  /* 自动网格窄屏变量的默认值(运行时由 JS 按舞台实测宽度覆盖): */
  --auto-card-h: 340px;
  --auto-scale: 1;
  --space-surface: var(--surface);
  --space-surface-alt: var(--surface-raised);
  --space-muted: var(--dim);
  --space-border: var(--border);
  --space-accent: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d0c;
    --surface: #111613;
    --surface-raised: #151a18;
    --text: #e8eee9;
    --dim: #8a9b91;
    --border: #29322d;
    --accent: #55e6a5;
    --accent-soft: #17382a;
    --danger: #ff7d6e;
    --warning: #f2c46f;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Aptos, "Noto Sans SC", system-ui, sans-serif; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell { min-height: 100vh; background: var(--bg); }
.utility-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 58px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
}
.relay-summary, .identity-button, .icon-button, .compose-button, .empty-state button, .publish-button {
  border: 0;
  cursor: pointer;
}
.relay-summary {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  padding: 9px 4px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.signal { width: 9px; height: 9px; border-radius: 999px; background: var(--dim); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dim) 12%, transparent); flex: 0 0 auto; }
.signal-live { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.utility-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: transparent; }
.icon-button.active { background: var(--surface); color: var(--accent); }
.icon-button:active { background: var(--surface); }
.identity-button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--dim); }
.identity-button span { display: none; font: 600 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }

.feed-column { width: min(100%, 720px); margin: 0 auto; padding: 26px 16px 110px; }
.feed-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-index { margin: 0 0 5px; color: var(--accent); font: 700 11px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .12em; }
h1, h2 { margin: 0; letter-spacing: -.04em; }
h1 { font-size: clamp(30px, 9vw, 46px); line-height: .98; font-weight: 720; }
h2 { font-size: 24px; line-height: 1.08; }
.compose-button { display: none; align-items: center; gap: 8px; padding: 11px 15px; border-radius: 10px; background: var(--accent); color: var(--bg); font-weight: 750; }

.inline-notice, .publish-strip { margin-bottom: 14px; padding: 11px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--dim); font-size: 13px; }
.inline-notice.warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.publish-strip { display: flex; flex-wrap: wrap; gap: 8px 13px; align-items: center; }
.publish-strip > span:first-child { font: 700 11px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; color: var(--dim); }
.publish-strip strong { color: var(--accent); }

.empty-state { min-height: 48vh; display: grid; justify-items: start; align-content: center; border-top: 1px solid var(--border); }
.empty-signal { display: flex; align-items: end; gap: 5px; height: 28px; margin-bottom: 22px; }
.empty-signal span { display: block; width: 4px; border-radius: 3px; background: var(--accent); }
.empty-signal span:nth-child(1) { height: 9px; opacity: .45; }
.empty-signal span:nth-child(2) { height: 17px; opacity: .72; }
.empty-signal span:nth-child(3) { height: 27px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { max-width: 380px; margin: 0 0 20px; color: var(--dim); line-height: 1.55; }
.empty-state button { padding: 10px 14px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; }

.feed-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.note { height: 340px; display: flex; flex-direction: column; padding: 17px 16px 15px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.note-meta { display: grid; grid-template-columns: 31px minmax(0, auto) 1fr; align-items: center; gap: 9px; }
.avatar-mark { width: 31px; height: 31px; display: grid; place-items: center; border: 0; border-radius: 8px 8px 8px 2px; background: var(--accent-soft); color: var(--accent); font: 800 10px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; cursor: pointer; overflow: hidden; padding: 0; }
.avatar-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.large-avatar-img { width: 54px; height: 54px; border-radius: 14px 14px 14px 4px; }
.author { min-width: 0; padding: 6px 0; overflow: hidden; text-overflow: ellipsis; border: 0; background: transparent; text-align: left; font: 650 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--text); cursor: pointer; }
.author:hover { color: var(--accent); }
.note-meta time { justify-self: end; color: var(--dim); font-size: 12px; }
.note-open { width: 100%; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.note-content { flex: 1 1 auto; min-height: 0; margin: 14px 0 4px 40px; overflow: hidden; overflow-wrap: anywhere; font-size: 16px; line-height: 1.62; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; }
.expand-hint { margin: 2px 0 0 40px; color: var(--accent); font-size: 12px; font-weight: 700; }
.note-prose > :first-child { margin-top: 0; }
.note-prose > :last-child { margin-bottom: 0; }
.note-prose p { margin: 0 0 11px; }
.note-prose ul { margin: 0 0 11px; padding-left: 1.25em; }
.note-prose li + li { margin-top: 5px; }
.note-prose blockquote { margin: 0 0 11px; padding: 3px 0 3px 13px; border-left: 2px solid var(--accent); color: var(--dim); }
.note-link { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.note-link:hover { text-decoration-color: currentColor; }
.hashtag { color: var(--accent); font-weight: 650; }
.nostr-token { display: inline-flex; max-width: 100%; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font: 600 .78em/1.45 ui-monospace, "SFMono-Regular", Consolas, monospace; vertical-align: .08em; }
.muted { color: var(--dim); }
.note-footer { margin: auto 0 0 40px; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-relays { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--dim); font: 600 11px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiny-signal { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.view-detail { flex: 0 0 auto; border: 0; background: transparent; padding: 6px 0; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.view-detail:hover { text-decoration: underline; text-underline-offset: 3px; }

.compose-fab { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 15; width: 56px; height: 56px; display: grid; place-items: center; border: 0; border-radius: 18px 18px 18px 6px; background: var(--accent); color: var(--bg); box-shadow: 0 12px 28px color-mix(in srgb, #000 28%, transparent); cursor: pointer; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: end; justify-content: center; background: color-mix(in srgb, #000 55%, transparent); }
.relay-sheet, .composer-sheet { width: 100%; max-height: 88vh; overflow-y: auto; padding: 22px 16px max(24px, env(safe-area-inset-bottom)); background: var(--surface-raised); border-radius: 20px 20px 0 0; box-shadow: 0 -18px 60px color-mix(in srgb, #000 30%, transparent); }
.sheet-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.sheet-copy { margin: 12px 0 22px; color: var(--dim); font-size: 14px; }
.help-body { margin-top: 14px; display: grid; gap: 4px; }
.help-body h3 { margin: 14px 0 2px; font-size: 14px; }
.help-body p { margin: 0 0 8px; color: var(--dim); font-size: 14px; line-height: 1.65; }
.relay-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.relay-row { min-height: 74px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 12px 40px; align-items: center; gap: 9px; border-bottom: 1px solid var(--border); }
.relay-toggle { width: 34px; height: 20px; border: 0; border-radius: 999px; padding: 2px; background: var(--border); cursor: pointer; }
.relay-toggle span { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-raised); transition: transform .18s ease; }
.relay-toggle.enabled { background: var(--accent); }
.relay-toggle.enabled span { transform: translateX(14px); }
.relay-address { min-width: 0; }
.relay-address strong, .relay-address code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relay-address strong { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.relay-address code { margin-top: 4px; color: var(--dim); font-size: 10px; }
.protocol-badge { flex: 0 0 auto; padding: 2px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font: 750 9px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .04em; }
.protocol-badge.insecure { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status-dot.online { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.status-dot.connecting { background: var(--warning); animation: pulse 1.25s ease-in-out infinite; }
.status-dot.offline { background: var(--danger); opacity: .7; }
.relay-problem { grid-column: 1 / -1; align-self: start; margin: 0 0 10px; color: var(--danger); font-size: 12px; line-height: 1.5; }
/* 每日推荐中继:名字 + 地址 + NIP-11 简介,一键加入。 */
.relay-picks { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.relay-picks h3 { margin: 0 0 4px; font-size: 14px; font-weight: 750; }
.relay-picks h3 small { color: var(--dim); font-weight: 600; }
.relay-picks-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.relay-pick { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); min-width: 0; }
.relay-pick-info { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.relay-pick-info strong { font-size: 13px; }
.relay-pick-info code { display: block; margin-top: 2px; color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relay-pick-info p { margin: 6px 0 0; color: var(--dim); font-size: 12px; line-height: 1.5; }
.pick-add { flex: 0 0 auto; min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.pick-add:hover { background: var(--accent-soft); }
.pick-added { flex: 0 0 auto; align-self: center; color: var(--dim); font-size: 12px; }
.trash-button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--dim); cursor: pointer; }
.add-relay { margin-top: 22px; }
.add-relay label, .composer-sheet label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.add-relay > div { display: grid; grid-template-columns: 1fr 48px; gap: 8px; }
.add-relay input, .composer-sheet textarea { width: 100%; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 10px; }
.add-relay input { min-width: 0; height: 46px; padding: 0 12px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.add-relay button { display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--accent); color: var(--bg); cursor: pointer; }
.filter-row { display: flex; align-items: start; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); cursor: pointer; }
.filter-row input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }
.filter-row span strong { display: block; font-size: 15px; }
.filter-row span small { display: block; margin-top: 4px; color: var(--dim); font-size: 12px; }
.filter-section { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--border); }
.filter-section > strong { display: block; font-size: 15px; }
.filter-section > small { display: block; margin-top: 4px; color: var(--dim); font-size: 12px; }
.keyword-add { display: grid; grid-template-columns: 1fr 64px; gap: 8px; margin-top: 12px; }
.keyword-add input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 14px; }
.keyword-add button { border: 0; border-radius: 10px; background: var(--accent); color: var(--bg); font-weight: 700; cursor: pointer; }
.keyword-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 13px; }
.keyword-chip button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface); color: var(--dim); font-size: 14px; cursor: pointer; }
.filter-clear { margin-top: 20px; width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--danger); font-weight: 700; cursor: pointer; }
.field-error { margin: 9px 0 0; color: var(--danger); font-size: 13px; line-height: 1.45; }
.field-hint { margin: 9px 0 0; color: var(--dim); font-size: 11px; line-height: 1.45; }

.composer-sheet form { margin-top: 22px; }
.composer-sheet textarea { min-height: 170px; resize: vertical; padding: 14px; line-height: 1.6; }
.composer-footer { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-footer > span { color: var(--dim); font: 600 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.publish-button { min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--accent); color: var(--bg); font-weight: 760; }
.publish-button:disabled { opacity: .42; cursor: not-allowed; }
.signing-note { margin: 14px 0 0; color: var(--dim); font-size: 12px; line-height: 1.45; }

.detail-sheet { width: 100%; max-height: 92vh; overflow-y: auto; padding: 22px 16px max(28px, env(safe-area-inset-bottom)); background: var(--surface-raised); border-radius: 20px 20px 0 0; box-shadow: 0 -18px 60px color-mix(in srgb, #000 30%, transparent); }
.detail-author { width: 100%; margin-top: 22px; padding: 12px 0; display: flex; align-items: center; gap: 11px; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.detail-author > span:last-child { min-width: 0; display: grid; gap: 4px; }
.detail-author strong { overflow: hidden; text-overflow: ellipsis; font: 700 13px/1.25 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.detail-author small { color: var(--dim); font-size: 12px; }
.detail-content { padding: 22px 0; overflow-wrap: anywhere; font-size: 17px; line-height: 1.68; }
/* 帖子详情里的对话 thread:原帖之下的直接回复,按时间正序。 */
.thread-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.thread-section h3 { margin: 0 0 12px; font-size: 14px; font-weight: 750; }
.thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.thread-reply { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.thread-reply-meta { display: grid; grid-template-columns: 31px minmax(0, auto) 1fr; align-items: center; gap: 9px; }
.thread-reply-meta time { justify-self: end; color: var(--dim); font-size: 12px; }
.thread-reply-body { width: 100%; margin-top: 8px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; font-size: 15px; line-height: 1.62; }
.thread-reply-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.longform-badge { flex: 0 0 auto; padding: 2px 8px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; white-space: nowrap; }
.longform-open { width: 100%; display: grid; gap: 6px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.longform-open strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; letter-spacing: -0.01em; line-height: 1.3; }
.longform-open > span { color: var(--dim); font-size: 14px; line-height: 1.6; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
/* 长文列表是单列目录:卡片高度由内容决定,不继承 .note 的 340px 固定高度;
   标题 12px 单行省略、摘要 2 行、角标并入作者行,典型卡片约 140-160px (<170px)。 */
.longform-note { height: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.longform-note .note-meta { grid-template-columns: 31px minmax(0, auto) 1fr auto; }
.longform-list { grid-template-columns: minmax(0, 1fr); }
.longform-cover { width: 100%; border-radius: 12px; margin-top: 18px; }
.longform-cover-hint { margin: 18px 0 0; font-size: 13px; }
.longform-cover-hint a { color: var(--accent); font-weight: 700; }
.longform-body { padding: 18px 0 6px; overflow-wrap: anywhere; font-size: 16.5px; line-height: 1.75; }
/* 长文详情:标题区收紧,正文区放大 */
.longform-sheet .sheet-heading { gap: 10px; align-items: center; }
.longform-sheet .sheet-heading > div { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.longform-sheet .section-index { margin: 0; font-size: 10px; white-space: nowrap; }
.longform-sheet .sheet-heading h2 { margin: 0; min-width: 0; font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.longform-sheet .sheet-heading > .icon-button { flex: 0 0 auto; width: 32px; height: 32px; }
.longform-sheet .detail-author { margin-top: 12px; padding: 8px 0; }
.longform-sheet .longform-body { padding-top: 12px; }
.longform-body > :first-child { margin-top: 0; }
.longform-body > :last-child { margin-bottom: 0; }
.longform-body h1, .longform-body h2, .longform-body h3, .longform-body h4 { margin: 1.4em 0 0.6em; letter-spacing: -0.015em; line-height: 1.35; }
.longform-body h1 { font-size: 1.5em; }
.longform-body h2 { font-size: 1.32em; }
.longform-body h3 { font-size: 1.16em; }
.longform-body h4 { font-size: 1.02em; }
.longform-body p { margin: 0.85em 0; }
.longform-body a { color: var(--accent); overflow-wrap: anywhere; }
.longform-body ul, .longform-body ol { margin: 0.85em 0; padding-left: 1.5em; }
.longform-body li { margin: 0.3em 0; }
.longform-body blockquote { margin: 0.85em 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--border); color: var(--dim); }
.longform-body pre { margin: 0.85em 0; padding: 12px 14px; border-radius: 10px; background: var(--surface); overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.longform-body code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.longform-body p code, .longform-body li code { padding: 1px 6px; border-radius: 6px; background: var(--surface); font-size: 0.88em; }
.longform-body img { max-width: 100%; border-radius: 10px; }
.longform-body hr { margin: 1.4em 0; border: 0; border-top: 1px solid var(--border); }
.event-facts { margin: 0; border-top: 1px solid var(--border); }
.event-facts > div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.event-facts dt { margin-bottom: 7px; color: var(--dim); font-size: 12px; font-weight: 700; }
.event-facts dd { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; font-size: 13px; line-height: 1.45; }
.event-facts code { overflow-wrap: anywhere; color: var(--text); font-size: 11px; }
.event-facts dd button, .profile-identity button { min-height: 36px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 750; cursor: pointer; }
.copy-status { margin: 14px 0 0; color: var(--accent); font-size: 13px; font-weight: 700; }
.profile-identity { margin-top: 24px; display: grid; justify-items: start; gap: 12px; }
.large-avatar { width: 54px; height: 54px; border-radius: 14px 14px 14px 4px; font-size: 15px; cursor: default; }
.profile-identity code { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); overflow-wrap: anywhere; font-size: 11px; line-height: 1.55; }
.profile-posts { margin-top: 28px; }
.profile-posts h3 { margin: 0 0 10px; font-size: 15px; }
.profile-posts h3 span { color: var(--dim); font-weight: 500; }
.profile-posts > button { width: 100%; padding: 14px 0; display: grid; gap: 7px; border: 0; border-top: 1px solid var(--border); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.profile-posts > button > span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-posts > button small { color: var(--dim); font: 600 11px/1.35 ui-monospace, "SFMono-Regular", Consolas, monospace; }

@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* ---- feed tabs / follow / profile (v2) ---- */
.feed-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.feed-tab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--dim); font-size: 13px; font-weight: 700; cursor: pointer; }
.feed-tab.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.manage-follows { margin-left: auto; border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; }
.manage-follows:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-names { display: grid; gap: 3px; justify-items: start; }
.profile-names strong { font-size: 17px; letter-spacing: -0.02em; }
.profile-nip05 { color: var(--dim); font-size: 12px; }
.profile-picture-link { color: var(--accent); font-size: 12px; font-weight: 700; text-underline-offset: 3px; }
.profile-about { margin: 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.follow-button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--bg); font-weight: 750; cursor: pointer; }
.follow-button.following { background: var(--accent-soft); color: var(--accent); }
.profile-history-hint { color: var(--dim); font-size: 13px; margin: 6px 0 0; }
.load-more-button { margin-top: 10px; width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; }
.load-more-button:disabled { opacity: 0.55; cursor: wait; }
.follow-list { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--border); }
.follow-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.follow-identity { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 0; text-align: left; cursor: pointer; color: inherit; }
.follow-names { min-width: 0; display: grid; gap: 2px; }
.follow-names strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.follow-names small { color: var(--dim); font: 600 11px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.unfollow-button { flex: 0 0 auto; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--danger); font-size: 12px; font-weight: 700; cursor: pointer; }

/* ---- 浏览模式切换 / 自动网格 / 回复 ---- */
.view-switch { margin-left: auto; display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.view-option { border: 0; background: transparent; padding: 7px 15px; border-radius: 999px; color: var(--dim); font-size: 13px; font-weight: 700; cursor: pointer; }
.view-option.active { background: var(--accent); color: var(--bg); }

.auto-stage { position: relative; overflow: hidden; min-height: min(58vh, 520px); display: flex; flex-direction: column; padding: 18px 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.auto-grid-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0 18px; }
/* 自动网格复用手动的 .feed-list 布局;内容轮换是整格直接替换,不做任何动画。 */
.auto-grid { height: 100%; overflow: hidden; }
.auto-grid .note { animation: none; transition: none; }
/* 窄屏(手机)自动网格:竖分三列,显示块按 --auto-scale 等比缩小
   (列数/块高/缩放系数由 JS 按舞台实测宽度注入,点小块进入详情)。 */
.auto-grid.narrow .note { height: var(--auto-card-h); padding: calc(14px * var(--auto-scale)); }
.auto-grid.narrow .avatar-mark { width: calc(31px * var(--auto-scale)); height: calc(31px * var(--auto-scale)); font-size: calc(10px * var(--auto-scale)); border-radius: calc(8px * var(--auto-scale)) calc(8px * var(--auto-scale)) calc(8px * var(--auto-scale)) calc(2px * var(--auto-scale)); }
.auto-grid.narrow .note-meta { grid-template-columns: calc(31px * var(--auto-scale)) minmax(0, 1fr); gap: calc(6px * var(--auto-scale)); }
.auto-grid.narrow .note-meta time { display: none; }
.auto-grid.narrow .author { padding: 0; font-size: calc(12px * var(--auto-scale)); }
.auto-grid.narrow .note-content { margin: calc(8px * var(--auto-scale)) 0 0; font-size: calc(15px * var(--auto-scale)); line-height: 1.5; -webkit-line-clamp: 4; }
.auto-grid.narrow .note-footer, .auto-grid.narrow .expand-hint { display: none; }
.app-version { margin-left: 8px; color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.auto-bar { margin: 12px 20px 0; display: flex; align-items: center; gap: 10px; }
.auto-count { color: var(--dim); font: 600 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.auto-hint { margin-left: auto; color: var(--dim); font-size: 11px; }

.note-actions { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; }
.reply-button { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.reply-button svg { width: 15px; height: 15px; }
.reply-button:hover { background: var(--accent-soft); }
.detail-actions { margin-top: 18px; display: flex; gap: 8px; }
.reply-context { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 10px; background: var(--bg); }
.reply-context-label { color: var(--accent); font-size: 12px; font-weight: 700; }
.reply-context p { margin: 8px 0 0; color: var(--dim); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reply-context-cancel { margin-top: 8px; border: 0; background: transparent; padding: 0; color: var(--dim); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 700px) {
  .utility-bar { padding-inline: 24px; }
  .identity-button span { display: inline; }
  .feed-column { padding: 44px 24px 80px; width: min(100%, 1120px); }
  .desktop-compose { display: inline-flex; }
  .compose-fab { display: none; }
  .relay-sheet { width: min(440px, 100%); height: 100%; max-height: none; margin-left: auto; border-radius: 0; padding: 32px 24px; }
  .sheet-backdrop { align-items: stretch; justify-content: end; }
  .composer-backdrop, .detail-backdrop { align-items: center; justify-content: center; padding: 24px; }
  .composer-sheet { width: min(560px, 100%); border-radius: 18px; padding: 26px; }
  .detail-sheet { width: min(620px, 100%); max-height: min(820px, calc(100vh - 48px)); border-radius: 18px; padding: 26px; }
  /* 长文详情:宽度至少不小于列表卡片(1120px 是 .feed-column 最大宽度,48px 是其左右 padding);
     高度与列表区同高——顶满可视区(backdrop 上下各 24px padding),不再按 820px 截断,超长正文在框内滚动。 */
  .detail-sheet.longform-sheet {
    width: min(100%, max(33.333vw, calc(1120px - 48px)));
    height: calc(100dvh - 48px);
    max-height: calc(100dvh - 48px);
  }
}


/* Auto mode owns the viewport: the stage advances notes instead of the page scrolling. */
.app-shell.auto-mode {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.auto-mode .utility-bar { flex: 0 0 auto; }
.feed-column.auto-feed {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 18px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auto-feed .feed-intro { flex: 0 0 auto; margin-bottom: 14px; }
.auto-feed .feed-tabs { flex: 0 0 auto; }
.auto-feed .auto-stage { flex: 1 1 auto; min-height: 0; }
.auto-feed .inline-notice,
.auto-feed .publish-strip { flex: 0 0 auto; }

.manual-refresh {
  min-height: 34px;
  margin-left: auto;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.manual-refresh svg { width: 16px; height: 16px; }
.manual-mode .view-switch { margin-left: 0; }

@media (max-width: 460px) {
  .feed-tabs { flex-wrap: wrap; }
  .manual-refresh { order: 3; margin-left: 0; }
  .manual-mode .view-switch { margin-left: auto; }
  .auto-hint { display: none; }
  .auto-stage { padding: 14px 0 10px; }
  .auto-grid-wrap { padding: 0 12px; }
}

@media (min-width: 700px) {
  .feed-column.auto-feed {
    padding-top: 28px;
    padding-bottom: 22px;
  }
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #4da3ff);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}