/* AI 工作台 —— 样式：浅色 · 墨绿主色 + 姜黄点缀
   参考 Notion / Linear / Vercel 的克制工具风。
   仅前端视觉层；不承载任何业务逻辑。
*/
:root {
  /* 表面 */
  --bg: #f7f8fa;
  --bg-2: #fbfcfd;
  --panel: #ffffff;
  --panel-2: #f3f5f8;
  --line: #e5e7eb;
  --line-2: #d3d8e0;
  /* 文字 */
  --text: #1f2329;
  --text-dim: #4b5563;
  --text-mute: #8a919c;
  /* 主色（低饱和墨绿，克制使用） */
  --blue: #2f7a58;
  --blue-hover: #26634a;
  --blue-tint: #e9f4ee;
  --blue-tint-2: #f4faf6;
  --blue-line: #b3d5c3;
  /* 点缀色：反差跳色。纯亮黄只做色块/竖条/边框，需要当文字时用深金 */
  --gold: #ffd400;
  --gold-ink: #b89900;
  --gold-tint: #fff9d9;
  --gold-line: #ffe066;
  /* 语义色（仅小面积使用） */
  --green: #17a06a;
  --green-tint: #e7f5ee;
  --green-line: #aed9c4;
  --red: #d23c3c;
  --red-tint: #fcecec;
  --red-line: #ecc2c2;
  --slate: #475569;
  --neutral-tint: #f3f5f8;
  --slate-line: #d5dce5;
  /* 圆角 / 阴影 */
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 10px 30px rgba(16, 24, 40, .10), 0 2px 8px rgba(16, 24, 40, .05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
#app { position: relative; z-index: 1; }

img { max-width: 100%; }

/* ---------------- 启动屏 ---------------- */
.boot {
  display: grid; place-items: center; min-height: 100vh;
  background: var(--bg); color: var(--text-mute);
}
.boot[hidden] { display: none; }
.boot-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.boot-title { color: var(--text-dim); font-size: 14px; letter-spacing: .04em; }
.boot-sub { font-size: 12px; color: var(--text-mute); }
.boot .spin { width: 22px; height: 22px; border-width: 2px; }

/* ---------------- 登录页 ---------------- */
.auth-wrap { display: grid; grid-template-columns: 1.15fr .85fr; min-height: 100vh; background: var(--panel); }
.auth-hero { padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.auth-hero h1 { font-size: 42px; line-height: 1.18; margin: 24px 0 14px; letter-spacing: -.5px; color: var(--text); font-weight: 700; }
.auth-hero h1 em { font-style: normal; color: var(--blue); }
.auth-hero p.lead { color: var(--text-dim); font-size: 14px; line-height: 1.9; max-width: 520px; }
.auth-hero .kicker { color: var(--blue); letter-spacing: .3em; font-size: 12px; font-weight: 500; }
.flow-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; max-width: 560px; }
.flow-line span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--text-dim); font-size: 12px; background: var(--bg-2); }
.auth-form { padding: 56px 56px; display: flex; flex-direction: column; justify-content: center; gap: 14px; background: var(--bg); }
.auth-form h2 { margin: 0 0 4px; font-size: 20px; color: var(--text); }
.auth-form .hint { color: var(--text-mute); font-size: 12px; line-height: 1.8; }
.tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: none; padding: 8px; border-radius: 6px; color: var(--text-dim); cursor: pointer; transition: all .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); font-weight: 500; }

/* ---------------- 表单元素 ---------------- */
label.field { display: block; margin-bottom: 12px; max-width: 100%; }
label.field > span { display: block; color: var(--text-dim); font-size: 12.5px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; max-width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; color: var(--text);
}
input::placeholder, textarea::placeholder { color: #a3a9b3; }
input:hover, select:hover, textarea:hover { border-color: #b9c0ca; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 122, 88, .14); }
textarea { resize: vertical; line-height: 1.85; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); width: 15px; height: 15px; vertical-align: middle; margin: 0 4px 0 0; }

/* 两步验证 6 位码：一排 6 格。
   全局 input[type=text] 是 width:100% + padding:9px 12px，不覆盖就会竖着占 6 行——原来丑就是这原因。
   选择器必须带 .totp-row 前缀：input[type=text] 的权重是 (0,1,1)，单写 .totp-box 只有 (0,1,0)，会被压住。 */
.totp-row { display: flex; gap: 8px; margin: 4px 0 14px; }
.totp-row .totp-box {
  flex: 0 1 46px; min-width: 30px; height: 56px; padding: 0;
  text-align: center; font-size: 24px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
/* 登录页右栏在 1024 屏只剩 323px，821 屏（还没到单列断点）只剩 237px——
   所以格子必须可收缩，光靠固定 46px 会在中等宽度挤出去。 */
@media (max-width: 1024px) {
  .totp-row { gap: 6px; }
  .totp-row .totp-box { flex-basis: 42px; height: 52px; font-size: 22px; }
}
@media (max-width: 520px) {
  .totp-row { gap: 5px; }
  .totp-row .totp-box { flex-basis: 38px; height: 48px; font-size: 20px; }
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 8px 15px; cursor: pointer; transition: all .15s; white-space: nowrap;
  color: var(--text-dim); max-width: 100%;
}
.btn:hover { border-color: #aeb6c1; background: var(--panel-2); color: var(--text); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--panel-2); border-color: transparent; color: var(--text); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red-line); color: var(--red); background: var(--red-tint); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--panel); border-color: var(--line-2); color: var(--text-dim); }

.row { display: flex; gap: 10px; align-items: center; max-width: 100%; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; min-width: 0; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }

/* ---------------- 应用骨架 ---------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line); background: var(--panel);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.logo {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; flex: none; overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.brand small { color: var(--text-mute); font-size: 11px; }
.nav-group { color: var(--text-mute); font-size: 11px; letter-spacing: .12em; padding: 14px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer; border: 1px solid transparent; font-size: 13.5px;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.on { background: var(--blue-tint); color: var(--blue); font-weight: 500; position: relative; }
/* 当前项左侧姜黄竖条：黄色只在这种极小面积上出现，做「你现在在这」的定位点 */
.nav-item.on:not(.nav-parent)::before {
  content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; border-radius: 2px; background: var(--gold);
}
.nav-item .tag {
  margin-left: auto; font-size: 10px; color: #5a739a;
  background: #eef2f8; border: 1px solid #dde5f0;
  padding: 0 6px; border-radius: 5px; line-height: 16px; white-space: nowrap;
}
.nav-item.on .tag { background: rgba(255, 255, 255, .7); border-color: var(--blue-line); color: var(--blue); }

/* 一级菜单（可点，跳到该组默认页）+ 二级菜单（手风琴，随当前页展开） */
.nav-item.nav-parent { margin-top: 6px; }
.nav-item.nav-parent .grow { flex: 1; min-width: 0; }
.nav-item .caret {
  font-size: 10px; line-height: 1; opacity: .45;
  transition: transform .15s ease; margin-left: 4px;
}
.nav-item.nav-parent.open .caret { transform: rotate(180deg); opacity: .8; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
/* 收起状态：DOM 留着（角标、测试、无障碍都要能查到），只是不显示 */
.nav-sub[hidden] { display: none; }
.nav-sub .nav-item {
  padding: 6px 10px 6px 28px; font-size: 13px;
  color: var(--text-mute); border: 1px solid transparent;
}
.nav-sub .nav-item:hover { color: var(--text); }
.nav-sub .nav-item.on { color: var(--blue); font-weight: 500; background: var(--blue-tint); }
.nav-divider { height: 1px; background: var(--line); margin: 6px 10px 6px 28px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }

/* 自媒体工作坊的当前账号切换条：原先常驻侧边栏，但它只影响这一支，收进页面里 */
.acct-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow-card);
}
.acct-bar-k { font-size: 12.5px; color: var(--text-mute); }
.acct-bar select { width: auto; min-width: 180px; padding: 6px 10px; font-size: 13px; }
.acct-bar .spacer { flex: 1; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--radius-sm); background: var(--panel-2); }
.avatar {
  width: 29px; height: 29px; flex: 0 0 29px; border-radius: 50%;
  background: var(--blue-tint); display: grid; place-items: center;
  font-size: 12px; color: var(--blue); font-weight: 600;
}
.side-user .grow > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: 24px 30px 80px; max-width: 1400px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { margin: 0 0 3px; font-size: 20px; letter-spacing: -.2px; color: var(--text); font-weight: 650; }
.topbar p { margin: 0; color: var(--text-mute); font-size: 13px; }
.topbar .row { flex-wrap: wrap; }
.user-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 11px; font-size: 12px; color: var(--text-dim); background: var(--panel);
  max-width: 100%;
}
.user-chip b { color: var(--blue); font-weight: 600; }

/* ---------------- 提示条 note ---------------- */
.note {
  border: 1px solid var(--line); border-left: 3px solid var(--blue-line);
  background: var(--blue-tint-2);
  border-radius: var(--radius-sm); padding: 11px 14px;
  color: var(--text-dim); font-size: 13px; line-height: 1.8;
  max-width: 100%; overflow-wrap: break-word;
}
.note.info { border-left-color: var(--blue); background: var(--blue-tint-2); }
.note.warn { border-left-color: #9aa7b8; background: var(--neutral-tint); color: var(--ink-2); }
.note.ok { border-left-color: var(--green); background: var(--green-tint); }
.note code { background: rgba(16, 24, 40, .06); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }

/* ---------------- 卡片 / 网格 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-card);
  max-width: 100%; min-width: 0; overflow-wrap: break-word;
}
.card.current { border-color: var(--blue-line); box-shadow: 0 0 0 1px var(--blue-line); }
.card.dense { padding: 14px; }
.card h3 {
  margin: 0 0 12px; font-size: 16px; color: var(--text); font-weight: 600; line-height: 1.3;
  display: flex; align-items: center; gap: 10px;
}
/* 全站卡片标题统一标识：一条 3px 绿竖条，替代原先各页面五花八门的 emoji 图标 */
.card h3::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px; background: var(--blue); flex: none;
}
.card h3 small { color: var(--text-mute); font-weight: 400; margin-left: 2px; font-size: 11.5px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero, .auth-form { padding: 36px 24px; }
}

/* ---------------- 步骤条 ---------------- */
.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 7px; padding: 6px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-mute); font-size: 12.5px; background: var(--panel);
}
.step.on { border-color: var(--blue-line); color: var(--blue); background: var(--blue-tint); font-weight: 500; }
.step.done { border-color: var(--green-line); color: var(--green); background: var(--green-tint); }
.step b { font-weight: 600; }
.step-sep { width: 20px; height: 1px; background: var(--line-2); }

/* ---------------- 统计卡 ---------------- */
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow-card); max-width: 100%;
}
.stat .k { color: var(--text-mute); font-size: 12px; }
.stat .v { font-size: 26px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -.5px; color: var(--text); }
.stat .v.gold {
  /* 关键数字不靠黄字（浅底上读不清），改成黄底深字：反差最大，可读性也最好 */
  color: #1f2329; background: var(--gold); display: inline-block;
  padding: 0 10px; border-radius: 7px; line-height: 1.45;
}
.stat .s { color: var(--text-mute); font-size: 11.5px; }

/* ---------------- 话题卡 ---------------- */
.topic {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; background: var(--panel);
  cursor: pointer; transition: all .16s; position: relative;
  max-width: 100%; overflow-wrap: break-word;
}
.topic:hover { border-color: var(--line-2); }
.topic.on { border-color: var(--blue-line); box-shadow: 0 0 0 1px var(--blue-line); background: var(--blue-tint-2); }
.topic .idx { position: absolute; top: 14px; right: 15px; color: var(--text-mute); font-size: 12px; font-family: var(--mono); }
.topic h4 { margin: 0 0 8px; font-size: 15px; line-height: 1.55; padding-right: 30px; color: var(--text); font-weight: 600; }
.topic .angle { color: var(--text-dim); font-size: 12.5px; line-height: 1.8; }
.topic .hook {
  margin-top: 10px; padding: 9px 12px;
  background: var(--blue-tint); border-left: 3px solid var(--blue);
  border-radius: 6px; font-size: 12.5px; color: var(--text-dim); line-height: 1.75;
}
.topic ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 12.5px; line-height: 1.9; }
.topic .foot { display: flex; align-items: center; gap: 7px; margin-top: 12px; flex-wrap: wrap; }

/* ---------------- 徽章 pill ---------------- */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; border: 1px solid var(--line);
  color: var(--text-dim); background: var(--bg-2);
  max-width: 100%; overflow-wrap: break-word; vertical-align: middle; line-height: 1.7;
}
.pill.checkable { cursor: pointer; user-select: none; }
.pill.checkable.on { border-color: var(--blue-line); color: var(--blue); background: var(--blue-tint); font-weight: 500; }
.pill.checkable input { margin-right: 5px; }
.pill.gold { border-color: #e8c200; color: #1f2329; background: var(--gold); font-weight: 600; }
.pill.blue { border-color: var(--blue-line); color: var(--blue); background: var(--blue-tint-2); }
.pill.green { border-color: var(--green-line); color: var(--green); background: var(--green-tint); }
.pill.red { border-color: var(--red-line); color: var(--red); background: var(--red-tint); }
.pill.orange { border-color: var(--slate-line); color: var(--slate); background: var(--neutral-tint); }

/* ---------------- 编辑器 ---------------- */
.editor-wrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1080px) { .editor-wrap { grid-template-columns: 1fr; } }
.editor {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
}
.editor-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.editor-body { padding: 18px 20px; min-width: 0; }
.editor textarea.doc {
  border: none; background: transparent; min-height: 460px;
  font-size: 15px; line-height: 2; padding: 0; border-radius: 0; color: var(--text);
}
.editor textarea.doc:focus { box-shadow: none; border-color: transparent; }
textarea.doc.draft-doc {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px; min-height: 320px;
}
textarea.doc.draft-doc:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

.slash-menu {
  position: absolute; z-index: 30; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: 5px;
  min-width: 232px; max-width: calc(100vw - 24px); max-height: 320px; overflow: auto;
}
.slash-menu .item {
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  display: flex; gap: 8px; align-items: center;
  font-size: 12.5px; color: var(--text-dim);
}
.slash-menu .item:hover, .slash-menu .item.on { background: var(--blue-tint); color: var(--blue); }
.slash-menu .item small { color: var(--text-mute); margin-left: auto; font-size: 10.5px; }

.sel-menu {
  position: absolute; z-index: 40; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: 4px;
  display: flex; gap: 3px; flex-wrap: wrap;
  max-width: min(430px, calc(100vw - 24px));
}
.sel-menu button { background: none; border: none; padding: 6px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--text-dim); }
.sel-menu button:hover { background: var(--blue-tint); color: var(--blue); }

.ai-result {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--bg-2); margin-top: 10px;
  max-width: 100%; min-width: 0;
}
.ai-result .rd { white-space: pre-wrap; line-height: 1.9; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.ai-result .ex { color: var(--text-mute); font-size: 11.5px; margin-top: 8px; line-height: 1.8; }

.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs-line button {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 13px; cursor: pointer; color: var(--text-mute);
  margin-bottom: -1px; font-size: 13px;
}
.tabs-line button:hover { color: var(--text-dim); }
.tabs-line button.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 500; }

/* ---------------- 列表 ---------------- */
.list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.list-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; background: var(--panel);
  display: flex; gap: 12px; align-items: center;
  max-width: 100%; min-width: 0;
}
.list-item:hover { border-color: var(--line-2); }
.list-item.current { border-color: var(--blue-line); background: var(--blue-tint-2); }
.list-item .t { font-size: 13.5px; margin-bottom: 2px; color: var(--text); overflow-wrap: break-word; }
.list-item .m { color: var(--text-mute); font-size: 11.5px; overflow-wrap: break-word; }
.list-item .grow { min-width: 0; }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: break-word; }
th { color: var(--text-mute); font-weight: 500; font-size: 11.5px; }
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-2); }

/* ---------------- 进度条 ---------------- */
.bar { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bar.green > i { background: var(--green); }
.bar.red > i { background: var(--red); }

/* ---------------- 提词器 ---------------- */
.tele-stage {
  position: fixed; inset: 0; background: var(--bg-2);
  z-index: 100; display: flex; flex-direction: column;
}
.tele-top {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap;
}
.tele-top b { font-size: 14px; color: var(--text); }
.tele-scroll { flex: 1; overflow-y: auto; padding: 44px 8vw 45vh; scroll-behavior: smooth; min-width: 0; }
.tele-block { margin: 0 auto 26px; max-width: 1120px; }
.tele-text { font-size: 34px; line-height: 1.65; font-weight: 500; letter-spacing: .01em; color: #a8aeb8; overflow-wrap: anywhere; }
.tele-block.readonly .tele-text { opacity: .4; }
.tele-block.current .tele-text { color: var(--text); font-weight: 600; }
.tele-tags { display: flex; gap: 9px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.tele-tone { color: var(--blue); font-size: 13px; border: 1px solid var(--blue-line); background: var(--blue-tint); padding: 2px 10px; border-radius: 999px; }
.tele-action { color: #5a6b82; font-size: 13px; border: 1px solid var(--line-2); background: var(--panel); padding: 2px 10px; border-radius: 999px; }
.tele-pause { color: var(--text-mute); font-size: 12px; }
.tele-guide {
  position: absolute; left: 0; right: 0; top: 42%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .5), transparent);
  pointer-events: none;
}
.tele-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 11px 18px; background: var(--panel);
  border-top: 1px solid var(--line);
}
.tele-progress { height: 3px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-bottom: 9px; }
.tele-progress > i { display: block; height: 100%; background: var(--blue); width: 0; }

/* ---------------- 弹层 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .32);
  display: grid; place-items: center; z-index: 200; backdrop-filter: blur(3px);
  padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-pop);
  width: min(720px, 100%); max-height: 88vh; overflow: auto; min-width: 0;
}
.modal header {
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.modal header h3 { margin: 0; font-size: 15px; color: var(--text); }
.modal .body { padding: 18px 20px; max-width: 100%; overflow-wrap: break-word; }
.modal footer {
  padding: 13px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  position: sticky; bottom: 0; background: var(--panel);
}

/* ---------------- toast ---------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 9px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); font-size: 13px; color: var(--text-dim);
  max-width: 100%; overflow-wrap: anywhere; animation: slide .22s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 平台预览 ---------------- */
.preview {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; background: var(--bg-2); max-width: 100%; min-width: 0;
}
.preview .ph { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; color: var(--text-mute); font-size: 12px; }
.preview .pbody {
  white-space: pre-wrap; line-height: 1.9; font-size: 13px;
  max-height: 320px; overflow: auto; color: var(--text); overflow-wrap: anywhere;
}
.counter.over { color: var(--red); }

/* ---------------- details ---------------- */
details { max-width: 100%; }
summary { color: var(--text-mute); font-size: 12.5px; }
summary:hover { color: var(--text-dim); }

/* 折叠卡片：默认收起，点标题展开。标题当 summary 用，右侧箭头指示状态 */
details.card.fold > summary {
  cursor: pointer; list-style: none; margin: 0;
  display: flex; align-items: center; gap: 6px; user-select: none;
}
details.card.fold > summary::-webkit-details-marker { display: none; }
details.card.fold > summary::after {
  content: '▾'; margin-left: auto; color: var(--text-mute);
  font-size: 11px; line-height: 1; transition: transform .15s ease;
}
details.card.fold[open] > summary::after { transform: rotate(180deg); }
details.card.fold > summary > h3 { margin: 0; }
details.card.fold > summary:hover > h3 { color: var(--blue); }
details.card.fold[open] > summary { margin-bottom: 14px; }

/* ---------------- loading ---------------- */
.spin {
  width: 15px; height: 15px;
  border: 2px solid var(--line-2); border-top-color: var(--blue);
  border-radius: 50%; animation: sp .7s linear infinite; display: inline-block;
}
@keyframes sp { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, #eef0f3, #f7f8fa, #eef0f3);
  background-size: 200% 100%; animation: sk 1.3s linear infinite;
  border-radius: 6px; height: 14px;
}
@keyframes sk { to { background-position: -200% 0; } }

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6dae1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #c2c7d0; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* 选中态（替代旧金色内联） */
.list-item.selected { border-color: var(--blue-line); }
.card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08); }
.pill.check.selected { border-color: var(--blue); color: var(--blue); background: var(--blue-tint); font-weight: 500; }

/* ============================ 生成中「停止」浮条 ============================ */
#stop-bar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  color: var(--text-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}
#stop-bar.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
#stop-bar .stop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: stop-pulse 1.2s ease-in-out infinite;
  flex: 0 0 auto;
}
#stop-bar .stop-txt {
  white-space: nowrap;
  color: var(--text-mute);
}
#stop-bar .stop-btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
#stop-bar .stop-btn:hover:not(:disabled) {
  background: var(--blue-tint);
  border-color: var(--blue-line);
  color: var(--blue);
}
#stop-bar .stop-btn:disabled {
  cursor: default;
  color: var(--text-mute);
  opacity: .7;
}
@keyframes stop-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.82); }
}
@media (max-width: 640px) {
  #stop-bar { bottom: 16px; padding: 8px 10px 8px 14px; }
  #stop-bar .stop-txt { display: none; }
}

/* 记忆时间线（D7-B1）：三栏在窄屏收成一栏，别挤 */
.mem-grid { display: grid; grid-template-columns: 212px minmax(0, 1fr) minmax(0, 1.25fr); gap: 14px; align-items: start }
@media (max-width: 1180px) { .mem-grid { grid-template-columns: 1fr } }

/* 账号菜单：点左下角头像向上弹出（账号安全 / 两步验证，属个人设置，不放管理后台） */
.acct-wrap { position: relative; }
.side-user { cursor: pointer; }
.side-user:hover { filter: brightness(.97); }
.side-user .caret {
  font-size: 10px; line-height: 1; opacity: .45; margin-left: 2px;
  transition: transform .15s ease;
}
.side-user.open .caret { transform: rotate(180deg); opacity: .8; }
.acct-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: 5px;
  display: flex; flex-direction: column; gap: 2px;
}
.acct-menu-item {
  padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
  display: flex; flex-direction: column; gap: 1px; color: var(--text-dim);
}
.acct-menu-item small { color: var(--text-mute); font-size: 11px; }
.acct-menu-item:hover { background: var(--panel-2); color: var(--text); }
.acct-menu-item.on { background: var(--blue-tint); color: var(--blue); }
.acct-menu-item.on small { color: var(--blue); opacity: .75; }
/* 菜单里混了链接（接入文档）：去掉下划线和默认蓝，跟旁边的按钮长一样 */
a.acct-menu-item { text-decoration: none; }
a.acct-menu-item:visited { color: var(--text-dim); }

/* ===== 文件库 v1（批次 2）===== */
.files-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:14px 0 12px; }
.files-toolbar .crumbs { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--dim,#666); }
.files-toolbar .crumbs a { color:inherit; text-decoration:none; }
.files-toolbar .crumbs a:hover { color:var(--blue); }
.files-toolbar .crumbs .sep { opacity:.45; }
.files-toolbar .fsearch { width:260px; }
.files-layout { display:grid; grid-template-columns:260px minmax(0,1fr); gap:14px; align-items:start; }
.ftree { padding:8px 0; max-height:70vh; overflow:auto; }
.ftree-row { display:flex; align-items:center; gap:6px; padding:7px 10px; cursor:pointer; border-radius:6px; font-size:13.5px; }
.ftree-row:hover { background:rgba(127,127,127,.08); }
.ftree-row.on { background:var(--blue-tint); color:var(--blue); font-weight:600; }
.ftree-caret { width:14px; opacity:.65; font-size:11px; }
.ftree-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ftree-count { font-size:11px; opacity:.5; }
.flist { padding:10px 12px; min-height:360px; max-height:70vh; overflow:auto; }
.flist.drop-hot { outline:2px dashed var(--blue,#2f7a58); outline-offset:-6px; background:rgba(47,122,88,.05); }
.frow { display:flex; align-items:center; gap:10px; padding:9px 6px; border-bottom:1px solid rgba(127,127,127,.12); }
.frow:last-child { border-bottom:0; }
.frow:hover { background:rgba(127,127,127,.04); }
/* 文件行的格式标签（替代原来的 emoji 图标）：小号等宽短标签，PNG / PDF / DOCX */
.ficon {
  width: 40px; flex: none; text-align: center; font-size: 9.5px; font-weight: 600;
  letter-spacing: .03em; color: var(--text-mute); background: var(--blue-tint-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 0; line-height: 1.2;
}
.fgrow { flex:1; min-width:0; }
.fname { font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fmeta { font-size:11.5px; opacity:.6; margin-top:2px; }
.factions { display:flex; gap:3px; flex-wrap:wrap; justify-content:flex-end; }
.factions .danger { color:#c0392b; }
.fempty { text-align:center; padding:70px 20px; opacity:.75; line-height:2; }
.fempty-icon { font-size:40px; }
.fdirlabel { margin:14px 0 2px; font-size:11.5px; opacity:.55; letter-spacing:.05em; }
.fupload { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.fpreview-mask { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:60; }
.fpreview { position:fixed; top:0; right:0; bottom:0; width:min(720px,92vw); background:var(--bg,#fff); z-index:61; display:flex; flex-direction:column; box-shadow:-8px 0 30px rgba(0,0,0,.18); }
.fpreview header { display:flex; align-items:flex-start; gap:10px; padding:16px 18px; border-bottom:1px solid rgba(127,127,127,.18); }
.fpreview-body { flex:1; overflow:auto; padding:16px 18px; }
.fpreview footer { padding:12px 18px; border-top:1px solid rgba(127,127,127,.18); }
.fpreview-text { white-space:pre-wrap; word-break:break-word; font-size:13px; line-height:1.7; margin:0; }
.fpreview-img { max-width:100%; height:auto; display:block; margin:0 auto; }
.fpreview-pdf { width:100%; height:100%; min-height:60vh; border:0; }
@media (max-width:900px){ .files-layout{ grid-template-columns:1fr; } .ftree{ max-height:220px; } }

/* ============================ 自媒体工作坊入口卡 ============================ */
/* 去掉 emoji 图标后，用标题前的一条短绿线接住视觉重心；hover 时线变长，卡片轻微上浮 */
.entry-card { padding: 20px 20px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 9px; min-height: 136px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.entry-card h3 { margin: 0; transition: color .15s; }
.entry-card p { margin: 0; line-height: 1.65; }
.entry-card .tag {
  align-self: flex-start; margin-top: auto;
  color: var(--blue); border-color: var(--blue-line); background: var(--blue-tint); font-weight: 500;
}
.entry-card:hover { border-color: var(--blue-line); box-shadow: 0 6px 18px rgba(20, 30, 40, .07); transform: translateY(-1px); }
.entry-card:hover h3::before { height: 19px; }
.card h3::before { transition: height .18s ease; }
.entry-card:hover .tag { color: #fff; background: var(--blue); border-color: var(--blue); }

/* 通用弹窗（kit.js 的 openModal）—— 替代 window.prompt 的选项式交互 */
.modal-mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .42); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { width: min(520px, 94vw); max-height: 86vh; background: var(--panel, #fff); border-radius: 12px; box-shadow: 0 18px 50px rgba(16, 24, 40, .28); display: flex; flex-direction: column; overflow: hidden; }
.modal-box header { padding: 15px 18px 11px; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-body label.field:last-child { margin-bottom: 0; }
.modal-box footer { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }

/* 归档：封存的东西在列表里淡出去，别跟活跃文件抢注意力 */
.frow.farchived { opacity: .55; }
.frow.farchived .fname { text-decoration: line-through; text-decoration-color: var(--muted-line, #c9ced6); }
.frow.farchived:hover { opacity: .8; }

/* 删除确认弹窗：路径整条摆出来，别让人靠文件名猜 */
.fdel-path { margin: 8px 0 14px; padding: 9px 11px; border-radius: 8px; background: rgba(127,127,127,.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5;
  word-break: break-all; }
.fdel-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.fdel-check input { margin-top: 2px; flex: none; }
