:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #06b6d4;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34rem),
    radial-gradient(circle at 84% 12%, rgba(6, 182, 212, 0.15), transparent 25rem),
    var(--bg);
  color: var(--text);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
textarea { resize: vertical; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.94);
  color: #e5e7eb;
  backdrop-filter: blur(16px);
  z-index: 10;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #0f172a;
  font-weight: 900;
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
  box-shadow: 0 12px 32px rgba(103, 232, 249, 0.22);
}
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }

.nav-group { display: grid; gap: 8px; }
.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: #cbd5e1;
  padding: 12px 13px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  transition: 0.18s ease;
}
.nav-item span { font-weight: 700; }
.nav-item small { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.nav-item:hover,
.nav-item.is-active {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(125, 211, 252, 0.3);
  color: #ffffff;
}
.nav-item.is-active small { color: #bae6fd; }

.privacy-card {
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 10px;
}
.privacy-card p { margin: 4px 0 0; font-size: 12px; line-height: 1.55; color: #a5b4fc; }
.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.main-panel { min-width: 0; padding: 26px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
}
.topbar h1 { margin: 0; font-size: clamp(26px, 4vw, 42px); letter-spacing: -0.04em; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}
.badge-soft { background: #ecfeff; color: #0e7490; }
.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-solid);
}

.content { display: grid; gap: 18px; }
.hero {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.85));
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 38px);
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "</>";
  position: absolute;
  right: 36px;
  bottom: -18px;
  font-weight: 900;
  font-size: 116px;
  color: rgba(37, 99, 235, 0.07);
}
.hero h2 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 50px); letter-spacing: -0.05em; }
.hero p { margin: 0; max-width: 850px; line-height: 1.8; color: var(--muted); font-size: 16px; }
.hero-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tool-card,
.panel,
.tool-layout,
.notice-card,
.faq-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
}
.tool-card {
  padding: 18px;
  min-height: 132px;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.tool-card:hover { transform: translateY(-3px); border-color: rgba(37, 99, 235, 0.35); background: #ffffff; }
.tool-card strong { display: block; font-size: 17px; margin-bottom: 8px; }
.tool-card span { display: block; color: var(--muted); line-height: 1.6; font-size: 13px; }
.tool-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 12px;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 900;
}

.panel { padding: 22px; }
.section-title { margin: 0 0 12px; font-size: 20px; letter-spacing: -0.02em; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.9; }
.faq-list { display: grid; gap: 10px; }
details.faq-card { padding: 16px 18px; }
details summary { cursor: pointer; font-weight: 800; }
details p { color: var(--muted); line-height: 1.8; margin: 10px 0 0; }

.tool-layout { padding: 20px; }
.tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.tool-header h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.03em; }
.tool-header p { margin: 0; color: var(--muted); line-height: 1.7; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  overflow: hidden;
}
.field-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.88);
}
.field-head strong { font-size: 14px; }
.field-hint { color: var(--muted); font-size: 12px; }
textarea.textarea {
  width: 100%;
  min-height: 300px;
  border: 0;
  outline: none;
  padding: 14px;
  background: transparent;
  color: var(--text);
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}
textarea.textarea[readonly] { color: #0f172a; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.btn {
  border: 0;
  border-radius: 13px;
  padding: 10px 15px;
  font-weight: 850;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  min-height: 42px;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #0f172a; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16); }
.btn.ghost {
  background: #fff;
  color: #334155;
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn.warning { background: var(--warning); color: #111827; }
.btn:disabled { opacity: 0.56; cursor: not-allowed; }
.status-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.status-line.error { color: var(--danger); font-weight: 700; }
.status-line.success { color: var(--success); font-weight: 700; }

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.form-group { display: grid; gap: 7px; }
.form-group label { font-size: 13px; color: #334155; font-weight: 800; }
.input,
.select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  padding: 0 12px;
  outline: none;
}
.input:focus,
.select:focus,
textarea.textarea:focus { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.14); }

.qr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}
.qr-preview {
  min-height: 330px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
}
.qr-preview canvas,
.qr-preview img { max-width: 100%; height: auto; }
.upload-zone {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 16px;
  background: #f8fafc;
  display: grid;
  gap: 10px;
}

.media-panel { display: grid; gap: 14px; }
.media-preview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}
.media-preview video,
.media-preview audio { width: 100%; max-height: 420px; border-radius: 14px; background: #0f172a; }
.progress-wrap {
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.18s ease;
}
.log-box {
  height: 170px;
  overflow: auto;
  border-radius: 14px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.notice-card {
  padding: 14px 16px;
  color: #475569;
  line-height: 1.7;
  background: rgba(236, 254, 255, 0.7);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  pointer-events: none;
  min-width: min(460px, calc(100vw - 28px));
  text-align: center;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: var(--shadow);
  transition: 0.2s ease;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.mobile-mask { display: none; }

@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    transform: translateX(-105%);
    width: min(86vw, 320px);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-mask {
    display: block;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 8;
    transition: 0.22s ease;
  }
  .mobile-mask.show { opacity: 1; pointer-events: auto; }
  .main-panel { padding: 16px; }
  .menu-btn { display: inline-grid; place-items: center; flex: 0 0 auto; }
  .topbar { align-items: flex-start; }
  .topbar-actions { display: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .io-grid, .qr-grid { grid-template-columns: 1fr; }
  .input-row { grid-template-columns: 1fr; }
  textarea.textarea { min-height: 240px; }
}

@media (max-width: 560px) {
  .main-panel { padding: 12px; }
  .topbar { gap: 10px; margin-bottom: 14px; }
  .hero, .panel, .tool-layout { border-radius: 18px; padding: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .btn { width: 100%; padding-inline: 10px; }
  .tool-header { display: grid; }
  .pill-row { justify-content: flex-start; }
  .field-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  textarea.textarea { min-height: 210px; }
}
