/* ==========================================================================
   LiveDesk · 前台样式（落地页 / 客服窗口 / 会员中心 / 登录）
   ========================================================================== */

/* ---------------------------------------------------------------- 导航 */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid rgba(230, 233, 242, .8);
}
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16.5px; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .8); flex: none; }
.brand small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted-2); letter-spacing: .08em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.nav-links a:hover { background: rgba(99, 102, 241, .08); color: var(--brand-600); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

/* ---------------------------------------------------------------- 落地页 */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; }
.hero::before {
  content: ""; position: absolute; width: 720px; height: 720px; right: -180px; top: -320px;
  background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, .28), transparent 62%);
  filter: blur(10px); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; width: 620px; height: 620px; left: -240px; bottom: -380px;
  background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, .20), transparent 62%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 7px; border-radius: 99px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.eyebrow b { background: var(--grad); color: #fff; padding: 2px 8px; border-radius: 99px; font-size: 11px; }
.hero h1 { font-size: 52px; line-height: 1.1; letter-spacing: -.035em; margin: 22px 0 18px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 16.5px; color: var(--muted); max-width: 520px; line-height: 1.75; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hero-meta div strong { display: block; font-size: 22px; letter-spacing: -.02em; }
.hero-meta div span { font-size: 12.5px; color: var(--muted); }

/* 客服预览卡 */
.preview { position: relative; }
.preview-card {
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  overflow: hidden; transform: rotate(-1.2deg); transition: .4s cubic-bezier(.2, .8, .3, 1);
}
.preview-card:hover { transform: rotate(0) translateY(-4px); }
.preview-head { background: var(--grad); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 11px; }
.preview-head .avatar { background: rgba(255, 255, 255, .22); backdrop-filter: blur(4px); }
.preview-head h4 { font-size: 14px; }
.preview-head .st { font-size: 11.5px; opacity: .88; display: flex; align-items: center; gap: 5px; }
.preview-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(180deg, #fbfcff, #f6f8fd); min-height: 250px; }
.preview-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; background: #fff; }
.preview-foot .fake-input { flex: 1; height: 36px; border-radius: 10px; background: #f4f6fb; display: flex; align-items: center; padding: 0 12px; color: var(--muted-2); font-size: 12.5px; }
.float-badge { position: absolute; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 9px 13px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.float-badge.one { left: -44px; top: -26px; animation: floaty 5s ease-in-out infinite; }
.float-badge.two { right: -26px; bottom: -22px; animation: floaty 6s ease-in-out .8s infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* 通用气泡 */
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.65; word-break: break-word; }
.bubble.agent { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.bubble.user { background: var(--grad); color: #fff; border-bottom-right-radius: 5px; margin-left: auto; }
.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 20px; }
.bubble a { color: inherit; text-decoration: underline; }

/* 特性 */
.section { padding: 78px 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 44px; }
.section-head h2 { font-size: 34px; letter-spacing: -.03em; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 15px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px;
  transition: .22s ease; position: relative; overflow: hidden;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #dfe4f2; }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; background: var(--grad-soft); color: var(--brand-600); }
.feature h3 { font-size: 15.5px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.feature .tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* 价格 */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; position: relative; transition: .22s; }
.price-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.price-card.hot { border-color: transparent; box-shadow: 0 24px 50px -26px rgba(99, 102, 241, .55), 0 0 0 1.5px rgba(99, 102, 241, .35); }
.price-card .badge-hot { position: absolute; top: -11px; right: 22px; background: var(--grad); color: #fff; padding: 3px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .9); }
.price-card h3 { font-size: 17px; }
.price-card .price { font-size: 38px; font-weight: 800; letter-spacing: -.04em; margin: 12px 0 2px; }
.price-card .price small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-card ul { list-style: none; padding: 0; margin: 20px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.price-card li { display: flex; gap: 9px; font-size: 13px; color: var(--ink-2); align-items: flex-start; }
.price-card li svg { flex: none; margin-top: 3px; color: var(--green); }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.faq-q { padding: 16px 20px; display: flex; justify-content: space-between; gap: 16px; cursor: pointer; font-weight: 600; font-size: 14px; }
.faq-a { padding: 0 20px; max-height: 0; overflow: hidden; transition: .28s ease; color: var(--muted); font-size: 13px; line-height: 1.8; }
.faq-item.open .faq-a { max-height: 320px; padding: 0 20px 18px; }
.faq-q .chev { transition: .25s; color: var(--muted-2); }
.faq-item.open .chev { transform: rotate(180deg); }

/* CTA + footer */
.cta { background: var(--grad); border-radius: 26px; padding: 52px; color: #fff; text-align: center; position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; width: 400px; height: 400px; right: -120px; top: -160px; background: rgba(255, 255, 255, .13); border-radius: 50%; }
.cta h2 { font-size: 32px; margin-bottom: 12px; letter-spacing: -.03em; }
.cta p { opacity: .9; margin-bottom: 26px; }
.cta .btn { background: #fff; color: var(--brand-600); border: 0; }
footer { padding: 48px 0 34px; border-top: 1px solid var(--line); margin-top: 78px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 14px; }
.footer-grid a { display: block; color: var(--ink-2); font-size: 13px; padding: 5px 0; }
.footer-grid a:hover { color: var(--brand-600); }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

/* ---------------------------------------------------------------- 客服窗口 */
.chat-page { background: radial-gradient(1200px 500px at 50% -10%, rgba(139, 92, 246, .14), transparent 70%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.chat-top { max-width: 1180px; margin: 0 auto; padding: 22px 24px 0; width: 100%; display: flex; align-items: center; justify-content: space-between; }
.chat-shell { max-width: 1180px; margin: 0 auto; padding: 20px 24px 34px; width: 100%; flex: 1; display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: stretch; }
.chat-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; height: calc(100vh - 160px); min-height: 540px; }
.chat-header { padding: 14px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; background: linear-gradient(180deg, #fff, #fcfdff); }
.chat-header .meta { flex: 1; min-width: 0; }
.chat-header .meta h3 { font-size: 14.5px; }
.chat-header .meta .st { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); }
.offline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }

.chat-body { flex: 1; overflow-y: auto; padding: 20px; background: linear-gradient(180deg, #fcfdff, #f7f9fe); scroll-behavior: smooth; }
.chat-body .day { text-align: center; font-size: 11.5px; color: var(--muted-2); margin: 14px 0; }
.msg { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-end; animation: msgIn .22s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.msg .content { max-width: 74%; min-width: 0; }
.msg .name { font-size: 11.5px; color: var(--muted-2); margin-bottom: 4px; }
.msg .bubble { max-width: 100%; }
.msg .time { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; opacity: 0; transition: .2s; }
.msg:hover .time { opacity: 1; }
.msg.me { flex-direction: row-reverse; }
.msg.me .content { display: flex; flex-direction: column; align-items: flex-end; }
.msg.system { justify-content: center; }
.msg.system .bubble { background: rgba(15, 23, 42, .045); color: var(--muted); font-size: 12px; border: 0; box-shadow: none; text-align: center; max-width: 88%; }
.msg .bubble img { border-radius: 10px; max-height: 240px; cursor: zoom-in; margin-top: 4px; }
.attach-card { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); margin-top: 6px; }
.msg:not(.me) .attach-card { background: #f4f6fb; border-color: var(--line); }
.attach-card .fi { width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.msg:not(.me) .attach-card .fi { background: #fff; color: var(--brand-600); }
.attach-card .fn { font-size: 12.5px; font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-card .fs { font-size: 10.5px; opacity: .75; }

.typing { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 20px 8px; height: 22px; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); animation: blink 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .2s; }
.typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* 富文本编辑器 */
.composer { border-top: 1px solid var(--line-2); background: #fff; padding: 10px 14px 12px; }
.toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px dashed var(--line-2); margin-bottom: 8px; }
.tool { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; font-size: 13px; font-weight: 700; transition: .15s; }
.tool:hover { background: #f1f4fa; color: var(--brand-600); }
.tool.on { background: rgba(99, 102, 241, .12); color: var(--brand-600); }
.tool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }
.editor { min-height: 62px; max-height: 168px; overflow-y: auto; outline: none; font-size: 13.5px; line-height: 1.7; padding: 6px 4px; color: var(--ink-2); }
.editor:empty::before { content: attr(data-ph); color: var(--muted-2); pointer-events: none; }
.editor a { color: var(--brand-600); }
.editor blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.editor pre { background: #f4f6fb; padding: 8px 10px; border-radius: 8px; font-family: var(--mono); font-size: 12px; overflow-x: auto; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.composer-tools { display: flex; align-items: center; gap: 4px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.attach-chip { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 10px; border-radius: 9px; background: #f4f6fb; border: 1px solid var(--line); font-size: 12px; }
.attach-chip .x { cursor: pointer; color: var(--muted-2); font-weight: 700; padding: 0 2px; }
.attach-chip .x:hover { color: var(--red); }
.attach-chip .prog { width: 60px; height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; }
.attach-chip .prog i { display: block; height: 100%; background: var(--brand); width: 0; transition: .2s; }

/* 侧栏 */
.chat-side { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; max-height: calc(100vh - 160px); padding-right: 2px; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.side-card h4 { font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.side-card .ad-card { border-radius: 12px; padding: 16px; background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.side-card .ad-card .ad-tag { font-size: 10.5px; background: rgba(255, 255, 255, .22); padding: 2px 8px; border-radius: 99px; }
.side-card .ad-card h4 { font-size: 15px; margin: 8px 0 4px; }
.side-card .ad-card p { font-size: 12px; opacity: .9; }
.kb-item { display: block; padding: 9px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.kb-item:last-child { border-bottom: 0; }
.kb-item:hover { color: var(--brand-600); }
.side-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 6px 0; }
.side-meta b { color: var(--ink-2); font-weight: 600; }

/* 预填表单 */
.prechat { padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.prechat h3 { font-size: 19px; margin-bottom: 6px; }
.prechat > p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* 评分 */
.stars { display: flex; gap: 8px; justify-content: center; font-size: 30px; cursor: pointer; }
.stars span { color: #e2e6f0; transition: .15s; }
.stars span.on { color: #fbbf24; transform: scale(1.06); }

/* ---------------------------------------------------------------- 登录 / 注册 */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.auth-art { background: linear-gradient(150deg, #4f46e5, #7c3aed 45%, #0ea5e9); color: #fff; padding: 54px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%; background: rgba(255, 255, 255, .1); right: -180px; top: -160px; }
.auth-art::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .08); left: -100px; bottom: -120px; }
.auth-art .brand { color: #fff; position: relative; }
.auth-art .brand small { color: rgba(255, 255, 255, .6); }
.auth-art h2 { font-size: 34px; line-height: 1.28; letter-spacing: -.03em; position: relative; margin-bottom: 16px; }
.auth-art p { opacity: .82; font-size: 14.5px; line-height: 1.8; max-width: 420px; position: relative; }
.auth-art .points { position: relative; display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
.auth-art .points div { display: flex; gap: 10px; font-size: 13.5px; align-items: center; }
.auth-art .points i { width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 11px; font-style: normal; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 27px; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-form .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.tabs { display: flex; background: #eef1f9; padding: 4px; border-radius: 11px; margin-bottom: 24px; }
.tabs button { flex: 1; height: 34px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; transition: .18s; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.oauth-row { display: flex; gap: 10px; margin-top: 18px; }
.oauth-row .btn { flex: 1; }

/* ---------------------------------------------------------------- 会员中心 */
.app-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.app-top-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.member-layout { max-width: 1240px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 232px 1fr; gap: 22px; align-items: start; }
.side-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: 86px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.side-nav a:hover { background: #f6f8fd; }
.side-nav a.on { background: rgba(99, 102, 241, .1); color: var(--brand-600); font-weight: 600; }
.side-nav .sep { height: 1px; background: var(--line-2); margin: 10px 6px; }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 10px; }
.user-mini .nm { font-size: 13px; font-weight: 600; }
.user-mini .pl { font-size: 11px; color: var(--muted); }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-card .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.stat-card .v small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-banner { background: var(--grad); color: #fff; border-radius: var(--radius-lg); padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; overflow: hidden; }
.plan-banner::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -90px; top: -140px; }
.plan-banner h3 { font-size: 20px; }
.plan-banner p { opacity: .88; font-size: 13px; margin-top: 4px; }

/* 表格操作 */
.op-link { color: var(--brand-600); font-weight: 600; cursor: pointer; font-size: 12.5px; }
.op-link:hover { text-decoration: underline; }
.op-link.danger { color: #dc2626; }

/* 键值行 */
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; color: var(--ink-2); text-align: right; word-break: break-all; }

/* ---------------------------------------------------------------- 嵌入模式 */
body.embed { background: transparent; }
body.embed .chat-shell { grid-template-columns: 1fr; padding: 0; max-width: none; }
body.embed .chat-main { height: 100vh; border-radius: 0; border: 0; box-shadow: none; }
body.embed .chat-side, body.embed .chat-top { display: none; }
body.embed .prechat { padding: 18px 18px 24px; justify-content: flex-start; height: auto; }
body.embed .prechat h3 { font-size: 17px; }
body.embed .chat-body { padding: 14px; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 42px; }
  .chat-shell { grid-template-columns: 1fr; }
  .chat-side { max-height: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .hero { padding: 44px 0 60px; }
  .hero h1 { font-size: 34px; }
  .hero p.lead { font-size: 15px; }
  .price-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .member-layout { grid-template-columns: 1fr; padding: 16px; }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .side-nav a { white-space: nowrap; }
  .side-nav .sep, .user-mini { display: none; }
  .chat-main { height: calc(100vh - 120px); }
  .cta { padding: 34px 22px; }
  .cta h2 { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .modal-body { padding: 16px; }
}

/* ==========================================================================
   内容运营 · 广告位 / 公告（content.js）
   ========================================================================== */

/* ---------------------------------------------------------------- 广告位 */
[data-ad-slot] { margin: 0; }
[data-ad-slot].ld-slot-empty { display: none; }

.ld-ad {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.2,.8,.3,1.1), box-shadow .22s;
}
.ld-ad[data-href] { cursor: pointer; }
.ld-ad:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ld-ad-body { padding: 16px; }
.ld-ad-body:empty { display: none; }
.ld-ad-flag {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 10px; line-height: 1; letter-spacing: .06em;
  padding: 3px 6px; border-radius: 5px;
  background: rgba(15, 23, 42, .55); color: #fff; backdrop-filter: blur(4px);
  opacity: .75;
}
.ld-ad-img { width: 100%; height: auto; display: block; }
.ld-ad-link { display: block; }
.ld-ad-text h4 { font-size: 15px; margin-bottom: 6px; }
.ld-ad-text p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.ld-ad-cta { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--brand-600); }

/* 广告内的富文本继承站点排版 */
/* 广告 HTML 里如果用了 .ad-card（推广卡片模板），沿用原来的紫色卡片外观，
   外层 .ld-ad 让位，避免出现双层边框 */
.ld-ad .ad-card {
  border-radius: 12px; padding: 16px; background: var(--grad); color: #fff;
  position: relative; overflow: hidden;
}
.ld-ad .ad-card h4 { font-size: 15px; margin: 8px 0 4px; color: #fff; }
.ld-ad .ad-card p { font-size: 12.5px; color: rgba(255, 255, 255, .92); line-height: 1.65; }
.ld-ad .ad-card .ad-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  background: rgba(255, 255, 255, .22); color: #fff; padding: 2px 8px; border-radius: 99px;
}
.ld-ad .ad-card .ad-btn,
.ld-ad .ad-card a.ad-btn {
  display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 8px;
  background: #fff; color: var(--brand-600); font-size: 12px; font-weight: 700;
}
.ld-ad:has(.ad-card) { background: transparent; border: 0; box-shadow: none; }
.ld-ad:has(.ad-card) .ld-ad-body { padding: 0; }
.ld-ad:has(.ad-card) .ld-ad-flag { background: rgba(255, 255, 255, .28); }
.ld-ad-body .ad-tag {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 99px; background: rgba(99,102,241,.12); color: var(--brand-600);
}
.ld-ad-body img { border-radius: 10px; }

/* 通栏样式：顶部/底部广告更扁 */
[data-slot="global_top"] .ld-ad-body,
[data-slot="global_bottom"] .ld-ad-body { padding: 12px 16px; }
[data-slot="global_top"] .ld-ad,
[data-slot="global_bottom"] .ld-ad { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }

/* ---------------------------------------------------------------- 附件 */
.ld-att-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ld-att {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 9px; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); text-decoration: none;
}
.ld-att:hover { border-color: var(--brand); color: var(--brand-600); background: #fff; }
.ld-att-ext {
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: var(--brand-600);
  background: rgba(99,102,241,.1); padding: 2px 5px; border-radius: 4px;
}
.ld-att-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-att-size { color: var(--muted-2); font-size: 11.5px; }

/* ---------------------------------------------------------------- 公告条 */
.ld-ann-bar { position: relative; z-index: 90; }
.ld-ann {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  font-size: 13px;
  background: rgba(99, 102, 241, .08);
  border-bottom: 1px solid rgba(99, 102, 241, .16);
  color: var(--ink-2);
}
.ld-ann[data-level="success"] { background: rgba(16, 185, 129, .09); border-bottom-color: rgba(16, 185, 129, .2); }
.ld-ann[data-level="warning"] { background: rgba(245, 158, 11, .1); border-bottom-color: rgba(245, 158, 11, .22); }
.ld-ann[data-level="danger"]  { background: rgba(239, 68, 68, .08); border-bottom-color: rgba(239, 68, 68, .2); }
.ld-ann-ico { display: inline-flex; color: var(--brand-600); flex: none; }
.ld-ann[data-level="success"] .ld-ann-ico { color: var(--green); }
.ld-ann[data-level="warning"] .ld-ann-ico { color: var(--amber); }
.ld-ann[data-level="danger"] .ld-ann-ico { color: var(--red); }
.ld-ann-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ld-ann-title { font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.ld-ann-sum { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ld-ann-pin {
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 99px;
  background: rgba(99,102,241,.14); color: var(--brand-600); letter-spacing: .02em;
}
.ld-ann-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; }
.ld-ann-more {
  flex: none; border: 0; background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--brand-600); padding: 4px 8px; border-radius: 7px;
}
.ld-ann-more:hover { background: rgba(99,102,241,.12); }
.ld-ann-more.ghost { color: var(--muted); font-weight: 600; }
.ld-ann-more.ghost:hover { background: rgba(15,23,42,.05); }
.ld-ann-x {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 12px; line-height: 1;
}
.ld-ann-x:hover { background: rgba(15,23,42,.06); color: var(--ink); }

/* ---------------------------------------------------------------- 公告卡片 */
.ld-ann-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.ld-ann-card + .ld-ann-card { margin-top: 12px; }
.ld-ann-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ld-ann-card-head .ld-ann-ico { color: var(--brand-600); }
.ld-ann-card[data-level="warning"] .ld-ann-ico { color: var(--amber); }
.ld-ann-card[data-level="danger"] .ld-ann-ico { color: var(--red); }
.ld-ann-card[data-level="success"] .ld-ann-ico { color: var(--green); }
.ld-ann-card-head h4 { font-size: 14.5px; flex: 1; min-width: 0; }
.ld-ann-card-date { font-size: 11.5px; color: var(--muted-2); flex: none; }
.ld-ann-card-sum { color: var(--muted); font-size: 13px; line-height: 1.7; }
.ld-ann-card-foot { display: flex; gap: 4px; margin-top: 10px; margin-left: -8px; }

/* ---------------------------------------------------------------- 公告弹窗 */
.ld-ann-pop-mask {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .42); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s;
}
.ld-ann-pop-mask.show { opacity: 1; }
.ld-ann-pop {
  position: relative; width: 100%; max-width: 480px; max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: translateY(14px) scale(.97); transition: transform .24s cubic-bezier(.2,.8,.3,1.1);
}
.ld-ann-pop-mask.show .ld-ann-pop { transform: none; }
.ld-ann-pop .ld-modal-x { position: absolute; top: 10px; right: 10px; z-index: 2; }
.ld-ann-pop-head { display: flex; align-items: center; gap: 9px; padding: 20px 22px 0; }
.ld-ann-pop-head .ld-ann-ico { color: var(--brand-600); }
.ld-ann-pop[data-level="warning"] .ld-ann-ico { color: var(--amber); }
.ld-ann-pop[data-level="danger"] .ld-ann-ico { color: var(--red); }
.ld-ann-pop[data-level="success"] .ld-ann-ico { color: var(--green); }
.ld-ann-pop-head h3 { font-size: 17px; padding-right: 26px; }
.ld-ann-pop-body { padding: 12px 22px 18px; overflow-y: auto; }
.ld-ann-pop-body .ld-ann-sum { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.ld-ann-pop-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* ---------------------------------------------------------------- 角标浮标 */
.ld-ann-badge {
  position: fixed; left: 20px; bottom: 20px; z-index: 700;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 11px; border-radius: 99px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow); cursor: pointer; max-width: 320px;
}
.ld-ann-badge:hover { color: var(--brand-600); border-color: var(--brand); }
.ld-ann-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- 通用弹层 */
.ld-modal-mask {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s;
}
.ld-modal-mask.show { opacity: 1; }
.ld-modal {
  width: 100%; max-width: 620px; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: translateY(14px) scale(.97);
  transition: transform .24s cubic-bezier(.2,.8,.3,1.1);
}
.ld-modal-mask.show .ld-modal { transform: none; }
.ld-modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.ld-modal-head h3 { font-size: 17px; flex: 1; }
.ld-modal-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 11.5px; color: var(--muted-2); }
.ld-ann-chip { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: rgba(99,102,241,.12); color: var(--brand-600); }
.ld-ann-chip[data-level="warning"] { background: rgba(245,158,11,.14); color: #b45309; }
.ld-ann-chip[data-level="danger"] { background: rgba(239,68,68,.12); color: #b91c1c; }
.ld-ann-chip[data-level="success"] { background: rgba(16,185,129,.13); color: #047857; }
.ld-modal-x {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 13px; line-height: 1;
}
.ld-modal-x:hover { background: rgba(15,23,42,.06); color: var(--ink); }
.ld-modal-body { padding: 18px 22px; overflow-y: auto; }
.ld-modal-sum { color: var(--muted); font-size: 13.5px; line-height: 1.75; margin-bottom: 14px; }
.ld-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* 富文本正文排版 */
.ld-rich { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }
.ld-rich > *:first-child { margin-top: 0; }
.ld-rich h1, .ld-rich h2, .ld-rich h3, .ld-rich h4 { color: var(--ink); margin: 18px 0 8px; font-size: 15px; }
.ld-rich p { margin: 0 0 10px; }
.ld-rich ul, .ld-rich ol { margin: 0 0 10px; padding-left: 20px; }
.ld-rich li { margin: 3px 0; }
.ld-rich blockquote {
  margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--brand);
  background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--ink-2);
}
.ld-rich pre {
  background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px;
  overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7;
}
.ld-rich code { font-family: var(--mono); font-size: 12px; background: rgba(99,102,241,.1); color: var(--brand-700); padding: 1px 5px; border-radius: 4px; }
.ld-rich pre code { background: none; color: inherit; padding: 0; }
.ld-rich img { border-radius: 10px; margin: 8px 0; }
.ld-rich a { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }
.ld-rich-clamp { max-height: 200px; overflow: hidden; position: relative; }
.ld-rich-clamp::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
  background: linear-gradient(transparent, #fff);
}
.ld-rich table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 10px 0; }
.ld-rich th, .ld-rich td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.ld-rich th { background: var(--surface-2); font-weight: 700; }

@media (max-width: 820px) {
  .ld-ann { padding: 9px 16px; flex-wrap: wrap; }
  .ld-ann-sum { display: none; }
  .ld-ann-pop, .ld-modal { max-height: 88vh; }
  .ld-ann-badge { left: 12px; bottom: 12px; max-width: 60vw; }
}

/* ---------------------------------------------------------------- 页面级容器适配 */
.auth-ad { margin-bottom: 20px; }
.auth-ad:empty { display: none; }
.auth-ad .ld-ad-body { padding: 12px 14px; }

.chat-ad-wrap { max-width: 1180px; margin: 0 auto; padding: 14px 24px 0; width: 100%; }
.chat-ad-wrap:empty { display: none; }
.chat-ad-wrap .ld-ad-body { padding: 12px 16px; }
body.embed .chat-ad-wrap { display: none; }

/* 顶部出现广告时压缩对话区高度，避免页面整体滚动 */
.chat-page:has(.chat-ad-wrap:not(:empty)) .chat-main { height: calc(100vh - 250px); }

/* 侧栏广告卡片内边距归零，交给 .ld-ad 自己控制 */
.side-card > [data-ad-slot] { margin: -4px 0 0; }
.side-card > [data-ad-slot] .ld-ad { box-shadow: none; }
.side-card > [data-ad-slot].ld-slot-empty + h4 { margin-top: 0; }
