/* 花汐阁 · 全站骨架预览样式（独立本机预览，不依赖现网 CDN / COS） */
:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #111111;
  --muted: #8a8a8a;
  --line: #efefef;
  --red: #ff2442;
  --orange: #f07828;
  --gold: #e8b03a;
  --danger: #e34545;
  --ok: #2f9b63;
  --ink: #3d2b1f;
  --tea: #8a6a4a;
  --cream: #fffaf5;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --shell-max: 960px;
  --tabbar-h: 56px;
  --top-h: 48px;
  --radius: 12px;
  --sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }
html { margin: 0; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; font-family: var(--sans); color: var(--text); background: #e8e8e8; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button { cursor: pointer; }

/* ===== Landing hub ===== */
body.hub {
  background: #f3efe9;
  color: #3d2b1f;
  min-height: 100dvh;
}
.hub-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.4rem 1.2rem 3.5rem;
}
.hub-mark {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 0.35rem;
}
.hub-kicker {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a6a4a;
  letter-spacing: 0.06em;
}
.hub-lead {
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #5a4a3c;
  max-width: 38rem;
}
.hub-warn {
  margin: 0 0 1.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e8d5c4;
  background: #fff8f1;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #6a4a32;
}
.hub-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}
@media (min-width: 700px) {
  .hub-cards { grid-template-columns: 1fr 1fr; }
}
.hub-card {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid #eadfd3;
  border-radius: 16px;
  padding: 1.2rem 1.15rem 1.25rem;
  box-shadow: 0 8px 24px rgba(40,24,10,0.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hub-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(40,24,10,0.08); }
.hub-card h2 { margin: 0 0 0.4rem; font-size: 1.12rem; font-weight: 900; }
.hub-card p { margin: 0; font-size: 0.84rem; line-height: 1.6; color: #8a6a4a; }
.hub-card .go { display: inline-block; margin-top: 0.85rem; font-size: 0.75rem; font-weight: 800; padding: 0.28rem 0.7rem; border-radius: 999px; background: #111; color: #fff; }
.hub-meta h3 { margin: 0 0 0.5rem; font-size: 0.92rem; }
.hub-meta ul, .hub-meta ol { margin: 0 0 1rem; padding-left: 1.15rem; color: #5a4a3c; font-size: 0.86rem; line-height: 1.7; }
.hub-meta code { font-size: 0.8em; background: #f4eee6; padding: 0.05rem 0.3rem; border-radius: 4px; }
.hub-foot { font-size: 0.75rem; color: #8a6a4a; line-height: 1.55; }

/* ===== App shell ===== */
html.app, body.app-shell {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
body.app-shell { background: #e8e8e8; }
.phone-frame {
  width: 100%;
  max-width: var(--shell-max);
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: fixed;
  left: 0; right: 0; top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}
@media (min-width: 640px) {
  .phone-frame { box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.08); }
}
@media (min-width: 640px) and (max-width: 899px) {
  .phone-frame { max-width: 720px; }
}

.preview-ribbon {
  flex: 0 0 auto;
  background: #3d2b1f;
  color: #f3e2c8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0.28rem 0.6rem;
  line-height: 1.4;
}
.preview-ribbon a { color: #f3e2c8; text-decoration: underline; }

.app-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--top-h);
  padding: 0 0.55rem 0 0.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 40;
}
.top-brand {
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  font-family: var(--serif);
  white-space: nowrap;
  padding: 0.2rem 0.15rem;
}
.scope-switch {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 1rem;
  min-width: 0;
}
.scope-tab {
  border: none;
  background: none;
  color: #666;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 0.1rem 0.45rem;
  border-bottom: 3px solid transparent;
  line-height: 1;
}
.scope-tab.is-on { color: #111; font-weight: 900; border-bottom-color: #111; }
.icon-btn {
  width: 2rem; height: 2rem; border: none; background: transparent;
  display: grid; place-items: center; border-radius: 8px; color: #222; padding: 0; flex: 0 0 auto;
}
.icon-btn:active { background: #f3f3f3; }
.icon-btn.is-disabled, .icon-btn:disabled { opacity: 0.4; }
.ann-btn {
  border: 1px solid #eadfd3;
  background: #fff8f1;
  color: #6a4a32;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  white-space: nowrap;
  height: 1.7rem;
}
.ann-btn:active { background: #f3ebe3; }

.app-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.7rem calc(0.4rem);
  width: 100%;
}
.app-main.is-flush { padding: 0; }

/* Tabbar */
.app-tabbar {
  flex: 0 0 auto;
  width: 100%;
  min-height: calc(var(--tabbar-h) + var(--safe-bottom));
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 0.12rem 0.08rem var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
  z-index: 50;
}
.tabbar-item {
  position: relative; border: none; background: transparent; color: #9a9a9a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.12rem; min-height: 48px; padding: 0.16rem 0.04rem; text-decoration: none;
}
.tabbar-item.is-on { color: #111; }
.tabbar-ico { display: grid; place-items: center; width: 22px; height: 22px; }
.tabbar-ico svg { width: 22px; height: 22px; display: block; }
.tabbar-item.is-on .tabbar-ico svg { stroke-width: 2; }
.tabbar-txt { font-size: 0.6rem; font-weight: 700; }
.tabbar-publish { gap: 0; }
.tabbar-publish-ico { display: grid; place-items: center; width: 26px; height: 26px; }
.tabbar-publish-ico svg { width: 26px; height: 26px; display: block; }

/* Feed toolbar */
.feed-toolbar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding: 0.05rem 0 0.4rem;
  margin: 0 0 0.15rem;
}
.sub-tabs {
  flex: 1;
  display: flex;
  gap: 0.05rem;
  overflow-x: auto;
  padding: 0.05rem 0;
  -webkit-overflow-scrolling: touch;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab {
  flex: 0 0 auto; border: none; background: transparent; color: #888;
  font-weight: 600; font-size: 0.92rem; padding: 0.3rem 0.65rem;
}
.sub-tab.is-on { color: #111; font-weight: 900; }

/* Feed grid / waterfall */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding-bottom: 1rem;
}
@media (min-width: 900px) {
  .feed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.card-media {
  aspect-ratio: 3 / 4;
  background: linear-gradient(145deg, #e8ddd2, #d4c4b0);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0.7rem 0.65rem;
  position: relative;
  color: #fff;
}
.card-media .cover-title {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0,0,0,0.25);
}
.card-media .cover-kind {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
}
.card-body { padding: 0.45rem 0.5rem 0.55rem; }
.card-title {
  margin: 0 0 0.3rem;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.card-author { display: inline-flex; align-items: center; gap: 0.28rem; min-width: 0; }
.mini-av {
  width: 1.05rem; height: 1.05rem; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-size: 0.55rem; font-weight: 800;
}
.card-author-name { color: var(--muted); font-size: 0.66rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-likes { color: var(--muted); font-size: 0.66rem; font-weight: 600; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.2rem 1rem;
  color: var(--muted);
}
.empty-state h3 { margin: 0 0 0.4rem; color: #333; font-size: 1rem; }
.empty-state p { margin: 0; font-size: 0.84rem; line-height: 1.6; }
.feed-more, .feed-end {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.6rem 0 1rem;
}

/* Cover palettes */
.cv-ink { background: linear-gradient(160deg, #4a4558 0%, #2c2836 70%); }
.cv-tea { background: linear-gradient(160deg, #c4a574 0%, #8a6a42 70%); }
.cv-dusk { background: linear-gradient(160deg, #d9896a 0%, #8a3e3a 75%); }
.cv-mist { background: linear-gradient(160deg, #9aa7b4 0%, #5d6a78 70%); }
.cv-peach { background: linear-gradient(160deg, #e8b4a2 0%, #c4786a 70%); }
.cv-moss { background: linear-gradient(160deg, #7d9a78 0%, #3f5a42 70%); }
.cv-gold { background: linear-gradient(160deg, #e0c072 0%, #b07a28 70%); }
.cv-night { background: linear-gradient(160deg, #2a3344 0%, #12161e 75%); }

/* Auth wall */
.auth-wall {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem 2rem;
}
.auth-wall h2 { margin: 0.2rem 0 0.35rem; font-size: 1.25rem; font-weight: 900; }
.auth-wall .lead { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.86rem; line-height: 1.65; }
.auth-tabs { display: flex; gap: 0.35rem; margin-bottom: 0.9rem; }
.tab {
  flex: 1; padding: 0.5rem; border-radius: 10px; color: #666; background: #fff;
  border: 1px solid #e5e5e5; font-weight: 700;
}
.tab.is-on { color: #fff; background: #111; border-color: #111; }
.panel {
  background: var(--card);
  border-radius: 14px;
  padding: 0.95rem 0.9rem 1.05rem;
  box-shadow: var(--shadow);
}
.stack { display: grid; gap: 0.7rem; }
label { display: grid; gap: 0.28rem; color: #333; font-size: 0.82rem; font-weight: 700; }
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; border: 1px solid #e5e5e5; border-radius: 10px;
  padding: 0.55rem 0.7rem; font-size: 0.92rem; background: #fff; color: #111;
}
textarea { resize: vertical; min-height: 5.5rem; line-height: 1.55; }
.hint { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 600; line-height: 1.5; }
.form-msg { margin: 0; font-size: 0.8rem; font-weight: 700; min-height: 1.2em; }
.form-msg.is-err { color: var(--danger); }
.form-msg.is-ok { color: var(--ok); }
.primary, .ghost, .danger-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 0.9rem; border-radius: 999px; font-weight: 800; font-size: 0.82rem;
  border: 1px solid transparent; min-height: 2.1rem;
}
.primary { background: #111; color: #fff; }
.ghost { background: #fff; color: #666; border-color: #e5e5e5; }
.danger-btn { background: #fff; color: var(--danger); border-color: #f0c8c8; }
.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.demo-accounts { margin-top: 0.4rem; }
.demo-accounts button {
  display: block; width: 100%; text-align: left; border: 1px solid #efefef;
  background: #fafafa; border-radius: 10px; padding: 0.5rem 0.7rem; margin-top: 0.35rem;
  font-size: 0.8rem; font-weight: 700;
}
.demo-accounts button small { display: block; font-weight: 600; color: var(--muted); margin-top: 0.1rem; }

/* Compose */
.cat-field { display: grid; gap: 0.35rem; }
.cat-label { font-size: 0.82rem; font-weight: 700; color: #333; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cat-pill {
  border: 1px solid #e5e5e5; background: #fff; color: #666;
  font-weight: 700; font-size: 0.82rem; padding: 0.38rem 0.85rem; border-radius: 999px;
}
.cat-pill.is-on { color: #fff; background: #111; border-color: #111; font-weight: 900; }
.cat-pill:disabled, .cat-pills.is-locked .cat-pill { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.cat-pills.is-locked .cat-pill.is-on { opacity: 1; }
.section-head h3 { margin: 0 0 0.2rem; font-size: 1.02rem; }
.section-head p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.8rem; }

/* Detail */
.detail-head { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.7rem; }
.back-btn { border: none; background: none; font-size: 1.4rem; line-height: 1; padding: 0.1rem 0.3rem; color: #222; }
.detail-title { margin: 0; font-size: 1.15rem; font-weight: 900; line-height: 1.4; }
.detail-meta { display: flex; align-items: center; gap: 0.5rem; margin: 0.55rem 0 0.8rem; flex-wrap: wrap; }
.detail-body { font-size: 0.95rem; line-height: 1.75; white-space: pre-wrap; margin: 0 0 1rem; }
.badge {
  display: inline-flex; align-items: center; font-size: 0.66rem; font-weight: 800;
  padding: 0.1rem 0.4rem; border-radius: 999px; border: 1px solid #e5e5e5; color: #666;
}
.badge-ann { background: #3d2b1f; border-color: #3d2b1f; color: #f3e2c8; }
.badge-event { background: #fff1e6; border-color: #e2c4a8; color: #c45c26; }
.badge-public { background: #eef4ff; border-color: #c9d7f0; color: #3a5a8c; }
.badge-private { background: #f3f3f3; border-color: #e5e5e5; color: #666; }
.detail-cover {
  border-radius: 14px; min-height: 9rem; margin: 0 0 0.9rem;
  display: flex; align-items: flex-end; padding: 1rem;
  color: #fff; font-weight: 800;
}
.action-row { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0 0 1rem; }
.comments { margin-top: 0.4rem; }
.comments h4 { margin: 0 0 0.55rem; font-size: 0.92rem; }
.comment { display: flex; gap: 0.55rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.comment p { margin: 0.15rem 0 0; font-size: 0.88rem; line-height: 1.55; }
.comment .who { font-size: 0.75rem; font-weight: 800; }
.comment-form { display: flex; gap: 0.4rem; margin-top: 0.7rem; }
.comment-form input { flex: 1; }
.disabled-action { opacity: 0.55; }

/* Chat / lists */
.list-page { padding: 0.2rem 0 1.2rem; }
.list-page h3 { margin: 0.15rem 0 0.25rem; font-size: 1.05rem; }
.list-lead { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.8rem; line-height: 1.55; }
.list-row {
  display: flex; align-items: center; gap: 0.7rem;
  background: #fff; border-radius: 12px; padding: 0.7rem 0.75rem; margin-bottom: 0.45rem;
  box-shadow: var(--shadow); width: 100%; border: none; text-align: left; color: inherit;
}
.list-row .meta { margin: 0; color: var(--muted); font-size: 0.74rem; }
.list-row .name { margin: 0; font-weight: 800; font-size: 0.9rem; }
.av-lg {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 800; flex: 0 0 auto;
}
.note-box {
  background: #fff8f1; border: 1px solid #eadfd3; border-radius: 12px;
  padding: 0.7rem 0.8rem; font-size: 0.8rem; line-height: 1.6; color: #6a4a32; margin: 0 0 0.8rem;
}

/* Mine */
.mine-hero { display: flex; gap: 0.8rem; align-items: flex-start; }
.mine-av {
  width: 4.2rem; height: 4.2rem; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 1.6rem; font-weight: 900; flex: 0 0 auto;
}
.mine-nick { margin: 0 0 0.2rem; font-size: 1.15rem; font-weight: 900; }
.mine-line { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.8rem; }
.mine-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.85rem; }
.mine-links { display: grid; gap: 0.4rem; margin-top: 0.9rem; }
.mine-link {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-radius: 12px; padding: 0.75rem 0.85rem;
  text-decoration: none; font-weight: 800; font-size: 0.9rem; border: none; width: 100%; text-align: left;
  box-shadow: var(--shadow);
}
.mine-link span { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.role-switch {
  margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed #eadfd3;
}
.role-switch p { margin: 0 0 0.45rem; font-size: 0.75rem; color: #8a6a4a; line-height: 1.5; }

/* Rank table */
.rank-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; background: #fff; border-radius: 12px; overflow: hidden; }
.rank-table th, .rank-table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
.rank-table th { font-size: 0.7rem; color: var(--muted); font-weight: 800; }

/* Activity */
.act-card {
  background: #fff; border-radius: 14px; padding: 0.9rem 0.9rem 1rem; margin-bottom: 0.6rem;
  box-shadow: var(--shadow); border: none; width: 100%; text-align: left; color: inherit;
}
.act-card h4 { margin: 0 0 0.25rem; font-size: 0.98rem; }
.act-card p { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }

/* Toast / modal */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 0.8rem);
  transform: translateX(-50%);
  background: rgba(20,16,12,0.92); color: #fff; font-size: 0.82rem; font-weight: 700;
  padding: 0.55rem 0.9rem; border-radius: 999px; z-index: 80; max-width: 86vw;
  text-align: center; pointer-events: none;
}
.scrim {
  position: fixed; inset: 0; background: rgba(40,28,18,0.45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.dialog {
  background: #fffaf5; border-radius: 16px; padding: 1rem 1rem 1.05rem;
  width: min(22rem, 100%); box-shadow: 0 16px 40px rgba(40,24,10,0.2);
}
.dialog h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.dialog p { margin: 0 0 0.9rem; font-size: 0.86rem; line-height: 1.6; color: #5a4a3c; }
.dialog .row-actions { justify-content: flex-end; }

/* Old-site nav mock extras */
body.oldnav-page { background: #e8e8e8; }
.oldnav-banner {
  background: #fff1e6; border-bottom: 1px solid #e2c4a8; color: #8a4a20;
  font-size: 0.72rem; font-weight: 700; line-height: 1.5; padding: 0.4rem 0.7rem; text-align: center;
}
.top-tabs { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 0.85rem; height: var(--top-h); }
.top-tab {
  text-decoration: none; color: #666; font-size: 0.95rem; font-weight: 600;
  padding: 0.7rem 0.05rem 0.45rem; border-bottom: 3px solid transparent; line-height: 1; background: none; border-top: 0; border-left: 0; border-right: 0;
}
.top-tab.is-active { color: #111; font-weight: 900; border-bottom-color: #111; }
.old-feed-placeholder { padding: 1rem 0.2rem; }
.old-feed-placeholder .card { cursor: default; }

.ico-search {
  display: block; width: 14px; height: 14px; border: 1.6px solid #222; border-radius: 50%; position: relative;
}
.ico-search::after {
  content: ""; position: absolute; width: 6px; height: 1.6px; background: #222;
  right: -3px; bottom: -1px; transform: rotate(45deg); border-radius: 1px;
}
