:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --border: #e5e7f0;
  --text: #1a1d29;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --danger: #dc2626;
  --ios: #007aff;
  --android: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 980px; margin: 0 auto; padding: 0 20px; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.brand-sub { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.topnav { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-link:hover { color: var(--primary); }
.nav-btn {
  background: none; border: none; cursor: pointer; font: inherit; padding: 0;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.nav-btn:hover { color: var(--primary); }

main { padding: 28px 20px 60px; }

.hero { text-align: center; padding: 30px 0 34px; }
.hero h1 { font-size: 32px; letter-spacing: -.5px; }
.hero p { color: var(--muted); margin-top: 8px; font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.upload-card h2, .install-card h2, .list-head h2 { font-size: 18px; margin-bottom: 16px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 40px 20px; border: 2px dashed #c7cbe0; border-radius: var(--radius);
  background: #fafbff; cursor: pointer; text-align: center; transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #eef0ff; }
.dropzone-icon { font-size: 30px; color: var(--primary); line-height: 1; }
.dropzone-title { font-weight: 600; font-size: 15px; }
.dropzone-hint { font-size: 13px; color: var(--muted); }
.dropzone input[type=file] { display: none; }
.dropzone.has-file { border-style: solid; border-color: var(--android); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.field input {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; outline: none; background: #fff;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }

.file-preview { margin-top: 14px; padding: 10px 14px; background: #f6f8ff; border-radius: 10px; font-size: 13px; color: var(--text); }
.file-preview b { color: var(--primary); }
.hidden { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f3c4c4; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }

.upload-status { margin-top: 12px; font-size: 14px; min-height: 20px; }
.upload-status.error { color: var(--danger); }
.upload-status.ok { color: var(--android); }

.upload-locked { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-locked h2 { margin: 0; }
.lock-icon {
  width: 46px; height: 40px; position: relative; margin-bottom: 4px;
}
.lock-icon::before {
  content: ""; position: absolute; left: 7px; top: 0; width: 32px; height: 26px;
  border: 3px solid var(--primary); border-bottom: none; border-radius: 8px 8px 0 0;
}
.lock-icon::after {
  content: ""; position: absolute; left: 4px; top: 15px; width: 38px; height: 25px;
  background: var(--primary); border-radius: 6px;
}

.login-wrap { display: flex; justify-content: center; padding-top: 30px; }
.login-card { width: 100%; max-width: 380px; padding: 30px; }
.login-head { text-align: center; margin-bottom: 20px; }
.login-head h1 { font-size: 20px; margin-top: 10px; }
.brand-mark-lg { width: 44px; height: 44px; font-size: 22px; margin: 0 auto; border-radius: 10px; }
.login-card .field + .field { margin-top: 14px; }
.login-card .field input { width: 100%; padding: 11px 12px; }
.btn-block { width: 100%; margin-top: 20px; padding: 12px; }
.login-error {
  background: #fef2f2; border: 1px solid #f3c4c4; color: var(--danger);
  padding: 9px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; text-align: center;
}
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }

.list-section { margin-top: 34px; }
.list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.list-head h2 { margin: 0; }
.count-badge {
  background: #eef0ff; color: var(--primary); font-size: 13px; font-weight: 700;
  padding: 1px 10px; border-radius: 999px;
}

.empty { text-align: center; padding: 50px 0; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 8px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.app-card {
  display: flex; gap: 14px; align-items: center; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.app-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16, 24, 40, .1); }

.app-icon {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  object-fit: cover; background: #eef0ff;
}
.app-icon-lg { width: 76px; height: 76px; border-radius: 16px; }
.app-icon-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: var(--primary); background: linear-gradient(135deg, #eef0ff, #e0e4ff);
}
.app-card-body { min-width: 0; flex: 1; }
.app-card-top { display: flex; align-items: center; gap: 8px; }
.app-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-meta { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }

.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: #fff; flex-shrink: 0; }
.badge-ios { background: var(--ios); }
.badge-android { background: var(--android); }

.detail-card { padding: 28px; }
.detail-head { display: flex; gap: 20px; align-items: flex-start; }
.detail-title { flex: 1; min-width: 0; }
.detail-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-top h1 { font-size: 24px; letter-spacing: -.3px; }
.detail-sub { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }

.kv { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 4px; }
.kv dt { float: left; clear: left; width: 110px; color: var(--muted); font-size: 13px; padding: 8px 0; }
.kv dd { margin-left: 110px; font-size: 13px; padding: 8px 0; word-break: break-all; }

.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.inline-form { display: inline; margin: 0; }

.qr-row { display: grid; grid-template-columns: 260px 1fr; gap: 16px; margin-top: 16px; }
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; }
.qr-img { width: 180px; height: 180px; border-radius: 10px; }
.qr-placeholder { width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: #f6f7fb; border-radius: 10px; }
.qr-caption { font-size: 13px; color: var(--muted); }

.steps { margin: 6px 0 0 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.note { margin-top: 14px; padding: 10px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; font-size: 13px; color: #9a3412; }

.result-icon { font-size: 40px; text-align: center; margin-bottom: 10px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.center + .center { margin-top: 14px; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding-bottom: 40px; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .qr-row { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; }
  .hero h1 { font-size: 26px; }
}

/* ===== App Store 风格落地页 ===== */
.store { max-width: 720px; margin: 0 auto; padding: 8px 0 32px; }

.st-head { display: flex; gap: 18px; align-items: flex-start; padding: 20px 0 22px; }
.st-icon {
  width: 104px; height: 104px; border-radius: 23px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .05);
  background: linear-gradient(160deg, #eef0ff, #e0e4ff);
}
.st-icon-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 700; color: var(--primary);
}
.st-head-body { padding-top: 2px; min-width: 0; }
.st-name { font-size: 26px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 4px; }
.st-auth { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.st-rate { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.st-stars { color: #c7c7cc; font-size: 14px; letter-spacing: 1px; }
.st-stars .on { color: #ff9500; }
.st-stars.sm { font-size: 11px; }
.st-rate-num { font-weight: 700; }
.st-rate-count { color: var(--muted); }

.st-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 0 18px; }
.st-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 34px; border-radius: 980px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none;
  transition: filter .15s, background .15s, border-color .15s, color .15s;
}
.st-btn-primary { background: #0071e3; color: #fff; flex: 1 1 auto; }
.st-btn-primary:hover { filter: brightness(1.08); }
.st-btn-ghost { background: #fff; color: #0071e3; border-color: #8cc4f3; }
.st-btn-ghost:hover { background: #eaf4fe; }

.st-summary {
  display: flex; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 18px 0; margin-bottom: 24px;
}
.st-sum-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.st-sum-item + .st-sum-item { border-left: 1px solid var(--border); }
.st-sum-top { font-size: 12px; color: var(--muted); }
.st-sum-main { font-size: 20px; font-weight: 700; }
.st-sum-sub { font-size: 11px; color: var(--muted); }

.st-h2 { font-size: 22px; font-weight: 700; letter-spacing: -.2px; margin: 0 0 16px; }

.st-rev-body { display: flex; gap: 32px; align-items: center; }
.st-rev-score { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.st-rev-num { font-size: 56px; font-weight: 700; line-height: 1; }
.st-rev-full { font-size: 12px; color: var(--muted); }
.st-rev-bars { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.st-bar { display: flex; align-items: center; gap: 10px; }
.st-bar-stars {
  color: #1d1d1f; font-size: 12px; letter-spacing: 1px; line-height: 1;
  flex-shrink: 0; width: 74px; display: flex;
}
.st-bar-track { flex: 1; height: 8px; border-radius: 4px; background: #f0f0f2; overflow: hidden; }
.st-bar-fill { height: 100%; border-radius: 4px; background: #1d1d1f; }
.st-rev-count { color: var(--muted); font-size: 13px; margin: 14px 0 0; text-align: right; }

.st-info { padding: 24px 0 8px; }
.st-list { margin: 0; }
.st-row {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 13px 0; border-bottom: 1px solid #ececee; font-size: 15px;
}
.st-row:last-child { border-bottom: none; }
.st-row dt { color: var(--muted); flex-shrink: 0; }
.st-row dd { margin: 0; text-align: right; word-break: break-all; font-weight: 500; }

.st-help { padding: 24px 0 8px; }
.st-steps { margin: 0 0 0 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; color: #333; }
.st-note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.st-note a { color: #0071e3; }

.st-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.st-modal[hidden] { display: none; }
.st-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.st-modal-box {
  position: relative; background: #fff; border-radius: 18px; padding: 26px 24px 22px;
  max-width: 400px; width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .08);
}
.st-modal-box .st-steps { margin-bottom: 20px; }
.st-modal-close { padding: 10px 24px; font-size: 15px; width: 100%; }

.st-admin { display: flex; justify-content: center; gap: 20px; padding: 18px 0 4px; }
.st-link {
  background: none; border: none; padding: 6px 10px; cursor: pointer;
  color: #0071e3; font-size: 14px; font-weight: 500; font-family: inherit;
}
.st-link:hover { text-decoration: underline; }
.st-link-danger { color: #d70015; }

@media (max-width: 560px) {
  .st-head { gap: 14px; }
  .st-icon { width: 84px; height: 84px; border-radius: 19px; }
  .st-name { font-size: 22px; }
  .st-rev-body { gap: 20px; }
  .st-btn { padding: 12px 22px; }
}
