:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #697386;
  --primary: #0ea5a4;
  --primary-dark: #0b7d7c;
  --danger: #dc2626;
  --line: #e5eaf1;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #e7fbfa 0%, #f4f7fb 40%, #eef2ff 100%);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 42px 6vw 30px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #0891b2 55%, #2563eb);
}

.hero h1 { margin: 8px 0 12px; font-size: 34px; }
.hero p { margin: 0; opacity: 0.9; }
.eyebrow { letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px; }
.hero-card {
  min-width: 180px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 20px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(10px);
}
.hero-card span, .hero-card small { display: block; opacity: 0.85; }
.hero-card strong { display: block; margin: 8px 0; font-size: 34px; }

main { padding: 28px 6vw 60px; }
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat, .panel {
  background: var(--panel);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.stat { padding: 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 8px; font-size: 26px; }
.panel { padding: 22px; margin-bottom: 22px; }
.grid-two { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 26px; }
.section-title { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-title h2 { margin: 0 0 6px; font-size: 20px; }
.section-title span { color: var(--muted); font-size: 13px; }
.with-filter { align-items: center; }

.form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
input, select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,164,0.12); }
.actions { grid-column: 1 / -1; display: flex; gap: 12px; }
button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #eef2f7;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
button.primary, .converter button { background: var(--primary); color: #fff; }
.hero-logout {
  width: 100%;
  margin-top: 10px;
  color: #0f172a;
  background: rgba(255,255,255,0.9);
}
button:hover { filter: brightness(0.97); }
button.danger { color: #fff; background: var(--danger); }
button.link { height: 32px; padding: 0 10px; }

.converter { display: grid; gap: 12px; }
pre {
  min-height: 86px;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: #0f172a;
  color: #d1fae5;
  white-space: pre-wrap;
}
.tips { margin-top: 18px; padding: 16px; border-radius: 16px; background: #f0fdfa; color: #0f766e; }
.tips h3 { margin: 0 0 8px; }
.tips p { margin: 8px 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-weight: 600; background: #f8fafc; }
.badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { color: #047857; background: #d1fae5; }
.badge.fail { color: #b91c1c; background: #fee2e2; }
.badge.info { color: #1d4ed8; background: #dbeafe; }
.filters { display: flex; gap: 10px; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #fff;
  background: #111827;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.compact-form {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.debug-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.debug-form {
  grid-template-columns: repeat(2, 1fr);
}

.debug-result {
  display: grid;
  gap: 12px;
}

.compact-title {
  align-items: baseline;
  margin-bottom: 0;
}

.compact-title h3 {
  margin: 0;
  font-size: 16px;
}

.debug-result pre {
  min-height: 150px;
}

.openid-text {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border-radius: 26px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 8px 0 10px; }
.login-desc, .login-tip { color: var(--muted); }
.login-form { display: grid; gap: 16px; margin-top: 22px; }
.login-tip { margin: 18px 0 0; font-size: 13px; line-height: 1.7; }

.entry-card {
  display: grid;
  gap: 10px;
  padding: 28px;
  border-radius: 22px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid var(--line);
  transition: 0.18s ease;
}
.entry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.entry-card span { color: var(--muted); font-size: 13px; }
.entry-card strong { font-size: 24px; }
.entry-card small { color: var(--muted); line-height: 1.7; }
.landing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.parent-main { max-width: 760px; margin: 0 auto; }
.parent-panel { margin-top: -10px; }
.parent-form { grid-template-columns: 1fr; }
.full { width: 100%; }
.wechat-status {
  margin-bottom: 18px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
}
.wechat-status.ok { background: #d1fae5; color: #047857; }
.wechat-status.fail { background: #fee2e2; color: #b91c1c; }
.bind-result {
  display: none;
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #ecfdf5;
  color: #047857;
}
.bind-result.show { display: block; }

@media (max-width: 980px) {
  .hero, .grid-two, .debug-grid { grid-template-columns: 1fr; display: grid; }
  .stats, .landing-grid { grid-template-columns: repeat(2, 1fr); }
  .form { grid-template-columns: 1fr; }
  .with-filter, .filters { align-items: stretch; flex-direction: column; }
  .landing-grid { grid-template-columns: 1fr; }
}

.tabs {
  display: flex;
  gap: 0;
  padding: 0 6vw;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 100;
}
.tab-btn {
  height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.load-more-wrap { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.load-more-btn {
  height: 36px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
}
.record-count { color: var(--muted); font-size: 13px; }
