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

:root {
  --primary: #3b5ee1;
  --primary-dark: #2f4fd4;
  --primary-light: rgba(59, 94, 225, 0.12);
  --bg: #eef0f4;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.hero {
  text-align: center;
  padding: 8px 0 32px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  background: linear-gradient(135deg, var(--primary), #5b7cf5);
  box-shadow: 0 10px 28px rgba(59, 94, 225, 0.35);
}

.hero-logo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 {
  font-size: 26px;
  font-weight: 700;
}

.hero p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-left: 4px;
}

.section-emoji {
  font-size: 20px;
}

.section-head h2 {
  font-size: 17px;
  font-weight: 600;
}

.section-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.res-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.res-item:last-child {
  border-bottom: none;
}

.res-item:hover {
  background: #fafbfc;
}

.res-icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.res-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.res-icon-wrap .fallback {
  font-size: 22px;
  color: var(--primary);
  font-weight: 700;
}

.res-body {
  flex: 1;
  min-width: 0;
}

.res-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.res-desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

.badge-ios {
  background: #f3f4f6;
  color: #374151;
}

.badge-android {
  background: #ecfdf5;
  color: #059669;
}

.res-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: #f3f4f6;
  color: var(--text);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
}

.icon-card {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.icon-preview {
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.icon-card .res-name {
  font-size: 13px;
  justify-content: center;
}

.icon-card .res-desc {
  font-size: 12px;
}

.icon-card .res-actions {
  margin-top: 12px;
  justify-content: center;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(31, 41, 55, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.error {
  text-align: center;
  padding: 48px 20px;
  color: #dc2626;
}

.error small {
  color: var(--muted);
  display: block;
  margin-top: 8px;
}

.res-creds {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.cred-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-top: 6px;
}

.cred-line:first-child {
  margin-top: 0;
}

.cred-label {
  color: var(--muted);
  min-width: 32px;
}

.cred-val {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.btn-copy-sm {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #9ca3af;
}

.footer a {
  color: #6b7280;
}

@media (max-width: 480px) {
  .res-item {
    flex-wrap: wrap;
  }
  .res-actions {
    width: 100%;
    padding-left: 62px;
  }
  .res-actions .btn {
    flex: 1;
  }
}
