:root {
  --ink: #18212b;
  --muted: #5d6b7a;
  --line: rgba(24, 33, 43, 0.08);
  --paper: #ffffff;
  --page: #eef2f6;
  --accent: #0f766e;
  --accent-2: #0d9488;
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow: 0 18px 50px rgba(24, 33, 43, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Sora, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(15, 118, 110, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 0%, rgba(37, 99, 235, 0.08), transparent 50%),
    linear-gradient(180deg, #f4f7fb 0%, var(--page) 45%, #e8edf3 100%);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.topnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.topnav .sep {
  opacity: 0.45;
}

.topnav a:hover { color: var(--accent); }

.header {
  text-align: center;
  padding: 12px 8px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.header h1 {
  margin: 0;
  font-family: Sora, "Noto Sans SC", sans-serif;
  font-size: clamp(1.55rem, 3.2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header p {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 0.95rem;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(12px);
}

.dropzone {
  border: 2px dashed rgba(15, 118, 110, 0.28);
  border-radius: 16px;
  padding: 42px 20px;
  text-align: center;
  background: rgba(15, 118, 110, 0.03);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.07);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
}

.dropzone-icon svg {
  width: 30px;
  height: 30px;
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  background: rgba(15, 118, 110, 0.14);
}

.dropzone h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar[hidden] {
  display: none !important;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.level {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s;
}

.level:hover { border-color: rgba(15, 118, 110, 0.35); }
.level.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-secondary {
  background: #eef2f6;
  color: var(--ink);
}

.btn:not(:disabled):hover { transform: translateY(-1px); }

.summary {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.06);
  font-size: 0.88rem;
  color: var(--muted);
}

.summary.show { display: block; }
.summary strong { color: var(--accent); }

.file-count {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}

.file-count span {
  color: var(--accent);
}

.list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 180px) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  min-height: 48px;
}

.item .name {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.item .size-line {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.status-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.status-cell .status {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.status-cell .status.save,
.meta .save {
  color: var(--ok);
  font-weight: 600;
}

.status-cell .status.warn { color: #b45309; }
.status-cell .status.err { color: var(--danger); }
.status-cell .running-text { color: var(--accent); }

.item-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-shrink: 0;
}

.item-actions button,
.item-actions a {
  appearance: none;
  border: none;
  background: #eef2f6;
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.item-actions a.disabled,
.item-actions button:disabled {
  pointer-events: none;
  opacity: 0.4;
}

/* 不确定进度：滑动光带动画 */
.progress-indeterminate {
  position: relative;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  overflow: hidden;
  flex-shrink: 0;
}

.progress-indeterminate > i {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: progress-slide 1.1s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@media (max-width: 720px) {
  .item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name actions"
      "status actions";
    gap: 6px 10px;
  }
  .item .name { grid-area: name; }
  .item .size-line:not(.status-cell .size-line) {
    display: none;
  }
  .status-cell {
    grid-area: status;
    justify-content: flex-start;
  }
  .item-actions {
    grid-area: actions;
    align-self: center;
  }
}

.compare-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.compare-modal.show { display: flex; }

.compare-box {
  width: min(920px, 100%);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.compare-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.compare-head button {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
}

.compare-body {
  position: relative;
  height: min(60vh, 520px);
  background: #111;
  user-select: none;
  overflow: hidden;
}

.compare-body img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare-body .after {
  clip-path: inset(0 0 0 50%);
}

.compare-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  transform: translateX(-50%);
  cursor: ew-resize;
}

.compare-slider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.compare-labels {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer {
  text-align: center;
  margin-top: 28px;
  color: #9ca3af;
  font-size: 0.78rem;
}

.footer a:hover { color: var(--accent); text-decoration: underline; }

.empty-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 18px 0 4px;
}

/* SEO 内容区 */
.seo-content {
  margin-top: 36px;
}

.seo-block {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  box-shadow: var(--shadow-sm, 0 4px 14px rgba(24, 33, 43, 0.06));
  padding: 24px 22px;
  margin-bottom: 16px;
}

.seo-block h2 {
  margin: 0 0 16px;
  font-family: Sora, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.seo-block h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.seo-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature-card {
  padding: 14px 14px 16px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.04);
  border: 1px solid var(--line);
}

.steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
}

.steps li {
  margin-bottom: 12px;
  padding-left: 4px;
}

.steps li:last-child { margin-bottom: 0; }

.steps strong {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent);
}

.steps p { margin-top: 4px; }

.table-wrap {
  overflow-x: auto;
}

.seo-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.seo-block th,
.seo-block td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.seo-block th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(15, 118, 110, 0.04);
}

.seo-block td:first-child {
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent);
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 8px;
  background: #fff;
}

.faq-list details:last-child { margin-bottom: 0; }

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: '+';
  float: right;
  color: var(--accent);
  font-weight: 700;
}

.faq-list details[open] summary::after { content: '−'; }

.faq-list details p {
  padding: 0 0 14px;
  margin: 0;
}

.seo-more a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.seo-more a:hover { color: var(--accent-2); }

@media (max-width: 720px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .actions {
    width: 100%;
  }
  .actions .btn {
    flex: 1;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .seo-block {
    padding: 18px 16px;
  }
}
