/* 星际元AI — 主样式 */
:root {
  --bg-deep: #070a0f;
  --bg: #0d1117;
  --bg-elevated: #121822;
  --bg-hover: #1a2230;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e6edf3;
  --text-muted: #8b9cb3;
  --accent: #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.15);
  --accent-glow: rgba(88, 166, 255, 0.35);
  --success: #3fb950;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1200px 600px at 15% -10%, rgba(88, 166, 255, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(63, 185, 80, 0.06), transparent 50%),
    var(--bg-deep);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #000;
  border-radius: 6px;
}
.skip-link:focus {
  left: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.shell {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 15, 0.72);
  backdrop-filter: blur(16px);
  isolation: isolate;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
}

/* 白底由 brand-logo.js 转为透明 PNG；此处不再使用 multiply，避免标志发灰不可见 */
.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  max-width: 48px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.brand-text {
  font-size: 1.12rem;
  line-height: 1.2;
}

.site-nav .nav-list {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 1px;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    padding: 1rem 1.25rem 1.25rem;
    background: rgba(7, 10, 15, 0.96);
    border-bottom: 1px solid var(--border);
    transform-origin: top;
    transform: scaleY(0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
  }
  .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
  }
  .site-nav .nav-list {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Hero */
.hero {
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    order: -1;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  max-width: 36ch;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.35rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  color: #fff;
  box-shadow: 0 8px 32px rgba(88, 166, 255, 0.25);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
}

.hero-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card-header {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.hero-card-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #484f58;
}
.hero-card-header .dot:first-child {
  background: #ff7b72;
}
.hero-card-header .dot:nth-child(2) {
  background: #d29922;
}
.hero-card-header .dot:nth-child(3) {
  background: #3fb950;
}

.hero-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 1.25rem;
}

/* 首页 Hero：模拟风景图前后对比（纯 CSS 演示） */
.hero-demo {
  gap: 12px;
  align-items: stretch;
}

.hero-demo-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hero-demo-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-demo-frame {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0d1117;
}

.hero-demo-photo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 55% at 72% 22%, rgba(255, 214, 140, 0.45) 0%, transparent 52%),
    radial-gradient(circle at 18% 72%, rgba(40, 90, 55, 0.35) 0%, transparent 42%),
    linear-gradient(165deg, #1e2f4a 0%, #3d5a85 32%, #6b8f5e 58%, #2d3d28 100%);
  transform-origin: center;
}

.hero-demo-frame--before .hero-demo-photo {
  filter: grayscale(0.38) brightness(0.78) contrast(0.95);
}

.hero-demo-frame--after .hero-demo-photo {
  filter: saturate(1.35) brightness(1.1) contrast(1.06);
  animation: hero-demo-live 3.2s ease-in-out infinite alternate;
}

@keyframes hero-demo-live {
  0% {
    filter: saturate(1.2) brightness(1.02) contrast(1.02);
  }
  100% {
    filter: saturate(1.55) brightness(1.16) contrast(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-demo-frame--after .hero-demo-photo {
    animation: none;
  }
}

.hero-demo-frame--after::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.25);
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.06), transparent 55%);
}

.hero-card-caption {
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Sections */
.section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}
.section-head--tight {
  text-align: left;
  margin-left: 0;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-card {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.tool-card:hover {
  border-color: rgba(88, 166, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.tool-icon {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-family: var(--mono);
}

.tool-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.tool-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Workspace */
.workspace-section {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.5), transparent 120px);
}

.workspace-shell {
  width: min(1200px, 100% - 2rem);
}

.workspace-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .workspace-layout {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}

.tool-rail {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.rail-head {
  margin-bottom: 0.75rem;
}

.rail-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}

.rail-scroll-hint {
  display: none;
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
}

.segmented {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seg {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.seg:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.seg.active {
  color: var(--text);
  background: var(--accent-dim);
  border-color: rgba(88, 166, 255, 0.35);
}

/* 手机端：当前功能为横向滑动标签，避免超出屏幕；滑动区域限制在导航条内 */
@media (max-width: 720px) {
  .workspace-shell {
    min-width: 0;
    overflow-x: hidden;
  }

  .workspace-layout .tool-rail {
    position: relative;
    top: auto;
    padding: 0.65rem 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
  }

  .workspace-layout .rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    padding: 0 0.1rem;
    min-width: 0;
  }

  .workspace-layout .rail-scroll-hint {
    display: block;
    flex-shrink: 0;
  }

  .workspace-layout .rail-title {
    padding-left: 0;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    min-width: 0;
  }

  .workspace-layout .segmented {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 4px 12px;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
    box-sizing: border-box;
  }

  .workspace-layout .segmented::-webkit-scrollbar {
    height: 5px;
  }

  .workspace-layout .segmented::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
  }

  .workspace-layout .seg {
    flex: 0 0 auto;
    align-self: center;
    min-height: 40px;
    padding: 0.42rem 0.95rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    text-align: center;
    border-radius: 999px;
  }

  .workspace-layout .seg.active {
    border-color: rgba(88, 166, 255, 0.5);
    box-shadow: 0 1px 8px rgba(88, 166, 255, 0.12);
  }

  .workspace-main {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.workspace-main {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.input-block {
  max-width: none;
  width: 100%;
}

.workspace-main--lite #dropzone,
.workspace-main--lite .preview-row,
.workspace-main--lite .action-bar {
  display: none !important;
}

.text-convert-input,
.text-convert-output {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 6.5rem;
  padding: 0.75rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  box-sizing: border-box;
}

.text-convert-output {
  min-height: 7.5rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9rem;
}

.text-convert-output:focus {
  outline: none;
  border-color: rgba(88, 166, 255, 0.45);
}

.text-convert-action-row {
  margin-top: 0.65rem;
}

.text-ocr-group {
  margin-bottom: 0.25rem;
}

.text-ocr-zone {
  margin-top: 0.35rem;
}

.text-ocr-zone-hit {
  display: block;
  margin: 0;
  cursor: pointer;
}

.text-ocr-zone-hit:focus-visible {
  outline: 2px solid rgba(88, 166, 255, 0.55);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.text-ocr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 9rem;
  padding: 1.25rem 1rem;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(88, 166, 255, 0.03);
  transition: border-color 0.15s, background 0.15s;
}

.text-ocr-zone-hit:hover .text-ocr-placeholder,
.text-ocr-zone--drag .text-ocr-placeholder {
  border-color: rgba(88, 166, 255, 0.45);
  background: rgba(88, 166, 255, 0.06);
}

.text-ocr-placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
}

.text-ocr-placeholder-title {
  font-weight: 600;
  color: var(--text);
}

.text-ocr-placeholder-hint {
  max-width: 22rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.text-ocr-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.text-ocr-preview {
  display: block;
  width: 100%;
  max-height: min(42vh, 220px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.text-ocr-zone--has-image .text-ocr-placeholder {
  display: none;
}

.text-ocr-zone--has-image .text-ocr-preview {
  display: block !important;
}

.panel-hint kbd {
  display: inline-block;
  padding: 0.1em 0.4em;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85em;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.video-action-row {
  margin-top: 0.5rem;
}

.video-status {
  min-height: 1.25rem;
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.video-status.video-status--error {
  color: #ff7b72;
}

.video-title-line {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  word-break: break-all;
}

.video-preview-shell {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.video-preview-el {
  display: block;
  width: 100%;
  max-height: min(52vh, 420px);
  vertical-align: middle;
  background: #000;
}

.dropzone {
  display: block;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
  -webkit-tap-highlight-color: rgba(88, 166, 255, 0.2);
  touch-action: manipulation;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: rgba(88, 166, 255, 0.45);
  background: rgba(88, 166, 255, 0.04);
}

.dropzone-inner {
  display: block;
  pointer-events: none;
}

.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 300;
}

.dropzone-title {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.dropzone-hint {
  display: block;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 微信内「长按保存」导出预览层 */
.wechat-save-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.78);
  -webkit-overflow-scrolling: touch;
}

.wechat-save-sheet img {
  max-width: 100%;
  max-height: min(70vh, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.wechat-save-sheet .wechat-save-tip {
  margin: 1rem 0 0;
  max-width: 22rem;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
}

.wechat-save-sheet .btn-wechat-close {
  margin-top: 1rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
}

.video-inapp-hint {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: rgba(240, 180, 60, 0.08);
  border: 1px solid rgba(240, 180, 60, 0.28);
}

.workspace-inapp-hint {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  background: rgba(240, 180, 60, 0.08);
  border: 1px solid rgba(240, 180, 60, 0.28);
}

.preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .preview-row {
    grid-template-columns: 1fr;
  }
}

.preview-card {
  margin: 0;
  padding: 0;
}

.preview-card figcaption {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.preview-canvas {
  min-height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
}

.preview-canvas.preview-canvas--checker {
  background: repeating-conic-gradient(#343a46 0% 25%, #282d36 0% 50%) 50% / 14px 14px;
  border-color: rgba(255, 255, 255, 0.12);
}

.matte-pick-hint {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
}

.input-color {
  height: 2.5rem;
  width: 100%;
  max-width: 12rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
}

.preview-surface {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: calc(var(--radius-sm) - 2px);
}

.preview-crop-shell {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
  line-height: 0;
}

.preview-crop-shell .preview-surface {
  display: block;
}

.crop-shade-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
  border-radius: calc(var(--radius-sm) - 2px);
}

.crop-shade-canvas.is-interactive {
  pointer-events: auto;
  cursor: crosshair;
}

.watermark-ai-warn {
  color: #ff7b72;
  font-size: 0.9rem;
}

.preview-placeholder {
  padding: 1rem;
  text-align: center;
  pointer-events: none;
}

.preview-canvas:not(.placeholder) .preview-placeholder {
  display: none;
}

.panels {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.panel {
  display: none;
}
.panel.active {
  display: block;
}

.panel-title {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.panel-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.control-group {
  margin-bottom: 1rem;
}
.control-group:last-child {
  margin-bottom: 0;
}

.control-group label,
.slider-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
}

.slider-label .value {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.select,
.input {
  width: 100%;
  max-width: 320px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.row-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 420px;
}

.crop-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 560px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-sm {
  min-height: 38px;
  padding: 0 0.9rem;
  font-size: 0.85rem;
}

.ico-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 0.5rem;
}

.ico-grid .checkbox-row {
  margin-top: 0;
}

@media (max-width: 480px) {
  .row-inputs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .crop-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* FAQ */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:first-child {
  padding-top: 0;
}

.faq-item dt {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.faq-item dd {
  margin: 0;
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-inner {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner p + p {
  margin-top: 0.65rem;
}

.footer-beian a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-beian a:hover {
  color: var(--accent);
  text-decoration: underline;
}
