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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0e17;
  color: #e2e8f0;
  min-height: 100vh;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0e17; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* === Header === */
.header {
  position: fixed;
  top: 0;
  left: 200px;
  right: 0;
  height: 56px;
  background: rgba(15, 21, 37, .95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 212, 255, .12);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  gap: 12px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.slogan { font-size: 12px; color: #64748b; }
.visit-counter {
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.visit-counter .num { color: #00d4ff; font-weight: 700; font-size: 13px; }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #00d4ff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* === Layout === */
.layout { display: flex; min-height: 100vh; padding-top: 56px; }

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 200px;
  background: #0f1525;
  border-right: 1px solid rgba(0, 212, 255, .08);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
}
.nav-list {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  width: 100%;
}
.nav-btn:hover {
  background: rgba(0, 212, 255, .06);
  color: #94a3b8;
}
.nav-btn.active {
  background: linear-gradient(135deg, rgba(0, 212, 255, .15), rgba(124, 58, 237, .1));
  color: #00d4ff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #00d4ff;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(0, 212, 255, .06);
  font-size: 11px;
  color: #334155;
  text-align: center;
}

/* === Overlay === */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 150;
}

/* === Content === */
.content {
  flex: 1;
  margin-left: 200px;
  padding: 24px;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}
#toolContent { flex: 1; }

/* === Home Page === */
.page-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.page-subtitle {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 8px;
}
.seo-text {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 0 16px;
}
.seo-text h2 {
  font-size: 18px;
  color: #e2e8f0;
  margin-bottom: 12px;
  text-align: center;
}
.seo-text h3 {
  font-size: 15px;
  color: #94a3b8;
  margin: 16px 0 8px;
}
.seo-text p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.8;
  margin-bottom: 10px;
}
.seo-text ul {
  list-style: none;
  padding: 0;
}
.seo-text li {
  font-size: 13px;
  color: #64748b;
  line-height: 1.8;
  padding-left: 16px;
  position: relative;
}
.seo-text li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: #00d4ff;
}
.seo-text li strong { color: #94a3b8; }

/* === Home Grid === */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.home-card {
  background: #131b2e;
  border: 1px solid rgba(0, 212, 255, .08);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
}
.home-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 255, .3);
  box-shadow: 0 8px 32px rgba(0, 212, 255, .1), inset 0 1px 0 rgba(0, 212, 255, .1);
  background: #16203a;
}
.home-card .icon { font-size: 36px; margin-bottom: 10px; }
.home-card .name { font-size: 14px; font-weight: 600; color: #94a3b8; }
.home-card:hover .name { color: #00d4ff; }

/* === Tool Card === */
.tool-card {
  background: #131b2e;
  border: 1px solid rgba(0, 212, 255, .08);
  border-radius: 12px;
  padding: 24px;
  max-width: 800px;
}
.tool-card h2 {
  font-size: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tool-card h3 { font-size: 14px; color: #64748b; margin: 16px 0 8px; }
.tool-card label { display: block; font-size: 13px; color: #64748b; margin-bottom: 4px; }

/* === Form === */
textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 212, 255, .12);
  border-radius: 8px;
  font-size: 14px;
  font-family: monospace;
  transition: all .2s;
  outline: none;
  background: #1a2332;
  color: #e2e8f0;
}
textarea:focus, input:focus {
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, .1);
}
textarea { resize: vertical; min-height: 120px; }
::placeholder { color: #334155; }

select { cursor: pointer; }
select option { background: #1a2332; color: #e2e8f0; }

input[type="color"] {
  padding: 2px;
  width: 60px;
  height: 60px;
  cursor: pointer;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  font-weight: 600;
}
.btn-primary {
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  color: #fff;
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 255, .3);
  transform: translateY(-1px);
}
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.btn-success:hover {
  box-shadow: 0 4px 20px rgba(16, 185, 129, .3);
  transform: translateY(-1px);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}
.btn-danger:hover {
  box-shadow: 0 4px 20px rgba(239, 68, 68, .3);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(0, 212, 255, .2);
  color: #64748b;
}
.btn-ghost:hover {
  border-color: #00d4ff;
  color: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, .1);
}
.btn + .btn { margin-left: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; gap: 8px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* === Result Box === */
.result-box {
  background: #1a2332;
  border: 1px solid rgba(0, 212, 255, .08);
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 8px;
  max-height: 300px;
  overflow: auto;
  color: #94a3b8;
}

/* === JSON Tree === */
.json-tree { max-height: 500px; }
.json-tree .j-block { margin-left: 16px; border-left: 1px solid rgba(0,212,255,.08); padding-left: 8px; }
.json-tree .j-folded { border-left-color: transparent; }
.json-tree .j-folded > .j-body { display: none; }
.json-tree .j-folded > .j-toggle { display: inline-block; }
.json-tree .j-folded > .j-info { display: inline; }
.json-tree .j-toggle { cursor: pointer; user-select: none; font-size: 10px; color: #00d4ff; margin-right: 2px; display: inline-block; width: 12px; text-align: center; }
.json-tree .j-info { display: none; font-size: 11px; color: #475569; margin-left: 4px; }
.json-tree .j-body { margin: 2px 0; }
.json-tree .j-line { padding: 1px 0; }
.json-tree .j-comma { color: #475569; }
.json-tree .j-bracket { color: #64748b; }
.json-tree .j-key { color: #f472b6; }
.json-tree .j-str { color: #34d399; }
.json-tree .j-num { color: #fbbf24; }
.json-tree .j-bool { color: #60a5fa; }
.json-tree .j-null { color: #94a3b8; font-style: italic; }

/* === Password === */
.pwd-field { display: flex; gap: 8px; align-items: center; }
.pwd-field input { flex: 1; font-size: 18px; letter-spacing: 2px; }
.pwd-options { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.pwd-options label { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; color: #94a3b8; }
.pwd-options input[type="checkbox"] { width: auto; accent-color: #00d4ff; }
.pwd-options input[type="range"] { width: 200px; accent-color: #00d4ff; }

/* === Color === */
.color-preview { width: 100%; height: 80px; border-radius: 8px; margin: 12px 0; border: 1px solid rgba(0, 212, 255, .1); }

/* === Diff === */
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .diff-grid { grid-template-columns: 1fr; } }

/* === QR === */
#qrcode { margin: 12px 0; display: flex; justify-content: center; }
#qrcode canvas, #qrcode img { border-radius: 8px; }

/* === Image === */
.img-preview { max-width: 100%; max-height: 300px; border-radius: 8px; margin: 12px 0; border: 1px solid rgba(0, 212, 255, .1); }

/* === Footer === */
.footer {
  border-top: 1px solid rgba(0, 212, 255, .06);
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: #334155;
  margin-top: 32px;
}

/* === Mobile === */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .header {
    left: 0;
    padding: 0 16px;
  }
  .sidebar {
    left: -200px;
    transition: left .25s;
  }
  .sidebar.open { left: 0; }
  .overlay.show { display: block; }
  .content {
    margin-left: 0;
    padding: 16px;
  }
}
