





:root {
  --bg: #070b14;
  --panel: rgba(255, 255, 255, 0.045);
  --panel2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.1);
  --txt: #e8edf6;
  --dim: #8c98ad;
  --accent: #35d0ba;
  --gold: #ffcc6b;
  --danger: #ff6b6b;
  --mono: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--mono);
  color: var(--txt);
  background:
    radial-gradient(900px 500px at 15% -5%, rgba(53, 208, 186, 0.12), transparent 65%),
    radial-gradient(800px 500px at 90% 0%, rgba(255, 204, 107, 0.08), transparent 60%),
    radial-gradient(700px 700px at 50% 110%, rgba(94, 124, 255, 0.1), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.5px; }
small { font-weight: 400; color: var(--dim); }

/* ============ 布局 ============ */
.app { max-width: 1200px; margin: 0 auto; padding: 14px 16px 26px; }
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  width: 40px; height: 40px; display: grid; place-items: center;
  font-size: 20px; border-radius: 12px;
  background: linear-gradient(140deg, rgba(53,208,186,.28), rgba(94,124,255,.22));
  border: 1px solid rgba(53,208,186,.45);
}
.brand h1 { font-size: 17px; }
.brand p { font-size: 11px; color: var(--dim); }
.turnbox {
  margin-left: auto; display: flex; flex-direction: column; align-items: flex-end;
  padding: 6px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(53, 208, 186, .1);
}
.turnbox.ai { background: rgba(255, 107, 107, .1); border-color: rgba(255,107,107,.3); }
.turnbox b { font-size: 14px; }
.turnbox span { font-size: 11px; color: var(--dim); }
.topbtns { display: flex; gap: 8px; }
.topbtns button {
  padding: 8px 12px; border-radius: 10px; font-size: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.05);
  transition: .15s;
}
.topbtns button:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); }

.board { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 14px; margin-top: 14px; }
.table { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ============ 区域面板 ============ */
.zone {
  border: 1px solid var(--line); border-radius: 16px; padding: 11px 13px;
  background: var(--panel);
}
.zone.me { border-color: rgba(53, 208, 186, .28); background: rgba(53, 208, 186, .05); }
.zone.opp { border-color: rgba(255, 107, 107, .24); background: rgba(255, 107, 107, .04); }
.zone-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 9px;
  font-size: 12px; color: var(--dim);
}
.zone-head .who { font-size: 13px; font-weight: 700; color: var(--txt); }
.zone-head .who.me { color: var(--accent); }
.zone-head .who.opp { color: #ff9b9b; }
.zone-head .meta { margin-left: auto; display: flex; gap: 10px; }
.zone-head .meta span { white-space: nowrap; }

/* ============ 卡牌 ============ */
.ecard {
  width: 58px; height: 76px; flex: 0 0 auto; position: relative;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(155deg, var(--c), var(--c2));
  box-shadow: 0 4px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; transition: transform .12s, box-shadow .12s;
  user-select: none;
}
.ecard .sym { font-size: 24px; font-weight: 900; line-height: 1; text-shadow: 0 2px 6px rgba(0,0,0,.45); }
.ecard .nm { font-size: 10px; margin-top: 3px; opacity: .92; }
.ecard .cls { position: absolute; top: 3px; left: 5px; font-size: 8px; opacity: .75; }
.ecard .info {
  position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px;
  border-radius: 50%; font-size: 9px; font-style: normal; line-height: 14px; text-align: center;
  background: rgba(0,0,0,.35); color: #fff;
}
.ecard:hover { transform: translateY(-4px); box-shadow: 0 8px 18px rgba(0,0,0,.5); }
.ecard.sel { transform: translateY(-10px); box-shadow: 0 0 0 2px var(--gold), 0 10px 22px rgba(255,204,107,.35); }
.ecard.mini { width: 44px; height: 58px; }
.ecard.mini .sym { font-size: 17px; }
.ecard.mini .nm { font-size: 8px; }
.ecard.comp {
  background: linear-gradient(155deg, #5b3a8e, #2a6f77);
  border: 1px solid rgba(255,214,140,.55);
  box-shadow: 0 4px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25), 0 0 10px rgba(255,204,107,.18);
}
.ecard.comp .sym { font-size: 18px; }
.ecard.comp .cls { color: var(--gold); opacity: 1; }
.ecard.rad {
  background: linear-gradient(155deg, #2a6f8e, #3a8e6a);
  border: 1px solid rgba(150,230,255,.5);
  box-shadow: 0 4px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25), 0 0 10px rgba(120,220,255,.18);
}
.ecard.rad .sym { font-size: 17px; }
.ecard.rad .cls { color: #9fe8ff; opacity: 1; }

.ccard {
  width: 66px; height: 84px; flex: 0 0 auto; border-radius: 10px; position: relative;
  border: 1px solid rgba(255,255,255,.2); overflow: hidden; cursor: pointer;
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(0,0,0,.25));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; transition: transform .12s, box-shadow .12s;
}
.ccard .tag { font-size: 15px; font-weight: 800; color: var(--cc, #fff); }
.ccard .nm { font-size: 9px; color: rgba(255,255,255,.75); }
.ccard::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-top: 3px solid var(--cc, #fff); opacity: .85;
}
.ccard:hover { transform: translateY(-4px); }

/* ============ 实验台 ============ */
.bench { display: flex; gap: 6px; flex-wrap: nowrap; }
.slot {
  width: 58px; height: 76px; border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.16); background: rgba(255,255,255,.02);
  display: grid; place-items: center; color: rgba(255,255,255,.22);
  font-size: 11px; flex: 0 0 auto;
}
.slot .no { font-size: 10px; }
.bench.targetable .slot { border-color: rgba(53,208,186,.5); cursor: pointer; background: rgba(53,208,186,.07); }
.bench.targetable .slot:hover { background: rgba(53,208,186,.16); }
.zone.opp .bench.targetable .slot { border-color: rgba(255,107,107,.5); background: rgba(255,107,107,.07); }

/* ============ 成果区 ============ */
.products { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; min-height: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border-radius: 999px; font-size: 11px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); cursor: pointer; transition: .15s;
}
.chip:hover { background: rgba(255,255,255,.12); }
.chip b { color: var(--gold); font-weight: 700; font-size: 10px; }
.chip.t-simple { border-color: rgba(140,152,173,.4); }
.chip.t-binary { border-color: rgba(95,184,255,.35); }
.chip.t-acid { border-color: rgba(255,107,107,.35); }
.chip.t-base { border-color: rgba(94,211,107,.35); }
.chip.t-salt { border-color: rgba(255,204,107,.38); }
.empty-hint { font-size: 11px; color: rgba(255,255,255,.28); }

/* ============ 共享区 ============ */
.shared { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; }
.shared .zone { padding: 10px 12px; }
.cond-market .row { display: flex; gap: 7px; }
.piles { display: flex; gap: 8px; }
.pile {
  flex: 1; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 2px;
}
.pile .lbl { font-size: 10px; color: var(--dim); }
.pile .val { font-size: 18px; font-weight: 800; }
.pile.waste { border-color: rgba(180,120,255,.35); background: rgba(180,120,255,.08); }
.waste-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; min-height: 18px; }
.wchip {
  font-size: 11px; padding: 2px 7px; border-radius: 6px;
  background: rgba(180,120,255,.16); border: 1px solid rgba(180,120,255,.35);
  cursor: pointer;
}

/* ============ 手牌 + 操作台 ============ */
.bottom { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "hand ops"; gap: 12px; }
.handzone { grid-area: hand; display: flex; flex-direction: column; gap: 9px; }
.handrow { display: flex; gap: 8px; align-items: flex-start; }
.handlabel { flex: 0 0 74px; font-size: 11px; color: var(--dim); padding-top: 6px; line-height: 1.5; }
.handlabel b { display: block; color: var(--txt); font-size: 13px; }
.cards { display: flex; gap: 6px; flex-wrap: wrap; min-height: 78px; align-items: flex-start; }
.ops {
  grid-area: ops; border: 1px solid var(--line); border-radius: 16px; padding: 12px;
  background: linear-gradient(180deg, rgba(53,208,186,.08), rgba(255,255,255,.03));
  display: flex; flex-direction: column; gap: 9px; max-height: 520px; overflow: auto;
}
.ops h3 { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ops h3 .pill { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--dim); font-weight: 400; }
.ops .hint { font-size: 11px; line-height: 1.6; color: var(--dim); }
.btn {
  padding: 10px 12px; border-radius: 11px; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(53,208,186,.45); background: rgba(53,208,186,.16);
  color: #d6fff7; transition: .15s; text-align: left;
}
.btn:hover { background: rgba(53,208,186,.28); }
.btn.ghost { border-color: var(--line); background: rgba(255,255,255,.05); color: var(--txt); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.gold { border-color: rgba(255,204,107,.5); background: rgba(255,204,107,.16); color: #ffe9bd; }
.btn.gold:hover { background: rgba(255,204,107,.28); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; text-align: center; }

.reactlist { display: flex; flex-direction: column; gap: 5px; }
.rrow {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045);
  font-size: 11px; cursor: pointer; transition: .12s;
}
.rrow:hover { background: rgba(255,255,255,.11); }
.rrow.no { opacity: .5; cursor: not-allowed; }
.rrow .f { font-weight: 700; font-size: 12px; min-width: 54px; }
.rrow .nm2 { color: var(--dim); font-size: 10px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .req { color: #a9b7cd; font-size: 10px; }
.rrow .sc { color: var(--gold); font-weight: 700; }
.rrow .cd { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.1); }
.rrow .lack { color: var(--danger); font-size: 10px; }
.rrow .kindtag { font-size: 9px; padding: 1px 6px; border-radius: 6px; background: rgba(120,200,255,.18); color: #9fd8ff; white-space: nowrap; }

/* ============ 侧栏 / 日志 ============ */
.side { display: flex; flex-direction: column; gap: 12px; }
.logbox { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 10px 12px; }
.logbox h4 { font-size: 12px; color: var(--dim); margin-bottom: 6px; font-weight: 500; }
.loglist { max-height: 380px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: 11px; line-height: 1.5; }
.loglist .l { color: #b5c0d1; }
.loglist .l.newest { color: #ffffff; }
.loglist .l.me { color: #7ee9d6; }
.loglist .l.ai { color: #ffb3b3; }
.loglist .l.sys { color: #8c98ad; }
.loglist .l.gold { color: var(--gold); }

/* ============ 弹窗 ============ */
#modal-root { position: fixed; inset: 0; z-index: 60; display: none; }
#modal-root.on { display: block; }
.mask { position: absolute; inset: 0; background: rgba(3, 6, 12, .72); backdrop-filter: blur(4px); }
.sheet {
  position: relative; max-width: 860px; width: calc(100% - 28px); max-height: 86vh;
  margin: 6vh auto; border-radius: 18px; border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, #121a28, #0b111b);
  box-shadow: 0 30px 70px rgba(0,0,0,.6); display: flex; flex-direction: column; overflow: hidden;
}
.sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 15px; }
.sheet-head .x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 16px; }
.sheet-body { padding: 16px 18px 22px; overflow: auto; font-size: 13px; line-height: 1.7; }

/* 详情/配方表 */
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; padding: 7px 8px; color: var(--dim); font-weight: 500; border-bottom: 1px solid var(--line); font-size: 11px; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.tbl tr:hover td { background: rgba(255,255,255,.04); }
.tagcond { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.1); }
.atomlist { color: #a9b7cd; font-size: 11px; }
.atomlist i { font-style: normal; color: var(--txt); font-weight: 700; }

/* 结算 */
.scoregrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scorecard { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(255,255,255,.035); }
.scorecard.win { border-color: rgba(255,204,107,.6); background: rgba(255,204,107,.08); }
.scorecard h3 { font-size: 14px; margin-bottom: 6px; }
.big { font-size: 26px; font-weight: 900; color: var(--gold); }
.sub { font-size: 11px; color: var(--dim); }
.items { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow: auto; }
.items .it { display: flex; gap: 8px; font-size: 11px; padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,.07); }
.items .it span:first-child { min-width: 66px; font-weight: 700; }
.items .it .n2 { flex: 1; color: var(--dim); }
.items .it .s2 { color: var(--gold); }

/* 开局 */
.intro { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.intro-card { max-width: 720px; width: 100%; border: 1px solid var(--line); border-radius: 22px; padding: 28px; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.intro-card h1 { font-size: 30px; letter-spacing: 2px; }
.intro-card .lead { color: var(--dim); font-size: 13px; line-height: 1.9; margin-top: 8px; }
.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.opt {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; background: rgba(255,255,255,.04);
  text-align: left; transition: .15s;
}
.opt:hover { border-color: rgba(53,208,186,.5); background: rgba(53,208,186,.1); }
.opt.on { border-color: var(--accent); background: rgba(53,208,186,.14); }
.opt b { display: block; font-size: 14px; margin-bottom: 4px; }
.opt span { font-size: 11px; color: var(--dim); line-height: 1.5; }
.startbtn { margin-top: 18px; width: 100%; padding: 15px; border-radius: 14px; font-size: 15px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(120deg, #2bb9a6, #1f9c8c); color: #fff; box-shadow: 0 10px 26px rgba(43,185,166,.3); }
.startbtn:hover { filter: brightness(1.1); }
.mini-rule { margin-top: 18px; font-size: 11px; color: var(--dim); line-height: 1.8; border-top: 1px dashed var(--line); padding-top: 14px; }
.mini-rule b { color: var(--txt); }

/* 提示条 */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: rgba(20, 28, 42, .96); border: 1px solid rgba(255,255,255,.18);
  padding: 10px 18px; border-radius: 12px; font-size: 12px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 70; max-width: 80vw; text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.selectors { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-cond { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); font-size: 12px; }
.mini-cond:hover { background: rgba(255,255,255,.12); }


@media (max-width: 480px) {
  .ecard, .slot { width: 44px; height: 60px; border-radius: 8px; }
  .ecard .sym { font-size: 19px; }
  .ecard .nm { font-size: 9px; margin-top: 1px; }
  .ecard .cls { font-size: 7px; }
  .ecard.mini { width: 38px; height: 52px; }
  .bench { gap: 4px; flex-wrap: wrap; }
  .ccard { width: 56px; height: 72px; }
  .ccard .tag { font-size: 13px; }
  .cards { min-height: 62px; gap: 4px; }
  .handlabel { flex: 0 0 58px; font-size: 10px; }
  .handlabel b { font-size: 12px; }
  .handlabel .lb-extra { display: none; }
  .rrow { flex-wrap: wrap; row-gap: 2px; }
  .rrow .f { min-width: 44px; }
  .rrow .nm2 { flex: 1 1 40%; }
  .rrow .req { order: 4; width: 100%; color: #8fa0b8; }
  .rrow .sc, .rrow .lack { margin-left: auto; }
  #toast { top: 76px; bottom: auto; transform: translate(-50%, -14px); font-size: 11px; padding: 8px 14px; }
  #toast.on { transform: translate(-50%, 0); }
  .topsub { display: none; }
  .intro-card { padding: 20px; }
  .intro-card h1 { font-size: 24px; }
  .sheet { margin: 2vh auto; max-height: 94vh; }
  .sheet-body { padding: 12px 14px 18px; }
  .scoregrid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .board { grid-template-columns: 1fr; }
  .bottom { grid-template-columns: 1fr; grid-template-areas: "ops" "hand"; }
  .shared { grid-template-columns: 1fr; }
  .ops { max-height: none; }
  .loglist { max-height: 200px; }
  .intro-grid { grid-template-columns: 1fr; }
}







.rrow .eq { font-size: 10px; color: var(--dim); opacity: .85; }






