/* 会员页的预览（src/lib/member-preview.ts）：被挡住的正文在服务器上已经换成灰条，这里只管长相。
   面分层：登录卡是浮起的白卡，按钮是不描边的墨色胶囊，不画四边框（site-surfaces.test.ts）。
   官网页（site.css，html[data-theme]）与 AIDC UI 页（ui.css，.dark）都会加载这一份，所以颜色自带一套令牌。 */
:root {
  --mp-bg: #ffffff;
  --mp-ink: #151515;
  --mp-mut: #6e6e73;
  --mp-bar: #e6e6e8;
  --mp-surface: #f5f5f7;
  --mp-raised: #ffffff;
  --mp-fade: rgba(255, 255, 255, 0);
  --mp-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 18px 44px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mp-bg: #1e1e1e; --mp-ink: #f5f5f7; --mp-mut: #a1a1a6; --mp-bar: #3a3a3c; --mp-surface: #252525; --mp-raised: #2c2c2e;
    --mp-fade: rgba(30, 30, 30, 0); --mp-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 28px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}
:root[data-theme="dark"], .dark {
  --mp-bg: #1e1e1e; --mp-ink: #f5f5f7; --mp-mut: #a1a1a6; --mp-bar: #3a3a3c; --mp-surface: #252525; --mp-raised: #2c2c2e;
  --mp-fade: rgba(30, 30, 30, 0); --mp-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 28px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* 被挡住的一段：骨架越往下越淡 */
.mp-veil { position: relative; margin-top: 8px; }
.mp-ghost { position: relative; user-select: none; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%); }
.mp-ghost .mp-line, .mp-ghost .mp-code, .mp-ghost .mp-table, .mp-stage { filter: blur(2.5px); }
.mp-ghost .mp-img, .mp-ghost img { opacity: 0.9; }

/* 灰条：一条就是一行被挡住的字 */
.mp-line { display: block; height: 0.62em; margin: 0.62em 0; border-radius: 999px; background: var(--mp-bar); }
.mp-p { margin: 0.4em 0 1.1em; }
.mp-h { color: var(--mp-ink); opacity: 0.82; }
.mp-code { margin: 1em 0 1.4em; padding: 14px 18px; border-radius: 12px; background: var(--mp-surface); }
.mp-code .mp-line { height: 0.5em; margin: 0.7em 0; }
.mp-table { margin: 1em 0 1.4em; }
.mp-tr { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 16px; padding: 4px 0; box-shadow: 0 1px 0 var(--mp-surface); }
.mp-img { display: block; max-width: 100%; height: auto; margin: 1em 0; border-radius: 12px; }

/* 按钮：墨色胶囊（主）/ 浅灰胶囊（次），不描边 */
a.mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 22px; border-radius: 999px;
  background: var(--mp-ink); color: var(--mp-bg); font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
a.mp-btn:hover { opacity: 0.88; }
a.mp-btn:focus-visible { outline: 2px solid #ff4d00; outline-offset: 2px; }
a.mp-btn--sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
a.mp-btn--soft { background: var(--mp-surface); color: var(--mp-ink); }
a.mp-btn svg { width: 13px; height: 13px; }

/* 成品块 / 组件 / 整页例子：名字和一句话照原样，样子换成骨架 */
.mp-item { display: grid; gap: 14px; justify-items: start; }
.mp-item-head h3 { margin: 0; font-size: 1.1rem; color: var(--mp-ink); }
.mp-item-head h3 code { font-size: 0.8em; color: var(--mp-mut); font-weight: 500; }
.mp-item-head p { margin: 4px 0 0; color: var(--mp-mut); font-size: 0.95rem; }
.mp-stage { justify-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px; border-radius: 18px; background: var(--mp-surface); }
.mp-stage .mp-p { grid-column: 1 / -1; margin: 4px 0 0; }
.mp-tile { display: block; height: 84px; border-radius: 12px; background: var(--mp-raised); }
.mp-stage--thumb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp-stage--thumb .mp-tile { height: 56px; }
.mp-item--block + .mp-item--block .mp-stage, .mp-item--comp + .mp-item--comp .mp-stage { filter: blur(4px); }

/* 底部小浮窗：整页都在，不挡排版（Owner 10-13：不要正文中间的大卡） */
.mp-bar { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 6px 6px 6px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--mp-raised) 88%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  color: var(--mp-ink); box-shadow: var(--mp-shadow); font-size: 13.5px; line-height: 1.3;
  animation: mp-rise 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.mp-bar span { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--mp-mut); }
.mp-bar span svg { flex: none; width: 14px; height: 14px; color: var(--mp-ink); }
.mp-bar b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-bar-short { display: none; }
.mp-bar a.mp-btn { min-height: 32px; padding: 0 16px; }
@keyframes mp-rise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
body[data-member-preview] { padding-bottom: 72px; }

@media (max-width: 640px) {
  .mp-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-bar { left: 16px; transform: none; gap: 10px; padding-left: 14px; animation: none; }
  .mp-bar-long { display: none; }
  .mp-bar-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .mp-bar { animation: none; } }
