/* 公众订阅页(sub.html)· 杂志封面 + 聊天(founder 9/25:要有他的照片、背景要有设计、⛔社交软件的样子)。
   手机:第一眼是整屏照片封面,开聊后封面退成虚化的背景;电脑:左半屏封面常驻,右半屏对话。
   只用系统字体(CSP 只放同源字体)。界面上只有他的消息、你的消息、正在输入;AI 身份在页头小标 + 一行提示。 */
:root {
  --bg: #0b0908;
  --ink: #f4ede6;
  --ink-2: rgba(244, 237, 230, .68);
  --ink-3: rgba(244, 237, 230, .42);
  --line: rgba(255, 240, 228, .1);
  --glass: rgba(255, 244, 236, .085);
  --glass-2: rgba(255, 244, 236, .14);
  --copper: #ff6a3d;
  --crimson: #d4145a;
  --gold: #ffb65c;
  --ember: linear-gradient(135deg, #ff6a3d 0%, #d4145a 100%);
  --r: 20px;
  --col: 620px;
  --top-h: 64px;
  --left: 0px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
          "Helvetica Neue", Arial, sans-serif;
  --display: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", Arial, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.chat {
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; }

/* ── 封面 ── */
.cover { position: fixed; top: 0; left: 0; bottom: 0; width: 100vw; z-index: 1; overflow: hidden; background: #140e0b;
         transition: opacity .9s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.cover-pic { position: absolute; left: 0; right: 0; top: 0; height: min(72vh, 132vw); overflow: hidden; }
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; filter: saturate(1.06) contrast(1.06);
             animation: push 22s cubic-bezier(.2, .6, .2, 1) both; transform-origin: 50% 35%; }
@keyframes push { from { transform: scale(1.07); } to { transform: scale(1.0); } }
.cover-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 50% 30%, rgba(11, 9, 8, 0) 40%, rgba(11, 9, 8, .55) 100%),
    linear-gradient(180deg, rgba(11, 9, 8, .6) 0%, rgba(11, 9, 8, 0) 16%, rgba(11, 9, 8, 0) 34%, rgba(11, 9, 8, .6) 50%, #0b0908 min(72vh, 132vw));
}
.cover::after {                                    /* 一道暖色漏光 */
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background: linear-gradient(115deg, rgba(255, 106, 61, 0) 35%, rgba(255, 106, 61, .22) 52%, rgba(212, 20, 90, 0) 70%);
  animation: leak 9s ease-in-out infinite alternate;
}
@keyframes leak { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
.vert {
  position: absolute; right: 14px; top: 17vh; writing-mode: vertical-rl; font-size: 15px; font-weight: 700; letter-spacing: .7em;
  color: rgba(244, 237, 230, .86); text-shadow: 0 1px 12px rgba(0, 0, 0, .5); animation: rise 1.2s .5s cubic-bezier(.2, .8, .2, 1) both;
}
.vert::after { content: ""; display: block; width: 1px; height: 64px; margin: 14px auto 0; background: linear-gradient(var(--copper), rgba(255, 106, 61, 0)); }
.cover-txt { position: absolute; left: 20px; right: 20px; bottom: calc(var(--dock-h, 150px) + 10px); }
.kicker {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .28em;
  text-transform: uppercase; color: var(--gold); animation: rise 1s .15s cubic-bezier(.2, .8, .2, 1) both;
}
.live { position: relative; width: 8px; height: 8px; }
.live i { position: absolute; inset: 0; border-radius: 50%; background: #3ee07d; }
.live::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid rgba(62, 224, 125, .6); animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.name { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: .82; letter-spacing: -.055em; }
.name span { display: block; font-size: clamp(60px, 18.5vw, 150px); animation: rise 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.name span:first-child { color: var(--ink); animation-delay: .25s; }
.name span:last-child { color: transparent; -webkit-text-stroke: 2px var(--ink); animation-delay: .35s; }
.line { margin: 18px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; animation: rise 1s .5s cubic-bezier(.2, .8, .2, 1) both; }
.intro { margin: 8px 0 0; max-width: 30em; font-size: 15px; line-height: 1.55; color: var(--ink-2); animation: rise 1s .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
body.chatting .cover { opacity: 0; transform: scale(1.04); pointer-events: none; }

/* 开聊后的背景:他的照片虚化压暗 */
.backdrop { position: fixed; inset: -40px; z-index: 0; background-size: cover; background-position: 50% 30%; opacity: 0; transition: opacity 1.2s ease; }
.backdrop::after { content: ""; position: absolute; inset: 0;
                   background: linear-gradient(180deg, rgba(11, 9, 8, .55), rgba(11, 9, 8, .78) 60%, rgba(11, 9, 8, .92)); }
body.chatting .backdrop { opacity: 1; }
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ── 头像环 ── */
.ring { position: relative; display: inline-grid; place-items: center; border-radius: 50%; flex: none; }
.ring::before { content: ""; position: absolute; inset: -2px; border-radius: 50%;
                background: conic-gradient(from 0deg, var(--copper), var(--gold), var(--crimson), var(--copper)); animation: spin 7s linear infinite; }
.ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--bg); }
.ring .av { position: relative; z-index: 1; border-radius: 50%; object-fit: cover; background: #2a1a14; display: block; }
.ring.sm { width: 40px; height: 40px; }
.ring.sm .av { width: 36px; height: 36px; }
.ring.xs { width: 30px; height: 30px; }
.ring.xs .av { width: 28px; height: 28px; }
.ring.xs::before { inset: -1.5px; animation-duration: 12s; }
@keyframes spin { to { transform: rotate(1turn); } }

/* ── 页头 ── */
.top { position: fixed; top: 0; left: var(--left); right: 0; z-index: 20; padding-top: env(safe-area-inset-top);
       transition: background .6s ease, border-color .6s ease; border-bottom: 1px solid transparent; }
body.chatting .top { background: rgba(11, 9, 8, .74); -webkit-backdrop-filter: saturate(150%) blur(20px); backdrop-filter: saturate(150%) blur(20px);
                     border-bottom-color: var(--line); }
.top-in { max-width: var(--col); margin: 0 auto; height: var(--top-h); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me { display: flex; align-items: center; gap: 11px; min-width: 0; text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }
.me-t { min-width: 0; }
.me-n { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; white-space: nowrap; }
.badge { font-size: 10.5px; font-weight: 900; letter-spacing: .03em; padding: 3px 7px 2px; border-radius: 6px; line-height: 1; text-shadow: none;
         color: #1a0f0b; background: var(--gold); }
.me-s { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); height: 18px; }
.me-s.typing { color: var(--gold); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3ee07d; flex: none; }
.me-s.typing .dot { background: var(--copper); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.55); opacity: .6; } }
.acts { position: relative; display: flex; align-items: center; gap: 6px; }
.chip-btn { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; padding: 7px 11px; border-radius: 999px; cursor: pointer;
            background: rgba(11, 9, 8, .35); border: 1px solid rgba(255, 240, 228, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(11, 9, 8, .3); cursor: pointer; display: grid; place-items: center;
            -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.chip-btn:hover, .icon-btn:hover { background: var(--glass-2); }
.menu { position: absolute; right: 0; top: 44px; min-width: 200px; padding: 6px; border-radius: 14px;
        background: rgba(26, 19, 16, .97); border: 1px solid var(--line); box-shadow: 0 18px 48px rgba(0, 0, 0, .55); }
.menu a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.menu a:hover { background: var(--glass-2); }
.hint { max-width: var(--col); margin: 0 auto; padding: 0 16px 8px; font-size: 11.5px; line-height: 1.4; color: var(--ink-3);
        text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }

/* ── 对话 ── */
.stage { position: relative; z-index: 2; margin-left: var(--left); padding: calc(var(--top-h) + 36px + env(safe-area-inset-top)) 16px calc(var(--dock-h, 150px) + 14px); min-height: 100vh; }
.thread { max-width: var(--col); margin: 0 auto; display: flex; flex-direction: column; gap: 3px; }
.sep { align-self: center; margin: 18px 0 10px; font-size: 11.5px; letter-spacing: .06em; color: var(--ink-3); }
.row { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.row.him { align-self: flex-start; }
.row.you { align-self: flex-end; flex-direction: row-reverse; }
.row .slot { width: 30px; flex: none; }
.row.gap { margin-top: 12px; }
.b { padding: 10px 14px; border-radius: var(--r); font-size: 16px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
     animation: pop .34s cubic-bezier(.2, .9, .3, 1.2) both; }
.him .b { background: rgba(30, 22, 18, .62); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.you .b { background: var(--ember); color: #fff; box-shadow: 0 10px 26px rgba(212, 20, 90, .28); }
.him .b.first { border-bottom-left-radius: 6px; }
.him .b.mid { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.him .b.last { border-top-left-radius: 6px; }
.you .b.first { border-bottom-right-radius: 6px; }
.you .b.mid { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.you .b.last { border-top-right-radius: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.94); } }
.b.still { animation: none; }
.read { align-self: flex-end; margin: 3px 4px 0; font-size: 11px; color: var(--ink-3); animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; } }
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 240, 228, .8); animation: bob 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

.empty { display: none; }
@media (min-width: 960px) {
  .empty { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 18vh auto 0; color: var(--ink-2); font-size: 15px; }
  .empty .ring.sm { width: 64px; height: 64px; }
  .empty .ring.sm .av { width: 58px; height: 58px; }
  .empty p { margin: 0; }
}
/* 他亲自回了你 */
.pin { position: relative; margin: 6px 0 16px; padding: 16px 16px 14px; border-radius: 18px; background: rgba(255, 182, 92, .08);
       border: 1px solid rgba(255, 182, 92, .45); box-shadow: 0 0 0 4px rgba(255, 182, 92, .06), 0 18px 40px rgba(0, 0, 0, .35); animation: rise .8s ease both; }
.pin-k { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; }
.pin-k svg { width: 16px; height: 16px; fill: var(--gold); }
.pin-q { margin: 10px 0 6px; font-size: 13.5px; color: var(--ink-2); }
.pin-a { margin: 0; font-size: 16.5px; line-height: 1.5; white-space: pre-wrap; }
.sys { align-self: center; margin: 14px 0 6px; padding: 7px 13px; border-radius: 999px; font-size: 13px; color: var(--ink-2); background: var(--glass); border: 1px solid var(--line); }
.sys button { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--gold); font-weight: 800; cursor: pointer; }

/* ── 底部输入 ── */
.dock { position: fixed; left: var(--left); right: 0; bottom: 0; z-index: 20; padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
        background: linear-gradient(to top, rgba(11, 9, 8, .96) 50%, rgba(11, 9, 8, 0)); }
.dock > * { max-width: var(--col); margin-left: auto; margin-right: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; white-space: nowrap;
        background: rgba(30, 22, 18, .55); border: 1px solid rgba(255, 240, 228, .2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
        animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.chip:hover { border-color: rgba(255, 106, 61, .7); background: rgba(255, 106, 61, .12); }
.left { margin: 0 0 8px; text-align: center; font-size: 12px; color: var(--ink-3); }
.bar { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 26px; background: rgba(30, 22, 18, .66);
       border: 1px solid rgba(255, 240, 228, .18); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: border-color .2s ease, box-shadow .2s ease; }
.bar:focus-within { border-color: rgba(255, 106, 61, .75); box-shadow: 0 0 0 4px rgba(255, 106, 61, .14); }
.bar textarea { flex: 1; min-height: 40px; max-height: 132px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink);
                font: inherit; font-size: 16px; line-height: 1.5; padding: 8px 0; }
.bar textarea::placeholder { color: var(--ink-3); }
.send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
        background: var(--ember); box-shadow: 0 6px 18px rgba(212, 20, 90, .38); transition: transform .15s ease, opacity .2s ease; }
.send svg { width: 18px; height: 18px; fill: #fff; transform: translateX(-1px); }
.send:disabled { opacity: .3; box-shadow: none; cursor: default; }
.send:not(:disabled):active { transform: scale(.92); }
.dock.closed .bar { opacity: .45; pointer-events: none; }

/* ── 电脑:左半屏封面常驻,右半屏对话 ── */
@media (min-width: 960px) {
  :root { --left: 46vw; }
  .cover { width: var(--left); }
  .cover-pic { height: 100%; }
  .cover-img { object-position: 50% 20%; }
  body.chatting .cover { opacity: 1; transform: none; pointer-events: auto; }
  .cover-txt { left: 44px; right: 72px; bottom: 48px; }
  .name span { font-size: clamp(72px, 8.6vw, 150px); }
  .vert { right: 24px; top: 14vh; }
  .backdrop { left: var(--left); opacity: 1; }
  .top { background: rgba(11, 9, 8, .6); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom-color: var(--line); }
  .stage { padding-top: calc(var(--top-h) + 56px); }
}
@media (prefers-reduced-motion: reduce) {
  .cover-img, .cover::after, .ring::before, .typing i, .me-s.typing .dot, .live::after { animation: none; }
  .b, .name span, .line, .intro, .kicker, .vert, .chip, .pin, .read { animation: none; }
}
