:root {
  --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --panel: #fff;
  --line: #e5e7eb;
  --text: #111827;
  --sub: #6b7280;
  --primary: #111827;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.title { margin: 0 0 8px; font-size: 40px; }
.subtitle { margin: 0 0 18px; color: var(--sub); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.card h3 { margin: 0 0 6px; font-size: 32px; }
.card p { margin: 0 0 12px; color: var(--sub); font-size: 22px; line-height: 1.35; }
.use { border-top: 1px solid var(--line); padding-top: 10px; color: #374151; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px 13px;
  cursor: pointer;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

textarea, input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}
textarea { min-height: 300px; resize: vertical; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.log {
  margin-top: 10px;
  background: #0b1020;
  color: #d1d5db;
  border-radius: 10px;
  padding: 10px;
  min-height: 70px;
  max-height: 200px;
  overflow: auto;
  font-family: Consolas, monospace;
  white-space: pre-wrap;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tab {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
}
.tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.dev-layout {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
  padding: 18px 12px 28px;
}
.dev-sidebar {
  position: sticky;
  top: 18px;
  height: fit-content;
}
.dev-main .title { color: #ffffff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.dev-main .subtitle { color: #ecebff; }
.dev-sidebar .brand { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: #4b5ad9; }
.dev-sidebar .desc { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 14px; }
.jump-home {
  display: block; width: 100%; text-align: center; text-decoration: none;
  background: #4b5ad9; color: #fff; border-radius: 10px; padding: 10px 12px; font-weight: 600; margin-bottom: 14px;
}
.group-title { font-size: 13px; color: #666; margin: 12px 0 8px; }
.tool-nav { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.tool-link {
  display: block; border: 1px solid #ececf2; border-radius: 10px; padding: 10px 12px;
  text-decoration: none; color: #333; font-size: 14px;
}
.tool-link .nav-short { display: none; }
.tool-link.active { border-color: #4b5ad9; background: #eef1ff; color: #3747c7; font-weight: 600; }
.dev-main .btn { font-weight: 600; }
.dev-main .log { min-height: 90px; }

.mobile-topbar {
  display: none; position: fixed; left: 0; right: 0; top: 0; z-index: 40; align-items: center; gap: 8px;
  padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid rgba(0, 0, 0, 0.06); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.mobile-topbar .nav-back {
  flex: 0 0 auto; text-decoration: none; color: #4b5ad9; font-weight: 600; font-size: 14px;
  padding: 6px 8px; border-radius: 8px; background: #eef1ff;
}
.mobile-topbar .nav-title {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-topbar .nav-more {
  flex: 0 0 auto; border: 1px solid #d6daf5; background: #fff; color: #4b5ad9;
  font-weight: 600; font-size: 13px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.nav-sheet {
  display: none; position: fixed; inset: 0; z-index: 50; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.45);
}
.nav-sheet.open { display: flex; }
.nav-sheet-panel {
  width: 100%; max-height: min(72vh, 520px); background: #fff; border-radius: 18px 18px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); overflow: auto; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
}
.nav-sheet-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid #eee; font-weight: 700; color: #333;
}
.nav-sheet-close {
  border: none; background: #f3f4f6; color: #333; width: 36px; height: 36px; border-radius: 10px; font-size: 18px; line-height: 1; cursor: pointer;
}

@media (max-width: 930px) {
  body {
    padding-top: calc(50px + env(safe-area-inset-top, 0px));
    padding-left: 10px;
    padding-right: 10px;
  }
  .mobile-topbar { display: flex; }
  .dev-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 0 14px;
  }
  .dev-sidebar { display: none; }
}
