/* WaveStore开放平台 · 控制台样式
   与官网共用同一套色彩与圆角，但布局是「侧栏 + 工作区」。 */

:root {
  --bg: #f6f9fa;
  --surface: #ffffff;
  --surface-2: #f2f7f7;
  --ink: #0d1a1d;
  --muted: #5a6c72;
  --line: #e1eaec;
  --line-strong: #cfdde0;
  --accent: #0c655a;
  --accent-deep: #084a42;
  --accent-soft: #e4f1ee;
  --danger: #a4292f;
  --danger-soft: #fbeaeb;
  --warn: #8a5a12;
  --warn-soft: #fdf2df;
  --ok: #1d6b4f;
  --ok-soft: #e3f2ea;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(13, 26, 29, .04), 0 14px 34px -22px rgba(13, 26, 29, .3);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1316;
    --surface: #141d21;
    --surface-2: #101a1e;
    --ink: #e9f1f2;
    --muted: #94a7ac;
    --line: #223036;
    --line-strong: #2e4048;
    --accent: #5fc9b7;
    --accent-deep: #8adccd;
    --accent-soft: #14302c;
    --danger: #f08c90;
    --danger-soft: #34191b;
    --warn: #e0b070;
    --warn-soft: #2e2416;
    --ok: #7fd0ac;
    --ok-soft: #122b22;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 18px 40px -26px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.62 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

/* ---------- 侧栏 ---------- */

.side {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 26px;
  padding: 26px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 750; letter-spacing: -.02em; }
.side-brand svg { width: 24px; height: 24px; color: var(--accent); flex: none; }
.side-brand img, .auth-brand img {
  width: 28px; height: 28px; border-radius: 8px;
  object-fit: cover; flex: none; background: var(--accent-soft);
}
.side-brand small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  font-size: 14.5px; color: var(--muted); font-weight: 550;
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side-nav svg { width: 17px; height: 17px; flex: none; }

.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.side-user { padding: 0 6px; }
.side-user strong { display: block; font-size: 14px; font-weight: 650; }
.side-user span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .btn { justify-content: flex-start; }

/* ---------- 主区 ---------- */

.main { padding: 34px 40px 72px; }
.page { max-width: 940px; margin: 0 auto; display: grid; gap: 20px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-title { font-size: 25px; letter-spacing: -.03em; font-weight: 780; line-height: 1.25; }
.page-sub { margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 58ch; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}
.card > h2 { font-size: 16px; font-weight: 720; letter-spacing: -.015em; margin-bottom: 4px; }
.card > h2 + .hint { margin-top: 0; }

.stack { display: grid; gap: 14px; }
.cluster { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.meta { font-size: 12.8px; color: var(--muted); }
.description { font-size: 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.hint { font-size: 12.8px; color: var(--muted); }
.notice {
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px;
}
.notice.bad { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px;
  border: 1px solid transparent; background: var(--surface-2); color: var(--ink);
  font-size: 14px; font-weight: 620; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #06211d; } }

.btn.ghost { background: var(--surface); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--line-strong); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- 表单 ---------- */

.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; }
.field > span { color: var(--ink); }
.field .hint { font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14.5px; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 128px; resize: vertical; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field input[type="file"] { padding: 8px 10px; font-size: 13.5px; background: var(--surface-2); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.check input { width: auto; }

/* ---------- 列表 ---------- */

.list { display: grid; gap: 0; }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 2px; border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.item:last-child { border-bottom: 0; }
.item:hover { text-decoration: none; }
.item:hover .item-name { color: var(--accent); }
.item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item-name { display: block; font-weight: 620; font-size: 15px; transition: color .15s; }
.item-meta { display: block; font-size: 12.8px; color: var(--muted); margin-top: 2px; }

.icon, .icon-fallback {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--line);
}
.icon-fallback {
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: var(--accent);
  background: var(--accent-soft); border-color: transparent;
}
.icon.lg, .icon-fallback.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 24px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 100px;
  font-size: 12px; font-weight: 620; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.wait { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.empty {
  padding: 34px 20px; text-align: center;
  color: var(--muted); font-size: 13.8px;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px;
}

/* ---------- 上传 ---------- */

.shots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.shots img {
  height: 132px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); object-fit: cover;
}
.shots:empty { display: none; }

progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 100px; overflow: hidden; background: var(--surface-2); }
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

/* ---------- 登录页 ---------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth-card {
  width: min(420px, 100%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 30px; box-shadow: var(--shadow);
  display: grid; gap: 18px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.auth-brand svg { width: 26px; height: 26px; color: var(--accent); }
.auth-brand img { width: 28px; height: 28px; }
.auth-card h1 { font-size: 21px; letter-spacing: -.025em; font-weight: 760; }
.auth-card .hint { margin-top: -8px; }
.auth-links { display: flex; gap: 16px; font-size: 13px; }

/* ---------- 提示条 ---------- */

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  max-width: min(560px, calc(100% - 32px));
  background: #12211f; color: #eaf5f3;
  padding: 11px 18px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.5;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 90;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #4a1518; color: #ffe6e7; }

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky; height: auto; z-index: 30;
    flex-direction: row; align-items: center; gap: 14px;
    padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .side-brand { padding: 0; }
  .side-brand small { display: none; }
  .side-nav { display: flex; gap: 4px; }
  .side-nav a { padding: 7px 10px; font-size: 13.5px; white-space: nowrap; }
  .side-nav svg { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: 8px; }
  .side-user { display: none; }
  .main { padding: 22px 16px 60px; }
  .field-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 21px; }
  .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 分步向导 ---------- */

.steps {
  list-style: none; display: flex; gap: 6px; padding: 0; margin: 0;
  overflow-x: auto; scrollbar-width: none;
}
.steps li {
  flex: 1 1 0; min-width: 118px; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 620; white-space: nowrap;
}
.steps li b {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface-2); color: var(--muted);
}
.steps li.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.steps li.active b { background: var(--accent); color: #fff; }
.steps li.done b { background: var(--ok-soft); color: var(--ok); }
@media (prefers-color-scheme: dark) { .steps li.active b { color: #06211d; } }

.step { display: none; }
.step.active { display: grid; gap: 14px; }

.dropzone {
  display: grid; place-items: center; gap: 6px; padding: 34px 18px;
  border: 1.5px dashed var(--line-strong); border-radius: 14px;
  background: var(--surface-2); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone strong { font-size: 15px; }

.apk-card {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
}

.facts { display: grid; gap: 6px; margin: 0; }
.facts > div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; font-size: 13px; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.readout { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }

.icon-row { display: flex; gap: 14px; align-items: center; }
.icon-row .btn { width: max-content; }
.field-label { font-size: 13.5px; font-weight: 600; }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; margin: 0; }
.thumb img {
  width: 96px; height: 96px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); display: block;
}
.thumb-x {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--danger);
  font-size: 14px; line-height: 1; cursor: pointer;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 11px;
  border-radius: 100px; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.chip button {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 4px; opacity: .65;
}
.chip button:hover { opacity: 1; }

#kw-input {
  width: min(320px, 100%); padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 14px;
}
#kw-input:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.members { display: grid; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.member-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.member-main strong { font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.member-role { font-size: 13px; color: var(--muted); text-align: right; max-width: 42%; }
.member-add {
  display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 12px; align-items: end;
  padding-top: 16px; border-top: 1px solid var(--line);
}

.wizard-foot {
  position: sticky; bottom: 12px; z-index: 3;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.wizard-foot #step-hint { flex: 1; text-align: center; }

@media (max-width: 720px) {
  .field-grid, .member-add { grid-template-columns: 1fr; }
  .steps { flex-wrap: wrap; }
  .steps li { flex: 1 1 30%; min-width: 0; justify-content: center; padding: 8px 6px; font-size: 12px; }
  .steps li span { display: block; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .facts dt { font-size: 12px; }
  .facts dd { font-size: 13px; }
  .member-role { text-align: left; max-width: none; }
  .member { flex-wrap: wrap; }
  .wizard-foot { position: static; padding: 10px; gap: 8px; }
  .wizard-foot #step-hint { order: -1; flex-basis: 100%; text-align: left; }
}

/* 头像 */
.avatar-row{display:flex;align-items:center;gap:18px}
.avatar{width:76px;height:76px;border-radius:50%;object-fit:cover;background:var(--surface-2);
  border:1px solid var(--line);flex:none}
.avatar-side{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.avatar-side .hint{margin:0}
.avatar-side label.btn{cursor:pointer}

/* 权利声明勾选 */
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}
.consent input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.consent label { flex: 1; cursor: pointer; }
.consent strong { color: var(--ink); font-weight: 600; }
.consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 审核后台 ---------- */

.nav-label {
  margin: 16px 11px 2px;
  font-size: 11px; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  display: grid; gap: 3px; box-shadow: var(--shadow);
}
.stat span { font-size: 12.8px; color: var(--muted); }
.stat strong { font-size: 27px; font-weight: 780; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat em { font-size: 12px; color: var(--muted); font-style: normal; }

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.seg a { padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg a:hover { color: var(--ink); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 26, 29, .08); }

.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 10px; fill: var(--muted); }
.chart line { stroke: var(--line); }

.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend i { width: 14px; height: 0; border-top: 2px solid var(--accent); display: inline-block; }
.legend i.mk-user { border-top-style: dashed; border-top-color: var(--warn); }

.table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { font-size: 12px; font-weight: 620; color: var(--muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.shots.review img { height: 210px; }
.card details summary { cursor: pointer; }
.card details[open] summary { margin-bottom: 8px; }

@media (max-width: 860px) {
  .nav-label { display: none; }
  .stat strong { font-size: 23px; }
  .seg { overflow-x: auto; }
}

/* ---------- 分类排序 / 批量上传 ---------- */

.sort-item { gap: 10px; }
.sort-item .grip { color: var(--muted); cursor: grab; user-select: none; font-size: 15px; line-height: 1; letter-spacing: -1px; }
.sort-item.dragging { opacity: .55; background: var(--surface-2); }
.sort-item .item-main { flex: 1; min-width: 0; }
.sort-item .cluster { flex: none; }

.batch-head { display: flex; align-items: center; gap: 14px; }
.batch-icon { flex: none; }
.batch-icon img, .batch-icon .icon-fallback { width: 52px; height: 52px; border-radius: 14px; font-size: 20px; }
.batch-info { flex: 1; min-width: 0; }
.batch-info strong { font-size: 15.5px; font-weight: 650; overflow-wrap: anywhere; }
.batch-info .meta { font-size: 12.6px; color: var(--muted); margin: 3px 0 0; overflow-wrap: anywhere; }
.batch-info progress { margin-top: 8px; }

@media (max-width: 640px) {
  .batch-head { align-items: flex-start; flex-wrap: wrap; }
  .batch-head .cluster { width: 100%; justify-content: flex-end; }
  .sort-item .cluster { gap: 4px; }
}

/* ---------- 账号资料编辑 ---------- */

.editor { border-top: 1px solid var(--line); padding-top: 10px; }
.editor summary { font-size: 13.5px; font-weight: 620; color: var(--accent); }
.editor form { margin-top: 12px; }
.editor .hint { font-size: 12.4px; }

/* ---------- 未验证邮箱提醒 ---------- */

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 16px;
  margin-bottom: 18px;
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  border-radius: 10px;
  font-size: 13.4px;
  line-height: 1.6;
  color: var(--warn);
}
.banner span { flex: 1 1 320px; }
.banner .btn {
  background: #fff;
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn);
}
