:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel2: #1c2230;
  --line: #262d3a;
  --text: #e6edf3;
  --dim: #8b98a9;
  --accent: #4f8cff;
  --accent2: #2f6fe0;
  --ok: #2ea043;
  --warn: #d29922;
  --err: #f85149;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1220px, calc(100% - 40px)); margin: 0 auto; }

/* ---------------- 顶栏 ---------------- */
.top {
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 22, .82);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 19px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 4px 16px rgba(79, 140, 255, .32);
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .3px; }
.brand p { margin: 1px 0 0; font-size: 12px; color: var(--dim); }

.status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.status.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(46,160,67,.16); }
.status.bad .dot { background: var(--err); box-shadow: 0 0 0 3px rgba(248,81,73,.16); }

/* ---------------- 布局 ---------------- */
.grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  padding: 22px 0 40px;
  align-items: start;
}
@media (max-width: 940px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.result { min-height: 520px; display: flex; flex-direction: column; }

h2 {
  margin: 22px 0 12px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--dim);
}
h2:first-child { margin-top: 0; }
h2 .h2em {
  font-style: normal; font-weight: 400; letter-spacing: 0;
  text-transform: none; font-size: 11px; color: #55637a; margin-left: 6px;
}

/* ---------------- 上传区 ---------------- */
.drop {
  border: 1.5px dashed #313b4c;
  border-radius: var(--radius);
  min-height: 176px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #12171f;
  overflow: hidden;
  position: relative;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #141b26; }
.drop-empty { text-align: center; padding: 22px; color: var(--dim); }
.drop-empty .ic { width: 34px; height: 34px; fill: #3d4c63; margin-bottom: 8px; }
.drop-empty b { display: block; color: #b9c6d6; font-weight: 550; font-size: 13px; }
.drop-empty span { display: block; margin-top: 5px; font-size: 11.5px; }

.drop-preview { position: absolute; inset: 0; display: grid; place-items: center; background: #0b0f14; }
.drop-preview img { max-width: 100%; max-height: 320px; object-fit: contain; display: block; }
.rm {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(0,0,0,.65); color: #fff; font-size: 17px; line-height: 1;
}
.rm:hover { background: var(--err); }

.urlrow { display: flex; gap: 8px; margin-top: 10px; }
.urlrow input { flex: 1; }

/* ---------------- 表单 ---------------- */
input[type=text], input[type=url], textarea, select {
  width: 100%;
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,.14);
}
textarea { resize: vertical; min-height: 68px; }
select { cursor: pointer; }

.field { display: block; margin-bottom: 13px; }
.field > span {
  display: block; margin-bottom: 6px;
  font-size: 12.5px; color: #aab7c8; font-weight: 550;
}
.field > span em {
  font-style: normal; font-weight: 400;
  font-size: 11.5px; color: #5f6d80; margin-left: 5px;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.row2.tight { align-items: end; }
.btnfield { margin-bottom: 0; }

/* ---------------- 平台 ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; user-select: none; }
.chip input { display: none; }
.chip span {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: #9dabbe;
  background: #12171f;
  transition: all .15s;
}
.chip input:checked + span {
  border-color: var(--accent);
  color: #dbe8ff;
  background: rgba(79,140,255,.14);
}
.chip:hover span { border-color: #3c4a60; }

/* ---------------- 按钮 ---------------- */
button { font: inherit; cursor: pointer; border-radius: 9px; border: 1px solid var(--line); }
.primary {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(79,140,255,.28);
  transition: transform .1s, box-shadow .15s, opacity .15s;
}
.primary:hover { box-shadow: 0 6px 20px rgba(79,140,255,.42); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.ghost {
  padding: 9px 14px;
  background: #12171f;
  color: #b6c3d4;
  font-size: 13px;
  transition: all .15s;
}
.ghost:hover { border-color: #3c4a60; color: #fff; background: #171e28; }

.hint { margin: 14px 0 0; font-size: 11.5px; color: #5f6d80; line-height: 1.65; }

/* ---------------- 结果区 ---------------- */
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.result-head h2 { margin: 0; }
.meta { font-size: 11.5px; color: #5f6d80; font-variant-numeric: tabular-nums; }

.empty { color: #55637a; text-align: center; padding: 90px 20px; }
.empty p { margin: 0 0 8px; }
.empty .sub { font-size: 12px; color: #45526a; }

.loading { padding: 70px 20px 60px; text-align: center; }
.loading p { color: var(--dim); font-size: 13px; margin-top: 16px; }
.bar { height: 3px; background: #1e2632; border-radius: 3px; overflow: hidden; }
.bar i {
  display: block; height: 100%; width: 38%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.15s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* 识别摘要 */
.vision {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 16px;
  font-size: 12.5px;
  line-height: 1.75;
}
.vision .vt {
  font-size: 11.5px; font-weight: 650; letter-spacing: .5px;
  color: #6c7a8f; text-transform: uppercase; margin-bottom: 7px;
  display: flex; align-items: center; gap: 8px;
}
.vrow { display: flex; gap: 8px; padding: 2px 0; }
.vrow dt { color: #7c8a9e; min-width: 58px; flex: none; }
.vrow dd { margin: 0; color: #ccd7e4; }
.tag {
  display: inline-block; padding: 1px 8px; margin: 0 5px 4px 0;
  border-radius: 6px; font-size: 11.5px;
  background: rgba(79,140,255,.14); color: #a8c8ff;
  border: 1px solid rgba(79,140,255,.22);
}
.conf { font-size: 11px; color: #64748b; margin-left: auto; font-weight: 400; }
.conf.warn { color: var(--warn); }

/* 合规检查 */
.check {
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 16px;
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.check .vtitle { font-size: 12px; margin-bottom: 6px; color: #ccd7e4; }
.check .vtitle b.bad { color: #ff9a94; font-weight: 650; }
.check .vtitle b.good { color: #7ee2a8; font-weight: 650; }
.check.has-err { background: rgba(248,81,73,.06); border-color: rgba(248,81,73,.28); }
.issues { margin: 0; padding: 0; list-style: none; }
.issues li { padding: 4px 0; border-top: 1px solid rgba(255,255,255,.045); }
.issues li:first-child { border-top: none; }
.issues li.err { color: #ffb0aa; }
.issues li.warn { color: #d9b264; }
.issues .pl {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  margin-right: 7px;
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  color: #93a1b5;
  white-space: nowrap;
}

/* 各平台描述 */
.pdesc {
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pdesc > header {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 9px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.pdesc > header b { font-size: 12.5px; font-weight: 650; color: #d7e2ef; }
.pdesc > header .dlg { font-size: 11px; color: #5d6b80; font-variant-numeric: tabular-nums; }
.pdesc > header .copy { margin-left: auto; }
.pdesc pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 13px;
  line-height: 1.78;
  color: #c6d2e0;
}
.tagline { margin-top: 9px; }
.tagline .tag { font-size: 11px; }


/* 标题组 */
.pgroup { margin-bottom: 18px; }
.pgroup > header {
  display: flex; align-items: baseline; gap: 9px;
  margin-bottom: 9px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.pgroup > header b { font-size: 13px; font-weight: 650; color: #d7e2ef; }
.pgroup > header .lg { font-size: 11px; color: #5d6b80; }

.title {
  display: flex; align-items: flex-start; gap: 10px;
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}
.title:hover { border-color: #33405a; background: #111823; }
.title .body { flex: 1; min-width: 0; }
.title .text {
  font-size: 14px; line-height: 1.55; color: #e9f0f8;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.title .why { font-size: 11.5px; color: #64748b; margin-top: 5px; line-height: 1.55; }
.title .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.chars { font-size: 11px; color: #5a6779; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chars.over { color: var(--warn); }
.chars.way-over { color: var(--err); }
.copy {
  padding: 4px 10px; font-size: 11.5px;
  background: #1a2130; border-color: #2a3444; color: #9fb0c6;
  white-space: nowrap;
}
.copy:hover { border-color: var(--accent); color: #cfe0ff; }
.copy.done { border-color: var(--ok); color: #7ee2a8; }

/* 描述 / 提示 */
.desc, .note {
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  margin-bottom: 14px;
}
.desc { background: var(--panel2); border: 1px solid var(--line); color: #c6d2e0; }
.note {
  background: rgba(210,153,34,.08);
  border: 1px solid rgba(210,153,34,.26);
  color: #e0c080;
  font-size: 12.5px;
  white-space: normal;
}
.desc .lbl, .note .lbl {
  display: block; font-size: 11px; font-weight: 650;
  letter-spacing: .5px; text-transform: uppercase;
  margin-bottom: 7px; color: #6c7a8f;
}
.note .lbl { color: #b28b2e; }

.actions { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 4px; }

.err {
  background: rgba(248,81,73,.08);
  border: 1px solid rgba(248,81,73,.3);
  color: #ff9a94;
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.foot {
  border-top: 1px solid var(--line);
  padding: 16px 0 26px;
  font-size: 11.5px;
  color: #4a566a;
}

/* ---------------- 登录 / 账号 ---------------- */
.topright { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { font-size: 12.5px; color: #aab7c8; }
.quota {
  font-size: 11.5px; color: #6c7a8f;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: #12171f;
}
.quota.low { color: #ffb0aa; border-color: rgba(248,81,73,.35); background: rgba(248,81,73,.08); }
.btnlink {
  padding: 7px 12px; font-size: 12.5px; text-decoration: none;
  border-radius: 9px; border: 1px solid var(--line);
  background: #12171f; color: #b6c3d4; white-space: nowrap;
}
.btnlink:hover { border-color: #3c4a60; color: #fff; background: #171e28; }

.auth-body { min-height: 100vh; display: grid; place-items: center; }
.auth { width: min(400px, calc(100% - 32px)); padding: 40px 0; }
.auth-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.auth-brand { margin-bottom: 22px; }
.auth-foot { margin: 16px 0 0; font-size: 11.5px; color: #5f6d80; line-height: 1.7; }

.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6,9,13,.78); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(420px, 100%);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}

.admin { display: grid; gap: 20px; padding: 22px 0 40px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 11px; }
@media (max-width: 780px) { .row3 { grid-template-columns: 1fr; } }

.tablewrap { overflow-x: auto; margin: 4px -4px 0; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font-weight: 550; color: #6c7a8f;
  font-size: 11px; letter-spacing: .4px; text-transform: uppercase;
  padding: 0 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 9px 10px 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.tbl tr.off td { opacity: .45; }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }
.tbl .ops { text-align: right; white-space: nowrap; }
.tbl .ops .mini { margin-left: 5px; }
.mini { padding: 4px 9px; font-size: 11.5px; }
.ghost.danger { color: #ff9a94; border-color: rgba(248,81,73,.3); }
.ghost.danger:hover { background: rgba(248,81,73,.12); border-color: rgba(248,81,73,.6); color: #ffc4c0; }
.ghost[disabled] { opacity: .35; cursor: not-allowed; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; border: 1px solid transparent;
}
.pill.ok { color: #7ee2a8; background: rgba(46,160,67,.12); border-color: rgba(46,160,67,.3); }
.pill.warn { color: #e0c080; background: rgba(210,153,34,.12); border-color: rgba(210,153,34,.3); }
.pill.bad { color: #ff9a94; background: rgba(248,81,73,.12); border-color: rgba(248,81,73,.3); }
.pill.adm { color: #a8c8ff; background: rgba(79,140,255,.14); border-color: rgba(79,140,255,.28); }
.dimtext { color: #5d6b80; }

.batchpre {
  margin: 10px 0 0; padding: 13px 15px;
  background: #0f141b; border: 1px solid var(--line); border-radius: 10px;
  font: 13px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #c6d2e0; white-space: pre; overflow-x: auto;
}
#copyBatch { margin-top: 10px; }

/* ---------------- 标签页 ---------------- */
.tabs {
  display: flex; gap: 4px; padding: 3px;
  background: #12171f; border: 1px solid var(--line); border-radius: 10px;
}
.tab {
  padding: 6px 14px; border: none; border-radius: 8px;
  background: transparent; color: #8b98a9;
  font-size: 12.5px; font-weight: 550;
  text-decoration: none;
  display: inline-block;
  transition: all .15s;
}
.tab:hover { color: #c6d2e0; }
.tab.on {
  background: rgba(79,140,255,.16);
  color: #cfe0ff;
  box-shadow: inset 0 0 0 1px rgba(79,140,255,.3);
}

/* ---------------- 换背景 ---------------- */
.bgthumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px; padding: 12px; width: 100%;
}
.thumb { position: relative; aspect-ratio: 4/5; border-radius: 8px; overflow: hidden; background: #0b0f14; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm { top: 3px; right: 3px; width: 20px; height: 20px; font-size: 14px; }

.drop.small { min-height: 120px; }

.bgtabs { display: flex; gap: 6px; margin-bottom: 14px; }
.bgtab {
  flex: 1; padding: 8px 10px;
  background: #12171f; border: 1px solid var(--line); border-radius: 9px;
  color: #8b98a9; font-size: 12.5px;
  transition: all .15s;
}
.bgtab:hover { border-color: #3c4a60; color: #c6d2e0; }
.bgtab.on {
  border-color: var(--accent); color: #dbe8ff;
  background: rgba(79,140,255,.12);
}

.scenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.scene {
  padding: 0; border: 1px solid var(--line); border-radius: 9px;
  background: #12171f; overflow: hidden; text-align: left;
  transition: border-color .15s, transform .1s;
}
.scene:hover { border-color: #3c4a60; }
.scene.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,140,255,.18); }
.scene i { display: block; height: 62px; }
.scene span {
  display: block; padding: 6px 8px; font-size: 11.5px;
  color: #aab7c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scene.on span { color: #dbe8ff; }

.bgprev { margin: 10px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.bgprev img { width: 100%; display: block; }

.checkline { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkline input { width: 15px; height: 15px; accent-color: var(--accent); }
.checkline span { font-size: 12.5px; color: #aab7c8; }
.checkline em { font-style: normal; color: #5f6d80; font-size: 11.5px; margin-left: 4px; }

input[type=range] {
  width: 100%; height: 26px; padding: 0;
  background: transparent; accent-color: var(--accent); cursor: pointer;
}

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }

.shot { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0b0f14; }
.shot img { width: 100%; display: block; }
.shot figcaption {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  font-size: 11.5px; border-top: 1px solid var(--line);
}
.shot figcaption .dimtext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 框选：canvas 打底，上面盖一层可拖拽的遮罩 */
.cropwrap {
  position: relative; width: 100%; aspect-ratio: 4/5;
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #0b0f14;
  user-select: none; touch-action: none; cursor: crosshair;
}
.cropwrap canvas { width: 100%; height: 100%; display: block; }
.cropmask {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  cursor: crosshair;
}
.cropbox {
  position: absolute; display: none;
  border: 2px solid var(--accent);
  background: rgba(79,140,255,.12);
  box-shadow: 0 0 0 9999px rgba(6,9,13,.55);
  pointer-events: none;
}
.crophint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font-size: 11px; color: #7c8a9e; background: rgba(6,9,13,.72);
  padding: 3px 10px; border-radius: 999px; pointer-events: none;
  white-space: nowrap;
}
.crophint:empty { display: none; }
#cropClear { margin-top: 8px; }


