/* WorkBuddy × 制造业 实战面板 · 纸质质感 · 浅色暖调 */
* { margin:0; padding:0; box-sizing:border-box; -webkit-font-smoothing:antialiased; }
:root{
  --bg:#F6F2E9;              /* 米纸 */
  --bg2:#FBF8F1;             /* 亮纸 */
  --card:#FFFDF7;            /* 卡纸 */
  --ink:#2E2A23;             /* 暖墨 */
  --ink2:#5B544A;
  --ink3:#9A9184;
  --line:rgba(120,100,70,.18);
  --line2:rgba(120,100,70,.10);
  --brand:#A4642A;           /* 赭石 */
  --brand-strong:#8F521F;
  --brand-soft:rgba(164,100,42,.10);
  --shadow:0 2px 10px rgba(90,72,45,.08);
  --shadow-lg:0 16px 44px rgba(90,72,45,.14);
  --radius:18px;
  --serif:"Songti SC","Noto Serif SC","STSong",serif;
  --sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Helvetica Neue",sans-serif;
}
html{ font-size:15px; }
body{ font-family:var(--sans); color:var(--ink); line-height:1.6; background:var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(164,100,42,.05), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(120,140,90,.05), transparent 46%),
    repeating-linear-gradient(0deg, rgba(120,100,70,.014) 0 1px, transparent 1px 3px);
  background-attachment:fixed; }

/* ===== 顶栏 ===== */
.topbar{ position:sticky; top:0; z-index:50; display:flex; justify-content:space-between; align-items:center;
  background:rgba(246,242,233,.9); backdrop-filter:saturate(160%) blur(14px); -webkit-backdrop-filter:saturate(160%) blur(14px);
  border-bottom:1px solid var(--line2); padding:12px 28px; }
.brand{ display:flex; align-items:center; gap:13px; }
.logo{ width:40px; height:40px; border-radius:11px; background:linear-gradient(135deg,#A4642A,#7C4A2C);
  color:#F6F2E9; font-family:var(--serif); font-weight:700; display:flex; align-items:center; justify-content:center; font-size:16px;
  box-shadow:0 4px 14px rgba(143,82,31,.28); }
.brand-txt h1{ font-size:17px; font-weight:600; font-family:var(--serif); letter-spacing:.3px; }
.brand-txt h1 .x{ color:var(--brand); }
.brand-txt p{ font-size:12px; color:var(--ink3); margin-top:1px; }
.topbar-right{ display:flex; align-items:center; gap:14px; }
.top-tag{ font-size:12px; color:var(--brand-strong); background:var(--brand-soft); border:1px solid rgba(164,100,42,.18); padding:5px 13px; border-radius:99px; font-weight:500; }
.menu-toggle{ display:none; border:none; background:transparent; font-size:20px; padding:2px 8px; cursor:pointer; color:var(--ink2); }

/* ===== 布局 ===== */
.layout{ display:flex; min-height:calc(100vh - 65px); }
.sidebar{ width:262px; flex-shrink:0; background:rgba(246,242,233,.75); border-right:1px solid var(--line2);
  position:sticky; top:65px; height:calc(100vh - 65px); overflow-y:auto; padding:20px 12px 24px; }
.sidebar::-webkit-scrollbar{ width:6px; } .sidebar::-webkit-scrollbar-thumb{ background:rgba(120,100,70,.2); border-radius:3px; }
.sidebar-hd{ font-size:11px; color:var(--ink3); padding:2px 14px 12px; letter-spacing:2.5px; font-weight:600; }
.sidebar-ft{ margin-top:18px; padding:12px 14px; font-size:12px; color:var(--ink3); border-top:1px solid var(--line2); line-height:1.8; }
.nav-cat{ margin-bottom:4px; }
.nav-cat-hd{ display:flex; align-items:center; gap:9px; padding:9px 14px 5px; font-size:12px; font-weight:600; color:var(--ink3); letter-spacing:.4px; }
.nav-dot{ width:7px; height:7px; border-radius:99px; flex-shrink:0; }
.nav-item{ display:flex; align-items:center; gap:8px; padding:8px 12px 8px 30px; font-size:13.5px; color:var(--ink2);
  border-radius:9px; cursor:pointer; line-height:1.4; transition:background .15s; }
.nav-item:hover{ background:rgba(164,100,42,.08); }
.nav-item.active{ background:var(--brand-soft); color:var(--brand-strong); font-weight:600; }
.nav-item .star{ color:#C8881F; font-size:11px; }
.content{ flex:1; padding:34px 40px 90px; min-width:0; }
.overlay{ display:none; }

/* ===== 欢迎页 ===== */
.welcome-card{ max-width:1060px; }
.welcome-hero{ text-align:center; padding:30px 0 38px; }
.welcome-logo{ width:62px; height:62px; border-radius:16px; background:linear-gradient(135deg,#A4642A,#7C4A2C);
  color:#F6F2E9; font-family:var(--serif); font-weight:700; display:flex; align-items:center; justify-content:center; font-size:25px; margin:0 auto 20px;
  box-shadow:0 10px 28px rgba(143,82,31,.3); }
.welcome-hero h2{ font-family:var(--serif); font-size:31px; font-weight:700; letter-spacing:.5px; margin-bottom:12px; }
.welcome-hero .grad{ color:var(--brand); }
.welcome-sub{ color:var(--ink3); font-size:15px; max-width:620px; margin:0 auto; line-height:1.8; }
.welcome-legend{ display:flex; justify-content:center; gap:22px; margin:22px auto 0; font-size:12.5px; color:var(--ink2); flex-wrap:wrap; }
.welcome-legend span{ display:flex; align-items:center; gap:6px; }
.welcome-legend i{ width:8px; height:8px; border-radius:99px; display:inline-block; }

/* 总览网格 */
.ov-cat{ margin-bottom:32px; }
.ov-cat-hd{ display:flex; align-items:center; gap:11px; font-size:18px; font-weight:700; font-family:var(--serif); margin-bottom:15px; letter-spacing:.3px; }
.ov-cat-hd .bar{ width:4px; height:17px; border-radius:2px; }
.ov-cat-hd .cnt{ font-size:12px; color:var(--ink3); font-weight:400; font-family:var(--sans); }
.ov-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:15px; }
.ov-card{ background:var(--card); border:1px solid var(--line2); border-radius:16px;
  padding:18px 20px; cursor:pointer; transition:.22s cubic-bezier(.2,.7,.3,1); box-shadow:var(--shadow); position:relative; overflow:hidden; }
.ov-card::before{ content:""; position:absolute; top:0; left:0; bottom:0; width:3px; background:var(--cat-color,#999); opacity:.8; }
.ov-card:hover{ box-shadow:var(--shadow-lg); transform:translateY(-3px); border-color:var(--line); }
.ov-card .code{ font-size:11px; color:var(--ink3); font-weight:600; letter-spacing:.8px; }
.ov-card .ti{ font-size:16px; font-weight:600; margin:5px 0 8px; letter-spacing:.2px; }
.ov-card .meta{ display:flex; gap:9px; flex-wrap:wrap; font-size:11px; color:var(--ink3); align-items:center; }
.ov-card .roles{ font-size:12px; color:var(--ink2); margin-top:10px; line-height:1.55; padding-top:10px; border-top:1px solid var(--line2); }
.badge-star{ background:linear-gradient(120deg,#C8881F,#A4642A); color:#fff; padding:2px 8px; border-radius:99px; font-size:10px; font-weight:600; }

/* ===== 详情页 ===== */
.detail{ max-width:880px; margin:0 auto; }
.d-back{ display:inline-flex; align-items:center; gap:5px; font-size:14px; color:var(--brand-strong); cursor:pointer; margin-bottom:18px; font-weight:500; }
.d-back:hover{ opacity:.7; }
.d-head{ background:var(--card); border:1px solid var(--line2); border-radius:var(--radius);
  padding:26px 30px; margin-bottom:18px; box-shadow:var(--shadow); }
.d-head .code{ font-size:12px; color:var(--ink3); font-weight:600; letter-spacing:1.2px; }
.d-head h2{ font-family:var(--serif); font-size:25px; font-weight:700; margin:8px 0 14px; letter-spacing:.3px; }
.d-chips{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{ font-size:12px; padding:5px 12px; border-radius:99px; background:rgba(120,100,70,.08); color:var(--ink2); font-weight:500; }
.chip.dim{ color:#F6F2E9; }
.chip.star{ background:linear-gradient(120deg,#C8881F,#A4642A); color:#fff; }
.chip.real{ background:linear-gradient(120deg,#5E8C4A,#4A7A5A); color:#fff; }
.sec{ background:var(--card); border:1px solid var(--line2); border-radius:var(--radius);
  padding:24px 30px; margin-bottom:18px; box-shadow:var(--shadow); }
.sec-hd{ display:flex; align-items:baseline; gap:10px; font-size:16.5px; font-weight:700; font-family:var(--serif); margin-bottom:16px; letter-spacing:.3px; }
.sec-hd .bar{ width:3px; height:15px; border-radius:2px; background:var(--brand); align-self:center; }
.sec-hd .sub{ font-size:12px; color:var(--ink3); font-weight:400; font-family:var(--sans); }
.intro{ color:var(--ink2); line-height:1.95; font-size:15px; }

/* 文件卡片 */
.file-cards{ display:flex; flex-direction:column; gap:11px; }
.file-card{ display:flex; align-items:center; gap:14px; border:1px solid var(--line2); border-radius:13px; padding:13px 16px; background:var(--bg2); }
.file-ic{ width:40px; height:40px; border-radius:10px; background:linear-gradient(135deg,#5E8C4A,#4A7A5A); color:#F6F2E9; font-size:10px; font-weight:700;
  display:flex; align-items:center; justify-content:center; flex-shrink:0; letter-spacing:.5px; }
.file-ic.txt{ background:linear-gradient(135deg,#A4642A,#8F521F); }
.file-ic.py{ background:linear-gradient(135deg,#C8881F,#A4642A); }
.file-info{ flex:1; min-width:0; }
.file-info .fn{ font-size:14px; font-weight:600; }
.file-info .fd{ font-size:12px; color:var(--ink3); margin-top:2px; }
.file-btns{ display:flex; gap:8px; flex-shrink:0; }
.btn{ border:1px solid var(--line); background:var(--card); color:var(--ink2); font-size:12.5px; padding:7px 16px; border-radius:99px; cursor:pointer; text-decoration:none; font-weight:500; transition:.15s; white-space:nowrap; }
.btn:hover{ color:var(--brand-strong); border-color:var(--brand); }
.btn.primary{ background:var(--brand); color:#FFFDF7; border-color:var(--brand); }
.btn.primary:hover{ background:var(--brand-strong); color:#FFFDF7; }

/* 提示词 */
.prompt-box{ background:var(--bg2); border:1px solid var(--line2); border-radius:13px; padding:18px 20px; margin-bottom:13px; position:relative; }
.prompt-box .p-label{ font-size:12px; font-weight:600; color:var(--brand-strong); margin-bottom:9px; letter-spacing:.3px; }
.prompt-box pre{ white-space:pre-wrap; font-family:"SF Mono","SFMono-Regular",ui-monospace,"PingFang SC",monospace; font-size:13px; line-height:1.9; color:var(--ink); }
.copy-btn{ position:absolute; top:14px; right:14px; }

/* 会话回放 */
.chat{ background:#F2EDDF; border:1px solid var(--line2); border-radius:16px; padding:22px; }
.msg{ display:flex; gap:11px; margin-bottom:16px; }
.msg .avatar{ width:34px; height:34px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:15px; box-shadow:var(--shadow); }
.msg.user .avatar{ background:#E4DCC9; }
.msg.ai .avatar{ background:linear-gradient(135deg,#A4642A,#7C4A2C); color:#F6F2E9; font-size:11px; font-weight:700; font-family:var(--serif); }
.bubble{ max-width:90%; border-radius:15px; padding:13px 17px; font-size:14px; line-height:1.9; }
.msg.user .bubble{ background:var(--card); border:1px solid var(--line2); border-top-left-radius:5px; white-space:pre-wrap; box-shadow:var(--shadow); }
.msg.ai .bubble{ background:var(--card); border:1px solid var(--line2); border-top-left-radius:5px; box-shadow:var(--shadow); }
.send-btn{ display:inline-flex; align-items:center; gap:6px; margin:0 0 18px 45px; }
.replay-ctrl{ display:flex; gap:10px; margin:0 0 18px 45px; flex-wrap:wrap; }
.think-tag{ display:inline-block; font-style:normal; font-size:11px; font-weight:700; color:#4A7A3C; background:rgba(94,140,74,.15); border-radius:5px; padding:1px 8px; margin-right:8px; letter-spacing:1px; }
/* 逐步回放：各部分初始隐藏 */
.part{ opacity:0; transform:translateY(8px); transition:opacity .5s cubic-bezier(.2,.7,.3,1), transform .5s cubic-bezier(.2,.7,.3,1); }
.part.on{ opacity:1; transform:none; }
.part-steps .wb-step{ opacity:0; transform:translateX(-8px); transition:opacity .35s, transform .35s; }
.part-steps .wb-step.on{ opacity:1; transform:none; }
.ai-output{ display:none; }
.ai-output.show{ display:flex; animation:fadein .45s cubic-bezier(.2,.7,.3,1); }
@keyframes fadein{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

/* AI 思考/工具调用过程条 */
.wb-steps{ margin:2px 0 12px; border-left:2px solid rgba(164,100,42,.3); padding-left:14px; }
.wb-step{ font-size:12.5px; color:var(--ink3); padding:4px 0; display:flex; align-items:center; gap:7px; }
.wb-step .st-ic{ font-size:12px; color:var(--brand); }
.wb-step .st-tool{ font-family:"SF Mono",monospace; font-size:11.5px; background:var(--brand-soft); color:var(--brand-strong); padding:1px 7px; border-radius:6px; border:1px solid rgba(164,100,42,.15); }
.wb-think{ font-size:13px; color:var(--ink2); background:rgba(94,140,74,.08); border:1px solid rgba(94,140,74,.15); border-radius:11px; padding:10px 14px; margin:2px 0 12px; line-height:1.8; font-style:italic; }

/* wb 表格与结论 */
.wb-table{ width:100%; border-collapse:collapse; margin:12px 0; font-size:13px; background:var(--card); border-radius:10px; overflow:hidden; box-shadow:0 1px 4px rgba(90,72,45,.06); }
.wb-table th,.wb-table td{ border-bottom:1px solid var(--line2); padding:9px 12px; text-align:left; }
.wb-table thead th{ background:#F2EDDF; font-weight:600; border-bottom:1px solid var(--line); }
.wb-table tfoot td{ background:#F5EFE2; font-weight:600; }
.wb-table tr:last-child td{ border-bottom:none; }
.wb-quote{ background:rgba(164,100,42,.05); border:1px solid rgba(164,100,42,.14); border-radius:12px; padding:13px 16px; margin:10px 0; font-size:13.5px; line-height:1.9; }
.wb-conclusion{ background:rgba(94,140,74,.08); border-left:3px solid #5E8C4A; border-radius:8px; padding:12px 16px; margin-top:12px; font-size:14px; line-height:1.85; }
.wb-warn{ background:rgba(200,136,31,.09); border-left:3px solid #C8881F; border-radius:8px; padding:12px 16px; margin-top:12px; font-size:14px; line-height:1.85; }
.wb-outs{ margin-top:12px; display:flex; flex-wrap:wrap; gap:8px; }
.wb-file-out{ display:inline-flex; align-items:center; gap:7px; background:#F2EDDF; border:1px solid var(--line2); border-radius:8px; padding:6px 12px; font-size:12.5px; text-decoration:none; color:var(--ink); }
.wb-file-out.real{ background:rgba(94,140,74,.1); border-color:rgba(94,140,74,.3); cursor:pointer; transition:.15s; }
.wb-file-out.real:hover{ background:rgba(94,140,74,.18); }
.wb-file-out .fo-ic{ width:22px; height:22px; border-radius:6px; background:linear-gradient(135deg,#5E8C4A,#4A7A5A); color:#F6F2E9; font-size:8px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.wb-file-out .fo-open{ font-size:11px; color:#4A7A3C; font-weight:600; margin-left:2px; }
code{ background:rgba(120,100,70,.1); padding:2px 7px; border-radius:6px; font-size:12.5px; font-family:"SF Mono",monospace; }

/* 贴士列表 */
.tip-list{ list-style:none; }
.tip-list li{ padding:10px 0 10px 28px; position:relative; font-size:14px; color:var(--ink2); line-height:1.8; border-bottom:1px solid var(--line2); }
.tip-list li:last-child{ border-bottom:none; }
.tip-list li::before{ content:""; position:absolute; left:2px; top:16px; width:6px; height:6px; border-radius:99px; background:#5E8C4A; }
.bonus-body{ background:rgba(94,140,74,.06); border:1px solid rgba(94,140,74,.15); border-radius:13px; padding:16px 18px; font-size:14px; line-height:1.9; color:var(--ink2); }

/* 预览模态窗 */
.pv-mask{ display:none; position:fixed; inset:0; background:rgba(46,42,35,.4); backdrop-filter:blur(4px); z-index:100; align-items:center; justify-content:center; padding:20px; }
.pv-mask.show{ display:flex; }
.pv-modal{ background:var(--card); border:1px solid var(--line); border-radius:18px; width:min(880px,94vw); max-height:86vh; display:flex; flex-direction:column; box-shadow:var(--shadow-lg); }
.pv-modal-hd{ display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid var(--line2); }
.pv-modal-ti{ display:flex; align-items:center; gap:11px; font-weight:600; font-size:15px; }
.pv-modal-ic{ background:linear-gradient(135deg,#5E8C4A,#4A7A5A); color:#F6F2E9; font-size:10px; font-weight:700; padding:5px 9px; border-radius:8px; }
.pv-modal-actions{ display:flex; gap:12px; align-items:center; }
.pv-modal-dl{ font-size:13px; color:var(--brand-strong); text-decoration:none; font-weight:500; }
.pv-modal-close{ border:none; background:rgba(120,100,70,.1); width:32px; height:32px; border-radius:99px; cursor:pointer; font-size:14px; color:var(--ink2); }
.pv-modal-body{ overflow:auto; padding:18px 20px; font-size:13px; }
.pv-modal-body pre{ white-space:pre-wrap; font-family:"SF Mono",monospace; line-height:1.9; }
.pv-modal-ft{ padding:11px 20px; border-top:1px solid var(--line2); font-size:12px; color:var(--ink3); }

/* Toast */
.toast{ position:fixed; bottom:32px; left:50%; transform:translateX(-50%) translateY(10px); background:rgba(46,42,35,.94); color:#F6F2E9;
  padding:11px 24px; border-radius:99px; font-size:13.5px; opacity:0; pointer-events:none; transition:.3s cubic-bezier(.2,.7,.3,1); z-index:200; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

@media (max-width:960px){
  .sidebar{ position:fixed; left:-290px; z-index:80; transition:.25s; top:0; height:100vh; background:var(--bg); }
  .sidebar.open{ left:0; }
  .overlay.show{ display:block; position:fixed; inset:0; background:rgba(46,42,35,.35); z-index:70; }
  .menu-toggle{ display:block; }
  .ov-grid{ grid-template-columns:1fr; }
  .content{ padding:20px 16px 60px; }
  .welcome-hero h2{ font-size:25px; }
}
