@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  background: #020202;
  color: #F5F4F0;
}
a { color: #FFFFFF; text-decoration: none; }
a:hover { color: rgba(255,255,255,0.75); }

.shell {
  min-height: 100vh;
  background:
    radial-gradient(720px 340px at 58% 8%, rgba(255,255,255,0.06), transparent 70%),
    radial-gradient(circle, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0/22px 22px,
    #020202;
  display: flex;
}

.sidebar {
  width: 172px;
  flex: 0 0 172px;
  background: #050505;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.sidebar .brand { padding: 0 24px 28px; display: flex; align-items: center; gap: 8px; }
.sidebar .brand .mark { width: 22px; height: 22px; border-radius: 6px; background: #F5F4F0; position: relative; flex: none; }
.sidebar .brand .mark::after {
  content: ""; position: absolute; left: 8px; top: 6px; border-style: solid;
  border-width: 5px 0 5px 8px; border-color: transparent transparent transparent #050505;
}
.sidebar .brand .name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; color: #FFFFFF; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px;
  color: rgba(255,255,255,0.5); font-size: 14px;
}
.sidebar nav a.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.07));
  color: #FFFFFF; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 0 0 1px rgba(255,255,255,0.07);
}
.sidebar .spend {
  margin-top: auto; padding: 16px 24px; font-size: 12px; color: rgba(255,255,255,0.38);
  border-top: 1px solid rgba(255,255,255,0.07);
}

.main { flex: 1; padding: 40px 48px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.section-title { font-size: 16px; font-weight: 700; }
.section-title .count { color: #E5675F; }

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.14); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 34px 90px -36px rgba(0,0,0,0.95);
  padding: 24px 28px; color: #FFFFFF;
}

.card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 24px 48px -28px rgba(0,0,0,0.9);
  padding: 16px 20px; display: flex; align-items: center; gap: 14px;
}
.card.awaiting {
  background: linear-gradient(180deg, rgba(229,103,95,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(229,103,95,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 34px -6px rgba(229,103,95,0.18);
  padding: 20px 24px;
}

.pill {
  padding: 6px 14px; border: 1px solid rgba(255,255,255,0.32); border-radius: 999px;
  font-size: 13px; color: rgba(255,255,255,0.92); background: transparent;
}
.pill.on { border-color: #F5F4F0; color: #FFFFFF; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 22px;
  background: linear-gradient(180deg, #FFFFFF, #EAE8E2); color: #0A0A0A; border-radius: 10px;
  box-shadow: inset 0 1px 0 #FFFFFF, inset 0 -1px 0 rgba(0,0,0,0.14), 0 6px 20px -6px rgba(245,244,240,0.25);
  font-size: 14px; font-weight: 700; border: none; cursor: pointer;
}
.btn:hover { opacity: 0.92; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-dot.running { background: #E0B054; box-shadow: 0 0 0 3px rgba(224,176,84,0.16); }
.status-dot.done { background: #7DBB72; box-shadow: 0 0 0 3px rgba(125,187,114,0.16); }
.status-dot.awaiting { background: #E5675F; box-shadow: 0 0 0 3px rgba(229,103,95,0.16); }
.status-dot.rejected { background: #B49CF0; box-shadow: 0 0 0 3px rgba(180,156,240,0.16); }

.progress-track { width: 130px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; flex: none; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #C8973F, #EEC168); border-radius: 3px; box-shadow: 0 0 10px rgba(224,176,84,0.55); }

.muted { color: rgba(255,255,255,0.45); font-size: 13px; }
.empty { color: rgba(255,255,255,0.35); font-size: 13px; padding: 4px 2px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.placeholder-page { padding: 40px 4px; color: rgba(255,255,255,0.5); font-size: 14px; }

/* ---- 任务线程页(Task/Review/Concept 板) ---- */
.topbar {
  display: flex; align-items: center; gap: 14px; margin: -40px -48px 0; padding: 18px 32px;
  background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.09);
}
.topbar .back { font-size: 18px; color: rgba(255,255,255,0.66); }
.topbar-title { font-size: 16px; font-weight: 700; }

.status-capsule { padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.status-capsule.awaiting { background: rgba(229,103,95,0.14); color: #E5675F; }
.status-capsule.running { background: rgba(224,176,84,0.13); color: #D9AC4E; }
.status-capsule.done { background: rgba(125,187,114,0.13); color: #7DBB72; }
.status-capsule.rejected { background: rgba(180,156,240,0.12); color: #B49CF0; }

.progress-head { display: flex; align-items: center; gap: 14px; }

.thread { max-width: 820px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.tcard-row { display: flex; gap: 14px; }
.tcard-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; background: rgba(125,187,114,0.2);
}
.tcard-avatar.gate { background: rgba(229,103,95,0.14); }
.tcard {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09); border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 24px 48px -28px rgba(0,0,0,0.9);
  padding: 16px 20px; display: flex; flex-direction: column; gap: 8px;
}
.tcard.gate { background: rgba(255,255,255,0.05); border: 1.5px solid rgba(229,103,95,0.35); }
.tcard-head { font-size: 14.5px; font-weight: 600; }
.tcard-body { font-size: 13px; color: rgba(255,255,255,0.66); line-height: 1.7; }

.ledger-row, .shot-row, .qc-row {
  display: flex; gap: 12px; font-size: 12.5px; color: rgba(255,255,255,0.66);
  padding: 7px 0; border-top: 1px solid rgba(255,255,255,0.07);
}
.shot-id { width: 54px; flex: none; color: #F5F4F0; font-weight: 600; }
.shot-dur, .shot-move { width: 120px; flex: none; }
.shot-mode { width: 96px; flex: none; }
.shot-directive { flex: 1; min-width: 0; }
.qc-verdict { width: 46px; flex: none; font-weight: 600; }
.qc-verdict.ok { color: #7DBB72; }
.qc-verdict.bad { color: #E5675F; }

.thumb-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { margin: 0; width: 132px; display: flex; flex-direction: column; gap: 6px; }
.thumb.wide { width: 220px; }
.thumb img, .thumb video {
  width: 100%; border-radius: 10px; background: #101014;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), 0 16px 36px -16px rgba(0,0,0,0.95);
}
.thumb figcaption { font-size: 11.5px; color: rgba(255,255,255,0.45); }

.concept-option {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px; padding: 14px 18px; display: flex; gap: 14px; align-items: flex-start;
}
.concept-option.lead { border: 2px solid #FFFFFF; background: rgba(255,255,255,0.05); }
.concept-key {
  padding: 3px 10px; border-radius: 8px; background: rgba(255,255,255,0.08);
  font-size: 12px; font-weight: 700; flex: none;
}
.concept-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.concept-title { font-size: 14.5px; font-weight: 600; }

.gate-form, .composer { display: flex; gap: 10px; align-items: center; }
.composer { max-width: 820px; width: 100%; margin: 0 auto; }
.note-input, .composer input[type=text] {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; font-family: inherit; font-size: 13.5px;
  color: #F5F4F0; background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.16); border-radius: 12px; outline: none;
}
.note-input::placeholder, .composer input::placeholder { color: rgba(255,255,255,0.42); }
.btn.ghost {
  background: transparent; border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.66); box-shadow: none; font-weight: 500;
}

.msg-row { display: flex; justify-content: flex-end; }
.msg-user {
  max-width: 480px; background: #F5F4F0; color: #0A0A0A; border-radius: 16px;
  padding: 13px 18px; font-size: 13.5px; line-height: 1.7;
}

.fold { font-size: 13px; color: rgba(255,255,255,0.45); }
.fold summary { cursor: pointer; }
.fold ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.8; }

/* ---- 客户空间(Clients/Client 板) ---- */
.page-head { display: flex; align-items: center; }
.page-title { font-size: 22px; font-weight: 700; }

.tabs-line {
  display: flex; gap: 4px; margin: 0 -48px; padding: 0 32px;
  background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.09);
}
.tabs-line a { padding: 10px 18px; font-size: 14px; color: rgba(255,255,255,0.66); }
.tabs-line a.active { color: #FFFFFF; font-weight: 600; border-bottom: 2.5px solid #FFFFFF; }

.avatar {
  width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.08);
  color: #FFFFFF; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex: none;
}
.avatar.self { background: rgba(180,156,240,0.12); color: #B49CF0; }

.client-card { flex-direction: column; align-items: stretch; gap: 14px; padding: 22px 24px; }
.client-card.self { border-color: rgba(180,156,240,0.3); }
.client-head { display: flex; align-items: center; gap: 14px; }
.client-name .name { font-size: 15.5px; font-weight: 700; }
.client-stats {
  display: flex; gap: 20px; padding-top: 12px; font-size: 13px;
  color: rgba(255,255,255,0.66); border-top: 1px solid rgba(255,255,255,0.07);
}
.client-stats b { color: #F5F4F0; }
.tag { margin-left: auto; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.active { background: rgba(125,187,114,0.13); color: #7DBB72; box-shadow: inset 0 0 0 1px rgba(125,187,114,0.3); }
.tag.self { background: rgba(180,156,240,0.12); color: #B49CF0; box-shadow: inset 0 0 0 1px rgba(180,156,240,0.3); }

.asset-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.asset-card {
  width: 190px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 24px 48px -28px rgba(0,0,0,0.9);
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.asset-card.dashed { background: transparent; border: 1.5px dashed rgba(255,255,255,0.22); box-shadow: none; }
.asset-card img, .clip-thumb {
  width: 100%; height: 110px; object-fit: cover; border-radius: 10px; background: #101014;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}
.asset-card input[type=text] {
  height: 34px; padding: 0 10px; font-family: inherit; font-size: 12.5px; color: #F5F4F0;
  background: rgba(0,0,0,0.32); border: 1px solid rgba(255,255,255,0.16); border-radius: 8px; outline: none;
}
.asset-card input[type=file] { font-size: 11.5px; color: rgba(255,255,255,0.66); }
.asset-name { font-size: 13.5px; font-weight: 600; }

.rules-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.rules-form textarea {
  width: 100%; padding: 12px 14px; font-family: inherit; font-size: 13.5px; line-height: 1.7;
  color: #F5F4F0; background: rgba(0,0,0,0.32); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px; outline: none; resize: vertical;
}
.rules-list { margin: 0; padding-left: 20px; font-size: 13px; color: rgba(255,255,255,0.66); line-height: 1.9; }
.panel { display: flex; flex-direction: column; gap: 12px; }

/* ---- 流程与技能页(Library/PromptLib/Distill/States 板) ---- */
.flow-track { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.flow-track + .flow-track { border-top: 1px solid rgba(255,255,255,0.07); }
.flow-domain { width: 84px; flex: none; font-size: 13.5px; font-weight: 700; }
.flow-nodes { display: flex; gap: 8px; flex-wrap: wrap; }
.flow-node { padding: 5px 13px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.flow-node.dsh { background: rgba(224,176,84,0.13); color: #D9AC4E; }
.flow-node.gate { background: rgba(229,103,95,0.14); color: #E5675F; }
.flow-node.det { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.66); }
.flow-legend { display: flex; gap: 10px; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.official { background: rgba(125,187,114,0.13); color: #7DBB72; }
.badge.opensource { background: rgba(224,176,84,0.13); color: #D9AC4E; }
.badge.custom { background: rgba(255,255,255,0.08); color: #FFFFFF; }
.badge.om-badge { background: rgba(224,176,84,0.13); color: #D9AC4E; margin-left: 8px; }

.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-row { background: transparent; }
.acc-row > summary {
  list-style: none; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 24px 48px -28px rgba(0,0,0,0.9);
  padding: 14px 20px; display: flex; align-items: center; gap: 14px;
}
.acc-row > summary::-webkit-details-marker,
.acc-row > summary::marker { display: none; content: ""; }
.acc-row[open] > summary { border-radius: 16px 16px 0 0; border-bottom: none; }
.acc-body {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09); border-top: none;
  border-radius: 0 0 16px 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}
.tut-badge {
  flex: none; padding: 3px 10px; border-radius: 8px; background: rgba(255,255,255,0.08);
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.85);
}
.code-panel {
  margin: 0; padding: 14px; border-radius: 10px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Courier New', monospace;
  font-size: 12.5px; line-height: 1.7; color: rgba(255,255,255,0.78);
  white-space: pre-wrap; word-break: break-word;
}

.asset-card.wide { width: 260px; }
.kv { display: flex; gap: 14px; font-size: 13px; padding: 7px 0; }
.kv + .kv { border-top: 1px solid rgba(255,255,255,0.07); }
.kv .k { width: 180px; flex: none; color: rgba(255,255,255,0.45); }
.kv .v { flex: 1; color: rgba(255,255,255,0.85); }
.prompt-body {
  margin: 0; padding: 14px; border-radius: 10px; background: rgba(0,0,0,0.32);
  font-size: 12.5px; line-height: 1.7; color: rgba(255,255,255,0.75);
  white-space: pre-wrap; word-break: break-word;
}

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 340px; background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.14); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 34px 90px -36px rgba(0,0,0,0.95);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 16px;
}
.login-card .title { font-size: 20px; font-weight: 700; color: #FFFFFF; }
.field {
  height: 48px; display: flex; align-items: center; padding: 0 16px;
  background: rgba(0,0,0,0.32); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16), inset 0 2px 6px rgba(0,0,0,0.5);
  border-radius: 10px;
}
.field input {
  background: transparent; border: none; outline: none; color: #F5F4F0; font-size: 14px; width: 100%;
  font-family: inherit;
}
.field input::placeholder { color: rgba(255,255,255,0.4); }
.error-text { color: #E5675F; font-size: 13px; }

/* ---- lightbox(素材缩略图点开放大)---- */
.lightbox-img { cursor: zoom-in; }
.thumb, .asset-card { position: relative; }
.lightbox-expand {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.3); border-radius: 6px;
  color: #FFFFFF; font-size: 13px; line-height: 1; cursor: zoom-in; z-index: 2;
}
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.9); cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img, .lightbox-overlay video {
  max-width: 90vw; max-height: 90vh; border-radius: 8px; cursor: default;
  box-shadow: 0 24px 64px -20px rgba(0,0,0,0.9);
}

/* ---- intake form ---- */
.intake-head { display: flex; align-items: center; gap: 14px; }
.intake-head .title { font-size: 20px; font-weight: 700; }
.tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.08); border-radius: 10px; padding: 3px; }
.tabs .tab { padding: 6px 16px; border-radius: 8px; font-size: 13px; color: rgba(255,255,255,0.75); cursor: pointer; border: none; background: transparent; font-family: inherit; }
.tabs .tab.active { background: #F5F4F0; color: #0A0A0A; font-weight: 700; }
.intake-row { display: flex; gap: 12px; }
.intake-input {
  flex: 1; display: flex; align-items: center; padding: 0 18px; height: 52px;
  background: rgba(0,0,0,0.32); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16), inset 0 2px 6px rgba(0,0,0,0.5);
  border-radius: 10px;
}
.intake-input input { background: transparent; border: none; outline: none; color: #F5F4F0; font-size: 14px; width: 100%; font-family: inherit; }
.intake-input input::placeholder { color: rgba(255,255,255,0.45); }
.intake-options { display: flex; gap: 10px; font-size: 13px; flex-wrap: wrap; }
select.pill { -webkit-appearance: none; appearance: none; }
.checkbox-pill { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
