/* ==================================================================
   DIY 朋友圈 · 样式表
   设计基调：微信原生观感 —— 干净、克制、信息层级清楚
   颜色：微信绿 #07C160 / 朋友圈蓝 #576B95 / 页面灰 #EDEDED
   ================================================================== */

:root {
  --wx-green: #07c160;
  --wx-green-dark: #06ad56;
  --wx-green-soft: #e8f8ef;
  --wx-blue: #576b95;
  --wx-blue-soft: #eef2fb;

  --text: #191919;
  --text-2: #57606a;
  --text-3: #8c8c8c;
  --text-4: #b2b2b2;

  --bg: #ededed;
  --bg-2: #f7f7f7;
  --card: #ffffff;
  --line: #ebebeb;
  --line-2: #e2e2e2;

  --danger: #fa5151;
  --warn: #ff9f0a;
  --info: #10aeff;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.14);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/**
 * 让 [hidden] 真的能隐藏元素。
 *
 * 浏览器对 [hidden] 的默认样式是 `display:none`，但它的优先级极低 ——
 * 只要元素自己带了 `display:flex` 之类的作者样式（比如 .actionbar、.grid），
 * 就会被盖掉，JS 里 `el.hidden = true` 看着生效、实际元素还显示着。
 * 这里显式加一条 !important 规则兜住，全站统一，页面就不用各自绕过了。
 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--wx-blue);
  text-decoration: none;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------- 布局 ---------- */

.page {
  min-height: 100vh;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 12px;
}

.wrap--narrow {
  max-width: 560px;
}

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

.row {
  display: flex;
  align-items: center;
}

.row--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grow {
  flex: 1;
  min-width: 0;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.center { text-align: center; }

/* ---------- 顶部导航 ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.navbar__title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar__side {
  min-width: 60px;
  font-size: 15px;
  color: var(--wx-blue);
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar__side--right {
  justify-content: flex-end;
}

.navbar__side--plain {
  color: var(--text-2);
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.card + .card {
  margin-top: 12px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
}

.card__body {
  padding: 16px;
}

.card__body--tight {
  padding: 12px;
}

.card__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, background 0.15s;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.985);
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--wx-green);
  color: #fff;
}

.btn--primary:active {
  background: var(--wx-green-dark);
}

.btn--ghost {
  background: #fff;
  border: 1px solid var(--line-2);
}

.btn--blue {
  background: var(--wx-blue);
  color: #fff;
}

.btn--danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid rgba(250, 81, 81, 0.35);
}

.btn--block {
  width: 100%;
}

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

.btn--xs {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn--icon {
  width: 44px;
  padding: 0;
}

/* 底部固定操作栏 */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  gap: 10px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.actionbar .btn {
  flex: 1;
}

.has-actionbar {
  padding-bottom: calc(78px + var(--safe-bottom));
}

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

.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.field__hint {
  font-size: 12px;
  color: var(--text-4);
}

.input,
.textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 15px;
}

.input:focus,
.textarea:focus {
  border-color: var(--wx-green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.textarea--sm {
  min-height: 62px;
}

.counter {
  font-size: 12px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}

.counter--warn {
  color: var(--warn);
}

/* 图片上传区 */
.uploader {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.uploader__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-2);
}

.uploader__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploader__del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.uploader__cover {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(7, 193, 96, 0.92);
  color: #fff;
  font-size: 11px;
}

.uploader__add {
  aspect-ratio: 1;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-4);
  font-size: 12px;
  cursor: pointer;
}

.uploader__add:active {
  background: #eee;
}

.uploader__plus {
  font-size: 26px;
  line-height: 1;
  color: var(--text-4);
}

/* ---------- 朋友圈内容卡片（核心视觉） ---------- */

.moment {
  background: #fff;
  padding: 16px 14px 14px;
}

.moment__head {
  display: flex;
  gap: 10px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-2);
  flex: 0 0 auto;
}

.avatar--round {
  border-radius: 50%;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  border-radius: 5px;
}

.avatar--xs {
  width: 26px;
  height: 26px;
  border-radius: 4px;
}

.avatar--lg {
  width: 64px;
  height: 64px;
  border-radius: 10px;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dfe6ea, #c9d3d9);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  flex: 0 0 auto;
}

.moment__main {
  flex: 1;
  min-width: 0;
}

.moment__author {
  font-size: 16px;
  font-weight: 600;
  color: var(--wx-blue);
  line-height: 1.3;
}

.moment__title {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.42;
  color: var(--text);
  white-space: pre-wrap;
}

.moment__text {
  margin-top: 5px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.moment__text--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.moment__expand {
  margin-top: 6px;
  font-size: 15px;
  color: var(--wx-blue);
  cursor: pointer;
}

/* 九宫格图片 */
.grid {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.grid--1 {
  grid-template-columns: 1fr;
  max-width: 62%;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 68%;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 68%;
}

.grid__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-2);
  cursor: zoom-in;
}

.grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.grid--1 .grid__item {
  aspect-ratio: auto;
}

.grid--1 .grid__item img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  background: var(--bg-2);
}

.grid__item--loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f2f2f2 25%, #e9e9e9 37%, #f2f2f2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* 位置 / 时间行 */
.moment__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-4);
}

.moment__location {
  color: var(--wx-blue);
}

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

.moment__action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
}

.moment__action:active {
  background: #eaeaea;
}

/* 互动区（点赞 / 评论样式） */
.interact {
  margin-top: 10px;
  border-radius: 6px;
  background: var(--bg-2);
  overflow: hidden;
}

.interact__row {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.45;
}

.interact__row + .interact__row {
  border-top: 1px solid var(--line);
}

.interact__label {
  color: var(--wx-blue);
  flex: 0 0 auto;
  font-weight: 500;
}

.interact__name {
  color: var(--wx-blue);
}

.interact__text {
  color: var(--text);
  min-width: 0;
}

/* ---------- 通用小部件 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12px;
  background: var(--bg-2);
  color: var(--text-2);
  white-space: nowrap;
}

.tag--green { background: var(--wx-green-soft); color: var(--wx-green-dark); }
.tag--blue { background: var(--wx-blue-soft); color: var(--wx-blue); }
.tag--warn { background: #fff5e5; color: #c77700; }
.tag--danger { background: #ffecec; color: var(--danger); }
.tag--gray { background: #f0f0f0; color: var(--text-3); }

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 12px 4px;
}

.stat__num {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat__label {
  font-size: 12px;
  color: var(--text-3);
}

.stats {
  display: flex;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.stats .stat + .stat {
  border-left: 1px solid var(--line);
}

.stat--green .stat__num { color: var(--wx-green); }
.stat--blue .stat__num { color: var(--wx-blue); }
.stat--warn .stat__num { color: var(--warn); }

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-4);
  font-size: 14px;
}

.empty__icon {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.55;
}

.alert--info { background: var(--wx-blue-soft); color: #3c4f75; }
.alert--warn { background: #fff7e6; color: #8a5a00; }
.alert--danger { background: #ffecec; color: #a52a2a; }
.alert--success { background: var(--wx-green-soft); color: #0a6b3d; }

.alert__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.kv {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

.kv:last-child {
  border-bottom: none;
}

.kv__k {
  flex: 0 0 84px;
  color: var(--text-3);
  font-size: 13px;
}

.kv__v {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* ---------- 访客列表 ---------- */

.visitor {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.visitor:last-child {
  border-bottom: none;
}

.visitor__body {
  flex: 1;
  min-width: 0;
}

.visitor__top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.visitor__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.visitor__time {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 3px;
}

.visitor__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.visitor__first {
  color: var(--wx-green);
  font-weight: 500;
}

/* ---------- 作品列表 ---------- */

.work {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.work:last-child {
  border-bottom: none;
}

.work__cover {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-2);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  font-size: 22px;
}

.work__body {
  flex: 1;
  min-width: 0;
}

.work__title {
  font-size: 15.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work__excerpt {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work__stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.work__avatars {
  display: flex;
  align-items: center;
}

.work__avatars .avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1.5px solid #fff;
  margin-left: -6px;
}

.work__avatars .avatar:first-child {
  margin-left: 0;
}

/* ---------- 弹层 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal__panel {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 18px calc(20px + var(--safe-bottom));
  transform: translateY(24px);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.is-open .modal__panel {
  transform: translateY(0);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal__title {
  font-size: 17px;
  font-weight: 600;
}

.modal__close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 17px;
  cursor: pointer;
}

/* 居中弹窗（图片预览等） */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 100vw;
  max-height: 88vh;
  object-fit: contain;
}

.lightbox__bar {
  position: absolute;
  top: var(--safe-top);
  right: 0;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  opacity: 0.85;
}

.lightbox__counter {
  position: absolute;
  bottom: calc(20px + var(--safe-bottom));
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

/* ---------- 提示条 ---------- */

.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 58px);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 84vw;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  animation: toast-in 0.24s ease;
  box-shadow: var(--shadow-2);
}

.toast--success { background: rgba(7, 160, 84, 0.94); }
.toast--error { background: rgba(214, 48, 48, 0.94); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 加载 ---------- */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--wx-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner--light {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- 开关 ---------- */

.switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__slider {
  position: absolute;
  inset: 0;
  background: #dcdcdc;
  border-radius: 14px;
  transition: background 0.2s;
  cursor: pointer;
}

.switch__slider::before {
  content: '';
  position: absolute;
  width: 23px;
  height: 23px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .switch__slider {
  background: var(--wx-green);
}

.switch input:checked + .switch__slider::before {
  transform: translateX(19px);
}

/* ---------- 首页 ---------- */

.hero {
  padding: 34px 20px 26px;
  text-align: center;
  background: linear-gradient(160deg, #ffffff 0%, #f3fbf6 60%, #e9f7f0 100%);
}

.hero__logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: var(--wx-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(7, 193, 96, 0.28);
  object-fit: cover;
  overflow: hidden;
}

.hero__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.hero__sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}

.feature {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.feature:last-child {
  border-bottom: none;
}

.feature__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--wx-green-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.feature__title {
  font-size: 15px;
  font-weight: 600;
}

.feature__desc {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.55;
}

/* ---------- 预览切换 ---------- */

.segmented {
  display: flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-2);
  gap: 3px;
}

.segmented__item {
  flex: 1;
  text-align: center;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: transparent;
  /* 窄屏下「待支付」「已关闭」这类三字标签会换行，撑高整条筛选栏 */
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segmented__item.is-active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 手机预览外框 */
.phone {
  border-radius: 22px;
  background: #f6f6f6;
  border: 1px solid var(--line-2);
  padding: 10px 0;
  overflow: hidden;
}

.phone__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 10px;
  font-size: 12px;
  color: var(--text-4);
}

/* ---------- 分享弹层 ---------- */

.share-box {
  text-align: center;
}

.share-box__qr {
  width: 168px;
  height: 168px;
  margin: 0 auto 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
}

.share-box__qr img,
.share-box__qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.share-box__link {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--bg-2);
  font-size: 13px;
  color: var(--text-2);
  text-align: left;
  word-break: break-all;
}


/* ---------- 代理后台 ---------- */

.agent-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.agent-stat {
  padding: 12px 10px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  text-align: center;
}

.agent-stat__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  /* 金额可能很长，别把格子撑破 */
  word-break: break-all;
}

.agent-stat__label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
}

.agent-stat__hint {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-2);
  opacity: 0.8;
}

.agent-order {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.agent-order:first-child {
  border-top: none;
  padding-top: 0;
}

.share-box__card {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-top: 12px;
}

.share-steps {
  text-align: left;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: s;
}

.share-steps li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  counter-increment: s;
}

.share-steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--wx-green);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* ---------- 底部提示 ---------- */

.footer-note {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-4);
  line-height: 1.7;
}

.footer-note a {
  color: var(--text-3);
}

/* 微信外打开提示 */
.wechat-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: #fff8e6;
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.6;
}

/* 悬浮「后台」入口 */
.fab {
  position: fixed;
  right: 14px;
  bottom: calc(20px + var(--safe-bottom));
  z-index: 80;
  height: 42px;
  padding: 0 16px;
  border-radius: 21px;
  border: none;
  background: rgba(25, 25, 25, 0.86);
  color: #fff;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-2);
  cursor: pointer;
}

/* ---------- 二维码 / 图片长按保存 ---------- */

.saveable {
  -webkit-touch-callout: default;
}

/* ---------- 深色模式（跟随系统） ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e8;
    --text-2: #b8b8b8;
    --text-3: #909090;
    --text-4: #6e6e6e;
    --bg: #111111;
    --bg-2: #1e1e1e;
    --card: #1c1c1c;
    --line: #2a2a2a;
    --line-2: #333333;
    --wx-green-soft: #12301f;
    --wx-blue-soft: #1a2233;
    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  .navbar {
    background: rgba(28, 28, 28, 0.94);
  }

  .actionbar {
    background: rgba(28, 28, 28, 0.96);
  }

  .moment {
    background: #1c1c1c;
  }

  .btn--ghost {
    background: #1c1c1c;
  }

  .hero {
    background: linear-gradient(160deg, #1c1c1c 0%, #16241c 60%, #12211a 100%);
  }

  .phone {
    background: #161616;
  }

  .modal__panel {
    background: #1c1c1c;
  }
}

/* ================================================================== */
/* 开局加载进度条                                                      */
/* ================================================================== */

/**
 * 只在首次打开时出现（判断在 assets/loader.js 里，用 sessionStorage）。
 * 页面之间跳转不显示这个，靠下面 .page 的淡入来保证「丝滑」。
 */
.dm-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f5f7;
  /* 淡出时不要挡住点击 */
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.dm-loader--early {
  /* 挂在 documentElement 上时的兜底定位 */
  position: fixed;
}

.dm-loader.is-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dm-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px;
  width: 100%;
  max-width: 320px;
}

/**
 * logo 图标（和首页顶部同一张图）。
 * 不用转圈：转圈是「等待」的意思，而这里其实只有一两秒 ——
 * 放自家图标更像「正在打开」，也更像样。
 */
.dm-loader__logo {
  width: 68px;
  height: 68px;
  /* 不许被 flex 压缩：容器一压，里面的图就会被拉成非正方形（真出现过） */
  flex: 0 0 auto;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  margin-bottom: 20px;
  /* 轻微呼吸 + 极小的浮动，静态画面就不死板了 */
  animation: dmLogoIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both,
             dmLogoBreath 3s ease-in-out 0.8s infinite;
}

.dm-loader__logo img {
  display: block;
  width: 68px;
  height: 68px;
  /* 1:1 + contain：双保险，任何情况下都不会变形 */
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 16px;
  /* 和首页 header 的图标阴影保持一致 */
  box-shadow: 0 8px 24px rgba(7, 193, 96, 0.24);
}

@keyframes dmLogoIn {
  from { opacity: 0; transform: scale(0.86) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes dmLogoBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.03); }
}

.dm-loader__brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #191919;
  margin-bottom: 22px;
  /* 轻轻呼吸，让静态画面不死板 */
  animation: dmBreathe 2.4s ease-in-out infinite;
}

@keyframes dmBreathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.dm-loader__track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dm-loader__bar {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, #07c160, #0aa85a);
  /* 缓动用的是「先快后慢再收住」，配合 JS 的变速推进更自然 */
  transition: width 0.6s cubic-bezier(0.32, 0.9, 0.36, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(7, 193, 96, 0.4);
}

.dm-loader__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: dmShine 1.4s linear infinite;
}

@keyframes dmShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.dm-loader__hint {
  margin-top: 12px;
  font-size: 12px;
  color: #8c8c8c;
  min-height: 16px;
  transition: opacity 0.3s ease;
}

/* ================================================================== */
/* 页面跳转的丝滑过渡                                                  */
/* ================================================================== */

/**
 * 每个页面在 <html> 上先挂 dm-preload（在 loader.js 里同步加，
 * 或由内联脚本加），CSS 一到位页面就是在「起点」状态；
 * loader.js 加 dm-ready 后开始动画。
 *
 * 为什么要这样：跳转时浏览器会保留旧页面直到新页面首帧渲染，
 * 如果新页面一上来就是最终样子，就会出现「啪」地闪一下。
 * 让它从「略微透明 + 轻微上浮」开始，视觉上是接上去的。
 */
html.dm-preload .page {
  opacity: 0;
  transform: translateY(10px);
}

html.dm-preload.dm-ready .page {
  opacity: 1;
  transform: none;
  transition: opacity 0.36s ease, transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 尊重系统的「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  html.dm-preload .page {
    opacity: 1;
    transform: none;
  }
  html.dm-preload.dm-ready .page {
    transition: none;
  }
  .dm-loader__logo,
  .dm-loader__brand,
  .dm-loader__bar::after {
    animation: none !important;
  }
}

/* ---------- 入场动效（错峰出现，避免整页一起蹦出来） ---------- */

@keyframes dmRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes dmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dmPop {
  0% { opacity: 0; transform: scale(0.9); }
  60% { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

/**
 * 只在「首次打开」那一次播放完整入场。
 * 页面之间跳转时 .dm-ready 还挂在 html 上（loader.js 提前加的），
 * 所以不做错峰 —— 否则每跳一次都要等 0.5 秒才看清内容，反而变慢。
 */
html.dm-modules-ready .hero,
html.dm-modules-ready .card,
html.dm-modules-ready .actionbar {
  animation: dmRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.dm-modules-ready .card:nth-of-type(1) { animation-delay: 0.06s; }
html.dm-modules-ready .card:nth-of-type(2) { animation-delay: 0.12s; }
html.dm-modules-ready .card:nth-of-type(3) { animation-delay: 0.18s; }
html.dm-modules-ready .card:nth-of-type(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html.dm-modules-ready .hero,
  html.dm-modules-ready .card,
  html.dm-modules-ready .actionbar {
    animation: none;
  }
}

/* ================================================================== */
/* 高级感：质感与细节                                                  */
/* ================================================================== */

/* 首页头图：柔和的品牌色光晕，比纯色块有层次 */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  width: 340px;
  height: 340px;
  margin-left: -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(7, 193, 96, 0.13) 0%, rgba(7, 193, 96, 0) 68%);
  pointer-events: none;
  animation: dmGlow 7s ease-in-out infinite;
}

@keyframes dmGlow {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.9; }
  50% { transform: translateY(12px) scale(1.08); opacity: 0.65; }
}

.hero__logo {
  position: relative;
  z-index: 1;
  /* 图标带一点立体感，不是贴上去的方图 */
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(7, 193, 96, 0.18), 0 1px 3px rgba(0, 0, 0, 0.06);
  animation: dmPop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__title {
  position: relative;
  z-index: 1;
}

.hero__sub {
  position: relative;
  z-index: 1;
}

/* 特性条目：图标加底色，鼠标移上去轻微抬起 */
.feature {
  transition: transform 0.24s ease;
}

@media (hover: hover) {
  .feature:hover {
    transform: translateX(3px);
  }
}

.feature__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--wx-green-soft), rgba(7, 193, 96, 0.06));
  box-shadow: inset 0 0 0 1px rgba(7, 193, 96, 0.08);
}

/* 主按钮：按下时有回弹，比单纯变暗更有反馈 */
.btn {
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.btn--primary {
  box-shadow: 0 4px 14px rgba(7, 193, 96, 0.24);
}

.btn--primary:active:not(:disabled) {
  transform: scale(0.975);
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.2);
}

@media (hover: hover) {
  .btn--primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(7, 193, 96, 0.3);
  }
}

/* 卡片：极轻的悬浮感 */
.card {
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.28s ease;
}

@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow-2);
  }
}

/* 骨架屏：加载数据时的呼吸感，比干瘪的「加载中…」高级 */
.dm-skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.045) 25%,
    rgba(0, 0, 0, 0.075) 37%,
    rgba(0, 0, 0, 0.045) 63%
  );
  background-size: 400% 100%;
  animation: dmSkeleton 1.4s ease infinite;
}

@keyframes dmSkeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .dm-skeleton { animation: none; }
  .hero::before { animation: none; }
  .hero__logo { animation: none; }
}

/* 深色模式下的适配 */
@media (prefers-color-scheme: dark) {
  .dm-loader { background: #111214; }
  .dm-loader__brand { color: #f2f2f2; }
  .dm-loader__track { background: rgba(255, 255, 255, 0.1); }
  .dm-loader__hint { color: #8a8a8a; }
  .dm-skeleton {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(255, 255, 255, 0.1) 37%,
      rgba(255, 255, 255, 0.05) 63%
    );
    background-size: 400% 100%;
  }
  .feature__icon {
    background: linear-gradient(145deg, rgba(7, 193, 96, 0.14), rgba(7, 193, 96, 0.05));
  }
}

/* ================================================================== */
/* 首页：引导与高级感                                                  */
/* ================================================================== */

/* ---------- 首屏徽标 ---------- */

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  margin-bottom: 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--wx-green-dark);
  background: rgba(7, 193, 96, 0.09);
  box-shadow: inset 0 0 0 1px rgba(7, 193, 96, 0.14);
  animation: dmRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wx-green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.16);
  animation: dmPulse 2s ease-in-out infinite;
}

@keyframes dmPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(7, 193, 96, 0.05); }
}

/* ---------- 三步走 ---------- */

.card--steps {
  /* 比普通卡片更「抬」一点，引导区值得被第一眼看到 */
  background: linear-gradient(160deg, #ffffff 0%, #fbfefc 100%);
  box-shadow: 0 2px 10px rgba(7, 193, 96, 0.06), var(--shadow-1);
  border-color: rgba(7, 193, 96, 0.1);
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.step {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 68px;
}

.step__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #0ac264, #069e50);
  box-shadow: 0 3px 8px rgba(7, 193, 96, 0.26);
}

.step__text {
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  color: var(--text-2);
  white-space: nowrap;
}

.step__text em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

/* 连接线：中间那条虚线上加个流动的小点，暗示「流程在走」 */
.step__line {
  position: relative;
  flex: 1 1 auto;
  height: 1px;
  margin-top: 13px;
  background: repeating-linear-gradient(
    90deg,
    rgba(7, 193, 96, 0.28) 0 4px,
    transparent 4px 8px
  );
  overflow: hidden;
}

.step__line::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -20%;
  width: 20%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--wx-green), transparent);
  animation: dmFlow 2.6s ease-in-out infinite;
}

@keyframes dmFlow {
  0% { left: -22%; }
  100% { left: 102%; }
}

/* ---------- 特性条目 ---------- */

.feature__main {
  flex: 1 1 auto;
  min-width: 0;
}

.feature__icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  font-size: 19px;
}

.feature__desc b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- 主按钮与说明 ---------- */

/*
 * Large primary button.
 *
 * Sized as "standard button (44px / 16px) shrunk by 25%":
 *   height 52 -> 39, font 17 -> 13, radius 14 -> 10, padding 18 -> 14.
 *
 * height AND min-height are both required: the base .btn rule sets
 * height: 44px, which wins over a lone min-height (measured: stayed 44).
 * Only used by the two buttons on the home page.
 */
.btn--lg {
  height: 39px;
  min-height: 39px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 10px;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s ease, opacity 0.2s ease, background-color 0.2s ease;
}

/* 主按钮上一道缓慢掠过的光，静态截图里看不出来，动起来才有的质感 */
.btn--primary {
  position: relative;
  overflow: hidden;
}

.btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-18deg);
  animation: dmSweep 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes dmSweep {
  0%, 68% { left: -32%; }
  100% { left: 132%; }
}

.cta-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 12px;
  font-size: 12px;
  color: var(--text-3);
}

.cta-note__sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-2);
}

@media (prefers-reduced-motion: reduce) {
  .hero__badge,
  .hero__badge-dot,
  .step__line::after,
  .btn--primary::after {
    animation: none;
  }
}

/* ---------- 深色模式 ---------- */

@media (prefers-color-scheme: dark) {
  .card--steps {
    background: linear-gradient(160deg, #1b1c1e 0%, #17201a 100%);
    border-color: rgba(7, 193, 96, 0.16);
  }
  .hero__badge {
    color: #4ade80;
    background: rgba(7, 193, 96, 0.14);
  }
  .cta-note__sep {
    background: rgba(255, 255, 255, 0.16);
  }
}

/* ================================================================== */
/* 跳转动画：点链接时当前页轻微淡出，和新页面的淡入接起来               */
/* ================================================================== */

/**
 * 页面背景色放到 html 上。
 * 跳转时浏览器会先把旧页面刷成空白，如果底色只在 body 上，
 * 那一瞬间会闪白 —— 这是「廉价感」最主要的来源。
 */
html {
  background: var(--bg);
}

/**
 * 离场动画。
 * 只用 opacity + 极小的位移，不用大位移：
 * 位移大了会显得晃，而且和浏览器的页面切换动画打架。
 *
 * 类由 assets/loader.js 里的站内点击拦截器加上。
 */
/**
 * 注意选择器要写足够长：入场规则是 `html.dm-preload.dm-ready .page`（特异度 0,3,0），
 * 如果这里只写 `html.dm-leaving .page`（0,2,0），入场规则会把它盖掉 ——
 * 表现就是「类加上了、画面纹丝不动」。这个坑踩过一次。
 */
html.dm-leaving .page,
html.dm-leaving.dm-ready .page,
html.dm-leaving.dm-preload .page,
html.dm-leaving.dm-preload.dm-ready .page {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.17s ease-in, transform 0.17s ease-in;
  pointer-events: none;
}

/* 离场时按钮等可交互元素也别再有反馈，否则像点到了但没反应 */
html.dm-leaving .btn:active {
  transform: none;
}

/**
 * 离场时给一层极淡的纱，让「旧页面淡出」这件事看得出来，
 * 而不是单纯变透明露出底色。
 */
html.dm-leaving::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  animation: dmVeil 0.17s ease-in forwards;
}

@keyframes dmVeil {
  from { opacity: 0; }
  to { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  html.dm-leaving .page,
  html.dm-leaving.dm-ready .page,
  html.dm-leaving.dm-preload .page,
  html.dm-leaving.dm-preload.dm-ready .page {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html.dm-leaving::after {
    animation: none;
  }
}

/* ================================================================== */
/* 底部悬浮操作栏：别盖住页面内容                                      */
/* ================================================================== */

/**
 * 问题：.actionbar 是 position:fixed 贴在底部（大约 64px + 安全区高），
 * 但 .page 只留了 24px 的下内边距 —— 于是制作页的「位置」快捷选项
 * 被按钮栏压住了，用户看不到也点不到（截图里能直接看出来）。
 *
 * 修法：页面里存在 .actionbar 时，给 .page 补足底部空间。
 * 用 :has() 精确判断，没有按钮栏的页面不多留空白。
 * 老浏览器不支持 :has() 时，靠页面自己加的 .page--has-actionbar 兜底。
 */
.page:has(.actionbar) {
  padding-bottom: calc(92px + var(--safe-bottom));
}

.page--has-actionbar {
  padding-bottom: calc(92px + var(--safe-bottom));
}

/* 按钮栏本身再厚一点，手指点着更从容 */
.actionbar {
  padding-top: 12px;
  padding-bottom: calc(12px + var(--safe-bottom));
}

/* 按钮栏上方加一层极淡的渐隐，内容滚到底时不会「硬切」 */
.actionbar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 16px;
  background: linear-gradient(to bottom, rgba(237, 237, 237, 0), rgba(237, 237, 237, 0.9));
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .actionbar::before {
    background: linear-gradient(to bottom, rgba(17, 18, 20, 0), rgba(17, 18, 20, 0.9));
  }
}

/* ================================================================== */
/* 「开始制作」并进「作品与访客记录」卡片后的样式                        */
/* ================================================================== */

/**
 * 背景：当这台手机发过内容时，index.js 会把 #start-card 移进
 * 「我的作品与访客记录」卡片里，排在「进入作者后台」上面。
 * 这样两个按钮在同一张卡片里，关系一目了然。
 *
 * 移进去之后它不再是 .card 的直接子元素，所以：
 *   · 需要自己补一条分隔线，把「看记录」和「发新的」分开
 *   · 不再需要卡片自己的白底（父卡片已经给了）
 */
/*
 * 「开始制作」并进「作品与访客记录」卡片后的间距。
 *
 * 这里**只调下间距**。宽度交给 btn--block、高度交给 btn--lg，
 * 横向一个像素都不能碰 —— 碰了上面那个按钮就不和「进入作者后台」等宽了
 * （实测差 32px，原因是多套了一层 .card__body，左右各 16px）。
 *
 * 也刻意不画分隔线：之前加过 border-top，那条 1px 灰线正好落在按钮上方，
 * 看起来像给按钮套了个框（站长反馈过「按钮附近有个框框」）。
 */
.start-inset {
  margin-bottom: 12px;
}

/* 在卡片内部时，主按钮不需要外面那层发光阴影那么重 */
.start-inset .btn--primary {
  box-shadow: 0 4px 14px rgba(7, 193, 96, 0.2);
}

/* ================================================================== */
/* 文章页的分享引导                                                    */
/* ================================================================== */

/*
 * 为什么把提示印在页面上，而不是做成一个「分享给朋友」按钮：
 *   微信不允许网页主动弹出分享面板 —— JS-SDK 的 updateAppMessageShareData
 *   只负责"设置分享内容"，没有任何接口能"打开分享面板"（微信刻意不开放，
 *   诱导分享会被永久回收接口权限）。
 *   所以按钮点下去也只能弹一句「请点右上角」，多一次点击、多一层困惑。
 *   直接印出来 + 一个指向右上角的箭头，反而更清楚。
 */
.share-hint {
  background: linear-gradient(160deg, #ffffff 0%, #fbfefc 100%);
  border: 1px solid rgba(7, 193, 96, 0.1);
}

.share-hint__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.share-hint__dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 14px;
  letter-spacing: 1px;
  color: #fff;
  background: var(--wx-green);
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

/* 箭头指向右上角（微信「···」的真实位置），有一点来回的位移吸引注意 */
.share-hint__arrow {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: var(--wx-green);
  animation: shareHintArrow 1.8s ease-in-out infinite;
}

@keyframes shareHintArrow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4px, -4px); }
}

.share-hint__ways {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-2);
}

.share-hint__way {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--wx-green-soft);
  color: var(--wx-green-dark);
  font-weight: 500;
}

.share-hint__or {
  font-size: 12px;
  color: var(--text-4);
}

@media (prefers-reduced-motion: reduce) {
  .share-hint__arrow { animation: none; }
}

@media (prefers-color-scheme: dark) {
  .share-hint {
    background: linear-gradient(160deg, #1b1c1e 0%, #17201a 100%);
    border-color: rgba(7, 193, 96, 0.16);
  }
  .share-hint__way {
    background: rgba(7, 193, 96, 0.16);
    color: #4ade80;
  }
}

/* ==================================================================
   底部导航（4 个 tab：首页 / 创建 / 记录 / 我的）
   ------------------------------------------------------------------
   导航由 assets/nav.js 注入，页面只需要在自己的 JS 入口调用
   mountTabbar('home'|'create'|'records'|'mine')。
   这些页面统一用 body.has-tabbar 调整底部留白，避免内容被挡住。
   ================================================================== */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: stretch;
  padding: 5px 4px calc(5px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0 4px;
  color: var(--text-3);
  text-decoration: none;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 10px;
  transition: color 0.15s, opacity 0.15s;
}

.tabbar__item:active {
  opacity: 0.65;
}

.tabbar__icon {
  display: block;
  width: 22px;
  height: 22px;
}

.tabbar__icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar__item.is-active {
  color: var(--wx-green);
  font-weight: 600;
}

/* 有底部导航时的留白：普通页面 88px，带操作栏的页面再让出一整条操作栏 */
body.has-tabbar .page {
  padding-bottom: calc(88px + var(--safe-bottom));
}

body.has-tabbar .page.has-actionbar {
  padding-bottom: calc(148px + var(--safe-bottom));
}

body.has-tabbar .actionbar {
  bottom: calc(60px + var(--safe-bottom));
}

/* ---------- 访问记录：顶部两个数字 ---------- */

.visit-stats {
  display: flex;
  align-items: stretch;
  padding: 18px 8px 24px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.visit-stat {
  flex: 1;
  text-align: center;
}

.visit-stat + .visit-stat {
  border-left: 1px solid var(--line);
}

.visit-stat__label {
  font-size: 13px;
  color: var(--text-3);
}

.visit-stat__num {
  position: relative;
  display: inline-block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  color: #4d6bfe;
  font-variant-numeric: tabular-nums;
}

.visit-stat__num::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: #4d6bfe;
  transform: translateX(-50%);
  opacity: 0.85;
}

/* ---------- 访问记录：访客列表 ---------- */

.visit-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 8px;
  font-size: 12px;
  color: var(--text-4);
}

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

.visit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}

.visit-item:active {
  transform: scale(0.994);
  box-shadow: var(--shadow-2);
}

.visit-item__avatar {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--bg-2);
}

.visit-item__main {
  flex: 1;
  min-width: 0;
}

.visit-item__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
}

.visit-item__name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-item__badge {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
}

.visit-item__time {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.visit-item__chevron {
  flex: 0 0 auto;
  color: var(--text-4);
  font-size: 20px;
  line-height: 1;
  padding-left: 2px;
}

/* ---------- 我的：个人信息 + 作品卡片 ---------- */

.profile-card__name {
  font-size: 18px;
  font-weight: 600;
}

.profile-card__meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-3);
}

.profile-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

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

.mine-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform 0.1s;
}

.mine-item:active {
  transform: scale(0.994);
}

.mine-item__cover {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--bg-2);
}

.mine-item__cover--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--text-4);
}

.mine-item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mine-item__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
}

.mine-item__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-item__meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
}

.mine-item__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

/* ---------- 首页：使用教程 ---------- */

.tutorial {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tutorial__step {
  display: flex;
  gap: 12px;
}

.tutorial__num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--wx-green-soft);
  color: var(--wx-green-dark);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial__title {
  font-size: 15px;
  font-weight: 600;
}

.tutorial__desc {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.tutorial__desc code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-2);
  font-size: 12.5px;
}

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

.tips__item {
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.tips__icon {
  flex: 0 0 auto;
}

@media (prefers-color-scheme: dark) {
  .tabbar {
    background: rgba(28, 28, 30, 0.94);
  }
}

/* 有底部导航时，安全区已经被 tabbar 吃掉，操作栏不要再补一次，
   否则 iPhone 上两个条之间会空出一条 34px 的灰带 */
body.has-tabbar .actionbar {
  padding-bottom: 10px;
}

/* ---------- 创建页：操作按钮贴着「效果预览」卡片底部 ---------- */

.create-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
