/* open进攻 · 科研智能体 */
:root {
  --bg: #080c11;
  --bg2: #0b1017;
  --pn: #0e141b;
  --pn2: #141c25;
  --pn3: #1a242f;
  --ln: #1d2833;
  --ln2: #27333f;
  --tx: #e8eef5;
  --sub: #93a3b5;
  --dim: #66768a;
  --ac: #35e0c8;
  --ac2: #5ad1ff;
  --blue: #7aa2ff;
  --gold: #f6c05a;
  --violet: #c084fc;
  --bad: #ff8b7a;
  --good: #6ee7a8;
  --r: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--tx);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
button, input, textarea { font-family: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------------- 启动 ---------------- */
#boot {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(120% 80% at 50% 0%, #0d1a22 0%, #080c11 62%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .45s ease, visibility .45s;
}
#boot.off { opacity: 0; visibility: hidden; }
.bl-ring { color: var(--ac); filter: drop-shadow(0 0 16px rgba(53, 224, 200, .5)); }
.bl-ring .spin { animation: spin 9s linear infinite; transform-origin: 24px 24px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bl-t { font-size: 19px; font-weight: 800; letter-spacing: 3px; }
.bl-s { font-size: 11.5px; color: var(--dim); letter-spacing: .6px; }
.bl-bar { width: 132px; height: 2px; background: #16202a; border-radius: 2px; overflow: hidden; margin-top: 8px; }
.bl-bar i { display: block; height: 100%; width: 36%; background: linear-gradient(90deg, transparent, var(--ac), transparent); animation: slide 1.1s infinite; }
@keyframes slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(380%); } }

/* ---------------- 顶栏 ---------------- */
#top {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  background: rgba(8, 12, 17, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ln);
  position: relative; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 7px; color: var(--ac); min-width: 0; }
.brand .nm { font-size: 13.5px; font-weight: 700; color: var(--tx); letter-spacing: .3px; }
.brand .nm i { font-style: normal; color: var(--ac); font-weight: 800; }
.brand .tag {
  font-size: 9.5px; color: var(--dim); border: 1px solid var(--ln2);
  padding: 2px 6px; border-radius: 5px; letter-spacing: .5px; white-space: nowrap;
}
.hact { margin-left: auto; display: flex; gap: 2px; }
.ico {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--sub); display: grid; place-items: center; cursor: pointer;
}
.ico:active { background: var(--pn2); }

/* ---------------- 首页 ---------------- */
#home {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px 34px;
}
.hero { position: relative; padding: 26px 2px 20px; overflow: hidden; }
.grid-bg {
  position: absolute; inset: -40px -40px auto; height: 300px;
  background-image: linear-gradient(rgba(53,224,200,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53,224,200,.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(80% 60% at 20% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 60% at 20% 0%, #000 0%, transparent 78%);
  pointer-events: none;
}
.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; color: var(--ac);
  letter-spacing: 1.2px; margin-bottom: 12px;
}
.kicker i { width: 5px; height: 5px; border-radius: 50%; background: var(--ac); box-shadow: 0 0 8px var(--ac); }
.hero h1 {
  margin: 0 0 10px; font-size: 26px; line-height: 1.32; font-weight: 800; letter-spacing: -.2px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(96deg, #35e0c8, #5ad1ff 45%, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; font-size: 12px; line-height: 1.75; color: var(--sub); max-width: 460px; }

/* 输入卡 */
.compose {
  background: linear-gradient(180deg, #0f1720, #0c1219);
  border: 1px solid var(--ln); border-radius: 16px; padding: 13px;
  box-shadow: 0 18px 40px -24px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.03);
}
.cp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cp-l { font-size: 11.5px; color: var(--sub); letter-spacing: .4px; }
.cp-net {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; color: var(--ac); font-family: var(--mono);
  background: rgba(53,224,200,.08); border: 1px solid rgba(53,224,200,.24);
  padding: 3px 7px; border-radius: 20px;
}
.cp-net i { width: 5px; height: 5px; border-radius: 50%; background: var(--ac); animation: blink 1.8s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
#task {
  width: 100%; min-height: 92px; resize: vertical; border: none; outline: none;
  background: #070b10; border: 1px solid var(--ln); border-radius: 11px;
  padding: 11px 12px; font-size: 13.5px; line-height: 1.65; color: var(--tx);
}
#task::placeholder { color: #4b5a6b; }
#task:focus { border-color: rgba(53,224,200,.45); box-shadow: 0 0 0 3px rgba(53,224,200,.08); }

.ex-row { display: flex; gap: 6px; overflow-x: auto; padding: 9px 0 2px; scrollbar-width: none; }
.ex-row::-webkit-scrollbar { display: none; }
.ex {
  flex: 0 0 auto; padding: 6px 10px; border-radius: 20px;
  border: 1px solid var(--ln); background: var(--pn2); color: var(--sub);
  font-size: 11px; cursor: pointer; white-space: nowrap;
}
.ex:active { border-color: rgba(53,224,200,.4); color: var(--tx); }

.opts { margin-top: 10px; display: flex; flex-direction: column; gap: 9px; }
.opt-row { display: flex; align-items: center; gap: 10px; }
.ol { flex: 0 0 52px; font-size: 11px; color: var(--dim); }
.chips { display: flex; gap: 5px; flex: 1; flex-wrap: wrap; }
.chips button {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--ln);
  background: var(--pn2); color: var(--sub); font-size: 11px; cursor: pointer; transition: .15s;
}
.chips button.on {
  border-color: rgba(53,224,200,.5); color: var(--ac);
  background: rgba(53,224,200,.1); font-weight: 600;
}
input[type=range] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--ac) 0%, var(--ac) 65%, #1d2833 65%);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #eafaf7; border: 2px solid var(--ac); box-shadow: 0 0 8px rgba(53,224,200,.5);
  cursor: pointer;
}
.ov { flex: 0 0 26px; font-family: var(--mono); font-size: 12px; color: var(--ac); text-align: right; }

.go {
  width: 100%; margin-top: 13px; height: 46px; border-radius: 12px; border: none;
  background: linear-gradient(96deg, #17b8a3, #35e0c8 55%, #5ad1ff);
  color: #04231f; font-size: 14.5px; font-weight: 800; letter-spacing: .6px;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(53,224,200,.65);
}
.go:active { transform: scale(.985); }
.go:disabled { opacity: .55; }
.fine { margin-top: 9px; font-size: 10.5px; color: var(--dim); line-height: 1.6; text-align: center; }

/* 能力卡 */
.caps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.cap {
  background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; padding: 11px;
  display: flex; flex-direction: column; gap: 5px;
}
.cp-i {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  color: var(--c, var(--ac)); background: color-mix(in srgb, var(--c, var(--ac)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--ac)) 26%, transparent);
}
.cap b { font-size: 12.5px; font-weight: 700; }
.cap span { font-size: 10.5px; color: var(--dim); line-height: 1.6; }

/* 安装卡 */
.inst {
  display: flex; align-items: center; gap: 11px; margin-top: 14px;
  padding: 12px; border-radius: 14px; text-decoration: none;
  background: linear-gradient(100deg, rgba(53,224,200,.1), rgba(90,209,255,.05));
  border: 1px solid rgba(53,224,200,.28);
}
.ic-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ac); background: rgba(53,224,200,.12); }
.ic-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ic-l b { font-size: 13px; color: var(--tx); }
.ic-l i { font-style: normal; font-size: 10.5px; color: var(--sub); }
.ic-btn {
  flex: 0 0 auto; padding: 8px 13px; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: rgba(53,224,200,.16); border: 1px solid rgba(53,224,200,.4); color: var(--ac);
}
.foot { margin-top: 18px; font-size: 10px; color: #465568; text-align: center; line-height: 1.7; }

/* ---------------- 作战室 ---------------- */
#ops { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ops-head { flex: 0 0 auto; padding: 10px 14px 0; }
.oh-top { display: flex; align-items: center; gap: 8px; }
.oh-task {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.oh-phase { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.pbar { height: 3px; border-radius: 3px; background: #16202a; margin-top: 8px; overflow: hidden; }
.pbar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #17b8a3, #35e0c8, #5ad1ff);
  transition: width .5s ease; box-shadow: 0 0 10px rgba(53,224,200,.6);
}
.ph-name { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.ph-name #phName { font-size: 11px; color: var(--ac); font-weight: 600; letter-spacing: .3px; }
.ph-sub { font-size: 10px; color: var(--dim); }

.metrics {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, 1fr);
  margin: 9px 14px 0; border: 1px solid var(--ln); border-radius: 11px;
  background: var(--pn); overflow: hidden;
}
.mt { padding: 7px 4px; text-align: center; border-right: 1px solid var(--ln); }
.mt:last-child { border-right: none; }
.mt b { display: block; font-family: var(--mono); font-size: 13px; color: var(--tx); font-weight: 600; }
.mt span { font-size: 9px; color: var(--dim); }

.tabs {
  flex: 0 0 auto; display: flex; gap: 2px; padding: 9px 12px 0; overflow-x: auto;
  scrollbar-width: none; border-bottom: 1px solid var(--ln); margin-bottom: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; padding: 7px 11px 9px; border: none; background: none; cursor: pointer;
  font-size: 12px; color: var(--dim); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button i {
  font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--dim);
  background: var(--pn2); padding: 1px 4px; border-radius: 4px; margin-left: 3px;
}
.tabs button.on { color: var(--ac); border-bottom-color: var(--ac); font-weight: 600; }
.tabs button.on i { color: var(--ac); background: rgba(53,224,200,.12); }

.panes { flex: 1; min-height: 0; position: relative; }
.pane { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 11px 12px 16px; }

/* 智能体卡片 */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 7px; }
.ag {
  position: relative; border-radius: 11px; padding: 9px 9px 8px;
  background: linear-gradient(180deg, #101821, #0c131a);
  border: 1px solid var(--ln); border-left: 2px solid var(--tc, var(--ac));
  overflow: hidden; animation: agIn .32s cubic-bezier(.2,.9,.3,1);
}
@keyframes agIn { from { opacity: 0; transform: translateY(7px) scale(.97); } to { opacity: 1; transform: none; } }
.ag.spawn { animation: agSpawn .5s cubic-bezier(.2,.9,.3,1); }
@keyframes agSpawn {
  0% { opacity: 0; transform: scale(.7); box-shadow: 0 0 0 0 rgba(246,192,90,.6); }
  60% { opacity: 1; transform: scale(1.03); box-shadow: 0 0 0 8px rgba(246,192,90,0); }
  100% { transform: scale(1); }
}
.ag-top { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: #3a4a5c; flex: 0 0 auto; }
.ag[data-st="working"] .dot, .ag[data-st="reading"] .dot, .ag[data-st="thinking"] .dot {
  background: var(--tc); box-shadow: 0 0 7px var(--tc); animation: blink 1.1s infinite;
}
.ag[data-st="done"] .dot { background: var(--good); }
.ag[data-st="fail"] .dot { background: var(--bad); }
.ag-role { font-size: 9.5px; color: var(--tc); font-weight: 600; letter-spacing: .3px; }
.ag-tok { margin-left: auto; font-family: var(--mono); font-size: 8.5px; color: var(--dim); }
.ag-name { font-size: 12px; font-weight: 700; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-task {
  font-size: 10px; color: var(--sub); line-height: 1.5; height: 30px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ag-bar { height: 2px; background: #17212b; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.ag-bar i { display: block; height: 100%; background: var(--tc); opacity: .75; transition: width .4s; }
.ag-dir { font-size: 8.5px; color: #46586c; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 日志 */
.logs { display: flex; flex-direction: column; gap: 1px; font-family: var(--mono); }
.lg { display: flex; gap: 7px; padding: 4px 2px; font-size: 10.5px; line-height: 1.55; border-bottom: 1px solid rgba(29,40,51,.55); }
.lg-t { flex: 0 0 46px; color: #3d4d60; font-size: 9px; padding-top: 1px; }
.lg-w { flex: 0 0 auto; color: var(--lc, var(--sub)); font-weight: 600; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-x { flex: 1; color: #a8b7c7; word-break: break-word; }
.lg[data-k="cmd"] .lg-x, .lg[data-k="boss"] .lg-x { color: #f0d9a8; }
.lg[data-k="net"] .lg-x { color: #9ec9ff; }
.lg[data-k="audit"] .lg-x { color: #ffb3a7; }
.lg[data-k="spawn"] .lg-x { color: #ffd489; }
.lg[data-k="done"] .lg-x { color: var(--good); font-weight: 600; }
.lg[data-k="warn"] .lg-x, .lg[data-k="err"] .lg-x { color: #ff9b8a; }

/* 文献 */
.papers { display: flex; flex-direction: column; gap: 7px; }
.pa {
  background: var(--pn); border: 1px solid var(--ln); border-radius: 11px; padding: 10px 11px;
}
.pa-h { display: flex; gap: 7px; align-items: flex-start; }
.pa-n {
  flex: 0 0 auto; font-family: var(--mono); font-size: 9.5px; color: var(--ac);
  background: rgba(53,224,200,.1); border-radius: 4px; padding: 1px 5px; margin-top: 1px;
}
.pa-t { flex: 1; font-size: 11.5px; line-height: 1.5; font-weight: 600; color: #dfe8f1; }
.pa-m { margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; font-size: 9px; color: var(--dim); font-family: var(--mono); }
.pa-m span { border: 1px solid var(--ln2); border-radius: 4px; padding: 0 4px; }
.pa-m .src { color: var(--ac2); border-color: rgba(90,209,255,.28); }
.pa-a {
  margin-top: 6px; font-size: 10.5px; line-height: 1.6; color: #7d8ea1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pa-x { margin-top: 5px; font-size: 9.5px; }
.pa-x a { color: var(--ac2); text-decoration: none; }

/* 实验 */
.exps { display: flex; flex-direction: column; gap: 8px; }
.ep { background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; padding: 11px; }
.ep-h { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ep-d { font-size: 9.5px; color: var(--ac); font-weight: 600; letter-spacing: .3px; }
.ep-sig {
  margin-left: auto; font-size: 9px; padding: 2px 7px; border-radius: 20px;
  border: 1px solid; font-family: var(--mono);
}
.ep-sig.sig { color: var(--good); border-color: rgba(110,231,168,.35); background: rgba(110,231,168,.1); }
.ep-sig.ns { color: var(--dim); border-color: var(--ln2); }
.ep-t { font-size: 10.5px; color: var(--dim); font-family: var(--mono); margin-bottom: 4px; }
.ep-c { font-size: 11.5px; line-height: 1.65; color: #cbd8e5; }
.ep-kv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.ep-kv span {
  font-family: var(--mono); font-size: 9.5px; color: #9fb0c2; background: var(--pn2);
  border: 1px solid var(--ln); border-radius: 5px; padding: 2px 6px;
}
.ep-kv b { color: var(--ac); font-weight: 600; }
.ep-groups { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.ep-g { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--sub); font-family: var(--mono); }
.ep-g i { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }

/* 报告 */
.report { font-size: 12.5px; line-height: 1.78; color: #c8d5e2; }
.report h1 { font-size: 18px; line-height: 1.4; margin: 4px 0 8px; color: #fff; }
.report h2 {
  font-size: 14px; margin: 20px 0 8px; color: var(--ac);
  padding-bottom: 5px; border-bottom: 1px solid var(--ln);
}
.report h3 { font-size: 12.5px; margin: 14px 0 6px; color: var(--ac2); }
.report p { margin: 7px 0; }
.report ul, .report ol { margin: 7px 0; padding-left: 18px; }
.report li { margin: 4px 0; }
.report blockquote {
  margin: 8px 0; padding: 8px 11px; border-left: 2px solid var(--ac);
  background: rgba(53,224,200,.06); border-radius: 0 8px 8px 0; color: #d9e6f2;
}
.report code {
  font-family: var(--mono); font-size: 10.5px; background: #0a1118;
  padding: 1px 4px; border-radius: 4px; color: #9ee6d8;
}
.report table { width: 100%; border-collapse: collapse; margin: 9px 0; font-size: 10.5px; display: block; overflow-x: auto; }
.report th, .report td { border: 1px solid var(--ln); padding: 5px 7px; text-align: left; white-space: nowrap; }
.report th { background: var(--pn2); color: var(--ac); font-weight: 600; }
.report tr:nth-child(even) td { background: rgba(20,28,37,.5); }
.report hr { border: none; border-top: 1px solid var(--ln); margin: 14px 0; }
.report a { color: var(--ac2); }
.report .cite { color: var(--ac); font-family: var(--mono); font-size: 9.5px; vertical-align: super; }
.report strong { color: #eaf3fb; }

.empty { padding: 30px 10px; text-align: center; font-size: 11px; color: #46586c; }

/* 底部操作 */
.ops-foot {
  flex: 0 0 auto; display: flex; gap: 7px; padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  background: rgba(8,12,17,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--ln);
}
.of-btn {
  flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--ln2);
  background: var(--pn2); color: var(--sub); font-size: 12px; font-weight: 600; cursor: pointer;
}
.of-btn.pri {
  flex: 1.3; border: none; color: #04231f;
  background: linear-gradient(96deg, #17b8a3, #35e0c8);
}
.of-btn:active { transform: scale(.98); }
.of-btn:disabled { opacity: .5; }

/* ---------------- 弹层 ---------------- */
#sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sh-mask { position: absolute; inset: 0; background: rgba(3, 6, 9, .72); backdrop-filter: blur(3px); }
.sh-body {
  position: relative; width: 100%; max-width: 560px; max-height: 86dvh;
  background: #0c1219; border: 1px solid var(--ln2); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; animation: up .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes up { from { transform: translateY(22px); opacity: .4; } to { transform: none; opacity: 1; } }
.sh-bar { width: 34px; height: 3px; border-radius: 3px; background: #2a3846; margin: 8px auto 0; }
.sh-head { display: flex; align-items: center; padding: 10px 14px 8px; }
.sh-head b { font-size: 14px; }
.sh-x {
  margin-left: auto; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ln2);
  background: var(--pn2); color: var(--sub); font-size: 12px; cursor: pointer;
}
.sh-in { padding: 4px 14px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.fld { margin-bottom: 11px; }
.fld label { display: block; font-size: 10.5px; color: var(--dim); margin-bottom: 5px; }
.fld input, .fld select {
  width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--ln2);
  background: #070b10; padding: 0 10px; font-size: 12.5px; outline: none;
}
.fld input:focus { border-color: rgba(53,224,200,.45); }
.fld .tip { font-size: 9.5px; color: #46586c; margin-top: 4px; line-height: 1.6; }
.btn {
  height: 38px; border-radius: 9px; border: 1px solid var(--ln2); background: var(--pn2);
  color: var(--tx); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 12px;
}
.btn.pri { background: linear-gradient(96deg, #17b8a3, #35e0c8); color: #04231f; border: none; }
.btn.block { width: 100%; }
.btn.grow { flex: 1; }
.row { display: flex; align-items: center; }
.hr { height: 1px; background: var(--ln); margin: 14px 0; }
.lbl { font-size: 11px; color: var(--dim); }
.tiny { font-size: 9.5px; color: #4c5e72; line-height: 1.6; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }

/* ---------------- toast ---------------- */
#toast {
  position: fixed; left: 50%; bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px); z-index: 300; pointer-events: none;
  background: rgba(20, 30, 40, .96); border: 1px solid var(--ln2);
  color: var(--tx); font-size: 11.5px; padding: 8px 14px; border-radius: 20px;
  opacity: 0; transition: .25s; max-width: 84vw; text-align: center;
  box-shadow: 0 12px 30px -14px #000;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 桌面 ---------------- */
@media (min-width: 720px) {
  #home { padding: 0 22px 40px; }
  .hero { padding: 40px 0 26px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 13px; }
  .compose { max-width: 760px; }
  .caps { grid-template-columns: repeat(4, 1fr); max-width: 1000px; }
  .inst, .foot { max-width: 760px; }
  .board { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 9px; }
  .papers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .exps { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .report { max-width: 860px; margin: 0 auto; }
  #ops { max-width: 1200px; width: 100%; margin: 0 auto; }
  .sh-body { border-radius: 18px; margin-bottom: 6dvh; max-height: 82dvh; }
  #sheet { align-items: center; }
}
@media (max-width: 360px) {
  .hero h1 { font-size: 23px; }
  .caps { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr 1fr; }
}

/* ===== 资料导入 ===== */
.mats { margin-top: 11px; }
.mat-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mat-add {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(53, 224, 200, .28);
  background: rgba(53, 224, 200, .08); color: #7fe6d6;
  font-size: 11.5px; font-weight: 600;
}
.mat-add:active { transform: scale(.96); }
.mat-hint { flex: 1; min-width: 120px; font-size: 10px; color: var(--dim); line-height: 1.4; }
.mat-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mat-list:empty { display: none; }
.mat-chip {
  display: flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 4px 7px 4px 4px; border-radius: 10px;
  border: 1px solid var(--ln); background: var(--pn2);
}
.mat-chip .mc-th { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.mat-chip .mc-bd {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center; font-family: var(--mono);
  font-size: 8.5px; font-weight: 700; color: #06231f;
  background: linear-gradient(135deg, #35e0c8, #5ad1ff);
}
.mat-chip.loading .mc-bd { background: linear-gradient(135deg, #2a3a46, #1d2833); color: #8ea0b4; }
.mat-chip .mc-tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mat-chip .mc-n { font-size: 11px; color: var(--tx); max-width: 148px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-chip .mc-s { font-size: 9px; color: var(--dim); white-space: nowrap; }
.mat-chip.err { border-color: rgba(255, 139, 122, .42); }
.mat-chip.err .mc-s { color: #ff8b7a; }
.mat-chip .mc-x {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  border: none; background: rgba(255, 255, 255, .07); color: var(--sub);
  font-size: 11px; line-height: 1;
}

/* ===== 拖拽遮罩 ===== */
.drop-mask {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(6, 12, 16, .8); backdrop-filter: blur(3px);
}
.drop-mask.hidden { display: none; }
.dm-box {
  border: 1.5px dashed rgba(53, 224, 200, .55); border-radius: 18px;
  padding: 26px 34px; text-align: center; color: #7fe6d6;
  background: rgba(53, 224, 200, .05);
}
.dm-box b { display: block; margin-top: 8px; font-size: 15px; color: #e8fbf7; }
.dm-box span { display: block; margin-top: 4px; font-size: 11px; color: #7d93a6; }

/* ===== 加速徽章 ===== */
.spd {
  margin-left: auto; font-family: var(--mono); font-size: 9px;
  color: #8ef0ff; border: 1px solid rgba(142, 240, 255, .3);
  background: rgba(142, 240, 255, .08); border-radius: 6px; padding: 1.5px 5px;
  white-space: nowrap;
}
