/* 心动助手 · 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fdf6f4;
  --surface: #ffffff;
  --surface-2: #fffaf8;
  --surface-3: #fbf0f1;
  --ink: #2f2430;
  --ink-2: #5b4a55;
  --muted: #97848e;
  --line: #f0e2e4;
  --primary: #e05c74;
  --primary-deep: #c74a63;
  --primary-soft: #ffe9ee;
  --primary-glow: rgba(224, 92, 116, .16);
  --plum: #8b5f86;
  --gold: #b8893f;
  --radius-l: 22px;
  --radius-m: 16px;
  --radius-s: 11px;
  --shadow-sm: 0 4px 16px rgba(180, 120, 135, .08);
  --shadow-md: 0 14px 34px rgba(180, 120, 135, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 8% -12%, #ffeef2 0%, rgba(255, 238, 242, 0) 62%),
    radial-gradient(900px 520px at 102% -6%, #f5edff 0%, rgba(245, 237, 255, 0) 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
ul { list-style: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #eddade; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #e2c9cf; }
::-webkit-scrollbar-track { background: transparent; }

.app { display: flex; min-height: 100vh; }

/* ================= 侧边栏 ================= */
.sidebar {
  width: 262px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(255, 252, 251, .82);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }

.brand-mark {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 22px;
  border-radius: 16px;
  background: linear-gradient(140deg, #ffc2ce, #ff8fa3);
  box-shadow: 0 8px 18px rgba(255, 143, 163, .35);
}

.brand-text h1 { font-size: 18px; letter-spacing: .5px; }
.brand-text p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.main-nav { display: flex; flex-direction: column; gap: 6px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background .18s, color .18s, transform .18s;
  text-align: left;
}
.nav-item:hover { background: #fff1f3; color: var(--primary-deep); }
.nav-item.active {
  background: linear-gradient(120deg, #ffe6ec, #ffeef2);
  color: var(--primary-deep);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #ffdbe3;
}
.nav-icon { font-size: 17px; filter: saturate(1.05); }
.nav-label { flex: 1; }

.side-note {
  margin-top: auto;
  padding: 16px;
  border-radius: var(--radius-m);
  background: linear-gradient(150deg, #fff4f6, #fdf1ff);
  border: 1px solid #f7e2e8;
}
.side-note-title { font-size: 11px; letter-spacing: 1.5px; color: var(--primary-deep); margin-bottom: 6px; }
.side-note-text { font-size: 13px; line-height: 1.7; color: var(--ink-2); }

.profile-card {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: box-shadow .18s, transform .18s;
}
.profile-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.profile-avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 18px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff0f3, #ffe3ea);
}
.profile-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-info strong { font-size: 13.5px; }
.profile-info em { font-size: 11px; color: var(--muted); font-style: normal; }
.profile-arrow { margin-left: auto; color: var(--muted); font-size: 16px; }

/* ================= 主区域 ================= */
.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 30px 34px 44px;
}

.panel { max-width: 1180px; margin: 0 auto; animation: fadeUp .34s ease both; }
.panel[hidden] { display: none; }

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

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: 2.4px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}
.page-head h2 { font-size: 27px; letter-spacing: .6px; }
.sub { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.7; max-width: 560px; }

/* ================= 通用按钮 / 标签 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #f47b91, #e05c74);
  box-shadow: 0 10px 22px rgba(224, 92, 116, .26);
}
.btn.primary:hover { box-shadow: 0 14px 28px rgba(224, 92, 116, .32); transform: translateY(-1px); }

.btn.ghost {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: #f4cdd6; color: var(--primary-deep); background: #fff7f8; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-3);
  border: 1px solid transparent;
  transition: all .16s;
}
.chip:hover { background: #ffeef2; color: var(--primary-deep); }
.chip.active {
  background: #fff;
  color: var(--primary-deep);
  border-color: #ffd3dd;
  box-shadow: 0 4px 12px rgba(224, 92, 116, .14);
  font-weight: 600;
}

/* ================= 聊天教练 ================= */
.coach-body {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.coach-settings {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.setting-block h3 {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 11px;
}
.stage-tip {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--primary-deep);
  background: linear-gradient(140deg, #fff4f6, #fff);
  border-left: 3px solid #ffc2ce;
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
}
.mini-tips { display: flex; flex-direction: column; gap: 9px; }
.mini-tips li {
  font-size: 12px; line-height: 1.65; color: var(--ink-2);
  position: relative; padding-left: 14px;
}
.mini-tips li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #f2b3c0;
}

.chat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px);
  min-height: 540px;
  overflow: hidden;
}

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #fffafb, #fff);
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(140deg, #ffe0e8, #ffc9d5);
}
.chat-head-text { display: flex; flex-direction: column; gap: 3px; }
.chat-head-text strong { font-size: 13.5px; }
.chat-head-text span { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.online-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #59c28a; display: inline-block;
  box-shadow: 0 0 0 3px rgba(89, 194, 138, .16);
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 22px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.bubble-row { display: flex; flex-direction: column; gap: 5px; max-width: 82%; }
.bubble-row.ta { align-self: flex-start; align-items: flex-start; }
.bubble-row.me { align-self: flex-end; align-items: flex-end; }

.bubble-meta { font-size: 10.5px; color: var(--muted); padding: 0 4px; }

.bubble {
  padding: 11px 15px;
  font-size: 13.5px;
  line-height: 1.7;
  border-radius: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble-ta {
  background: var(--surface-3);
  color: var(--ink);
  border-bottom-left-radius: 5px;
}
.bubble-me {
  color: #fff;
  background: linear-gradient(135deg, #f4798f, #e05c74);
  box-shadow: 0 8px 18px rgba(224, 92, 116, .22);
  border-bottom-right-radius: 5px;
}

.note-row { align-self: center; max-width: 88%; }
.note-bubble {
  font-size: 12px; color: var(--muted); line-height: 1.7;
  background: #fdf7f6; border: 1px dashed #f3dfe2;
  padding: 9px 14px; border-radius: 12px; text-align: center;
}

/* 建议块 */
.suggest-block {
  background: linear-gradient(160deg, #fffafa, #fff8fb);
  border: 1px solid #f9e6ea;
  border-radius: 18px;
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  animation: fadeUp .3s ease both;
}
.suggest-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--muted);
}
.suggest-head .tag-intent {
  background: #ffeaf0; color: var(--primary-deep);
  padding: 3px 9px; border-radius: 999px; font-weight: 600;
}
.suggest-head .reroll {
  font-size: 11.5px; color: var(--plum);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 8px;
}
.suggest-head .reroll:hover { background: #f6ecfb; }

.suggest-card {
  background: #fff;
  border: 1px solid #f6e3e7;
  border-radius: 14px;
  padding: 12px 14px;
  transition: box-shadow .18s, transform .18s, border-color .18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.suggest-card:hover {
  box-shadow: 0 10px 24px rgba(200, 130, 145, .14);
  transform: translateY(-1px);
  border-color: #ffd2dc;
}
.suggest-top { display: flex; align-items: center; gap: 7px; }
.angle-tag {
  font-size: 10.5px; font-weight: 600;
  color: var(--plum);
  background: #f7eefb;
  padding: 3px 8px; border-radius: 7px;
  white-space: nowrap;
}
.recommend-tag {
  font-size: 10px; color: #b8792c;
  background: #fff5e2; padding: 3px 7px; border-radius: 7px;
}
.suggest-text { font-size: 13.8px; line-height: 1.75; color: var(--ink); }
.suggest-tip { font-size: 11.5px; line-height: 1.65; color: var(--muted); }

/* SSE 流式打字机：最后一张卡片带闪烁光标 */
.suggest-live .suggest-card.live:last-child .card-text::after,
.suggest-live .live-hint::after {
  content: '▍';
  margin-left: 2px;
  color: var(--primary);
  animation: liveCaret 1s steps(1) infinite;
}
.suggest-live .suggest-card.live { border-style: dashed; border-color: #ffd2dc; }
@keyframes liveCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.suggest-actions { display: flex; gap: 8px; padding-top: 2px; }
.suggest-actions button {
  font-size: 11.5px; padding: 5px 11px; border-radius: 8px;
  color: var(--ink-2); background: #fbf3f5;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .15s;
}
.suggest-actions button:hover { background: #ffe9ee; color: var(--primary-deep); }
.suggest-actions .use-btn { background: var(--primary); color: #fff; }
.suggest-actions .use-btn:hover { background: var(--primary-deep); color: #fff; }

/* 欢迎块 */
.welcome {
  margin: auto;
  text-align: center;
  max-width: 520px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.welcome-emoji {
  width: 66px; height: 66px; border-radius: 22px;
  display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(140deg, #fff0f3, #ffe0e9);
  box-shadow: 0 12px 26px rgba(255, 160, 180, .28);
}
.welcome h3 { font-size: 17px; }
.welcome p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.example-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.example-chip {
  font-size: 12px; padding: 7px 13px; border-radius: 999px;
  background: #fff; border: 1px solid #f6e0e5; color: var(--ink-2);
  transition: all .16s;
}
.example-chip:hover { border-color: #ffcbd7; color: var(--primary-deep); transform: translateY(-1px); }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #fffdfd;
}
.composer textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  max-height: 120px;
  background: var(--surface-2);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.composer textarea:focus {
  border-color: #ffc3d0;
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #fff;
}
.send-btn { padding: 11px 18px; border-radius: 14px; }

/* ================= 交流频道 ================= */
.channel-body {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.channel-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 14px 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}
.channel-group { display: flex; flex-direction: column; gap: 4px; }
.channel-group h4 {
  font-size: 10.5px; letter-spacing: 1.4px; color: var(--muted);
  font-weight: 600; padding: 0 8px 6px;
}
.channel-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  font-size: 13px;
  color: var(--ink-2);
  transition: all .16s;
  text-align: left;
}
.channel-item:hover { background: #fff3f5; }
.channel-item.active {
  background: linear-gradient(120deg, #ffe9ee, #fff4f6);
  color: var(--primary-deep);
  font-weight: 600;
}
.channel-item.active .ch-emoji { transform: scale(1.08); }
.ch-emoji {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 13px; border-radius: 8px;
  background: #fbf3f5;
  transition: transform .16s;
}
.ch-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-dot { width: 5px; height: 5px; border-radius: 50%; background: #f4b3c1; flex-shrink: 0; }

.channel-main { min-width: 0; }

.channel-banner {
  border-radius: var(--radius-l);
  padding: 22px 24px;
  background: linear-gradient(125deg, #ffe7ec 0%, #fff4f6 45%, #f5edff 100%);
  border: 1px solid #fbe0e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.channel-banner::after {
  content: "";
  position: absolute; right: -30px; top: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0));
}
.banner-text { position: relative; z-index: 1; }
.banner-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.banner-emoji { font-size: 22px; }
.banner-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.banner-stats { display: flex; gap: 16px; margin-top: 12px; }
.banner-stats span { font-size: 11.5px; color: var(--muted); }
.banner-stats b { color: var(--ink); font-weight: 600; }

.feed-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 2px;
}
.tabs { display: flex; gap: 4px; background: #fff; padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.tab {
  padding: 7px 16px; border-radius: 999px;
  font-size: 12.5px; color: var(--muted);
  transition: all .16s;
}
.tab:hover { color: var(--primary-deep); }
.tab.active { background: linear-gradient(120deg, #ffdfe7, #ffeaf0); color: var(--primary-deep); font-weight: 600; }
.feed-count { font-size: 11.5px; color: var(--muted); }

.feed { display: flex; flex-direction: column; gap: 14px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 18px 20px 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  animation: fadeUp .3s ease both;
}
.post-card:hover { box-shadow: 0 12px 28px rgba(180, 120, 135, .12); transform: translateY(-1px); }

.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(140deg, #fff1f4, #ffe4eb);
  flex-shrink: 0;
}
.post-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.post-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-name { font-size: 13px; font-weight: 600; }
.level-badge {
  font-size: 9.5px; color: #fff; font-weight: 600;
  padding: 2px 6px; border-radius: 5px;
  background: linear-gradient(120deg, #f2a1b3, #e06982);
}
.badge-tag {
  font-size: 9.5px; color: var(--plum); background: #f7edfb;
  padding: 2px 6px; border-radius: 5px;
}
.badge-official {
  font-size: 9.5px; color: #fff; background: linear-gradient(120deg, #b98bd8, #8b5f9c);
  padding: 2px 6px; border-radius: 5px;
}
.post-time { font-size: 10.5px; color: var(--muted); }
.post-channel-tag {
  margin-left: auto; font-size: 10.5px; color: var(--primary-deep);
  background: #fff2f5; padding: 4px 9px; border-radius: 7px;
  white-space: nowrap;
}

.post-content {
  font-size: 13.8px; line-height: 1.85; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
  margin-bottom: 12px;
}

.post-actions {
  display: flex; gap: 4px; align-items: center;
  padding: 8px 0 4px;
  border-top: 1px solid #f8eef0;
  margin-top: 4px;
}
.act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  padding: 6px 10px; border-radius: 9px;
  transition: all .15s;
}
.act-btn:hover { background: #fff2f5; color: var(--primary-deep); }
.act-btn.liked { color: var(--primary); }
.act-btn.liked svg { fill: var(--primary); stroke: var(--primary); }
.act-btn svg { width: 15px; height: 15px; }
.act-spacer { flex: 1; }

.comments {
  margin-top: 10px;
  background: #fdf8f8;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: fadeUp .25s ease both;
}
.comment-item { display: flex; gap: 8px; align-items: flex-start; }
.comment-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px;
  background: #fff0f3; flex-shrink: 0;
}
.comment-body { min-width: 0; }
.comment-name { font-size: 11px; color: var(--muted); }
.comment-text { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); margin-top: 2px; word-break: break-word; }

.comment-form { display: flex; gap: 8px; align-items: center; }
.comment-input {
  flex: 1; min-width: 0;
  border: 1px solid #f1e0e4; border-radius: 9px;
  padding: 7px 11px; font-size: 12.5px;
  background: #fff; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.comment-input:focus { border-color: #ffc7d3; box-shadow: 0 0 0 2px var(--primary-glow); }
.comment-send {
  font-size: 11.5px; padding: 7px 12px; border-radius: 9px;
  background: #ffe9ee; color: var(--primary-deep); font-weight: 600;
}
.comment-send:hover { background: #ffdbe3; }

.empty-posts {
  text-align: center; padding: 50px 20px;
  color: var(--muted); font-size: 13px; line-height: 1.9;
  background: #fff; border: 1px dashed #f2dde1; border-radius: var(--radius-m);
}

/* ================= 话术库 ================= */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 230px;
  color: var(--muted);
  transition: border-color .16s, box-shadow .16s;
}
.search-box:focus-within { border-color: #ffc7d3; box-shadow: 0 0 0 3px var(--primary-glow); }
.search-box input {
  border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--ink); width: 100%;
}
.search-box input::placeholder { color: #bfaab2; }

.head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.fav-entry {
  gap: 6px; white-space: nowrap;
  border: 1px solid #ffd8e0; background: #fff;
  color: var(--primary-deep); font-size: 12.5px; padding: 10px 14px;
}
.fav-entry:hover { background: #fff4f7; }
.fav-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 10.5px; line-height: 18px; text-align: center;
}

.script-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.script-tabs { flex-shrink: 0; }

.script-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.script-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  animation: fadeUp .3s ease both;
}
.script-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(180, 120, 135, .14); border-color: #f8dfe4; }
.script-top { display: flex; align-items: center; justify-content: space-between; }
.script-cat {
  font-size: 10.5px; font-weight: 600;
  color: var(--primary-deep); background: #ffeef2;
  padding: 3px 9px; border-radius: 7px;
}
.fav-btn {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  color: #cdb8bf; transition: all .16s;
}
.fav-btn:hover { background: #fff4f6; color: var(--primary); }
.fav-btn.active { color: var(--primary); }
.fav-btn svg { width: 16px; height: 16px; }
.hot-rank {
  flex-shrink: 0;
  font-size: 10.5px; font-weight: 700; color: #fff;
  padding: 2px 7px; border-radius: 7px;
  background: linear-gradient(135deg, #ff9db0, #ff7d95);
}
.script-top { gap: 8px; }
.script-top .fav-btn { margin-left: auto; }

.script-text {
  font-size: 13.5px; line-height: 1.8; color: var(--ink);
  flex: 1;
}
.script-note {
  font-size: 11.5px; line-height: 1.65; color: var(--muted);
  padding-top: 10px; border-top: 1px dashed #f2e2e5;
}
.script-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.copy-btn {
  font-size: 11.5px; color: var(--ink-2);
  padding: 5px 11px; border-radius: 8px;
  background: #fbf3f5; display: inline-flex; align-items: center; gap: 4px;
  transition: all .15s;
}
.copy-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.copy-btn:hover { background: #ffe9ee; color: var(--primary-deep); }
.fav-stat { font-size: 11px; color: var(--muted); }
.fav-stat.active { color: var(--primary); }
.script-foot-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* 我的收藏弹窗 */
.fav-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.fav-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: #fffafb; border: 1px solid var(--line); border-radius: 12px;
}
.fav-item-main { flex: 1; min-width: 0; }
.fav-item-meta { font-size: 11px; color: var(--muted); }
.fav-item-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ================= 我的页面 ================= */
.me-body { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }

.me-profile {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s;
}
.me-profile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.me-avatar {
  width: 52px; height: 52px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff0f3, #ffe3ea);
}
.me-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.me-info strong { font-size: 15.5px; }
.me-info em { font-size: 12px; color: var(--muted); font-style: normal; }
.me-edit { margin-left: auto; font-size: 12px; color: var(--primary-deep); flex-shrink: 0; }

.me-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.me-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.me-section-head h3 { font-size: 14px; letter-spacing: .4px; }
.me-count { font-size: 11.5px; color: var(--muted); }
.my-list { display: flex; flex-direction: column; gap: 10px; }

/* 我的页面：可折叠区块 */
.me-toggle { width: 100%; margin-bottom: 0; border-radius: 8px; }
.me-h3 { font-size: 14px; letter-spacing: .4px; font-weight: 700; transition: color .16s; }
.me-toggle:hover .me-h3 { color: var(--primary-deep); }
.me-toggle .me-count { margin-left: auto; }
.me-chevron { font-size: 12px; color: var(--primary-deep); transition: transform .2s; flex-shrink: 0; }
.me-toggle.open .me-chevron { transform: rotate(180deg); }
.me-collapse-body { margin-top: 12px; animation: fadeUp .22s ease both; }

.copy-btn.danger { color: #b3392e; background: #fdeceb; }
.copy-btn.danger:hover { background: #fadcd8; color: #8f2b21; }

/* ================= 弹窗 ================= */
#modalRoot { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#modalRoot.open { pointer-events: auto; }

.modal-mask {
  position: absolute; inset: 0;
  background: rgba(60, 35, 45, .38);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: maskIn .2s ease both;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(520px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-l);
  padding: 24px;
  box-shadow: 0 30px 70px rgba(80, 40, 55, .3);
  animation: modalIn .26s cubic-bezier(.2, .9, .3, 1.05) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h3 { font-size: 18px; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.modal-close {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: var(--muted); font-size: 17px;
}
.modal-close:hover { background: #fdf0f2; color: var(--primary-deep); }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.form-field input[type="text"],
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13.5px;
  background: var(--surface-2);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.form-field textarea { resize: vertical; min-height: 130px; line-height: 1.75; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: #ffc3d0; box-shadow: 0 0 0 3px var(--primary-glow); background: #fff;
}
.anon-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-2);
  padding: 9px 0 2px;
  user-select: none;
}
.anon-toggle input { accent-color: var(--primary); width: 15px; height: 15px; }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-option {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: #fdf5f6; border: 1px solid transparent;
  transition: all .15s;
}
.avatar-option:hover { background: #fff0f3; }
.avatar-option.active {
  border-color: #ffb9c8; background: #fff; 
  box-shadow: 0 6px 14px rgba(224, 92, 116, .16);
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ================= 提示 ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 16px);
  background: rgba(47, 36, 48, .92);
  color: #fff;
  font-size: 12.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 80;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= 响应式 ================= */
@media (max-width: 1120px) {
  .main { padding: 24px 22px 40px; }
  .coach-body { grid-template-columns: 1fr; }
  .coach-settings {
    flex-direction: column;
    gap: 18px;
  }
  .chat-card { height: min(620px, calc(100vh - 420px)); min-height: 460px; }
  .channel-body { grid-template-columns: 1fr; }
  .channel-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
    align-items: center;
  }
  .channel-nav .channel-group { flex-direction: row; gap: 6px; flex-shrink: 0; }
  .channel-group h4 { display: none; }
  .channel-item { white-space: nowrap; padding: 8px 11px; }
  .channel-item .ch-dot { display: none; }
  .ch-name { white-space: nowrap; }
}

@media (max-width: 860px) {
  .app { display: block; padding-bottom: 74px; }
  .sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: auto;
    width: 100%;
    height: 68px;
    flex-direction: row;
    align-items: center;
    padding: 0 8px;
    gap: 0;
    border-right: none;
    border-top: 1px solid var(--line);
    background: rgba(255, 252, 251, .96);
    z-index: 30;
  }
  .brand, .side-note, .profile-card { display: none; }
  .main-nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 10px; flex: 1; align-items: center; justify-content: center; }
  .nav-icon { font-size: 18px; }
  .nav-label { font-size: 11px; flex: none; }
  .main { height: auto; min-height: calc(100vh - 68px); padding: 20px 16px 30px; }
  .page-head { flex-direction: column; gap: 14px; }
  .page-head h2 { font-size: 23px; }
  .sub { font-size: 12.5px; }
  .page-head .btn { align-self: flex-start; }
  .chat-card { height: calc(100vh - 330px); min-height: 420px; }
  .search-box { width: 100%; min-width: 0; }
  .head-actions { width: 100%; flex-wrap: wrap; }
  .head-actions .search-box { flex: 1 1 180px; width: auto; }
  .script-grid { grid-template-columns: 1fr; }
  .banner-stats { flex-wrap: wrap; gap: 10px 14px; }
  .composer { padding: 10px; gap: 8px; }
  .composer .send-btn span { display: none; }
  .composer .send-btn { padding: 12px 14px; border-radius: 12px; }
  .post-card { padding: 16px 16px 10px; }
  .toast { bottom: 86px; }
}

@media (max-width: 420px) {
  .bubble-row { max-width: 92%; }
  .suggest-block { padding: 12px 12px 14px; }
  .avatar-picker .avatar-option { width: 36px; height: 36px; font-size: 17px; }
}

/* 帖子媒体 / 上传 / 灯箱 */
.post-media { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.post-media-grid { display: grid; gap: 6px; border-radius: 14px; overflow: hidden; }
.post-media-grid.grid-1 { grid-template-columns: 1fr; }
.post-media-grid.grid-2, .post-media-grid.grid-3, .post-media-grid.grid-4 { grid-template-columns: 1fr 1fr; }
.post-media-img { padding: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fbf1f2; }
.post-media-img img { width: 100%; height: auto; max-height: 460px; object-fit: contain; display: block; transition: transform .3s; }
.post-media-img:hover img { transform: scale(1.01); }
.post-media-video { width: 100%; max-height: 420px; border-radius: 14px; background: #000; display: block; }
.lightbox-mask { background: rgba(23, 12, 18, .86); padding: 40px 20px; cursor: zoom-out; }
.lightbox-img { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.lightbox-close { position: absolute; top: 22px; right: 24px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 20px; display: grid; place-items: center; }
.lightbox-close:hover { background: rgba(255,255,255,.28); }
.lightbox-download { position: absolute; top: 22px; right: 76px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 17px; display: grid; place-items: center; text-decoration: none; line-height: 1; cursor: pointer; }
.lightbox-download:hover { background: rgba(255,255,255,.28); }

/* 分享链接卡片 */
.share-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.share-card-thumb { width: 64px; height: 64px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: linear-gradient(140deg, #ffe0e8, #ffc9d5); display: grid; place-items: center; font-size: 26px; }
.share-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share-card-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.share-card-title { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-card-desc { font-size: 12px; color: var(--ink-2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-card-host { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 深链定位高亮 */
.flash { animation: flashRing 2.2s ease; }
@keyframes flashRing {
  0%, 50% { box-shadow: 0 0 0 3px rgba(224, 92, 116, .5); }
  100% { box-shadow: 0 0 0 3px rgba(224, 92, 116, 0); }
}
.upload-zone { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.media-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.media-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 18px; background: rgba(0,0,0,.28); pointer-events: none; }
.media-remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; display: grid; place-items: center; }
.media-remove:hover { background: rgba(224,92,116,.9); }
.feed-loading { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.feed-error { display: block; margin-top: 10px; font-size: 11px; color: #c08d99; }
.empty-posts code { background: #fdf1f3; padding: 2px 6px; border-radius: 5px; font-size: 12px; }
.badge-pinned { font-size: 9.5px; color: #fff; background: linear-gradient(120deg, #f0b15c, #df8b3b); padding: 2px 6px; border-radius: 5px; }
.admin-entry { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--plum); text-decoration: none; padding: 6px 0 0; }
.admin-entry:hover { color: var(--primary-deep); }
.agent-add {
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--primary-deep);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.agent-add:hover { background: #fff0f4; }
.form-field.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 每日撩人情话 */
.side-note-head { display: flex; align-items: center; justify-content: space-between; }
.side-note-actions { display: flex; gap: 4px; }
.side-note-btn {
  width: 26px; height: 26px; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .6);
  color: var(--primary-deep);
  font-size: 13px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
  transition: background .16s;
}
.side-note-btn:hover { background: #ffe7ed; }

/* 恋爱语录：AI 快速生成（可折叠卡片） */
.quick-gen {
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm);
  margin: 8px 0 16px; overflow: hidden;
}
.gen-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 14px 18px;
  border: 0; background: transparent; cursor: pointer;
  text-align: left; font-family: inherit;
}
.gen-toggle:hover { background: #fff7f9; }
.gen-toggle-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.gen-toggle-hint { font-size: 11px; color: var(--muted); }
.gen-chevron {
  margin-left: auto; font-size: 12px; color: var(--primary-deep);
  transition: transform .2s;
}
.gen-toggle.open .gen-chevron { transform: rotate(180deg); }
.gen-body { padding: 0 18px 16px; animation: fadeUp .22s ease both; }
.gen-note { font-size: 11.5px; color: var(--muted); margin: 0 0 10px; line-height: 1.6; }
.gen-actions { margin-top: 10px; }
.gen-result { margin-top: 12px; padding: 10px 12px; background: #fff8fa; border: 1px dashed #ffc3d0; border-radius: 12px; }
.gen-suggestion {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 6px 0; border-bottom: 1px dashed #ffe3ea;
}
.gen-suggestion:last-child { border-bottom: 0; }
.gen-suggestion p { flex: 1; margin: 0; font-size: 13px; line-height: 1.6; }
.gen-suggestion button {
  flex-shrink: 0; border: 0; background: transparent; color: var(--primary-deep);
  font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.gen-suggestion button:hover { background: #ffe7ed; }
.btn.small { padding: 7px 14px; font-size: 12px; }

/* 悬浮发帖 / 发语录按钮（Twitter 风格，固定在视口右下角） */
.fab-layer {
  position: fixed; inset: 0;
  z-index: 60; pointer-events: none;
}
.fab-layer .fab { pointer-events: auto; }
.fab[hidden] { display: none; }
.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px 14px 16px;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #ff9db0, #ff7d95);
  color: #fff; font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(255, 125, 149, .42);
  transition: transform .18s, box-shadow .18s;
}
.fab:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 32px rgba(255, 125, 149, .5);
}
.fab:active { transform: translateY(0) scale(.98); }
.fab-icon { font-size: 16px; line-height: 1; }
@media (max-width: 820px) {
  .fab { right: 16px; bottom: 84px; padding: 13px 16px 13px 14px; }
  .fab-text { display: none; }
}

/* AI 快速生成：自定义标签行 */
.custom-tag-row {
  display: flex; gap: 6px; margin-top: 8px;
}
.custom-tag-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 10px; font-size: 12.5px; background: #fffafa; outline: none;
}
.custom-tag-row input:focus { border-color: #ffc3d0; box-shadow: 0 0 0 3px var(--primary-glow); background: #fff; }
.chip { position: relative; }
.chip .chip-del {
  display: inline-block; margin-left: 4px; font-size: 10px; opacity: .55;
  color: #c5394f; border-radius: 999px; padding: 0 3px;
}
.chip .chip-del:hover { opacity: 1; background: #ffe7ed; }

/* 生成结果头部 */
.gen-result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.gen-result-head span { font-size: 12px; color: var(--primary-deep); }
.gen-result-head .btn.small { padding: 4px 10px; font-size: 11px; }
