#app-content[data-theme=dark] {
  --chestnut: #818cf8;
  --chestnut-dark: #6366f1;
  --accent: #22d3ee;
  --success: #34d399;
  --snow: #1e293b;
  --snow-dark: #0f172a;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-500: #94a3b8;
  --dark: #f1f5f9;
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 25px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
}

#app-content[data-theme=light] {
  --chestnut: #4361ee;
  --chestnut-dark: #3a0ca3;
  --accent: #4cc9f0;
  --success: #06d6a0;
  --snow: #fff;
  --snow-dark: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --dark: #1e293b;
  --bg-body: #f8faff;
  --bg-card: #fff;
  --bg-card-hover: #f1f5f9;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow: 0 4px 24px rgba(67,97,238,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 25px rgba(67,97,238,0.1);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.08);
}

:root {
  --chestnut: #4361ee;
  --chestnut-dark: #3a0ca3;
  --accent: #4cc9f0;
  --success: #06d6a0;
  --snow: #fff;
  --snow-dark: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --dark: #1e293b;
  --grad-primary: linear-gradient(135deg, #4361ee, #3a0ca3);
  --grad-accent: linear-gradient(135deg, #4cc9f0, #06d6a0);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 25px rgba(67,97,238,0.1);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.08);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all .25s ease;
}

#app-content {
  background: linear-gradient(160deg, #f8faff 0%, #f0f4ff 40%, #f5f0ff 100%);
  min-height: 100vh;
  color: var(--dark);
}

#app-content[data-theme=dark] {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
}

#floatThemeToggle {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--snow);
  color: var(--dark);
  border: 2px solid var(--gray-200);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}
#floatThemeToggle:hover {
  background: var(--chestnut);
  color: #fff;
  border-color: var(--chestnut);
}

#backToTop {
  position: fixed;
  bottom: 30px;
  right: 20px;
  z-index: 998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--snow);
  color: var(--dark);
  border: 2px solid var(--gray-200);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
}
#backToTop.show {
  opacity: 1;
  pointer-events: auto;
}
#backToTop:hover {
  background: var(--chestnut);
  color: #fff;
  border-color: var(--chestnut);
}

.hero-section {
  background: var(--grad-primary);
  padding: 120px 0 80px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23fff" fill-opacity="0.06" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L0,320Z"/></svg>') no-repeat bottom/cover;
}
.hero-section::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--snow-dark);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 900;
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 1.1rem;
  opacity: 0.92;
  max-width: 620px;
  line-height: 1.8;
  margin-bottom: 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 0.3rem 1rem;
  font-weight: 500;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tool-section {
  margin-top: -30px;
  position: relative;
  z-index: 10;
  padding-bottom: 2rem;
}

.tool-card {
  background: var(--snow);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.upload-zone {
  border: 2.5px dashed var(--gray-200);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(67, 97, 238, 0.03);
  cursor: pointer;
  transition: var(--transition);
}
.upload-zone:hover {
  border-color: var(--chestnut);
  background: rgba(67, 97, 238, 0.07);
}
.upload-zone.dragover {
  border-color: var(--chestnut);
  background: rgba(67, 97, 238, 0.1);
}

.step-indicator {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0 2rem;
  position: relative;
}
.step-indicator::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 15%;
  right: 15%;
  height: 3px;
  background: var(--gray-200);
  z-index: 1;
}

.step {
  text-align: center;
  z-index: 2;
  flex: 1;
}
.step .step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-weight: 700;
  font-size: 1rem;
  border: 3px solid var(--snow);
  transition: var(--transition);
}
.step.active .step-number {
  background: var(--chestnut);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.2);
  transform: scale(1.1);
}
.step.active .step-label {
  color: var(--chestnut);
}
.step.done .step-number {
  background: var(--success);
  color: #fff;
}
.step.done .step-label {
  color: var(--success);
}

.step-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
}

.content-card {
  background: var(--snow);
  border-radius: var(--radius-md);
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.content-card h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.content-card p {
  color: var(--gray-500);
  margin-bottom: 14px;
  line-height: 1.8;
}

.load-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.load-mask.active {
  opacity: 1;
  pointer-events: auto;
}

.load-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #fff;
  border-top-color: var(--chestnut);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.load-txt {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 16px;
}

.load-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-top: 6px;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 99999;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s ease;
}
.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast.ok {
  background: var(--success);
}
.toast.err {
  background: #ef4444;
}
.toast.inf {
  background: var(--chestnut);
}

.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 20px;
  margin: 16px 0;
  background: rgba(67, 97, 238, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(67, 97, 238, 0.1);
}
.trust-bar .trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--gray-500);
}
.trust-bar .trust-item i {
  color: var(--chestnut);
}

.upload-icon-circle {
  width: 64px;
  height: 64px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(67, 97, 238, 0.25);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.upload-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.upload-sub {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-bottom: 14px;
}

.browse-btn {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.25);
}
.browse-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.35);
}

.file-input-wrap {
  text-align: center;
}

.file-info-alert {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.06), rgba(114, 9, 183, 0.06));
  border: 1px solid rgba(67, 97, 238, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 12px;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-item {
  padding: 4px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.page-item.sel {
  background: var(--chestnut);
  color: #fff;
  border-color: var(--chestnut);
}
.page-item input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.thumbnails-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.thumb-item {
  width: 60px;
  height: 80px;
  border: 2px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--snow);
  font-size: 0.7rem;
  color: var(--gray-500);
}
.thumb-item.active {
  border-color: var(--chestnut);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}
.thumb-item.sel {
  border-color: var(--success);
}
.thumb-item input {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
}

.thumb-idx {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.thumb-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.set-select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--snow);
  color: var(--dark);
  transition: var(--transition);
  cursor: pointer;
}
.set-select:focus {
  outline: none;
  border-color: var(--chestnut);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.faq-question {
  width: 100%;
  padding: 14px 18px;
  background: var(--snow);
  border: none;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--dark);
}

.faq-answer {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.faq-item.open .faq-answer {
  max-height: 300px;
}
.faq-item.open .faq-toggle i {
  transform: rotate(180deg);
}

.related-tools {
  margin-top: 2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--snow);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  text-decoration: none;
  color: var(--dark);
  transition: var(--transition);
}
.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.case-card {
  background: rgba(67, 97, 238, 0.03);
  border: 1px solid rgba(67, 97, 238, 0.1);
  border-radius: 15px;
  padding: 1.5rem;
  transition: var(--transition);
}
.case-card:hover {
  transform: translateY(-4px);
  border-color: var(--chestnut);
}
.case-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.case-number {
  background: var(--chestnut);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.case-detail {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 4px;
  line-height: 1.5;
}
.case-detail strong {
  color: var(--chestnut);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.why-card {
  background: var(--snow-dark);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.why-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transition: var(--transition);
  transform-origin: left;
}
.why-card:hover {
  background: var(--snow);
  box-shadow: var(--shadow-lg);
  border-color: rgba(67, 97, 238, 0.1);
  transform: translateY(-4px);
}
.why-card:hover::before {
  transform: scaleX(1);
}
.why-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.why-card p {
  color: var(--gray-500);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.why-icon {
  width: 52px;
  height: 52px;
  background: var(--grad-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 1rem;
}

.info-callout {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.06), rgba(114, 9, 183, 0.06));
  border-left: 4px solid var(--chestnut);
  border-radius: 0 8px 8px 0;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.info-callout h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.warn-callout {
  background: rgba(245, 158, 11, 0.06);
  border-left: 4px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.warn-callout h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #92400e;
}

.article-wrap {
  max-width: 820px;
  margin: 0 auto;
}
.article-wrap h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 2rem 0 1rem;
}
.article-wrap h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.8rem;
}
.article-wrap p {
  color: var(--gray-500);
  font-size: 1.02rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}
.article-wrap ul, .article-wrap ol {
  color: var(--gray-500);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.article-wrap li {
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.7;
}
.article-wrap strong {
  color: var(--dark);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--grad-primary);
  border-radius: 2px;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--snow-dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--chestnut), var(--chestnut-dark));
  border-radius: 4px;
}

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

#app-content[data-theme=dark] .page-item {
  border-color: var(--gray-200);
}
#app-content[data-theme=dark] .page-item.sel {
  border-color: var(--chestnut);
}
#app-content[data-theme=dark] .thumb-item {
  border-color: var(--gray-200);
  background: var(--snow-dark);
}
#app-content[data-theme=dark] .why-card {
  background: rgba(51, 65, 85, 0.3);
  border-color: var(--gray-200);
}
#app-content[data-theme=dark] .why-card:hover {
  background: var(--snow);
  border-color: var(--chestnut);
}
#app-content[data-theme=dark] .why-card p {
  color: var(--gray-500);
}
#app-content[data-theme=dark] .case-card {
  background: rgba(67, 97, 238, 0.08);
  border-color: rgba(67, 97, 238, 0.2);
}
#app-content[data-theme=dark] .case-card:hover {
  border-color: var(--chestnut);
}
#app-content[data-theme=dark] .case-detail {
  color: var(--gray-500);
}
#app-content[data-theme=dark] .article-wrap {
  color: var(--gray-500);
}
#app-content[data-theme=dark] .article-wrap h2, #app-content[data-theme=dark] .article-wrap h3 {
  color: var(--dark);
}
#app-content[data-theme=dark] .article-wrap strong {
  color: var(--dark);
}
#app-content[data-theme=dark] .info-callout {
  background: rgba(67, 97, 238, 0.1);
}
#app-content[data-theme=dark] .warn-callout {
  background: rgba(245, 158, 11, 0.1);
}
#app-content[data-theme=dark] .trust-bar {
  background: rgba(67, 97, 238, 0.08);
  border-color: rgba(67, 97, 238, 0.15);
}
#app-content[data-theme=dark] .trust-item {
  color: var(--gray-500);
}
#app-content[data-theme=dark] .related-tools h2 {
  color: var(--dark);
}
#app-content[data-theme=dark] .set-select {
  background: var(--snow-dark);
  color: var(--dark);
  border-color: var(--gray-200);
}
#app-content[data-theme=dark] pre {
  background: var(--snow-dark) !important;
  color: var(--dark) !important;
}
#app-content[data-theme=dark] .file-info-alert {
  background: rgba(67, 97, 238, 0.1);
  border-color: rgba(67, 97, 238, 0.2);
}
