* { box-sizing: border-box; }

/* ---- 顶部滚动公告 ---- */
.marquee-bar {
  background: linear-gradient(90deg, #b8860b, #d4a017 50%, #b8860b);
  color: #fff8e1;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  border-bottom: 1px solid rgba(255,235,160,0.45);
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  will-change: transform;
  animation: marquee-scroll 24s linear infinite;
}
.marquee-bar:hover .marquee-track { animation-play-state: paused; }
.marquee-item { padding: 0 48px; }
.marquee-item b { color: #fff; text-decoration: underline; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-33.333%); }
}

.update-banner {
  background: linear-gradient(90deg, rgba(74,126,255,0.18), rgba(122,74,255,0.18));
  border-bottom: 1px solid rgba(122,74,255,0.4);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.update-banner.hidden { display: none; }
.update-text strong { color: #b4cbff; font-size: 14px; }
.update-current { margin-left: 8px; color: #9aa0b4; font-size: 12px; }
.update-changelog {
  color: #b0b4c8;
  font-size: 12px;
  margin-top: 4px;
  max-width: 60vw;
  white-space: pre-wrap;
}
.update-actions { display: flex; gap: 8px; flex-shrink: 0; }
.upd-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  text-decoration: none;
  display: inline-block;
}
.upd-btn.primary { background: #4a7eff; color: #fff; border-color: #4a7eff; }
.upd-btn.primary:hover { background: #5a8aff; }
.upd-btn.ghost {
  background: transparent;
  color: #b0b4c8;
  border-color: rgba(255,255,255,0.15);
}
.upd-btn.ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #1a1d29 0%, #2d3142 100%);
  color: #e8eaed;
  min-height: 100vh;
}
header { text-align: center; padding: 48px 16px 24px; position: relative; }
.header-actions {
  position: absolute;
  top: 24px;
  right: 24px;
}
.header-btn {
  background: rgba(120,160,255,0.12);
  color: #9ec1ff;
  border: 1px solid rgba(120,160,255,0.3);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.header-btn:hover {
  background: rgba(120,160,255,0.2);
  border-color: rgba(120,160,255,0.6);
  color: #fff;
}

.skillshub-panel {
  max-width: 920px;
  margin: 0 auto 24px;
  padding: 0 16px;
}
.skillshub-panel.hidden { display: none; }
.sh-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sh-head h3 { margin: 0; font-size: 16px; }
.sh-count { color: #9aa0b4; font-size: 13px; font-weight: 400; margin-left: 6px; }

.sh-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 460px;
  overflow-y: auto;
}
.sh-row {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 12px 14px;
}
.sh-row-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.sh-name { font-weight: 600; font-size: 14px; color: #e8eaed; }
.sh-ver  { font-size: 12px; color: #6ee0a0; font-family: ui-monospace, monospace; }
.sh-desc { color: #9aa0b4; font-size: 12.5px; line-height: 1.55; }
header h1 { margin: 0; font-size: 32px; letter-spacing: 1px; }
header .sub { margin: 8px 0 0; color: #9aa0b4; font-size: 14px; }

.cards {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  max-width: 920px;
  margin: 24px auto;
  padding: 0 16px;
}
.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: #9aa0b4;
  padding: 40px;
}

.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px;
  transition: border-color .2s;
}
.card:hover { border-color: rgba(120, 160, 255, 0.4); }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card h2 { margin: 0; font-size: 22px; }
.tag {
  font-size: 12px;
  background: rgba(120,160,255,0.15);
  color: #9ec1ff;
  padding: 4px 10px;
  border-radius: 12px;
}
.desc { color: #b0b4c8; font-size: 14px; line-height: 1.6; margin: 12px 0 16px; }

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.status-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.status-badge.installed {
  background: rgba(56, 178, 110, 0.18);
  color: #6ee0a0;
}
.status-badge.not-installed {
  background: rgba(176, 180, 200, 0.12);
  color: #b0b4c8;
}
.version-text { color: #9aa0b4; font-size: 13px; font-family: ui-monospace, monospace; }

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.actions-row {
  display: flex;
  gap: 8px;
}
.actions-row.primary-row {
  flex-wrap: wrap;
}
.actions-row.primary-row .action-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
}
.action-btn {
  flex: 1;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s, border-color .15s;
  white-space: nowrap;
}
.action-btn.full { flex: 1 1 100%; }
.action-btn.btn-hero {
  background: linear-gradient(135deg, #38b26e 0%, #4a7eff 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(74,126,255,0.3);
  position: relative;
}
.action-btn.btn-hero:hover:not(:disabled) {
  background: linear-gradient(135deg, #44c97c 0%, #5a8aff 100%);
  box-shadow: 0 6px 20px rgba(74,126,255,0.45);
  transform: translateY(-1px);
}
.action-btn.btn-hero::after {
  content: '已就绪 →';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
}
.actions-row.hero-row { margin-bottom: 4px; }

.action-btn.btn-primary { background: #4a7eff; color: #fff; }
.action-btn.btn-primary:hover:not(:disabled) { background: #5a8aff; }
.action-btn.btn-secondary {
  background: rgba(120,160,255,0.12);
  color: #9ec1ff;
  border: 1px solid rgba(120,160,255,0.25);
}
.action-btn.btn-secondary:hover:not(:disabled) {
  background: rgba(120,160,255,0.2);
  border-color: rgba(120,160,255,0.5);
}
.action-btn.btn-ghost {
  background: transparent;
  color: #b0b4c8;
  border: 1px solid rgba(255,255,255,0.12);
}
.action-btn.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.04);
  color: #fff;
}
.action-btn.btn-danger { background: #443; color: #ffb09a; border: 1px solid #6a4040; }
.action-btn.btn-danger:hover:not(:disabled) { background: #5a3838; color: #ffd0c0; }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Pay modal ---------- */
.pay-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.pay-modal.hidden { display: none; }
.pay-card {
  background: #1f2230;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px 28px;
  width: 440px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.pay-head { display: flex; justify-content: space-between; align-items: center; }
.pay-head h3 { margin: 0; font-size: 18px; }
.link-btn {
  background: transparent; border: 0; color: #9aa0b4;
  cursor: pointer; font-size: 13px; padding: 4px 8px;
}
.link-btn:hover { color: #fff; }

.pay-body { display: flex; gap: 20px; margin-top: 16px; align-items: center; }
#pay-qr-box {
  width: 200px; height: 200px;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
#pay-qr-box img, #pay-qr-box canvas { width: 100%; height: 100%; }
.pay-loading { color: #444; font-size: 12px; }

.pay-info { flex: 1; }
.pay-amount {
  font-size: 32px; font-weight: 700;
  color: #6ee0a0; font-family: ui-monospace, monospace;
}
.pay-sub { color: #b0b4c8; font-size: 13px; margin-top: 6px; }
.pay-status {
  margin-top: 14px; padding: 8px 12px;
  background: rgba(120,160,255,0.1);
  border: 1px solid rgba(120,160,255,0.3);
  border-radius: 6px;
  font-size: 12.5px; color: #9ec1ff;
}
.pay-status.paid {
  background: rgba(80,200,120,0.15);
  border-color: rgba(80,200,120,0.5);
  color: #6ee0a0;
}
.pay-status.failed {
  background: rgba(255,90,90,0.15);
  border-color: rgba(255,90,90,0.5);
  color: #ff9090;
}
.pay-actions {
  margin-top: 14px; display: flex; gap: 8px;
}
.pay-actions button {
  padding: 6px 12px; font-size: 12.5px;
  background: rgba(120,160,255,0.15);
  border: 1px solid rgba(120,160,255,0.4);
  color: #b0caff;
  border-radius: 6px; cursor: pointer;
}
.pay-actions button:hover {
  background: rgba(120,160,255,0.25);
}
.pay-actions button:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.pay-actions .pay-report {
  background: rgba(180,180,180,0.10);
  border-color: rgba(180,180,180,0.3);
  color: #c0c4d0;
}
.pay-status.failed {
  background: rgba(255,110,110,0.12);
  border-color: rgba(255,110,110,0.4);
  color: #ff9c9c;
}
.pay-order { margin-top: 8px; color: #6a6e80; font-size: 11px; font-family: ui-monospace, monospace; }

.quick-config {
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
}
.quick-config.hidden { display: none; }
.quick-config summary {
  cursor: pointer;
  color: #9ec1ff;
  font-size: 13px;
  user-select: none;
}
.qc-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qc-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #9aa0b4;
}
.qc-provider, .qc-apikey {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #e8eaed;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}
.qc-provider:focus, .qc-apikey:focus {
  outline: none;
  border-color: rgba(120,160,255,0.6);
}
.qc-submit { margin-top: 4px; }

/* ---- Next Steps checklist (v0.6.x, R3) ---- */
.next-steps {
  margin-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
}
.next-steps.hidden { display: none; }
.next-steps summary {
  cursor: pointer;
  color: #6ee0a0;
  font-size: 13px;
  user-select: none;
  font-weight: 600;
}
.next-steps summary:hover { color: #8aedb5; }
.ns-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  background: rgba(110, 224, 160, 0.04);
  border: 1px solid rgba(110, 224, 160, 0.15);
  border-radius: 10px;
}
.ns-item { display: flex; flex-direction: column; gap: 4px; }
.ns-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #e8eaed;
}
.ns-text {
  font-size: 12.5px;
  color: #b5bccf;
  line-height: 1.7;
}
.ns-text code {
  background: rgba(120,160,255,0.12);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  color: #9ec1ff;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.ns-text b { color: #ffd470; font-weight: 600; }
.ns-code {
  display: block;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 6px 0;
  font-size: 11.5px;
  color: #c0caea;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}
.ns-copy-btn {
  background: rgba(120,160,255,0.15);
  border: 1px solid rgba(120,160,255,0.4);
  color: #9ec1ff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.ns-copy-btn:hover {
  background: rgba(120,160,255,0.25);
}
.ns-copy-btn.copied {
  background: rgba(110,224,160,0.25);
  border-color: rgba(110,224,160,0.5);
  color: #6ee0a0;
}
.qc-hint {
  color: #7a7e90;
  font-size: 12px;
  margin: 4px 0 0;
  line-height: 1.5;
}

.progress-wrap { margin-top: 16px; }
.progress-wrap.hidden { display: none; }
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a7eff, #7a4aff);
  transition: width .4s ease;
}
.progress-text { margin-top: 8px; font-size: 13px; color: #b0b4c8; }

.log-wrap { margin-top: 16px; }
.log-wrap summary { cursor: pointer; color: #9aa0b4; font-size: 13px; }
.log {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}
.log .warn { color: #ffb454; }
.log .err  { color: #ff6b6b; }

footer {
  text-align: center;
  padding: 24px;
  color: #6a6e80;
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.link-btn {
  background: none;
  border: 0;
  color: #9ec1ff;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}
.link-btn:hover { color: #fff; }

/* ---- Platform-aware downloads ---- */
.downloads-panel {
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 16px 18px;
  background: rgba(30,41,59,0.85);
  border: 1px solid rgba(120,160,255,0.25);
  border-radius: 14px;
}
.dl-head { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:baseline; margin-bottom:12px; }
.dl-head h2 { margin:0; font-size:16px; color:#e8eaed; }
.dl-detected, .upd-detected { font-size:12px; color:#94a3b8; }
.dl-primary, .upd-btn.primary {
  display:inline-flex; align-items:center; justify-content:center;
  text-decoration:none;
}
.dl-primary {
  display:inline-block;
  background:#4a7eff; color:#fff; font-weight:700;
  padding:10px 16px; border-radius:10px; margin-bottom:12px;
}
.dl-primary:hover { background:#5a8aff; }
.dl-primary.recommended-mac { background:#16a34a; }
.dl-list, .upd-packages { display:flex; flex-direction:column; gap:8px; }
.dl-item, .upd-pkg {
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between;
  padding:10px 12px; border-radius:10px;
  background:rgba(15,23,42,0.55); border:1px solid #334155;
}
.dl-item.is-recommended, .upd-pkg.is-recommended {
  border-color: rgba(74,126,255,0.7);
  box-shadow: 0 0 0 1px rgba(74,126,255,0.25);
}
.dl-item-meta { display:flex; flex-direction:column; gap:2px; min-width:0; }
.dl-item-title { font-weight:600; color:#e8eaed; font-size:14px; }
.dl-item-sub { font-size:12px; color:#94a3b8; }
.dl-item a, .upd-pkg a {
  color:#93c5fd; text-decoration:none; font-weight:600; font-size:13px; white-space:nowrap;
}
.dl-item a:hover, .upd-pkg a:hover { text-decoration:underline; }
.upd-packages { margin-top:10px; }
