:root {
  --bg: #0f1115;
  --bg-soft: #161a21;
  --card: #1b2029;
  --card-2: #212734;
  --line: #2b3240;
  --text: #e7ecf3;
  --dim: #9aa5b4;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px 60px; }

header.top {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #151a22, #10131a);
  position: sticky; top: 0; z-index: 20;
}
header.top .inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.logo { font-size: 19px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
header.top .spacer { flex: 1; }
header.top .link { color: var(--dim); font-size: 14px; }
header.top .link:hover { color: var(--text); }

h1 { font-size: 22px; margin: 26px 0 6px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.sub { color: var(--dim); font-size: 14px; margin: 0 0 18px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text);
  padding: 9px 15px; border-radius: 10px; transition: .15s;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
button:hover, .btn:hover { background: #2a3140; text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); }
button.danger { color: #ffd9d9; border-color: #5a2b2b; background: #33201f; }
button.danger:hover { background: #452625; }
button.ghost { background: transparent; }
button.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }

input[type=text], input[type=password], input[type=number], input[type=search], select {
  font: inherit; background: #12161d; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; color: var(--dim); font-size: 13px; margin-bottom: 5px; }

.muted { color: var(--dim); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace; }
.center { text-align: center; }
.hidden { display: none !important; }

/* 文件列表 */
.filelist { display: flex; flex-direction: column; gap: 10px; }
.fileitem {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px; transition: .15s;
}
.fileitem:hover { border-color: #38425a; background: #1e2431; }
.fileitem .ico {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px;
  background: #0d1117; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fileitem .ico img { width: 100%; height: 100%; object-fit: cover; }
.fileitem .ico .ph { font-size: 13px; font-weight: 700; color: var(--accent); }
.fileitem .mid { flex: 1; min-width: 0; }
.fileitem .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileitem .meta { color: var(--dim); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; }
.fileitem .acts { display: flex; gap: 8px; }

.badge {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 20px;
  background: #22304a; color: #9dc0ff; border: 1px solid #2f4265;
}
.badge.gray { background: #23272e; color: var(--dim); border-color: var(--line); }
.badge.ok { background: #17301f; color: #86efac; border-color: #2b5138; }
.badge.warn { background: #35290f; color: #fcd34d; border-color: #54401a; }

/* 下载页 */
.dl-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.dl-icon {
  width: 108px; height: 108px; border-radius: 22px; overflow: hidden; flex: 0 0 108px;
  background: #0d1117; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: var(--accent);
}
.dl-icon img { width: 100%; height: 100%; object-fit: cover; }
.dl-hero .info { flex: 1; min-width: 240px; }
.dl-hero .info h1 { margin: 0 0 6px; font-size: 24px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; font-size: 14px; margin-top: 14px; }
.kv .k { color: var(--dim); }
.kv .v { word-break: break-all; }
.bigbtn { font-size: 17px; padding: 13px 30px; border-radius: 12px; }

.copybar { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copybar input { font-size: 13px; }

table.files { width: 100%; border-collapse: collapse; font-size: 14px; }
table.files th, table.files td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.files th { color: var(--dim); font-weight: 500; font-size: 13px; }
table.files tr:hover td { background: #1a1f29; }
table.files .name { font-weight: 600; }

/* 上传队列 */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 28px 18px; text-align: center; color: var(--dim); transition: .15s; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); color: var(--text); background: #141a24; }
.qitem { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-top: 10px; background: var(--bg-soft); }
.qitem .qname { font-size: 14px; margin-bottom: 7px; display: flex; gap: 8px; align-items: center; }
.qitem .qname .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 7px; background: #0e1219; border-radius: 20px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #60a5fa); transition: width .2s; }
.bar.ok > i { background: var(--ok); }
.bar.err > i { background: var(--danger); }

/* 提示 */
#toast { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 99; }
#toast div {
  background: #212734; border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  animation: pop .2s ease;
}
#toast div.ok { border-color: #2b5138; }
#toast div.err { border-color: #5a2b2b; color: #ffd9d9; }
@keyframes pop { from { transform: translateY(6px); opacity: 0 } to { transform: none; opacity: 1 } }

.empty { text-align: center; color: var(--dim); padding: 34px 12px; }
footer.foot { text-align: center; color: #5d687a; font-size: 13px; padding: 26px 0 10px; }

@media (max-width: 640px) {
  .fileitem { flex-wrap: wrap; }
  .fileitem .acts { width: 100%; }
  .dl-icon { width: 78px; height: 78px; flex-basis: 78px; }
  table.files .hide-sm { display: none; }
}
