:root {
  --bg: #0b1120;
  --bg-2: #0f172a;
  --panel: #141d31;
  --panel-2: #233248;
  --border: #2b3b52;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --ok: #4ade80;
  --err: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1100px 700px at 80% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(129, 140, 248, 0.09), transparent 60%),
    var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}
::selection { background: rgba(56, 189, 248, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3b4f6e; }

.layout { display: flex; height: 100vh; }
.topright-note {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 10;
  font-size: 12px;
  color: var(--muted);
  background: rgba(20, 29, 49, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: rgba(17, 25, 43, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.logo .logo-icon { font-size: 20px; filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.5)); }
.logo b {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
}
#nav { flex: 1; overflow-y: auto; padding: 6px 8px 10px; }
#nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  margin: 2px 0;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
#nav button .ico {
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
}
#nav button:hover { background: var(--panel-2); color: var(--text); transform: translateX(2px); }
#nav button.active {
  background: linear-gradient(135deg, var(--accent), #2196d6);
  color: #0b1120;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.28);
}
#nav button.active .ico { opacity: 1; }
.foot { padding: 12px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }

main { flex: 1; overflow-y: auto; padding: 26px 34px 48px; }
main.fadein { animation: fadeUp 0.22s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

h1 { font-size: 21px; margin-bottom: 6px; letter-spacing: 0.3px; }
.desc { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

textarea, input[type=text], select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
textarea::placeholder, input::placeholder { color: #5b6b82; }

.search-box { padding: 10px 12px 6px; }
.search-box input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input[type="text"]::placeholder { color: #64748b; }
.search-box input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.row { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; align-items: center; }
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #2196d6);
  color: #0b1120;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.22);
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(56, 189, 248, 0.32); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: none; }
.btn.ghost:hover { filter: brightness(1.2); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }

.output {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 40px;
  margin-top: 10px;
}
.output.ok { color: var(--ok); }
.output.err { color: var(--err); }

label { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 4px; }
.row label { display: inline-flex; align-items: center; gap: 5px; margin: 0; cursor: pointer; user-select: none; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.row label:has(input[type="checkbox"]:checked) { color: var(--accent); font-weight: 600; }

.swatch {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.copyline { cursor: pointer; padding: 3px 6px; border-radius: 6px; transition: background 0.12s; }
.copyline:hover { background: var(--panel-2); }
.copyline:active { background: var(--accent); color: #0b1120; }
.shades { display: flex; gap: 4px; margin-top: 10px; }
.shade {
  flex: 1;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.12s, border-color 0.12s;
}
.shade:hover { transform: scale(1.1); border-color: var(--accent); }

.big-clock {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 18px 10px 4px;
  cursor: pointer;
  user-select: none;
  font-family: Consolas, "Courier New", monospace;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(56, 189, 248, 0.35);
}
.big-clock:hover { color: #7dd3fc; }
.clock-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-family: Consolas, monospace;
  padding: 0 0 8px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  user-select: none;
}
.clock-sub:hover { color: var(--accent); }

.seo-links { padding: 10px 14px 6px; border-top: 1px solid var(--border); }
.seo-links a { display: block; color: var(--muted); text-decoration: none; font-size: 12px; padding: 3px 0; }
.seo-links a:hover { color: var(--accent); }

.color-preview {
  height: 86px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.color-preview b { font-size: 20px; font-family: Consolas, monospace; letter-spacing: 1px; }
.color-preview span { font-size: 12px; opacity: 0.75; font-family: Consolas, monospace; }

.cvcards { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.cvcard {
  flex: 1;
  min-width: 150px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, transform 0.15s;
}
.cvcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.cvcard .cvtag { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.cvcard code { font-size: 14px; color: var(--accent); font-family: Consolas, monospace; word-break: break-all; }
.cvcard .cvcopy { font-size: 11px; color: #5b6b82; }
.cvcard:hover .cvcopy { color: var(--muted); }

.rgbrow { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.rgblab { width: 18px; font-size: 13px; font-weight: 700; color: var(--muted); font-family: Consolas, monospace; }
.rgbval { width: 34px; text-align: right; font-size: 13px; font-family: Consolas, monospace; color: var(--accent); }
.rgbrow input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; height: 4px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  body { overflow: auto; }
  .layout { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .logo { padding: 12px 14px; border-bottom: none; white-space: nowrap; }
  .search-box { display: none; }
  #nav { display: flex; flex: 1; overflow-x: auto; overflow-y: hidden; padding: 8px; }
  #nav button { width: auto; white-space: nowrap; margin: 0 3px; }
  .foot { display: none; }
  .topright-note { display: none; }
  main { padding: 16px 16px 40px; overflow: visible; }
}

/* ===== 新增工具样式 ===== */
.side-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: #64748b;
  padding: 14px 16px 6px;
  font-weight: 700;
}
.qr-box {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 8px;
}
.qr-box canvas { display: block; }
.net-tip {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
  line-height: 1.6;
}
