:root {
  --accent: #2b6cf6;
  --accent-dark: #1f56d6;
  --text: #1f2733;
  --text-light: #7b8794;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e6eaf0;
  --green: #2bb673;
  --red: #e5484d;
}

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

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

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

.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f8cff, #2b6cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.nav a { color: var(--text-light); font-size: 14px; margin-left: 20px; }
.nav a:hover { color: var(--accent); }

.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }

.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--text-light); font-size: 14px; margin-bottom: 24px; }

/* 应用列表 */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  color: var(--text);
}

.app-card:hover {
  box-shadow: 0 8px 24px rgba(31, 39, 51, 0.08);
  transform: translateY(-2px);
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  flex-shrink: 0;
  object-fit: cover;
  background: #eef1f6;
}

.app-icon-fallback {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(135deg, #6ea2ff, #2b6cf6);
}

.app-card-info { min-width: 0; }
.app-card-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-card-meta { font-size: 12px; color: var(--text-light); margin-top: 5px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  vertical-align: 1px;
  margin-right: 6px;
}
.badge-ios { background: #eef1f6; color: #4a5568; }
.badge-android { background: #e6f7ef; color: #1e9e63; }

.empty {
  text-align: center;
  color: var(--text-light);
  padding: 80px 0;
  font-size: 14px;
}

/* 详情页 */
.detail-wrap { max-width: 460px; margin: 0 auto; }

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px;
  text-align: center;
}

.detail-icon, .detail-icon-fallback {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 16px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(31, 39, 51, 0.12);
}

.detail-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
  font-weight: 600;
  background: linear-gradient(135deg, #6ea2ff, #2b6cf6);
}

.detail-name { font-size: 21px; font-weight: 700; }
.detail-version { color: var(--text-light); font-size: 13px; margin-top: 6px; }

.qr-box { margin: 22px auto 6px; display: flex; justify-content: center; }
.qr-box svg { border: 1px solid var(--border); border-radius: 10px; }
.qr-tip { font-size: 12px; color: var(--text-light); margin-bottom: 18px; }

.btn {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  background: var(--accent);
  color: #fff;
  margin-top: 10px;
}
.btn:hover { background: var(--accent-dark); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: #f0f5ff; }
.btn-danger { background: var(--red); padding: 6px 12px; width: auto; display: inline-block; font-size: 12px; margin: 0; }

.meta-list {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}
.meta-list .row {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
}
.meta-list .row span:first-child { color: var(--text-light); }
.meta-list .row span:last-child { max-width: 65%; word-break: break-all; text-align: right; }

.changelog {
  margin-top: 18px;
  text-align: left;
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  color: #4a5568;
  white-space: pre-wrap;
  word-break: break-word;
}
.changelog-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* 管理后台 */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.panel h2 { font-size: 16px; margin-bottom: 16px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field textarea, .field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.progress {
  height: 8px;
  background: #eef1f6;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.progress-text { font-size: 12px; color: var(--text-light); margin-top: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-light); font-weight: 500; font-size: 12px; }
td .small { color: var(--text-light); font-size: 12px; }

.msg { font-size: 13px; margin-top: 10px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

.footer {
  text-align: center;
  color: #aab4c0;
  font-size: 12px;
  padding: 30px 0;
}
