:root {
  --bg-0: #0b1220;
  --bg-1: #121a2b;
  --ink: #e8eef8;
  --muted: #93a0b8;
  --line: rgba(232, 238, 248, 0.12);
  --accent: #2ec4b6;
  --accent-2: #f4a261;
  --danger: #ff6b7a;
  --panel: rgba(18, 26, 43, 0.78);
  --panel-strong: rgba(14, 22, 38, 0.92);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-0);
  line-height: 1.55;
}

.mono {
  font-family: var(--mono);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(46, 196, 182, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(244, 162, 97, 0.12), transparent 50%),
    linear-gradient(165deg, #0b1220 0%, #10182a 45%, #0a101c 100%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 238, 248, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 238, 248, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  animation: grid-drift 28s linear infinite;
}

.bg-glow {
  position: absolute;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: float 12s ease-in-out infinite;
}

.bg-glow-a {
  top: -8%;
  left: -6%;
  background: rgba(46, 196, 182, 0.35);
}

.bg-glow-b {
  right: -10%;
  bottom: 5%;
  background: rgba(244, 162, 97, 0.22);
  animation-delay: -4s;
}

@keyframes grid-drift {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2%, 3%); }
}

.site-header {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.4rem 1.25rem 1rem;
  animation: rise 0.7s ease both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #1b9e93 55%, var(--accent-2));
  box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.15);
}

.brand-name {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.tagline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
}

.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1;
  margin: 0;
  animation: none;
  position: static;
  top: auto;
  z-index: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.55rem 0.75rem;
  margin-bottom: 1.25rem;
  animation: rise 0.7s ease 0.08s both;
  position: sticky;
  top: 0.5rem;
  z-index: 5;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: blur(12px);
  transition: transform 0.28s ease, opacity 0.28s ease, box-shadow 0.28s ease;
  will-change: transform;
}

.nav-bar.is-collapsed {
  transform: translateY(calc(-100% - 0.85rem));
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-bar {
    transition: none;
  }
}

.nav-reset {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(232, 238, 248, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-reset:hover {
  color: var(--ink);
  border-color: rgba(46, 196, 182, 0.35);
}

.tool-nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.86rem;
  cursor: grab;
  user-select: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
}

.tool-nav-link:active {
  cursor: grabbing;
}

.tool-nav-link.is-dragging {
  opacity: 0.45;
}

.tool-nav-link.drag-over {
  border-color: rgba(46, 196, 182, 0.55);
  background: rgba(46, 196, 182, 0.12);
  color: var(--ink);
}

.tool-nav-link:hover,
.tool-nav-link.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(232, 238, 248, 0.04);
}

.tool-nav-link.is-soon {
  opacity: 0.75;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.panel[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.65s ease forwards;
}

.panel[data-reveal]:nth-of-type(n) {
  animation-delay: 0.08s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-head {
  padding: 1.35rem 1.4rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.panel-body {
  padding: 1.25rem 1.4rem 1.45rem;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.field-row label,
.field-block > label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field-row label {
  margin: 0;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.seg-btn.is-active {
  background: rgba(46, 196, 182, 0.18);
  color: var(--ink);
}

.convert-grid,
.color-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 820px) {
  .convert-grid,
  .color-layout {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.field-block {
  min-width: 0;
}

input[type="text"] {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: rgba(46, 196, 182, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.input-with-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.hint {
  margin: 0.45rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.copy-btn,
.preset {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
  border-radius: 11px;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, opacity 0.2s;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.copy-btn:hover,
.preset:hover,
.seg-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, #2ec4b6, #1fa89c);
  color: #06221f;
  font-weight: 650;
  padding: 0.7rem 1rem;
}

.secondary-btn {
  background: rgba(232, 238, 248, 0.06);
  color: var(--ink);
  border-color: var(--line);
  padding: 0.7rem 1rem;
}

.ghost-btn {
  background: rgba(244, 162, 97, 0.12);
  color: #ffd7b0;
  border-color: rgba(244, 162, 97, 0.28);
  padding: 0 0.9rem;
  white-space: nowrap;
}

.copy-btn {
  background: transparent;
  color: var(--accent);
  border-color: rgba(46, 196, 182, 0.3);
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.result {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(46, 196, 182, 0.08);
  border: 1px solid rgba(46, 196, 182, 0.2);
}

.result-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-value {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-size: 0.92rem;
}

.error {
  margin: 0.9rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.swatch-stack {
  position: relative;
  margin-top: 0.9rem;
  height: 140px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.swatch-checker {
  position: absolute;
  inset: 0;
  background-color: #ddd;
  background-image:
    linear-gradient(45deg, #bbb 25%, transparent 25%),
    linear-gradient(-45deg, #bbb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #bbb 75%),
    linear-gradient(-45deg, transparent 75%, #bbb 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.swatch {
  position: absolute;
  inset: 0;
  transition: background-color 0.18s ease;
}

.channel-grid {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.channel {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.35rem 0.65rem;
  align-items: center;
}

.channel-name {
  font-size: 0.82rem;
  color: var(--muted);
}

.channel-num,
.meta-input {
  width: 4.6rem;
  justify-self: end;
  appearance: textfield;
  -moz-appearance: textfield;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.42rem 0.5rem;
  font-size: 0.88rem;
  outline: none;
  text-align: right;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.channel-num::-webkit-outer-spin-button,
.channel-num::-webkit-inner-spin-button,
.meta-input::-webkit-outer-spin-button,
.meta-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.channel-num:focus,
.meta-input:focus {
  border-color: rgba(46, 196, 182, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.channel-slider {
  grid-column: 1 / -1;
  width: 100%;
  height: 1.35rem;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.channel-slider:focus-visible {
  outline: none;
}

.channel-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--slider-fill, var(--accent)) var(--slider-pct, 0%),
    rgba(232, 238, 248, 0.1) var(--slider-pct, 0%)
  );
}

.channel-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(232, 238, 248, 0.1);
}

.channel-slider::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--slider-fill, var(--accent));
}

.channel-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid #0b1220;
  background: #e8eef8;
  box-shadow: 0 0 0 2px var(--slider-fill, var(--accent));
  transition: transform 0.15s ease;
}

.channel-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #0b1220;
  background: #e8eef8;
  box-shadow: 0 0 0 2px var(--slider-fill, var(--accent));
}

.channel-slider:active::-webkit-slider-thumb,
.channel-slider:active::-moz-range-thumb {
  transform: scale(1.08);
}

.channel-r { --slider-fill: #ff6b6b; }
.channel-g { --slider-fill: #51cf66; }
.channel-b { --slider-fill: #4dabf7; }

.channel-meta {
  margin-top: 0.25rem;
  display: grid;
  gap: 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.case-results .meta-row {
  align-items: flex-start;
}

.case-out {
  flex: 1;
  min-width: 0;
  text-align: right;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 600;
}

.meta-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-edit .meta-input,
.rgb-edit .meta-input {
  width: 4.4rem;
  justify-self: auto;
  text-align: right;
}

.meta-hex {
  width: 6.4rem;
  justify-self: auto;
  text-align: right;
}

.meta-unit {
  color: var(--muted);
  font-size: 0.82rem;
}

.rgb-edit {
  display: inline-flex;
  gap: 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.preset {
  background: rgba(232, 238, 248, 0.05);
  color: var(--ink);
  border-color: var(--line);
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.area {
  width: 100%;
  resize: vertical;
  min-height: 9rem;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.area:focus {
  border-color: rgba(46, 196, 182, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.area[readonly] {
  color: var(--ink);
  opacity: 0.95;
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tool-actions {
  margin-top: 1rem;
  align-items: center;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.label-row label {
  margin-bottom: 0;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 238, 248, 0.06);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-size: 0.92rem;
  transition: transform 0.15s, background 0.2s;
}

.file-btn:hover {
  transform: translateY(-1px);
  background: rgba(232, 238, 248, 0.1);
}

.regex-line {
  display: grid;
  grid-template-columns: auto 1fr auto minmax(3.2rem, 4.5rem);
  gap: 0.4rem;
  align-items: center;
}

.regex-slash {
  color: var(--muted);
  font-size: 1.1rem;
}

.flags-input {
  text-align: center;
}

.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin-top: 0.7rem;
}

.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  cursor: pointer;
  user-select: none;
}

.flag input {
  accent-color: var(--accent);
}

.regex-grid {
  margin-top: 1rem;
}

.highlight-box {
  margin: 0;
  min-height: 9rem;
  max-height: 18rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #d7deea;
}

.re-mark {
  background: rgba(244, 162, 97, 0.35);
  color: #fff4e8;
  border-radius: 4px;
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.re-mark:nth-of-type(odd) {
  background: rgba(46, 196, 182, 0.32);
  color: #e8fffb;
}

.subhead {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.hint.tight {
  margin: 0;
}

.match-list {
  display: grid;
  gap: 0.55rem;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(232, 238, 248, 0.03);
  padding: 0.75rem 0.85rem;
}

.match-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 0.8rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.match-text {
  display: block;
  margin-bottom: 0.35rem;
  word-break: break-all;
}

.match-groups {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.match-groups strong {
  color: var(--ink);
  font-weight: 560;
}

.match-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.4rem 0;
}

@media (max-width: 600px) {
  .regex-line {
    grid-template-columns: auto 1fr auto;
  }

  .flags-input {
    grid-column: 2;
  }
}

.panel-soon .panel-head h1 {
  color: #c9d4e8;
}

.roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.roadmap li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.85rem;
  padding: 0.85rem 0.95rem;
  border: 1px dashed rgba(232, 238, 248, 0.18);
  border-radius: 14px;
  background: rgba(232, 238, 248, 0.03);
}

.roadmap-status {
  grid-row: span 2;
  align-self: center;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(244, 162, 97, 0.35);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  white-space: nowrap;
}

.roadmap strong {
  font-size: 0.98rem;
}

.roadmap span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.site-footer a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(12px);
  background: #18312e;
  color: #d7fff8;
  border: 1px solid rgba(46, 196, 182, 0.45);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 700px) {
  .site-header {
    padding: 1.1rem 1rem 0.55rem;
  }

  .brand-name {
    font-size: 1.55rem;
  }

  .tagline {
    margin-top: 0.3rem;
    font-size: 0.86rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .nav-bar {
    top: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.4rem 0.4rem 0.35rem;
    margin-bottom: 0.9rem;
  }

  .tool-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.2rem), transparent 100%);
  }

  .tool-nav::-webkit-scrollbar {
    display: none;
  }

  .tool-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .nav-reset {
    flex: 0 0 auto;
    padding: 0.32rem 0.55rem;
    font-size: 0.74rem;
  }
}

@media (max-width: 600px) {
  .panel-head,
  .panel-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .input-with-action {
    grid-template-columns: 1fr;
  }

  .ghost-btn {
    padding: 0.65rem 0.9rem;
  }
}

.select-input {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  border-radius: 11px;
  padding: 0.65rem 0.8rem;
  font: inherit;
  min-width: 5.5rem;
}

.img-preview {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(45deg, #bbb 25%, transparent 25%),
    linear-gradient(-45deg, #bbb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #bbb 75%),
    linear-gradient(-45deg, transparent 75%, #bbb 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-color: #ddd;
}

.qr-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 180px;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  margin-top: 0.5rem;
}

.qr-box img,
.qr-box canvas {
  display: block;
}

.diff-box {
  display: grid;
  gap: 0.15rem;
}

.diff-box .diff-mark {
  display: inline-block;
  width: 1.1em;
  opacity: 0.8;
}

.diff-add {
  background: rgba(81, 207, 102, 0.16);
  color: #d7ffe0;
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.diff-del {
  background: rgba(255, 107, 122, 0.16);
  color: #ffd0d6;
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.diff-same {
  color: #c9d4e8;
  padding: 0.1rem 0.35rem;
}

.meta-row .copy-btn {
  margin-left: 0.4rem;
}

.input-with-action .select-input {
  min-width: 4.8rem;
}

.qr-scan-wrap {
  margin-top: 0.55rem;
}

.qr-video {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #000;
  object-fit: cover;
}

.subhead {
  margin: 0 0 0.7rem;
}

.share-stage {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(600px 240px at 20% 0%, rgba(46, 196, 182, 0.12), transparent 60%),
    rgba(0, 0, 0, 0.18);
  padding: 1rem;
  overflow: auto;
  max-height: 640px;
}

.share-capture {
  display: inline-block;
  min-width: 100%;
  padding: 1.25rem;
}

.share-card {
  position: relative;
  min-width: 320px;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.share-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem 0.55rem;
}

.share-dots {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
  margin-right: 28px;
  flex: 0 0 auto;
}

.share-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
  margin-right: 28px;
}

.share-title {
  color: inherit;
  opacity: 0.72;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-code {
  margin: 0;
  padding: 0.35rem 1rem 1.2rem;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow: auto;
  background: transparent;
  white-space: pre;
}

.sc-line {
  display: flex;
  gap: 0.85rem;
  min-height: 1.55em;
}

.sc-ln {
  flex: 0 0 auto;
  opacity: 0.35;
  user-select: none;
  text-align: right;
  min-width: 1.6em;
}

.sc-code {
  flex: 1;
  min-width: 0;
}

.share-watermark {
  position: absolute;
  right: 0.9rem;
  bottom: 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

.theme-midnight {
  color: #e8eef8;
  background: linear-gradient(160deg, #1a2234 0%, #121826 55%, #0d1320 100%);
}
.theme-midnight .tok-key { color: #7dd3fc; }
.theme-midnight .tok-str { color: #86efac; }
.theme-midnight .tok-num { color: #fcd34d; }
.theme-midnight .tok-bool { color: #f9a8d4; }
.theme-midnight .tok-punc { color: #94a3b8; }
.theme-midnight .tok-kw { color: #c4b5fd; }
.theme-midnight .tok-comment { color: #64748b; }
.theme-midnight .tok-anno { color: #f9a8d4; }

.theme-ember {
  color: #fff4e8;
  background: linear-gradient(160deg, #3a1d13 0%, #2a120c 50%, #1a0c08 100%);
}
.theme-ember .tok-key { color: #fdba74; }
.theme-ember .tok-str { color: #fde68a; }
.theme-ember .tok-num { color: #fb7185; }
.theme-ember .tok-bool { color: #fda4af; }
.theme-ember .tok-punc { color: #b08968; }
.theme-ember .tok-kw { color: #fdba74; }
.theme-ember .tok-comment { color: #9a6b4f; }
.theme-ember .tok-anno { color: #fda4af; }

.theme-mint {
  color: #e7fff8;
  background: linear-gradient(160deg, #12352f 0%, #0d2622 55%, #081b18 100%);
}
.theme-mint .tok-key { color: #5eead4; }
.theme-mint .tok-str { color: #bbf7d0; }
.theme-mint .tok-num { color: #fde68a; }
.theme-mint .tok-bool { color: #a5b4fc; }
.theme-mint .tok-punc { color: #7f9e97; }
.theme-mint .tok-kw { color: #6ee7b7; }
.theme-mint .tok-comment { color: #5f7f78; }
.theme-mint .tok-anno { color: #a5b4fc; }

.theme-paper {
  color: #1f2937;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 55%, #e2e8f0 100%);
  border-color: rgba(15, 23, 42, 0.08);
}
.theme-paper .share-dot {
  background: #ef4444;
  box-shadow: 16px 0 0 #f59e0b, 32px 0 0 #22c55e;
}
.theme-paper .tok-key { color: #2563eb; }
.theme-paper .tok-str { color: #059669; }
.theme-paper .tok-num { color: #d97706; }
.theme-paper .tok-bool { color: #db2777; }
.theme-paper .tok-punc { color: #64748b; }
.theme-paper .tok-kw { color: #7c3aed; }
.theme-paper .tok-comment { color: #94a3b8; }
.theme-paper .tok-anno { color: #db2777; }
.theme-paper .share-dots {
  background: #ef4444;
  box-shadow: 16px 0 0 #f59e0b, 32px 0 0 #22c55e;
}

.md-preview {
  min-height: 12rem;
  max-height: 32rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 1rem 1.15rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink);
}

.md-preview h1, .md-preview h2, .md-preview h3 {
  margin: 0.6em 0 0.35em;
  line-height: 1.3;
}

.md-preview h1 { font-size: 1.4em; border-bottom: 1px solid var(--line); padding-bottom: 0.3em; }
.md-preview h2 { font-size: 1.2em; }
.md-preview h3 { font-size: 1.05em; }

.md-preview pre {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  overflow: auto;
  font-size: 0.88rem;
  margin: 0.6em 0;
}

.md-preview code {
  background: rgba(232, 238, 248, 0.08);
  border-radius: 5px;
  padding: 0.15em 0.35em;
  font-size: 0.88em;
}

.md-preview a {
  color: var(--accent);
  text-decoration: underline;
}

.md-preview ul, .md-preview ol {
  padding-left: 1.4em;
  margin: 0.5em 0;
}

.md-preview li {
  margin: 0.25em 0;
}

.md-preview strong {
  font-weight: 650;
}

.eye-img {
  cursor: crosshair;
}
