/*
 * KenEasy Word Converter — Apple-inspired interface system.
 * Layered tokens keep appearance data-driven; components consume semantic colors only.
 */

:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Theme tokens */
  --canvas: #f5f5f7;
  --canvas-deep: #ececf0;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-muted: rgba(118, 118, 128, 0.08);
  --surface-hover: rgba(118, 118, 128, 0.12);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --line: rgba(0, 0, 0, 0.085);
  --line-strong: rgba(0, 0, 0, 0.14);

  /* KenEasy Brand Colors */
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: rgba(0, 113, 227, 0.1);
  --pink: #ff375f;
  --pink-strong: #ff4f7e;
  --pink-soft: rgba(255, 55, 95, 0.11);
  --cyan: #32ade6;
  --cyan-soft: rgba(50, 173, 230, 0.12);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.12);
  --orange: #ff9f0a;
  --danger: #ff3b30;
  --control: rgba(118, 118, 128, 0.09);

  /* Elevation & shapes */
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.04), 0 5px 18px rgba(0, 0, 0, 0.05);
  --shadow-panel: 0 2px 3px rgba(0, 0, 0, 0.025), 0 18px 60px rgba(0, 0, 0, 0.075);
  --shadow-float: 0 16px 45px rgba(0, 0, 0, 0.14);
  --radius-small: 12px;
  --radius-control: 14px;
  --radius-card: 24px;
  --radius-hero: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0b0c0f;
  --canvas-deep: #050608;
  --surface: rgba(24, 27, 33, 0.72);
  --surface-strong: rgba(32, 36, 44, 0.94);
  --surface-solid: #15181e;
  --surface-muted: rgba(235, 235, 245, 0.07);
  --surface-hover: rgba(235, 235, 245, 0.11);
  --text: #f4f7fb;
  --text-secondary: #8d9aa9;
  --text-tertiary: #6b7785;
  --line: rgba(48, 54, 65, 0.45);
  --line-strong: rgba(72, 80, 95, 0.6);

  --blue: #00aeec;
  --blue-hover: #29bbf0;
  --blue-soft: rgba(0, 174, 236, 0.16);
  --pink: #fb7299;
  --pink-strong: #ff4f7e;
  --pink-soft: rgba(251, 114, 153, 0.16);
  --cyan: #64d2ff;
  --cyan-soft: rgba(100, 210, 255, 0.14);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --control: rgba(235, 235, 245, 0.08);

  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 25px rgba(0, 0, 0, 0.25);
  --shadow-panel: 0 2px 4px rgba(0, 0, 0, 0.3), 0 22px 70px rgba(0, 0, 0, 0.45);
  --shadow-float: 0 20px 55px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --canvas: #0b0c0f;
    --canvas-deep: #050608;
    --surface: rgba(24, 27, 33, 0.72);
    --surface-strong: rgba(32, 36, 44, 0.94);
    --surface-solid: #15181e;
    --surface-muted: rgba(235, 235, 245, 0.07);
    --surface-hover: rgba(235, 235, 245, 0.11);
    --text: #f4f7fb;
    --text-secondary: #8d9aa9;
    --text-tertiary: #6b7785;
    --line: rgba(48, 54, 65, 0.45);
    --line-strong: rgba(72, 80, 95, 0.6);

    --blue: #00aeec;
    --blue-hover: #29bbf0;
    --blue-soft: rgba(0, 174, 236, 0.16);
    --pink: #fb7299;
    --pink-strong: #ff4f7e;
    --pink-soft: rgba(251, 114, 153, 0.16);
    --cyan: #64d2ff;
    --cyan-soft: rgba(100, 210, 255, 0.14);
    --emerald: #10b981;
    --emerald-soft: rgba(16, 185, 129, 0.16);
    --control: rgba(235, 235, 245, 0.08);

    --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 25px rgba(0, 0, 0, 0.25);
    --shadow-panel: 0 2px 4px rgba(0, 0, 0, 0.3), 0 22px 70px rgba(0, 0, 0, 0.45);
    --shadow-float: 0 20px 55px rgba(0, 0, 0, 0.6);
  }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--canvas);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--blue);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-small);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 20px;
}

/* Background wallpaper with animated glows */
.wallpaper {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}
.glow-one {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--pink-strong), transparent 70%);
  top: -100px;
  left: 10%;
}
.glow-two {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--blue), transparent 70%);
  top: 15%;
  right: -50px;
}
.glow-three {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--emerald), transparent 70%);
  bottom: 5%;
  left: 30%;
  opacity: 0.15;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-small);
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo svg {
  width: 34px;
  height: 34px;
  display: block;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-copy strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-copy span {
  font-size: 12px;
  color: var(--text-secondary);
}
.version-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--pink-soft);
  color: var(--pink);
  border-radius: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.github-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-small);
  transition: all 0.2s var(--ease);
}
.github-link:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}
.github-link:active {
  transform: scale(0.96);
}
.github-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.icon-control {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.25s var(--ease-spring);
}
.icon-control:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: scale(1.06);
}
.icon-control:active {
  transform: scale(0.92);
}
.icon-control.theme-spin {
  animation: themeSpin 0.4s var(--ease-spring);
}
@keyframes themeSpin {
  0% { transform: rotate(0deg) scale(0.85); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}
.icon-control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.2s var(--ease);
}
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }

.lang-switch {
  display: flex;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
}
.lang-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.lang-btn:hover:not([aria-pressed="true"]) {
  color: var(--text);
}
.lang-btn:active {
  transform: scale(0.94);
}
.lang-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--pink), var(--blue));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 36px 40px;
  background: var(--surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--line);
  border-radius: var(--radius-hero);
  box-shadow: var(--shadow-panel);
  margin-bottom: 28px;
}
.hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pink);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.hero-copy h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 30%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.hero-badge:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-small);
}
.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: relative;
}
.hero-badge-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.5;
  animation: dotGlow 2.8s ease-in-out infinite;
}
@keyframes dotGlow {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.6); opacity: 0; }
}
.hero-badge-dot.pink { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.hero-badge-dot.blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.hero-badge-dot.green { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

/* Document stack illustration */
.doc-stack {
  position: relative;
  width: 220px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
}
.doc-paper {
  position: absolute;
  width: 88px;
  height: 114px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-small);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s var(--ease);
  will-change: transform;
}
.doc-paper b {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 4px;
  text-align: center;
  display: inline-block;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.doc-paper i {
  display: block;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
}
.doc-paper-back {
  background: var(--surface-muted);
  animation: docFloatBack 5.5s ease-in-out infinite;
}
.doc-paper-back b { background: var(--pink-soft); color: var(--pink); }

.doc-paper-mid {
  animation: docFloatMid 4.8s ease-in-out infinite 0.4s;
}
.doc-paper-mid b { background: var(--cyan-soft); color: var(--blue); }

.doc-paper-front {
  box-shadow: var(--shadow-panel);
  border-color: var(--blue);
  animation: docFloatFront 5.2s ease-in-out infinite 0.8s;
}
.doc-paper-front b {
  background: linear-gradient(135deg, var(--blue), #42bff5);
  color: #fff;
}

@keyframes docFloatBack {
  0%, 100% { transform: rotate(-12deg) translate(-50px, -6px); }
  50% { transform: rotate(-14deg) translate(-52px, -11px); }
}
@keyframes docFloatMid {
  0%, 100% { transform: rotate(-4deg) translate(-25px, 2px); }
  50% { transform: rotate(-2deg) translate(-24px, -4px); }
}
@keyframes docFloatFront {
  0%, 100% { transform: rotate(6deg) translate(35px, -2px); }
  50% { transform: rotate(8deg) translate(37px, -8px); }
}

.doc-stack:hover .doc-paper-back {
  animation-play-state: paused;
  transform: rotate(-18deg) translate(-62px, -12px);
}
.doc-stack:hover .doc-paper-mid {
  animation-play-state: paused;
  transform: rotate(-6deg) translate(-28px, 0px);
}
.doc-stack:hover .doc-paper-front {
  animation-play-state: paused;
  transform: rotate(11deg) translate(46px, -8px) scale(1.05);
  box-shadow: var(--shadow-float);
}

.doc-merge-arrow {
  position: absolute;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-tertiary);
  transform: translate(2px, -2px);
  animation: arrowPulse 2.8s ease-in-out infinite;
}
@keyframes arrowPulse {
  0%, 100% { transform: translate(2px, -2px); opacity: 0.6; }
  50% { transform: translate(6px, -2px); opacity: 1; color: var(--blue); }
}

/* Workflow step tracker */
.workflow-steps {
  display: flex;
  list-style: none;
  gap: 12px;
  margin-bottom: 28px;
}
.workflow-steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.25s var(--ease);
}
.workflow-steps li span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.25s var(--ease-spring), background 0.25s var(--ease);
}
.workflow-steps li[aria-current="step"] {
  border-color: var(--blue);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 0 0 2px var(--blue-soft);
  transform: translateY(-1px);
}
.workflow-steps li[aria-current="step"] span {
  background: var(--blue);
  color: #fff;
  transform: scale(1.1);
}

/* Dropzone */
.dropzone {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-card);
  padding: 44px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  margin-bottom: 32px;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--blue);
  background: var(--surface-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-panel), 0 0 0 4px var(--blue-soft);
}
.dropzone.drag-active {
  border-style: solid;
  border-color: var(--pink-strong);
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--shadow-float), 0 0 0 5px var(--pink-soft);
  animation: dropPulse 1.8s infinite;
}
@keyframes dropPulse {
  0% { box-shadow: var(--shadow-float), 0 0 0 0 rgba(255, 79, 126, 0.45); }
  70% { box-shadow: var(--shadow-float), 0 0 0 14px rgba(255, 79, 126, 0); }
  100% { box-shadow: var(--shadow-float), 0 0 0 0 rgba(255, 79, 126, 0); }
}

.dropzone-visual {
  margin-bottom: 16px;
}
.drop-icon-box {
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--pink-soft), var(--blue-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s var(--ease-spring), background 0.3s var(--ease);
  animation: iconFloat 4s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.drop-icon-box svg {
  width: 32px;
  height: 32px;
  stroke: var(--blue);
  fill: none;
  stroke-width: 2;
  transition: transform 0.25s var(--ease-spring), stroke 0.25s var(--ease);
}
.dropzone:hover .drop-icon-box {
  transform: translateY(-5px) scale(1.08);
  background: linear-gradient(135deg, var(--pink-soft), var(--cyan-soft));
}
.dropzone:hover .drop-icon-box svg {
  stroke: var(--blue-hover);
  transform: translateY(-2px);
}
.dropzone.drag-active .drop-icon-box {
  transform: scale(1.15);
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
}
.dropzone.drag-active .drop-icon-box svg {
  stroke: #fff;
  transform: translateY(-3px);
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dropzone h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.drop-hint {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-small);
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
}
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.drop-action {
  background: var(--blue);
  color: #fff;
  padding: 12px 28px;
  font-size: 15px;
  border-radius: var(--radius-control);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3);
  margin-bottom: 16px;
}
.drop-action:hover {
  background: var(--blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 113, 227, 0.42);
}
.drop-action:active {
  transform: scale(0.97) translateY(0);
}

.format-row {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.local-promise {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 4px 12px;
  border-radius: 12px;
  transition: transform 0.2s var(--ease);
}
.local-promise:hover {
  transform: translateY(-1px);
}
.local-promise svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Workspace Grid: Options (Left) + Queue (Right) */
.workspace-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-panel);
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-heading h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.muted {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Preset chips */
.preset-section {
  margin-bottom: 22px;
}
.preset-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.preset-btn {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s var(--ease-spring), background 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
  position: relative;
}
.preset-btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.preset-btn:active {
  transform: scale(0.98);
}
.preset-btn.active {
  background: var(--surface-solid);
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft), var(--shadow-small);
  transform: translateY(-1px);
}
.preset-btn strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  transition: color 0.2s var(--ease);
}
.preset-btn.active strong {
  color: var(--blue);
}
.preset-btn span {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.25;
}

/* Form controls */
.field-group {
  margin-bottom: 18px;
}
.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field-select, .field-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.field-select:focus, .field-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.field-help {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  user-select: none;
  transition: color 0.15s var(--ease);
}
.checkbox-label:hover {
  color: var(--blue);
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}
.checkbox-label input[type="checkbox"]:active {
  transform: scale(0.9);
}

/* Queue Panel (Right) */
.queue-panel {
  display: flex;
  flex-direction: column;
}
.queue-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-subtle {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-subtle:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}
.btn-subtle:active {
  transform: scale(0.95);
}

.queue-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-small);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  transition: background 0.2s var(--ease);
}

.queue-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 240px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Queue items */
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-small);
  transition: transform 0.22s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}
.queue-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-panel);
}
.queue-item.item-animate-in {
  animation: queueItemIn 0.28s var(--ease-spring) both;
  animation-delay: var(--item-delay, 0ms);
}
@keyframes queueItemIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.queue-item.removing {
  animation: queueItemOut 0.2s var(--ease) forwards;
  pointer-events: none;
}
@keyframes queueItemOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-height: 80px;
    margin-bottom: 8px;
  }
  100% {
    opacity: 0;
    transform: translateX(25px) scale(0.94);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-width: 0;
  }
}

.queue-item.is-processing {
  border-color: var(--blue);
  background: var(--surface-strong);
  box-shadow: 0 0 0 2px var(--blue-soft), var(--shadow-small);
}
.queue-item.is-processing::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pink), var(--blue));
  border-radius: 8px 0 0 8px;
  animation: processingPulse 1.2s ease-in-out infinite alternate;
}
@keyframes processingPulse {
  0% { opacity: 0.6; filter: brightness(1); }
  100% { opacity: 1; filter: brightness(1.25); }
}

.queue-item.is-done {
  border-color: rgba(16, 185, 129, 0.45);
}
.queue-item.is-done::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--emerald);
  border-radius: 8px 0 0 8px;
}

.queue-item.sortable-ghost {
  opacity: 0.4;
  background: var(--surface-muted);
  border-style: dashed;
}

.drag-handle {
  color: var(--text-tertiary);
  cursor: grab;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s var(--ease), transform 0.15s var(--ease-spring);
}
.drag-handle:hover {
  color: var(--text);
  transform: scale(1.15);
}
.drag-handle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.drag-handle:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.kind-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: transform 0.2s var(--ease);
}
.queue-item:hover .kind-badge {
  transform: scale(1.04);
}
.kind-badge.pink { background: var(--pink-soft); color: var(--pink); }
.kind-badge.blue { background: var(--blue-soft); color: var(--blue); }
.kind-badge.emerald { background: var(--emerald-soft); color: var(--emerald); }
.kind-badge.muted { background: var(--surface-muted); color: var(--text-secondary); }

.item-info {
  flex: 1;
  min-width: 0;
}
.item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.item-remove {
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.2s var(--ease);
}
.item-remove:hover {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.12);
  transform: scale(1.12) rotate(6deg);
}
.item-remove:active {
  transform: scale(0.92);
}
.item-remove svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Empty queue */
.empty-queue {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-tertiary);
}
.empty-queue svg {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  opacity: 0.6;
  animation: emptyFloat 3.8s ease-in-out infinite;
}
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.empty-queue strong {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.empty-queue p {
  font-size: 13px;
}

/* Sticky Export Action Bar */
.export-bar {
  background: var(--surface-strong);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-panel);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.export-info strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}
.export-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-convert {
  background: linear-gradient(135deg, var(--pink-strong), var(--blue));
  color: #fff;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-control);
  box-shadow: 0 4px 18px rgba(251, 114, 153, 0.35);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s var(--ease), filter 0.22s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-convert::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s var(--ease);
}
.btn-convert:hover:not(:disabled)::after {
  left: 140%;
}
.btn-convert:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(251, 114, 153, 0.48);
}
.btn-convert:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: 0 3px 12px rgba(251, 114, 153, 0.3);
}
.btn-convert:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-convert.is-busy {
  animation: convertBusyPulse 1.4s ease-in-out infinite alternate;
}
@keyframes convertBusyPulse {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.18); box-shadow: 0 6px 30px rgba(0, 113, 227, 0.5); }
}
.btn-convert.is-success {
  background: linear-gradient(135deg, var(--emerald), #059669);
  box-shadow: 0 4px 22px rgba(16, 185, 129, 0.45);
  animation: convertSuccess 0.5s var(--ease-spring);
}
@keyframes convertSuccess {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Progress bar */
.progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--surface-muted);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--blue), var(--cyan));
  background-size: 200% 100%;
  transition: width 0.25s var(--ease);
  animation: progressShimmer 2s linear infinite;
}
@keyframes progressShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Trust Cards Grid */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}
@media (max-width: 800px) {
  .trust-grid {
    grid-template-columns: 1fr;
  }
}
.trust-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.trust-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-panel);
}
.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  transition: transform 0.25s var(--ease-spring), background 0.25s var(--ease);
}
.trust-card:hover .trust-icon {
  transform: scale(1.1) rotate(-4deg);
  background: var(--blue-soft);
}
.trust-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--blue);
  fill: none;
  stroke-width: 2;
}
.trust-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.trust-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Tips Accordion */
.tips-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-bottom: 40px;
}
.tips-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.tips-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .tips-list {
    grid-template-columns: 1fr;
  }
}
.tips-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  padding-left: 20px;
}
.tips-list li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--pink);
  font-weight: 800;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
.footer a:hover {
  color: var(--blue);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--surface-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-float);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s var(--ease), transform 0.28s var(--ease-spring);
}
.toast.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast.toast-error {
  border-color: var(--danger);
  color: var(--danger);
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .doc-paper,
  .drop-icon-box,
  .empty-queue svg,
  .hero-badge-dot::after {
    animation: none !important;
  }
}
