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

:root {
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e7e9f0;
  --brand: #4f46e5;
  --brand-soft: #eef2ff;
  --green: #0f9d6e;
  --red: #d92d20;
  --card: rgba(255, 255, 255, 0.92);
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #f7f8ff 0%, #fdf7fb 55%, #f4fbf8 100%);
  padding: 48px 20px 60px;
  position: relative;
  overflow-x: hidden;
}

.bg-shape { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .45; z-index: -1; }
.shape-one { width: 360px; height: 360px; background: #dfe4ff; top: -120px; right: -80px; }
.shape-two { width: 320px; height: 320px; background: #d9f5e8; bottom: -120px; left: -60px; }

.wrap { max-width: 760px; margin: 0 auto; }

.hero { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.logo {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(99, 102, 241, .28);
}
h1 { font-size: 25px; letter-spacing: -.4px; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }

.card {
  background: var(--card); border: 1px solid rgba(255,255,255,.9);
  border-radius: 20px; padding: 26px;
  box-shadow: 0 14px 40px rgba(35, 40, 80, .07);
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
}

.label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 10px; }
.input-row { display: flex; gap: 10px; }
input[type=text], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none; transition: border-color .2s, box-shadow .2s;
}
input[type=text]:focus, textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
textarea { resize: vertical; margin-top: 10px; line-height: 1.5; }

.btn {
  border: none; border-radius: 12px; padding: 12px 22px; font-size: 14px; font-weight: 650;
  font-family: inherit; cursor: pointer; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.22); }
.btn.success { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(15,157,110,.22); }
.link-btn { display: none; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }

.advanced { margin-top: 18px; font-size: 13px; color: var(--muted); }
.advanced summary { cursor: pointer; list-style: none; user-select: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "▸ "; color: var(--brand); }
.advanced[open] summary::before { content: "▾ "; }
.advanced-body { margin-top: 12px; padding: 14px; background: #f8f9fe; border-radius: 12px; line-height: 1.6; }
.advanced-body .guide-title { font-weight: 650; color: var(--ink); margin-top: 12px; }
.advanced-body .guide-title:first-child { margin-top: 0; }
.advanced-body .micro { font-size: 12px; color: #98a0ae; margin-top: 6px; }
.advanced-body select {
  width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; font-family: inherit; font-size: 13.5px; color: var(--ink); outline: none;
}
.remember { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; cursor: pointer; }
.remember input { accent-color: var(--brand); }
.steps { margin: 8px 0 0 20px; }
.steps li { margin-bottom: 4px; }
.advanced-body a { color: var(--brand); }
kbd { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 11.5px; font-family: inherit; }
.advanced-body code { background: #fff; padding: 1px 5px; border-radius: 5px; font-size: 12px; }

.error-box {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: #fef3f2; border: 1px solid #fecdca; color: var(--red); font-size: 13.5px; line-height: 1.6;
}

.info-card {
  display: flex; gap: 16px; align-items: center; margin-top: 20px;
  padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.info-card img { width: 96px; height: 128px; object-fit: cover; border-radius: 10px; background: #eef0f6; flex: none; }
.info-text { min-width: 0; }
.info-text h2 { font-size: 15px; line-height: 1.45; margin-bottom: 8px; }
.info-text p { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.info-text .desc { margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.progress-box { margin-top: 20px; }
.progress-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
#percentText { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--brand); }
.progress-track { height: 8px; background: #eef0f6; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #22c55e); transition: width .3s; }
.speed { font-size: 12px; color: var(--muted); margin-top: 7px; min-height: 17px; }

.action-row { margin-top: 18px; }

.history-card { padding: 22px 26px; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.history-head h3 { font-size: 15px; }
.text-btn { border: none; background: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.text-btn:hover { color: var(--red); }
.history-list { list-style: none; }
.history-list li {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--line); font-size: 13px;
}
.history-list li:first-child { border-top: none; }
.history-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list a { color: var(--brand); text-decoration: none; font-size: 12.5px; flex: none; }
.history-list a:hover { text-decoration: underline; }
.history-list .empty { color: var(--muted); border: none; }

footer { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.9; margin-top: 26px; }
footer code { background: rgba(0,0,0,.05); padding: 1px 6px; border-radius: 5px; }
footer .tip { color: #98a0ae; }

@media (max-width: 560px) {
  body { padding: 28px 14px 40px; }
  .card { padding: 20px; }
  .input-row { flex-direction: column; }
  .info-card img { width: 72px; height: 96px; }
}

/* 访问码登录遮罩 */
.gate { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(18,22,30,.55); backdrop-filter: blur(3px); padding: 20px; }
.gate[hidden] { display: none; }
.gate-card { width: 100%; max-width: 340px; background: #fff; border-radius: 16px; padding: 30px 26px; box-shadow: 0 12px 40px rgba(0,0,0,.18); text-align: center; }
.gate-icon { font-size: 28px; margin-bottom: 8px; }
.gate-card h2 { font-size: 18px; margin: 0 0 8px; }
.gate-card p { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
.gate-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-family: var(--mono, monospace); letter-spacing: 2px; text-align: center; text-transform: uppercase; outline: none; box-sizing: border-box; }
.gate-card input:focus { border-color: var(--brand); }
.gate-card .btn { width: 100%; margin-top: 14px; }
.gate-error { color: var(--red) !important; min-height: 16px; margin: 8px 0 0 !important; font-size: 12px !important; }
