/* AI 员工工作台：沿用 021 首页的米白底 + 近黑文字 + 橙色点缀；排版紧凑，手机自动单列 */
:root {
  --bg: #f4f2f0;
  --surface: #ffffff;
  --ink: #0b0b0b;
  --muted: #6b6762;
  --faint: #9a958f;
  --line: #e2ded8;
  --accent: #ff6a00;
  --accent-soft: #fff1e6;
  --ok: #1f7a4d;
  --ok-soft: #e7f4ec;
  --warn: #9a5b00;
  --warn-soft: #fdf3e1;
  --danger: #b3261e;
  --danger-soft: #fbeaea;
  --radius: 10px;
  --gutter: 16px;
  --nav-current: #cfe6ff; /* 所在入口：浅蓝底黑字（yay 10-23 指定），深色模式也不变 */
  --panel-head: #dfe6ee; /* 首页各栏标题条：浅蓝灰底黑字（yay 10-23），深色模式也不变 */
  --gold: #a87400; /* 周规划关键点：金色粗体（yay 10-23），浅底上要压得住，取深一点的金 */
  --age: #2f6fd1; /* 首页条目"今天 / 昨天 / N 周前"：中蓝色字（yay 10-23） */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141312; --surface: #1d1c1a; --ink: #f2efea; --muted: #a8a29b; --faint: #7d7871; --line: #34312d;
    --accent: #ff7a1a; --accent-soft: #3a2415; --ok: #6fd39d; --ok-soft: #173326; --warn: #f0b45c; --warn-soft: #3a2c14;
    --danger: #f08a82; --danger-soft: #3b1d1b; --gold: #f2c14e; --age: #6aa6f8; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141312; --surface: #1d1c1a; --ink: #f2efea; --muted: #a8a29b; --faint: #7d7871; --line: #34312d;
  --accent: #ff7a1a; --accent-soft: #3a2415; --ok: #6fd39d; --ok-soft: #173326; --warn: #f0b45c; --warn-soft: #3a2c14;
  --danger: #f08a82; --danger-soft: #3b1d1b; --gold: #f2c14e; --age: #6aa6f8; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* 隐藏属性优先于 .company-switch 等的 display:flex */
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: 0.02em; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.company-switch { display: flex; gap: 4px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 3px 11px; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.pill[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.ghost { background: transparent; color: var(--muted); border-style: dashed; }
.topbar .spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; }

main { max-width: 1120px; margin: 0 auto; padding: 18px var(--gutter) 48px; }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .crumb { color: var(--muted); text-decoration: none; font-size: 13px; }

/* 卡片与分区 */
.section { margin-top: 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.split { display: grid; gap: 14px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* 入口卡 */
.entry { display: block; text-decoration: none; transition: border-color .15s, transform .15s; min-height: 92px; }
.entry:hover { border-color: var(--ink); transform: translateY(-1px); }
.entry .name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.entry .desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.entry.locked { opacity: .62; }
/* 首页顶部的入口条：按屏幕宽度自动排，电脑上一排放下，说明只留一行（鼠标停留看全文） */
.entry-row { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); margin-bottom: 14px; }
.entry-row .entry { min-height: 0; padding: 10px 12px; }
.entry-row .entry .name { font-size: 14px; }
.entry-row .entry .desc { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 页头入口条：工作台 + 全部入口，所在入口高亮 */
.entry-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.nav-pill { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; white-space: nowrap; }
.nav-pill:hover { border-color: var(--ink); }
.nav-pill[aria-current="page"] { background: var(--nav-current); border-color: var(--nav-current); color: #0b0b0b; font-weight: 600; }
/* 首页：左侧按入口分栏（3 栏，窄屏 2 栏 / 1 栏），栏内滚动；右侧进展栏收窄到原来一半 */
.home-split { display: grid; gap: 14px; grid-template-columns: minmax(0, 5fr) minmax(200px, 1fr); align-items: start; }
.home-panels { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-panel { display: flex; flex-direction: column; height: 520px; padding: 12px; } /* 首页平时一排三栏（yay 10-23），栏可以高一些 */
.home-panel-section { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; } /* 合并的栏里两段平分高度、各自滚动：按内容分会把条目少的那段挤得只剩标头 */
.home-panel-head { flex-shrink: 0; }
/* 高度不固定的栏（右侧窄栏、手机）：段落按内容排，列表自己限高滚动 */
.home-panel.side { height: auto; }
.home-panel.side .home-panel-section { flex: none; }
.home-panel.side .list { max-height: 280px; }
.home-panel .list { flex: 0 1 auto; min-height: 0; overflow-y: auto; font-size: 13px; }
.home-panel-head { margin: -12px -12px 8px; padding: 8px 12px; background: var(--panel-head); color: #0b0b0b; border-radius: var(--radius) var(--radius) 0 0; }
.home-panel-section + .home-panel-section .home-panel-head { margin-top: 10px; border-radius: 0; } /* 第二段的标头：不贴卡片顶，也不要圆角 */
.home-panel-head a { text-decoration: none; }
.home-panel-head { display: flex; align-items: center; gap: 8px; }
.home-panel-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 400; }
.home-panel-tools .btn { color: var(--ink); } /* 标头是浅底黑字，按钮照常用自己的底色和字色 */
.home-panel .neg { color: var(--danger); }
.home-panel .age { color: var(--age); font-size: 12px; white-space: nowrap; }
.home-panel .todo-line { align-items: center; }
.home-panel .one-line { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-panel .grow > div { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } /* 话术、摘要很长时最多 3 行，一条不占满一栏 */
@media (max-width: 960px) { .home-split { grid-template-columns: 1fr; } .home-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .home-panels { grid-template-columns: 1fr; } .home-panel { height: auto; } .home-panel-section { flex: none; } .home-panel .list { max-height: 240px; } }
/* 新媒体：稿件正文保留换行；三个热榜并排，窄屏叠起来 */
.media-body { white-space: pre-wrap; word-break: break-word; }
.highlights { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.highlights li { color: var(--gold); font-weight: 700; }
.media-hot { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* 列表 */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.empty { color: var(--muted); padding: 14px 0; text-align: center; font-size: 13px; }

/* 徽标 */
.badge { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.badge.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.badge.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.level { font-weight: 700; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--ink); color: var(--bg); }

/* 提示条 */
.notice { padding: 9px 12px; border-radius: 8px; font-size: 13px; background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.info { background: var(--accent-soft); color: var(--ink); }

/* 页签 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 8px 14px; border: 0; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-current="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* 表单与按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 13px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.chosen { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { resize: vertical; }
.form-row { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.error-text { color: var(--danger); font-size: 12.5px; min-height: 1em; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.toolbar input[type="text"], .toolbar input[type="search"] { width: 220px; }

/* 表格：紧凑、可横向滚动 */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; border-top: 0; white-space: nowrap; }
.kv.progress-kv { grid-template-columns: 1fr auto; }
.kv.progress-kv .v { text-align: right; font-variant-numeric: tabular-nums; }
.invite-row select { width: auto; max-width: 100%; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.neg { color: var(--danger); }
tfoot th, tfoot td { border-top: 2px solid var(--line); color: var(--ink); font-weight: 600; }

/* 产出内容 */
.output { padding: 14px; }
.output-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.kv .v { white-space: pre-wrap; word-break: break-word; }
.kv ul { margin: 0; padding-left: 18px; }
.next-step { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; font-size: 13px; }
.sources { margin-top: 8px; font-size: 12px; color: var(--muted); word-break: break-all; }
.feedback { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* 做提案：三个方向并排，手机上单列 */
.directions { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .directions { grid-template-columns: 1fr; } }
.direction.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
pre.prompt { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; background: var(--bg); border: 1px solid var(--line); padding: 10px; border-radius: 8px; font-size: 12px; }
.inline-tags { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.check-row { display: flex; gap: 8px; align-items: flex-start; }
.check-row input { margin-top: 3px; flex: none; }
/* 动趣样板验收：项目名 | 结果 | 备注 一行；手机上备注换到下一行 */
.check-grid { display: grid; grid-template-columns: 9em 7em 1fr; gap: 8px; align-items: center; }
@media (max-width: 640px) { .check-grid { grid-template-columns: 1fr 7em; } .check-grid > :last-child { grid-column: 1 / -1; } }
details > summary { cursor: pointer; color: var(--muted); }
.concept img { display: block; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }

/* 对话 */
.chat-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 0; }
.chat-message { display: flex; flex-direction: column; gap: 4px; max-width: 86%; }
.chat-message.from-user { align-self: flex-end; align-items: flex-end; }
.chat-message.from-ai { align-self: flex-start; }
.chat-bubble { padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); }
.from-user .chat-bubble { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chat-suggestion { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chat-form { display: flex; flex-direction: column; gap: 6px; }

/* 额度条 */
.meter { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.meter > span { display: block; height: 100%; background: var(--ink); }
.meter.high > span { background: var(--accent); }

/* 登录页 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 24px; margin: 6px 0 2px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.segmented button { border: 0; background: none; padding: 6px 4px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.segmented button[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }

@media (max-width: 520px) {
  .list > li.wrap-mobile { flex-direction: column; }
  .list > li.wrap-mobile > .actions { width: 100%; }
  h1 { font-size: 19px; }
  .topbar { gap: 8px; }
  .who { width: 100%; order: 10; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry { min-height: 0; padding: 12px; }
  .entry .desc { font-size: 12px; }
}
