/* 赛勘 Lab · 产品界面样式（官网在线体验与桌面端共用） */

:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #12181b;
  --ink-2: #45535a;
  --sub: #7c8a91;
  --line: #e8edef;
  --line-2: #dde4e7;

  --teal: #0fa3a0;
  --teal-d: #0a8583;
  --teal-dd: #076b69;
  --teal-soft: #e6f7f5;
  --teal-soft-2: #cfeff0;

  --amber: #e08a17;
  --amber-soft: #fdf3e3;
  --violet: #6a63d8;
  --violet-soft: #eeedfb;
  --rose: #d95b70;
  --rose-soft: #fdeef1;

  --radius: 12px;
  --shadow-s: 0 1px 2px rgba(18, 24, 27, .05);
  --shadow-m: 0 12px 30px -18px rgba(18, 24, 27, .35);
  --shadow-l: 0 40px 80px -40px rgba(7, 60, 59, .45);

  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ================= 布局 ================= */
.app { display: grid; grid-template-columns: 258px 1fr; height: 100vh; }

/* ================= 侧栏 ================= */
.rail {
  display: flex; flex-direction: column;
  background: #fbfcfc; border-right: 1px solid var(--line);
  padding: 14px 12px 10px; min-height: 0;
}
.rail-brand { display: flex; align-items: center; gap: 8px; padding: 2px 4px 0; }
.rail-brand img { border-radius: 7px; }
.rb-name { font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.rb-name b { color: var(--teal-d); }
.rb-mode {
  margin-left: auto; font-size: 10px; color: var(--teal-dd);
  background: var(--teal-soft); border: 1px solid var(--teal-soft-2);
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}

.new-project {
  margin: 14px 2px 10px; height: 38px; width: calc(100% - 4px);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(180deg, #12b3af, var(--teal));
  color: #fff; border: 0; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 20px -14px rgba(15, 163, 160, .9);
  transition: transform .16s, filter .16s;
}
.new-project:hover { transform: translateY(-1px); filter: brightness(1.03); }

.rail-search {
  display: flex; align-items: center; gap: 7px;
  margin: 4px 2px 12px; padding: 0 9px; height: 34px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--sub);
}
.rail-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font-size: 12.5px; color: var(--ink);
}
.rail-search input::-webkit-search-cancel-button { display: none; }

.rail-label {
  display: flex; justify-content: space-between;
  font-size: 10.5px; letter-spacing: .7px; color: #9aa7ad;
  padding: 4px 6px 8px;
}
.proj-list { flex: 1; overflow-y: auto; min-height: 0; padding: 0 2px 8px; }
.proj-list::-webkit-scrollbar { width: 6px; }
.proj-list::-webkit-scrollbar-thumb { background: #e2e8ea; border-radius: 3px; }

.proj-item {
  position: relative; cursor: pointer;
  border-radius: 9px; padding: 9px 10px 9px 13px; margin-bottom: 3px;
  transition: background .15s;
}
.proj-item::before {
  content: ""; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 2px; background: var(--pc, var(--teal)); opacity: .28;
}
.proj-item:hover { background: #f2f6f7; }
.proj-item.on { background: var(--teal-soft); }
.proj-item.on::before { opacity: 1; }
.pi-name { font-size: 13px; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-meta { font-size: 10.5px; color: var(--sub); font-family: var(--mono); margin-top: 2px; display: flex; gap: 8px; }
.proj-item.on .pi-name { color: var(--teal-dd); }

.rail-foot { border-top: 1px solid var(--line); padding: 10px 4px 2px; }
.storage-line { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--sub); }
.rail-acts { display: flex; gap: 12px; margin-top: 7px; }
.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 11.5px; color: var(--ink-2);
}
.link-btn:hover { color: var(--teal-d); }

/* ================= 主区 ================= */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: 58px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.rail-toggle { display: none; border: 0; background: none; color: var(--ink-2); padding: 6px; cursor: pointer; }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 10px; }
.crumb { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-code {
  font-family: var(--mono); font-size: 10.5px; color: var(--teal-dd);
  background: var(--teal-soft); border-radius: 4px; padding: 2px 6px; white-space: nowrap;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.view { flex: 1; overflow-y: auto; padding: 22px; }
.view::-webkit-scrollbar { width: 9px; }
.view::-webkit-scrollbar-thumb { background: #dde4e7; border-radius: 5px; border: 2px solid var(--bg); }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  transition: border-color .15s, color .15s, background .15s, transform .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--teal); color: var(--teal-d); }
.btn.primary {
  background: linear-gradient(180deg, #12b3af, var(--teal)); color: #fff; border-color: transparent;
  box-shadow: 0 8px 16px -12px rgba(15, 163, 160, .9);
}
.btn.primary:hover { filter: brightness(1.04); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f1f5f6; }
.btn.danger:hover { border-color: var(--rose); color: var(--rose); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ================= 统计 ================= */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; box-shadow: var(--shadow-s);
}
.stat b { display: block; font-size: 21px; letter-spacing: -.4px; line-height: 1.25; }
.stat span { font-size: 11.5px; color: var(--sub); }
.stat.teal b { color: var(--teal-d); }

/* ================= Tabs ================= */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  position: relative; border: 0; background: none; cursor: pointer;
  padding: 9px 12px 12px; font-size: 13px; color: var(--sub); font-weight: 600;
}
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--ink); }
.tab.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--teal); border-radius: 2px;
}
.tab .cnt { font-family: var(--mono); font-size: 10.5px; color: var(--sub); margin-left: 5px; }

/* ================= 实验卡片 ================= */
.exp-list { display: grid; gap: 14px; }
.exp-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-s); overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.exp-card:hover { border-color: var(--line-2); box-shadow: 0 10px 26px -22px rgba(18, 24, 27, .45); }
.exp-card.is-hot { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 163, 160, .12); }

.exp-head { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px 12px; }
.exp-badge {
  flex: none; margin-top: 1px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  border-radius: 5px; padding: 3px 7px;
  background: var(--teal-soft); color: var(--teal-dd);
}
.exp-badge.b-amber { background: var(--amber-soft); color: #a3650c; }
.exp-badge.b-violet { background: var(--violet-soft); color: #4a44ad; }
.exp-badge.b-rose { background: var(--rose-soft); color: #b03b51; }
.exp-title-wrap { flex: 1; min-width: 0; }
.exp-title { font-size: 14.5px; font-weight: 700; }
.exp-sub { font-size: 11.5px; color: var(--sub); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.exp-sub .mono { font-family: var(--mono); }
.exp-acts { display: flex; gap: 4px; }
.icon-btn {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; background: none; border-radius: 6px; color: var(--sub); cursor: pointer;
}
.icon-btn:hover { background: #f1f5f6; color: var(--rose); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; }
.chip { font-size: 10.5px; color: var(--ink-2); background: #f4f7f8; border-radius: 4px; padding: 2px 7px; }
.chip b { font-weight: 600; color: var(--sub); margin-right: 3px; }

.exp-body { border-top: 1px solid var(--line); background: #fdfefe; padding: 12px 16px 14px; }
.zone {
  border: 1.5px dashed var(--teal-soft-2); border-radius: 9px;
  background: linear-gradient(180deg, rgba(230, 247, 245, .5), rgba(230, 247, 245, .12));
  padding: 13px; text-align: center; cursor: pointer;
  transition: background .16s, border-color .16s;
}
.zone:hover, .zone.is-hot { border-color: var(--teal); background: var(--teal-soft); }
.zone-main { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--teal-d); font-weight: 600; }
.zone-sub { font-size: 10.5px; color: var(--sub); margin-top: 3px; }
.zone svg { flex: none; }

.files { margin-top: 10px; }
.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; border-radius: 7px;
  border-bottom: 1px dashed var(--line);
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #f7fafb; }
.file-ic {
  flex: none; width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center; overflow: hidden;
  background: #eef3f5; color: var(--ink-2);
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
}
.file-ic img { width: 100%; height: 100%; object-fit: cover; }
.cat-img .file-ic { background: #e8f2ff; color: #2f7ad6; }
.cat-doc .file-ic { background: #fdeef1; color: #c04a5f; }
.cat-sheet .file-ic { background: #e9f8f0; color: #1f8a5c; }
.cat-raw .file-ic { background: #f1eefb; color: #5a51c4; }
.cat-zip .file-ic { background: #fdf4e4; color: #a3650c; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-orig { font-size: 10.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-orig s { opacity: .7; }
.file-meta { flex: none; font-size: 10.5px; color: var(--sub); font-family: var(--mono); text-align: right; }
.file-flag { flex: none; font-size: 9.5px; color: var(--teal-dd); background: var(--teal-soft); border-radius: 4px; padding: 1px 5px; }
.file-flag.dup { color: #a3650c; background: var(--amber-soft); }

/* ================= 全部数据 ================= */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: flex; background: #eef2f3; border-radius: 8px; padding: 2px; }
.seg button {
  border: 0; background: none; padding: 5px 11px; border-radius: 6px;
  font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-s); font-weight: 600; }
.toolbar .spacer { flex: 1; }

.data-table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); }
.dt-head, .dt-row { display: grid; grid-template-columns: 34px 1fr 150px 92px 84px 46px; align-items: center; gap: 10px; padding: 9px 14px; }
.dt-head { font-size: 10.5px; color: var(--sub); background: #fafbfb; border-bottom: 1px solid var(--line); letter-spacing: .4px; }
.dt-row { border-bottom: 1px solid #f2f5f6; font-size: 12px; }
.dt-row:last-child { border-bottom: 0; }
.dt-row:hover { background: #f9fbfb; }
.dt-row .file-ic { width: 26px; height: 26px; border-radius: 6px; }
.dt-name { font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-sub { font-size: 10.5px; color: var(--sub); }
.dt-act { text-align: right; }

/* ================= 记录 ================= */
.record {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 34px; max-width: 820px; box-shadow: var(--shadow-s);
}
.rec-head h2 { font-size: 21px; letter-spacing: -.3px; }
.rec-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--sub); margin-top: 8px; font-family: var(--mono); }
.rec-goal { margin-top: 16px; padding: 12px 14px; background: #f7fafb; border-left: 3px solid var(--teal); border-radius: 0 8px 8px 0; font-size: 13px; color: var(--ink-2); }
.rec-sec { margin-top: 26px; }
.rec-sec h3 { font-size: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.rec-sec h3 span { font-family: var(--mono); font-size: 10.5px; color: var(--sub); font-weight: 400; margin-left: 8px; }
.rec-exp { margin-bottom: 18px; }
.rec-exp-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; }
.rec-exp-h em { font-family: var(--mono); font-size: 10.5px; font-style: normal; color: var(--teal-dd); background: var(--teal-soft); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.rec-exp-meta { font-size: 11.5px; color: var(--sub); margin: 4px 0 6px; font-family: var(--mono); }
.rec-exp ul li { font-size: 12px; color: var(--ink-2); font-family: var(--mono); padding: 2px 0 2px 12px; position: relative; }
.rec-exp ul li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--teal-soft-2); }
.rec-note { font-size: 12px; color: var(--sub); margin-top: 6px; }

/* ================= 空状态 ================= */
.empty {
  background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 52px 24px; text-align: center;
}
.empty .eic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--teal-soft); color: var(--teal-d); display: grid; place-items: center; }
.empty h3 { font-size: 15px; }
.empty p { font-size: 12.5px; color: var(--sub); margin-top: 6px; }
.empty .btn { margin-top: 16px; }

/* ================= 拖拽遮罩 ================= */
.drop-mask {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: rgba(7, 107, 105, .12);
  backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
}
.drop-mask.on { display: flex; }
.drop-mask-in {
  background: #fff; border: 2px dashed var(--teal); border-radius: 16px;
  padding: 34px 46px; text-align: center; color: var(--teal-d);
  box-shadow: var(--shadow-l);
}
.drop-mask-in b { display: block; font-size: 15px; margin: 10px 0 4px; }
.drop-mask-in span { font-size: 11.5px; color: var(--sub); }

/* ================= 弹窗 ================= */
.modal-root { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal-root[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(12, 20, 22, .42); backdrop-filter: blur(2px); }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: 88vh;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-l);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-head { display: flex; align-items: center; padding: 16px 18px 12px; }
.modal-head h3 { font-size: 15px; flex: 1; }
.modal-x { border: 0; background: none; color: var(--sub); cursor: pointer; padding: 4px; border-radius: 6px; }
.modal-x:hover { background: #f1f5f6; color: var(--ink); }
.modal-body { padding: 4px 18px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfb; }

.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 11.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.field > label em { font-style: normal; color: var(--rose); margin-left: 3px; }
.field input[type=text], .field input[type=date], .field textarea, .field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 13px; color: var(--ink); background: #fff; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 163, 160, .12);
}
.field textarea { resize: vertical; min-height: 66px; }
.field .hint { font-size: 10.5px; color: var(--sub); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-opt {
  border: 1px solid var(--line-2); background: #fff; border-radius: 8px;
  padding: 9px 6px; font-size: 12px; color: var(--ink-2); cursor: pointer;
  text-align: center; transition: border-color .15s, background .15s, color .15s;
}
.type-opt:hover { border-color: var(--teal-soft-2); }
.type-opt.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dd); font-weight: 600; }

/* ================= Toast ================= */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: #12292b; color: #eafcf9;
  border-radius: 9px; padding: 10px 14px; font-size: 12.5px;
  box-shadow: 0 18px 34px -20px rgba(0, 0, 0, .7);
  animation: toastIn .22s ease-out;
  max-width: 340px;
}
.toast .t-dot { width: 6px; height: 6px; border-radius: 50%; background: #4be0c8; flex: none; }
.toast.warn .t-dot { background: #ffc46b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ================= 图片预览 ================= */
.preview-img { max-width: 100%; max-height: 62vh; border-radius: 8px; display: block; margin: 0 auto; background: #f4f6f7; }
.preview-meta { font-family: var(--mono); font-size: 11px; color: var(--sub); margin-top: 12px; text-align: center; }

/* ================= 自适应 ================= */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: 268px;
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 30px 0 60px -40px rgba(0, 0, 0, .5);
  }
  .app.rail-open .rail { transform: none; }
  .rail-toggle { display: grid; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .view { padding: 16px; }
  .dt-head, .dt-row { grid-template-columns: 30px 1fr 92px 46px; }
  .dt-head .c-hide, .dt-row .c-hide { display: none; }
  .record { padding: 22px 20px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-right .btn span { display: none; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}
