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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2f3d;
  --text: #e8eaed;
  --muted: #9aa0ad;
  --accent: #6c8cff;
  --accent-hover: #8aa4ff;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #161a24 0%, var(--bg) 100%);
}

.site-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tagline {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text);
  border-color: #3d4455;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.controls input[type="text"],
.controls input[type="number"],
.controls select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.controls input[type="color"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.btn {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn:hover {
  background: #252a36;
}

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

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

.preview-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
  overflow: auto;
}

.preview-wrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.avatar-preview canvas {
  max-width: 240px;
}

.about {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.about h2 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.about p {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer .icp {
  margin-top: 0.4rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}
