/* ═══════════════════════════════════════════════════════════════
   星码助手 · 设计系统
   深空底色 / 玻璃面板 / 青紫双色强调 / 顶部导航条
   ═══════════════════════════════════════════════════════════════ */

/* hidden 属性优先于组件自身的 display，避免隐藏层继续拦截点击 */
[hidden] { display: none !important; }

:root {
  --bg:            #080a12;
  --bg-2:          #0c0f1a;
  --panel:         rgba(20, 24, 38, .72);
  --panel-solid:   #141826;
  --panel-hi:      rgba(255, 255, 255, .045);
  --line:          rgba(255, 255, 255, .075);
  --line-hi:       rgba(255, 255, 255, .14);

  --text:          #e9ecf5;
  --text-2:        #a4abc2;
  --muted:         #6f7794;

  --accent:        #35e0d4;
  --accent-soft:   rgba(53, 224, 212, .14);
  --accent-2:      #8b5cf6;
  --accent-2-soft: rgba(139, 92, 246, .16);

  --ok:            #3ddc97;
  --ok-soft:       rgba(61, 220, 151, .14);
  --warn:          #ffb547;
  --warn-soft:     rgba(255, 181, 71, .14);
  --danger:        #ff5f74;
  --danger-soft:   rgba(255, 95, 116, .14);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;

  --shadow:    0 18px 44px -22px rgba(0, 0, 0, .9);
  --shadow-lg: 0 34px 80px -30px rgba(0, 0, 0, .95);

  --rail-w: 74px;
  --top-h:  68px;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

html[data-theme="light"] {
  --bg:          #eef1f7;
  --bg-2:        #e4e8f2;
  --panel:       rgba(255, 255, 255, .82);
  --panel-solid: #ffffff;
  --panel-hi:    rgba(15, 23, 42, .03);
  --line:        rgba(15, 23, 42, .10);
  --line-hi:     rgba(15, 23, 42, .18);

  --text:        #131826;
  --text-2:      #4a5268;
  --muted:       #7b839b;

  --accent:      #0d9e92;
  --accent-soft: rgba(13, 158, 146, .12);
  --accent-2:    #6d3fd6;
  --accent-2-soft: rgba(109, 63, 214, .12);

  --shadow:    0 16px 38px -22px rgba(20, 28, 55, .45);
  --shadow-lg: 0 30px 70px -28px rgba(20, 28, 55, .5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* 背景纹理：径向光晕 + 网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(53, 224, 212, .16), transparent 62%),
    radial-gradient(760px 480px at 88% 4%, rgba(139, 92, 246, .16), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  background-image:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 88%);
}
html[data-theme="light"] body::after { opacity: .5; background-image:
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px); }

::selection { background: var(--accent-soft); color: var(--text); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ───────────────────────── 外壳 ───────────────────────── */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
}

/* ───────────────────────── 顶部导航条 ───────────────────────── */

.rail {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent);
  backdrop-filter: blur(16px);
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
  padding-right: 6px;
}
.rail__logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 16px rgba(53, 224, 212, .22), 0 0 0 1px rgba(255, 255, 255, .07);
}
.rail__names { display: flex; flex-direction: column; line-height: 1.25; }
.rail__name { font-size: 14px; font-weight: 650; letter-spacing: .4px; }
.rail__slogan { font-size: 11px; color: var(--muted); }

.rail__nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.rail__nav::-webkit-scrollbar { display: none; }

.rail__item {
  position: relative;
  flex: 0 0 auto;
  height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color .16s, background .16s, border-color .16s;
}
.rail__item svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
.rail__item:hover { color: var(--text); background: var(--panel-hi); }
.rail__item.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(53, 224, 212, .3);
}
.rail__item.is-active::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.rail__label { white-space: nowrap; }

.rail__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.rail__badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent-2);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.rail__badge:empty, .rail__badge[data-zero="1"] { display: none; }

.rail__foot { flex: 0 0 auto; }
.rail__foot .rail__label { display: none; }

/* ───────────────────────── 主区 ───────────────────────── */

.main { display: grid; grid-template-rows: 1fr; min-width: 0; }

.viewhead { margin-bottom: 18px; }
.viewhead h1 { font-size: 18px; font-weight: 650; letter-spacing: .2px; }

.omni {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px 0 13px;
  width: 232px;
  flex: 0 1 232px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-hi);
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.omni:hover { border-color: var(--line-hi); background: rgba(255, 255, 255, .06); }
.omni span { flex: 1; text-align: left; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omni svg { fill: currentColor; opacity: .75; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--panel-hi);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.topbar__status { display: flex; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel-hi);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--muted);
  transition: background .2s, box-shadow .2s;
}
.pill.is-on   { color: var(--ok);   border-color: rgba(61, 220, 151, .3); background: var(--ok-soft); }
.pill.is-on .dot   { background: var(--ok);   box-shadow: 0 0 8px var(--ok); }
.pill.is-off  { color: var(--danger); border-color: rgba(255, 95, 116, .28); background: var(--danger-soft); }
.pill.is-off .dot  { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.pill.is-warn { color: var(--warn); border-color: rgba(255, 181, 71, .28); background: var(--warn-soft); }
.pill.is-warn .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

/* ───────────────────────── 内容区 ───────────────────────── */

.content { overflow: auto; padding: 26px 26px 90px; }
.view { display: none; animation: fade .22s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ───────────────────────── 通用块 ───────────────────────── */

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px)  { .grid--3, .grid--2 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.card--flush { padding: 0; overflow: hidden; }

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card__head h3 { font-size: 14px; font-weight: 620; letter-spacing: .2px; }
.card__head .sub { font-size: 12px; color: var(--muted); }
.card__head .spacer { flex: 1; }

.section-title {
  display: flex; align-items: center; gap: 9px;
  margin: 26px 0 13px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.section-title:first-child { margin-top: 0; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-hi);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s, border-color .16s, transform .12s, opacity .16s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .08); border-color: var(--line-hi); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; fill: currentColor; }

.btn--primary {
  background: linear-gradient(120deg, var(--accent), #24b9d8);
  border-color: transparent;
  color: #04211f;
  font-weight: 620;
}
.btn--primary:hover:not(:disabled) {
  background: linear-gradient(120deg, #4bf0e3, #2fc6e4);
  box-shadow: 0 10px 26px -12px var(--accent);
}
html[data-theme="light"] .btn--primary { color: #fff; }

.btn--accent2 {
  background: linear-gradient(120deg, var(--accent-2), #6d3fd6);
  border-color: transparent; color: #fff; font-weight: 620;
}
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); border-color: rgba(255, 95, 116, .3); background: var(--danger-soft); }
.btn--danger:hover:not(:disabled) { background: rgba(255, 95, 116, .2); }
.btn--sm { height: 29px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn--block { width: 100%; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-hi);
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

/* 表单 */
.field { margin-bottom: 14px; }
.field > label:not(.switch) {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field .hint { font-size: 11px; color: var(--muted); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
html[data-theme="light"] .input, html[data-theme="light"] .select, html[data-theme="light"] .textarea {
  background: rgba(255, 255, 255, .8);
}
.textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(53, 224, 212, .55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%236f7794' d='M2 4.5 6 8.5 10 4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 11px;
  padding-right: 30px;
}
.input--mono { font-family: var(--mono); font-size: 12px; }

.row { display: flex; gap: 10px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.row > .input, .row > .select { flex: 1; min-width: 0; }

/* 分段控件 */
.seg { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0, 0, 0, .2); }
.seg button {
  height: 28px; padding: 0 13px;
  border: none; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12px; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch__track {
  flex: none;
  width: 38px; height: 21px; border-radius: 99px;
  background: var(--line-hi); position: relative;
  transition: background .18s;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 15px; height: 15px; border-radius: 99px;
  background: #fff; transition: transform .18s;
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(17px); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 9px;
  border-radius: 99px;
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--panel-hi);
  color: var(--text-2);
}
.tag--ok { color: var(--ok); border-color: rgba(61, 220, 151, .3); background: var(--ok-soft); }
.tag--warn { color: var(--warn); border-color: rgba(255, 181, 71, .3); background: var(--warn-soft); }
.tag--danger { color: var(--danger); border-color: rgba(255, 95, 116, .3); background: var(--danger-soft); }
.tag--accent { color: var(--accent); border-color: rgba(53, 224, 212, .3); background: var(--accent-soft); }

/* 空状态 */
.empty {
  display: grid; place-items: center; gap: 10px;
  padding: 54px 20px;
  text-align: center;
  color: var(--muted);
}
.empty__icon { font-size: 34px; opacity: .55; }
.empty p { font-size: 13px; }
.empty .sub { font-size: 12px; opacity: .75; }

/* ───────────────────────── 向导 ───────────────────────── */

.steps { display: flex; align-items: center; gap: 4px; margin-bottom: 22px; }
.step {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 11px;
  border-radius: 11px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  transition: color .16s, background .16s, border-color .16s;
}
.step__num {
  width: 21px; height: 21px; border-radius: 99px;
  display: grid; place-items: center;
  border: 1px solid currentColor;
  font-family: var(--mono); font-size: 11px;
}
.step.is-done { color: var(--ok); }
.step.is-done .step__num { background: var(--ok-soft); }
.step.is-current { color: var(--accent); background: var(--accent-soft); border-color: rgba(53, 224, 212, .3); }
.step__arrow { color: var(--line-hi); font-size: 11px; }

.wizard { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .wizard { grid-template-columns: 1fr; } }

/* 来源选择卡 */
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .source-grid { grid-template-columns: 1fr; } }
.source {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-hi);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
  text-align: left;
  color: inherit;
  font-family: inherit;
}
.source:hover { transform: translateY(-2px); border-color: var(--line-hi); }
.source.is-on { border-color: var(--accent); background: var(--accent-soft); }
.source__icon { font-size: 22px; line-height: 1; }
.source__name { font-weight: 600; margin-top: 9px; font-size: 13px; }
.source__desc { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* 模式选择 */
.modes { display: grid; gap: 10px; }
.mode {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-hi);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.mode:hover { border-color: var(--line-hi); }
.mode.is-on { border-color: var(--accent); background: var(--accent-soft); }
.mode__radio {
  width: 15px; height: 15px; margin-top: 3px;
  border-radius: 99px; border: 1.5px solid var(--muted);
  flex: none; position: relative;
}
.mode.is-on .mode__radio { border-color: var(--accent); }
.mode.is-on .mode__radio::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 99px; background: var(--accent);
}
.mode__body { min-width: 0; }
.mode__name { font-weight: 600; font-size: 13px; }
.mode__desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.55; }

/* 可执行文件列表 */
.exelist { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.exerow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .14s;
}
.exerow:last-child { border-bottom: none; }
.exerow:hover { background: var(--panel-hi); }
.exerow.is-on { background: var(--accent-soft); }
.exerow__name { font-size: 12.5px; font-weight: 500; }
.exerow__path { font-size: 11px; color: var(--muted); font-family: var(--mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exerow__meta { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* 预览卡 */
.preview { position: sticky; top: 0; }
.preview__cover {
  width: 100%; aspect-ratio: 3/4; border-radius: var(--radius-sm);
  object-fit: cover; background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
}
.preview__title { font-weight: 620; margin-top: 12px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 12px; margin-top: 12px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--text-2); word-break: break-all; font-family: var(--mono); font-size: 11.5px; }

/* ───────────────────────── 卡片矩阵 / 列表 ───────────────────────── */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.game {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: transform .16s, border-color .16s, box-shadow .16s;
  backdrop-filter: blur(10px);
}
.game:hover { transform: translateY(-3px); border-color: var(--line-hi); box-shadow: var(--shadow-lg); }
.game__cover {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  background: linear-gradient(140deg, rgba(53, 224, 212, .16), rgba(139, 92, 246, .16));
  display: grid; place-items: center; font-size: 30px; color: var(--muted);
}
.game__info { padding: 11px 13px 13px; }
.game__name { font-weight: 600; font-size: 13px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game__sub { font-size: 11px; color: var(--muted); margin-top: 4px; font-family: var(--mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game__acts { display: flex; gap: 6px; margin-top: 10px; }

/* ───────────────────────── 入库台：搜索 + 游戏网格 ───────────────────────── */

.import-head { margin-bottom: 16px; }
.import-head .card__head h3 { font-size: 15px; }

.import-search {
  position: relative;
  display: flex;
  align-items: center;
}
.import-search__icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  fill: var(--muted);
  pointer-events: none;
}
.import-search__input {
  flex: 1;
  height: 42px;
  padding: 0 38px 0 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-hi);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.import-search__input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(53, 224, 212, .14);
}
.import-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.import-search__clear {
  position: absolute;
  right: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.import-search__clear:hover { background: var(--panel-hi); color: var(--text); }
.import-search__clear.is-hidden { display: none; }

.gamegrid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.gamecard {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.gamecard:hover {
  transform: translateY(-3px);
  border-color: rgba(53, 224, 212, .45);
  box-shadow: var(--shadow-lg);
}
.gamecard__cover {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(140deg, rgba(53, 224, 212, .14), rgba(139, 92, 246, .18));
  display: grid;
  place-items: center;
  font-size: 32px;
  color: var(--muted);
  overflow: hidden;
}
.gamecard__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gamecard__cover.is-broken { font-size: 30px; }
.gamecard__body { padding: 10px 12px 12px; min-width: 0; }
.gamecard__name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gamecard__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.gamecard__price {
  margin-left: auto;
  color: var(--accent);
  background: rgba(53, 224, 212, .12);
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10.5px;
}

.import-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.import-pager__nums { display: flex; align-items: center; gap: 4px; }
.import-pager__dot { color: var(--muted); padding: 0 4px; }

/* 网格在小屏退化为更少列 */
@media (max-width: 1180px) { .gamegrid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 880px)  { .gamegrid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 620px)  { .gamegrid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 420px)  { .gamegrid { grid-template-columns: 1fr !important; } }

/* ───────────────────────── 游戏导入：左右分栏 ───────────────────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}
.split-left { min-width: 0; }
.split-right-host { position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow: auto; padding-right: 2px; }
.split-right-host::-webkit-scrollbar { width: 6px; }
.split-right-host::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

/* 右侧库管理卡片 */
.liblist { display: flex; flex-direction: column; gap: 10px; }
.libcard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px 13px;
  transition: border-color .16s, transform .16s;
}
.libcard:hover { border-color: var(--line-hi); transform: translateY(-1px); }
.libcard__head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.libcard__name {
  font-weight: 600; font-size: 13.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1;
}
.libcard__appid {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  background: rgba(53, 224, 212, .1); padding: 1px 7px; border-radius: 99px; flex: 0 0 auto;
}
.libcard__path {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.libcard__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.libcard__acts { display: flex; gap: 6px; margin-top: 10px; }
.lib-filter { height: 34px; font-size: 13px; }

@media (max-width: 1040px) {
  .split { grid-template-columns: 1fr; }
  .split-right-host { position: static; max-height: none; }
}

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11px;
  letter-spacing: .8px; text-transform: uppercase; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel-solid); z-index: 1;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--panel-hi); }
.table .mono { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.table .acts { display: flex; gap: 6px; justify-content: flex-end; }

.table-wrap { overflow: auto; max-height: 640px; }

/* ───────────────────────── 终端日志 ───────────────────────── */

.term {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
html[data-theme="light"] .term { background: rgba(15, 23, 42, .04); }
.term__line { display: flex; gap: 9px; }
.term__time { color: var(--muted); opacity: .7; flex: none; }
.term__msg { min-width: 0; }
.term__line--info  .term__msg { color: var(--text-2); }
.term__line--ok    .term__msg { color: var(--ok); }
.term__line--warn  .term__msg { color: var(--warn); }
.term__line--error .term__msg { color: var(--danger); }

.progress { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s ease; }

/* ───────────────────────── 日志抽屉 ───────────────────────── */

.drawer {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 460px; max-width: calc(100vw - 36px);
  height: 300px;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(calc(100% + 30px));
  transition: transform .26s cubic-bezier(.3, .9, .3, 1);
}
.drawer.is-open { transform: none; }
.drawer__head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-hi);
}
.drawer__title { font-size: 12px; font-weight: 600; letter-spacing: .6px; }
.drawer__actions { margin-left: auto; display: flex; gap: 6px; }
.drawer__body {
  flex: 1; overflow: auto; padding: 10px 14px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.8;
}
.drawer__body .term__line { gap: 8px; }

.drawer-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 55;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-solid);
  color: var(--text-2);
  font-size: 17px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .2s, color .16s;
}
.drawer-fab:hover { color: var(--accent); transform: translateY(-2px); }
.drawer-fab.is-hidden { opacity: 0; pointer-events: none; transform: translateY(14px); }

/* ───────────────────────── 命令面板 ───────────────────────── */

.omni-panel {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: start center;
  padding-top: 13vh;
  background: rgba(4, 6, 12, .62);
  backdrop-filter: blur(7px);
  animation: fade .16s ease;
}
.omni-panel__box {
  width: min(660px, calc(100vw - 32px));
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.omni-panel__input {
  width: 100%; height: 52px;
  padding: 0 18px;
  border: none; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 15px; outline: none;
}
.omni-panel__input::placeholder { color: var(--muted); }
.omni-panel__list { max-height: 46vh; overflow: auto; }
.omni-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px; cursor: pointer;
  border-left: 2px solid transparent;
}
.omni-row:hover, .omni-row.is-on { background: var(--panel-hi); border-left-color: var(--accent); }
.omni-row__cover { width: 30px; height: 42px; border-radius: 5px; object-fit: cover; background: rgba(0,0,0,.3); flex: none; }
.omni-row__icon { width: 30px; text-align: center; flex: none; opacity: .85; }
.omni-row__main { min-width: 0; flex: 1; }
.omni-row__name { font-size: 13px; font-weight: 550; }
.omni-row__sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-row__kind { font-size: 10px; color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; border-radius: 99px; flex: none; }
.omni-panel__foot {
  display: flex; gap: 16px; padding: 9px 18px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
  background: var(--panel-hi);
}
.omni-panel__foot kbd { margin-right: 3px; }

/* ───────────────────────── 配对闸门 ───────────────────────── */

.gate {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--bg);
}
.gate::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(800px 460px at 22% 12%, rgba(53, 224, 212, .18), transparent 60%),
    radial-gradient(700px 420px at 80% 80%, rgba(139, 92, 246, .18), transparent 60%);
}
.gate__panel {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 36px 32px 28px;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.gate__mark { display: grid; place-items: center; margin-bottom: 14px; }
.gate__mark img {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  box-shadow: 0 12px 34px -12px rgba(53, 224, 212, .5), 0 0 0 1px rgba(255, 255, 255, .08);
}
.gate__title { font-size: 20px; font-weight: 650; }
.gate__desc { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.gate__local { margin-top: 18px; }
.gate__sep {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 0; color: var(--muted); font-size: 11px;
}
.gate__sep::before, .gate__sep::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.gate__input {
  width: 100%; height: 54px; margin: 18px 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font-family: var(--mono); font-size: 24px; letter-spacing: 12px; text-align: center;
  text-transform: uppercase; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.gate__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate__error { min-height: 20px; font-size: 12px; color: var(--danger); margin-top: 10px; }
.gate__hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.gate__hint code { font-family: var(--mono); color: var(--text-2); }

/* ───────────────────────── 提示条 ───────────────────────── */

.toasts {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  border: 1px solid var(--line-hi);
  border-radius: 11px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: toastIn .22s cubic-bezier(.2, .9, .3, 1);
  max-width: 520px;
}
.toast--ok { border-color: rgba(61, 220, 151, .4); }
.toast--ok .toast__dot { background: var(--ok); box-shadow: 0 0 9px var(--ok); }
.toast--error { border-color: rgba(255, 95, 116, .4); }
.toast--error .toast__dot { background: var(--danger); box-shadow: 0 0 9px var(--danger); }
.toast--warn .toast__dot { background: var(--warn); box-shadow: 0 0 9px var(--warn); }
.toast__dot { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.toast.is-out { opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }

/* ───────────────────────── 工具箱分栏 ───────────────────────── */

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 15px; border: none; background: transparent;
  color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text-2); }
.tab.is-on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabpanel { display: none; }
.tabpanel.is-on { display: block; }

/* 列表项 */
.list { display: flex; flex-direction: column; gap: 8px; }
.list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-hi);
  font-size: 13px;
}
.list__item .grow { flex: 1; min-width: 0; }
.list__item .sub { font-size: 11px; color: var(--muted); font-family: var(--mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.note {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(53, 224, 212, .22);
  background: var(--accent-soft);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.65;
}
.note--warn { border-color: rgba(255, 181, 71, .26); background: var(--warn-soft); }

/* 小屏适配 */
@media (max-width: 1320px) {
  .topbar__status .pill span { display: none; }
  .topbar__status .pill { padding: 0 9px; }
}

@media (max-width: 1120px) {
  .omni span, .omni kbd { display: none; }
  .omni { width: 38px; min-width: 38px; flex: 0 0 38px; padding: 0; justify-content: center; }
}

@media (max-width: 940px) {
  .rail__slogan { display: none; }
  .rail__label { display: none; }
  .rail__item { width: 38px; padding: 0; justify-content: center; }
}

@media (max-width: 760px) {
  .rail { gap: 10px; padding: 8px 12px; }
  .rail__names { display: none; }
  .content { padding: 18px 14px 90px; }
}
