/* ============================================================
   可研工作台 · claude.ai 风格设计系统
   暖米白底 / 衬线展示标题 / 陶土橙强调色 / 大圆角 / 轻阴影
   ============================================================ */
:root {
  --bg: #FAF9F5;
  --bg-sidebar: #F0EEE6;
  --bg-hover: #EBE9DF;
  --surface: #FFFFFF;
  --surface-2: #F5F4EE;
  --border: #E5E2D7;
  --border-strong: #D5D2C6;
  --text: #1F1E1D;
  --text-2: #6E6B62;
  --text-3: #9C998E;
  --accent: #C96442;
  --accent-hover: #B5532F;
  --accent-soft: #F4E3DC;
  --ok: #5E7D5A;
  --ok-soft: #E7EEE4;
  --warn: #A8762E;
  --warn-soft: #F6ECDB;
  --err: #B0473C;
  --err-soft: #F6E3E0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(40, 35, 25, .05), 0 4px 16px rgba(40, 35, 25, .05);
  --serif: Georgia, "Times New Roman", "Noto Serif SC", "SimSun", "宋体", serif;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
#app { display: flex; height: 100vh; overflow: hidden; }

/* ---------------- 侧栏 ---------------- */
.sidebar {
  width: 264px; min-width: 264px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 12px 12px;
}
.brand { padding: 4px 10px 16px; cursor: pointer; }
.brand h1 { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .5px; }
.brand h1 .dot { color: var(--accent); }
.brand p { font-size: 11.5px; color: var(--text-3); letter-spacing: 1.5px; text-transform: uppercase; }
.btn-new {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--sans); font-weight: 500;
  transition: background .15s;
}
.btn-new:hover { background: var(--accent-hover); }
.side-label { font-size: 11px; color: var(--text-3); letter-spacing: 1px; margin: 18px 10px 6px; }
.proj-list { flex: 1; overflow-y: auto; }
.proj-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-2); font-size: 13.5px;
}
.proj-item:hover { background: var(--bg-hover); }
.proj-item.active { background: var(--bg-hover); color: var(--text); font-weight: 500; }
.proj-item .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 7px; min-width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status-dot.created { background: var(--text-3); }
.status-dot.extracting, .status-dot.generating { background: var(--warn); animation: pulse 1.2s infinite; }
.status-dot.awaiting_confirm { background: var(--accent); }
.status-dot.done { background: var(--ok); }
.status-dot.error { background: var(--err); }
@keyframes pulse { 50% { opacity: .35; } }
.side-foot { border-top: 1px solid var(--border); padding: 10px 10px 2px; font-size: 11.5px; color: var(--text-3); }
.side-foot .row { display: flex; justify-content: space-between; padding: 1px 0; }
.side-foot b { font-weight: 500; color: var(--text-2); }

/* ---------------- 主区 ---------------- */
.main { flex: 1; overflow-y: auto; }
.container { max-width: 1060px; margin: 0 auto; padding: 36px 40px 80px; }

/* 首页 hero */
.hero { text-align: center; padding: 9vh 0 30px; }
.hero h2 { font-family: var(--serif); font-size: 34px; font-weight: 500; }
.hero h2 em { font-style: italic; color: var(--accent); }
.hero p { color: var(--text-2); margin-top: 10px; }
.create-card {
  max-width: 620px; margin: 26px auto 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; gap: 10px;
}
.create-card input { flex: 1; }
.recent { margin-top: 48px; }
.recent h3, .panel-title { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.p-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.p-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.p-card .t { font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.p-card .m { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; }

/* ---------------- 项目页 ---------------- */
.proj-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.proj-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; flex: 1; line-height: 1.35; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; white-space: nowrap; margin-top: 4px;
}
.badge.created { background: var(--surface-2); color: var(--text-2); }
.badge.extracting, .badge.generating { background: var(--warn-soft); color: var(--warn); }
.badge.awaiting_confirm { background: var(--accent-soft); color: var(--accent); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.error { background: var(--err-soft); color: var(--err); }

/* 步骤条 */
.steps { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.step {
  padding: 9px 18px 11px; cursor: pointer; color: var(--text-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-size: 14px; display: flex; align-items: center; gap: 7px; user-select: none;
}
.step .n {
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border-strong); font-size: 11.5px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-3);
}
.step.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.step.on .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.ok .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.disabled { cursor: not-allowed; opacity: .45; }

/* 面板与表单 */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
}
.panel h4 {
  font-family: var(--serif); font-size: 16px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.panel h4 .hint { font-family: var(--sans); font-size: 12px; color: var(--text-3); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 18px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.field .pct { font-size: 12px; color: var(--accent); margin-left: 6px; }
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"])), select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface);
  font-family: var(--sans); font-size: 14px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 100, 66, .12);
}
textarea { resize: vertical; min-height: 72px; line-height: 1.55; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-family: var(--sans); font-weight: 500;
  border: 1px solid transparent; transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--border-strong); color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.toolbar .spacer { flex: 1; }

/* 上传区 */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 36px 20px; text-align: center; color: var(--text-2);
  cursor: pointer; transition: all .15s; background: var(--surface);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.dropzone .small { font-size: 12.5px; color: var(--text-3); }
.filelist { margin-top: 14px; }
.file-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; background: var(--surface); font-size: 13.5px;
}
.file-row .ic { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.file-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .sz, .file-row .og { color: var(--text-3); font-size: 12px; }
.file-row .rm { color: var(--text-3); cursor: pointer; padding: 0 4px; }
.file-row .rm:hover { color: var(--err); }

/* 数据表 */
table.dt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.dt th {
  text-align: left; font-weight: 500; color: var(--text-2); font-size: 12.5px;
  padding: 7px 8px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
table.dt td { padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.dt input, table.dt select { padding: 5px 8px; font-size: 13px; }
table.dt .num { text-align: right; }
.row-add { margin-top: 8px; }

/* 指标与提示 */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px; min-width: 120px;
}
.chip .k { font-size: 11.5px; color: var(--text-3); }
.chip .v { font-size: 17px; font-weight: 600; font-family: var(--serif); }
.chip.good .v { color: var(--ok); }
.chip.bad .v { color: var(--err); }
.callout { border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin: 8px 0; }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.err { background: var(--err-soft); color: var(--err); }
.callout.ok { background: var(--ok-soft); color: var(--ok); }
.callout.info { background: var(--surface-2); color: var(--text-2); }
.notes li { font-size: 13px; color: var(--text-2); margin: 4px 0 4px 18px; }

/* 生成进度 */
.progress-wrap { margin: 6px 0 16px; }
.progress-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.progress-label { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.stage-list { margin-top: 14px; }
.stage-item { display: flex; gap: 12px; padding: 7px 0; font-size: 13.5px; align-items: baseline; }
.stage-item .tag {
  min-width: 74px; text-align: center; font-size: 11.5px; padding: 2px 8px;
  border-radius: 99px; background: var(--surface-2); color: var(--text-3);
  font-family: var(--mono);
}
.stage-item.live .tag { background: var(--accent-soft); color: var(--accent); }
.stage-item .msg { color: var(--text-2); flex: 1; }
.thinking { display: inline-block; }
.thinking i {
  display: inline-block; width: 5px; height: 5px; margin: 0 2px;
  background: var(--accent); border-radius: 50%; animation: think 1.2s infinite;
  font-style: normal;
}
.thinking i:nth-child(2) { animation-delay: .2s; }
.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes think { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* 成果 */
.artifact {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 10px; transition: box-shadow .15s;
}
.artifact:hover { box-shadow: var(--shadow); }
.artifact .icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 13px; color: #fff;
}
.icon.report { background: #4A6FA5; }
.icon.excel { background: #4E7A52; }
.icon.json { background: #8B8678; }
.icon.file { background: #8B8678; }
.artifact .info { flex: 1; }
.artifact .info .n { font-weight: 500; font-size: 14px; }
.artifact .info .s { font-size: 12px; color: var(--text-3); }
.artifact a { color: var(--accent); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.artifact a:hover { text-decoration: underline; }

/* toast & modal */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #FBF9F4; padding: 10px 16px;
  border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: var(--shadow);
  max-width: 380px; animation: slidein .2s ease;
}
.toast.err { background: var(--err); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 28, 22, .35); z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; width: 460px; max-width: 92vw;
}
.modal h4 { font-family: var(--serif); font-size: 17px; margin-bottom: 12px; }
.modal p { font-size: 13.5px; color: var(--text-2); margin-bottom: 14px; }

.muted { color: var(--text-3); font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 自然语言修订 ---------------- */
.status-dot.revising { background: var(--warn); animation: pulse 1.2s infinite; }
.badge.revising { background: var(--warn-soft); color: var(--warn); }
.revise-input {
  width: 100%; resize: vertical; min-height: 76px;
  font-size: 14px; line-height: 1.7; padding: 12px 14px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-family: inherit;
}
.revise-input:focus { outline: none; border-color: var(--accent); }
.intent-card { border: 1.5px solid var(--accent); }
.rev-item { padding: 12px 2px; border-bottom: 1px solid var(--border); }
.rev-item:last-child { border-bottom: none; }
.rev-head { display: flex; align-items: center; gap: 8px; }
.rev-seq { font-family: var(--serif); font-size: 15px; }
.rev-time { margin-left: 2px; }
.rev-instr { font-size: 13.5px; color: var(--text); margin-top: 6px; white-space: pre-wrap; }
.rev-detail { margin-top: 6px; line-height: 1.8; }

/* ---------------- 登录与多用户 ---------------- */
.spacer { flex: 1; }
.login-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 360px; max-width: 90vw; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 32px 26px;
}
.login-card h1 { font-family: var(--serif); font-size: 26px; text-align: center; }
.login-card h1 .dot { color: var(--accent); }
.login-card .sub { text-align: center; color: var(--text-3); font-size: 12.5px; margin: 6px 0 22px; }
.login-btn { width: 100%; margin-top: 16px; justify-content: center; }
.user-foot {
  border-top: 1px solid var(--border); padding: 10px 14px 6px; font-size: 12.5px;
}
.user-line { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 24px; height: 24px; min-width: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px;
}
.user-line .uname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.user-acts { display: flex; gap: 12px; margin: 7px 0 4px 32px; }
.user-acts a { color: var(--text-3); cursor: pointer; font-size: 12px; }
.user-acts a:hover { color: var(--accent); }
.share-mark { color: var(--accent); font-size: 12px; margin-left: 4px; }
.user-create { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.user-ops a { color: var(--accent); cursor: pointer; margin-right: 10px; font-size: 12.5px; white-space: nowrap; }
.user-ops a.danger { color: var(--err); }
fieldset.bare { border: none; margin: 0; padding: 0; min-inline-size: auto; }
fieldset.bare:disabled input, fieldset.bare:disabled textarea, fieldset.bare:disabled select {
  background: var(--surface-2); color: var(--text-3); cursor: not-allowed;
}

/* 登录与新建成员输入框尺寸 */
.login-card input { padding: 11px 13px; font-size: 15px; }
.login-card .field + .field, .login-card .field.mt8 { margin-top: 12px; }
.user-create { gap: 10px; }
.user-create input { flex: 1 1 200px; min-width: 180px; width: auto; }
.user-create select { flex: 0 0 120px; width: 120px; }
.user-create .btn { flex: 0 0 auto; }
.modal .field input { padding: 10px 12px; font-size: 14.5px; }

/* 项目重命名 */
.rename-btn {
  font-size: 15px; color: var(--text-3); cursor: pointer;
  margin-left: 6px; vertical-align: 2px; visibility: hidden;
}
.proj-head h2:hover .rename-btn { visibility: visible; }
.rename-btn:hover { color: var(--accent); }
.rename-box { flex: 1; display: flex; gap: 8px; align-items: center; }
.rename-box input {
  flex: 1; font-family: var(--serif); font-size: 20px; font-weight: 600;
  padding: 6px 12px;
}
