:root {
  --bg1: #ebf2ff;
  --bg2: #c2d8ff;
  --panel: rgba(255,255,255,.58);
  --text: #1a2740;
  --line: rgba(255,255,255,.6);
  --accent: #1f70ff;
}

body.dark {
  --bg1: #0f1628;
  --bg2: #1a2f55;
  --panel: rgba(22,30,49,.7);
  --text: #dce8ff;
  --line: rgba(130,160,210,.3);
  --accent: #7cb0ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(255,255,255,.5), transparent 45%),
    linear-gradient(120deg, var(--bg1), var(--bg2));
}
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  padding: 14px;
}
.sidebar, .main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 10px 28px rgba(9,18,36,.16);
}
.sidebar { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sidebar h1 { font-size: 18px; margin: 4px 0 8px; }
button, input, textarea, select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.65);
  color: var(--text);
}
body.dark button, body.dark input, body.dark textarea, body.dark select {
  background: rgba(33,45,73,.75);
}
button { cursor: pointer; }
.sidebar button.active { background: linear-gradient(120deg, rgba(98,160,255,.38), rgba(24,112,255,.28)); }
.main { padding: 16px; }
.grid { display: grid; gap: 10px; }
.two { grid-template-columns: 1fr 2fr; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; background: rgba(255,255,255,.33); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.small { font-size: 12px; opacity: .8; word-break: break-all; }
pre.preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
  background: rgba(255,255,255,.33);
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
}
