/* key.css — glmkey.mlik.top Key 状态查询页（独立样式，不引用 member/style.css） */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --fg-3: #86868b;
  --fg-4: #a1a1a6;
  --card-bg: rgba(255,255,255,0.78);
  --card-border: rgba(255,255,255,0.65);
  --divider: rgba(0,0,0,0.07);
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --blue: #0071e3;
  --accent: #4c8bf5;
  --radius: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html, body { min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--fg);
  background-color: #f5f5f7;
  background-image:
    radial-gradient(ellipse 60rem 40rem at 88% -8%, rgba(0, 113, 227, 0.07), transparent 60%),
    radial-gradient(rgba(0, 0, 0, 0.045) 1px, transparent 1.4px);
  background-size: 100% 100%, 22px 22px;
  background-attachment: fixed;
  background-repeat: no-repeat, repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 72px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 36px 28px 28px;
  box-shadow: 0 24px 80px -20px rgba(0,0,0,0.18), 0 8px 24px -12px rgba(0,0,0,0.08);
  animation: cardIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.brand { text-align: center; margin-bottom: 22px; }
.brand-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.brand-slug { font-size: 13px; color: var(--fg-3); margin-top: 8px; line-height: 1.6; }

/* ===== 输入 ===== */
.key-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 6px 6px 6px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.key-input:focus-within {
  border-color: rgba(0,113,227,0.5);
  box-shadow: 0 0 0 4px rgba(0,113,227,0.12);
}
#keyInput {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--fg);
  letter-spacing: 0.01em;
  padding: 10px 0;
}
#keyInput::placeholder { color: var(--fg-4); font-family: inherit; }

.toggle-btn {
  flex-shrink: 0;
  border: 0;
  background: rgba(0,0,0,0.05);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle-btn:hover { background: rgba(0,0,0,0.08); }

.primary-btn {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0a84ff, #0071e3);
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(0,113,227,0.6);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(0,113,227,0.65); }
.primary-btn:active { transform: scale(0.985); }
.primary-btn:disabled { opacity: 0.7; cursor: default; transform: none; }

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--fg-3);
  text-align: center;
  line-height: 1.7;
}

/* ===== 结果 ===== */
.result { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--divider); animation: fadeIn 0.4s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(0,0,0,0.06);
  color: var(--fg-2);
}
.badge-max { background: linear-gradient(135deg, #ff9500, #ff5e3a); color: #fff; }
.badge-pro  { background: rgba(0,113,227,0.12); color: var(--blue); }
.badge-lite { background: rgba(52,199,89,0.14); color: #1f9d43; }
.queried-at { font-size: 12px; color: var(--fg-4); text-align: right; line-height: 1.5; }

.quota-cards { display: flex; flex-direction: column; gap: 12px; }
.quota-card {
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.quota-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.quota-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.quota-pct { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.quota-card.ok .quota-pct { color: var(--green); }
.quota-card.warn .quota-pct { color: var(--orange); }
.quota-card.danger .quota-pct { color: var(--red); }
.quota-card.unknown .quota-pct { color: var(--fg-4); }

.bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,0.06); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.quota-card.ok .bar-fill { background: linear-gradient(90deg, #34c759, #30d158); }
.quota-card.warn .bar-fill { background: linear-gradient(90deg, #ff9500, #ffb340); }
.quota-card.danger .bar-fill { background: linear-gradient(90deg, #ff3b30, #ff6961); }
.quota-card.unknown .bar-fill { background: var(--fg-4); }

.quota-sub { margin-top: 8px; font-size: 12px; color: var(--fg-2); line-height: 1.5; }
.quota-details { margin-top: 8px; font-size: 12px; color: var(--fg-3); }
.quota-details summary { cursor: pointer; color: var(--blue); user-select: none; }
.quota-details ul { margin: 6px 0 0 16px; line-height: 1.8; }

.result-foot { margin-top: 14px; font-size: 11px; color: var(--fg-4); text-align: center; }

/* ===== 错误 ===== */
.error { margin-top: 24px; padding: 18px 16px; border-radius: var(--radius-md); background: rgba(255,59,48,0.06); border: 1px solid rgba(255,59,48,0.18); text-align: center; animation: fadeIn 0.3s ease both; }
.error-text { font-size: 14px; color: #c5221a; font-weight: 600; line-height: 1.6; }
.error-hint { margin-top: 8px; font-size: 12px; color: var(--fg-2); line-height: 1.6; }
.secondary-btn {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(0,113,227,0.1);
  cursor: pointer;
}
.secondary-btn:hover { background: rgba(0,113,227,0.16); }

/* ===== 联系方式 / 店铺 ===== */
.contact {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--fg-3);
  text-align: center;
  line-height: 1.9;
}
.contact b { font-weight: 600; color: var(--fg-2); }
.contact a { color: var(--accent); word-break: break-all; }
.contact .renew-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff9500, #ff5e3a);
  border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(255, 94, 58, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.contact .renew-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(255, 94, 58, 0.45); }

.foot {
  position: fixed;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--fg-4);
  letter-spacing: 0.02em;
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 420px) {
  .card { padding: 30px 18px 22px; border-radius: 24px; }
  .brand-title { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .result, .error { animation: none; }
  .bar-fill { transition: none; }
}
