:root {
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-surface-hover: #edf0f6;
  --color-border: #e2e6ee;
  --color-accent: #0e4ca2;
  --color-accent-hover: #0b3d82;
  --color-accent-bg: rgba(14, 76, 162, 0.09);
  --color-text-primary: #1c2333;
  --color-text-secondary: #5a6478;
  --color-text-muted: #8b93a7;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* 仅供搜索引擎与屏幕阅读器使用的隐藏标题 */
.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;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ========== 顶部通栏 ========== */
.app-header {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}
.app-header-left, .app-header-right { display: flex; align-items: center; gap: 10px; }
.app-header-right { position: relative; }
.app-logo { display: flex; align-items: center; gap: 10px; }
.app-logo:hover .app-logo-text { color: var(--color-accent); }

/* 顶部导航菜单 */
.app-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface-hover);
  border: 1px solid transparent;
  border-radius: 18px;
  white-space: nowrap;
  transition: all .18s ease;
}
.nav-link:hover {
  color: var(--color-accent);
  background: var(--color-accent-bg);
  border-color: rgba(14, 76, 162, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(14, 76, 162, 0.18);
}
/* 给每个现有 nav-link 加 emoji 前缀（纯文字 → 小图标+文字） */
.app-nav .nav-link:nth-child(1)::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 2px;
  background: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M23%2019a2%202%200%200%201-2%202H3a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h4l2-3h6l2%203h4a2%202%200%200%201%202%202z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2213%22%20r%3D%224%22%2F%3E%3C%2Fsvg%3E') center/contain no-repeat;
  opacity: 0.75;
  vertical-align: middle;
}
.app-nav .nav-link:nth-child(1):hover::before { opacity: 1; }
.app-nav .nav-link:nth-child(2)::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 2px;
  background: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z%22%2F%3E%3Cpolyline%20points%3D%2214%202%2014%208%2020%208%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%2213%22%20x2%3D%228%22%20y2%3D%2213%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%2217%22%20x2%3D%228%22%20y2%3D%2217%22%2F%3E%3Cpolyline%20points%3D%2210%209%209%209%208%209%22%2F%3E%3C%2Fsvg%3E') center/contain no-repeat;
  opacity: 0.75;
  vertical-align: middle;
}
.app-nav .nav-link:nth-child(2):hover::before { opacity: 1; }
.app-nav .nav-link:nth-child(3)::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 2px;
  background: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%2220%22%20height%3D%2220%22%20rx%3D%222.18%22%20ry%3D%222.18%22%2F%3E%3Cline%20x1%3D%227%22%20y1%3D%222%22%20x2%3D%227%22%20y2%3D%2222%22%2F%3E%3Cline%20x1%3D%2217%22%20y1%3D%222%22%20x2%3D%2217%22%20y2%3D%2222%22%2F%3E%3Cline%20x1%3D%222%22%20y1%3D%2212%22%20x2%3D%2222%22%20y2%3D%2212%22%2F%3E%3Cline%20x1%3D%222%22%20y1%3D%227%22%20x2%3D%227%22%20y2%3D%227%22%2F%3E%3Cline%20x1%3D%222%22%20y1%3D%2217%22%20x2%3D%227%22%20y2%3D%2217%22%2F%3E%3Cline%20x1%3D%2217%22%20y1%3D%2217%22%20x2%3D%2222%22%20y2%3D%2217%22%2F%3E%3Cline%20x1%3D%2217%22%20y1%3D%227%22%20x2%3D%2222%22%20y2%3D%227%22%2F%3E%3C%2Fsvg%3E') center/contain no-repeat;
  opacity: 0.75;
  vertical-align: middle;
}
.app-nav .nav-link:nth-child(3):hover::before { opacity: 1; }
.app-nav .nav-link:nth-child(4)::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 2px;
  background: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14.7%206.3a1%201%200%200%200%200%201.4l1.6%201.6a1%201%200%200%200%201.4%200l3.77-3.77a6%206%200%200%201-7.94%207.94l-6.91%206.91a2.12%202.12%200%200%201-3-3l6.91-6.91a6%206%200%200%201%207.94-7.94l-3.76%203.76z%22%2F%3E%3C%2Fsvg%3E') center/contain no-repeat;
  opacity: 0.75;
  vertical-align: middle;
}
.app-nav .nav-link:nth-child(4):hover::before { opacity: 1; }
.app-nav .nav-link:nth-child(5)::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 2px;
  background: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cline%20x1%3D%222%22%20y1%3D%2212%22%20x2%3D%2222%22%20y2%3D%2212%22%2F%3E%3Cpath%20d%3D%22M12%202a15.3%2015.3%200%200%201%204%2010%2015.3%2015.3%200%200%201-4%2010%2015.3%2015.3%200%200%201-4-10%2015.3%2015.3%200%200%201%204-10z%22%2F%3E%3C%2Fsvg%3E') center/contain no-repeat;
  opacity: 0.75;
  vertical-align: middle;
}
.app-nav .nav-link:nth-child(5):hover::before { opacity: 1; }
.app-nav .nav-link:nth-child(6)::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 2px;
  background: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2015v4a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-4%22%2F%3E%3Cpolyline%20points%3D%227%2010%2012%2015%2017%2010%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%2215%22%20x2%3D%2212%22%20y2%3D%223%22%2F%3E%3C%2Fsvg%3E') center/contain no-repeat;
  opacity: 0.75;
  vertical-align: middle;
}
.app-nav .nav-link:nth-child(6):hover::before { opacity: 1; }
.nav-toggle {
  display: none;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-secondary);
  transition: color .15s, border-color .15s;
}
.nav-toggle:hover { color: var(--color-accent); border-color: var(--color-accent); }
.app-logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--color-surface-hover);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.app-logo-icon img { width: 100%; height: 100%; object-fit: contain; }
.app-logo-text { font-size: 15px; font-weight: 600; }
.app-logo-sub {
  font-size: 11px; color: var(--color-text-muted);
  margin-left: 4px;
}
.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
}
.status-pill.ok { color: var(--color-success); }
.status-pill.err { color: var(--color-danger); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-text-muted);
}
.status-pill.ok .status-dot { background: var(--color-success); box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
.status-pill.err .status-dot { background: var(--color-danger); }
.feedback-link {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.feedback-link:hover { border-color: var(--color-accent); background: var(--color-surface-hover); }
.header-link {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary);
  transition: background .15s, color .15s;
}
.header-link:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }

/* ========== 主体布局 ========== */
.app-main {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}
.panel-left {
  flex: 0 0 30%;
  max-width: 420px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.panel-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-right {
  flex: 0 0 22%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 统一 panel 卡片样式 */
.panel-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-primary);
  flex-shrink: 0;
  gap: 10px;
}
.panel-card-title {
  font-size: 13px;
  font-weight: 600;
}
.panel-card-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* ========== 统计条 ========== */
.stats-bar {
  display: flex;
  align-items: stretch;
  padding: 14px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 3px;
  min-width: 0;
}
.stat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.stat-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--color-accent), #1e6fd9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.stat-divider {
  width: 1px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* ========== 卡片 ========== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card-grow { flex: 1; min-height: 0; }
.card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 8px;
}
.card-icon {
  width: 18px; height: 18px;
  color: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
}
.card-title {
  font-size: 13px; font-weight: 600; margin: 0;
}
.card-badge {
  margin-left: auto;
  font-size: 11px; color: var(--color-text-muted);
  padding: 2px 8px; border-radius: 999px;
  background: var(--color-surface-hover);
}
.card-badge.has { color: var(--color-accent); background: var(--color-accent-bg); }
.card-body { padding: 0 14px 14px; min-height: 0; }
.card-grow .card-body { flex: 1; overflow-y: auto; }

/* ========== 上传区 ========== */
.dropzone {
  min-height: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 40px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-bg);
}
.dropzone-icon { color: var(--color-text-muted); margin-bottom: 6px; }
.dropzone-primary { margin: 0; font-size: 12px; font-weight: 500; color: var(--color-text-secondary); }
.dropzone-secondary { margin: 2px 0 0; font-size: 11px; color: var(--color-text-muted); }

.file-list {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: border-color .15s;
}
.file-ext {
  flex-shrink: 0;
  width: 42px;
  text-align: center;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--color-accent);
  background: var(--color-accent-bg);
  border: 1px solid rgba(14, 76, 162, 0.25);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.file-item.selected { border-color: var(--color-accent); background: var(--color-accent-bg); }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-weight: 500; }
.file-size { color: var(--color-text-muted); font-size: 11px; flex-shrink: 0; }
.file-remove {
  width: 20px; height: 20px; border: none; background: transparent;
  color: var(--color-text-muted); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-remove:hover { background: var(--color-surface-hover); color: var(--color-danger); }

/* ========== 转换目标 ========== */
.search-box { position: relative; margin-bottom: 12px; }
.search-box svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); }
.search-box input {
  width: 100%; height: 32px;
  padding: 0 10px 0 28px;
  font-size: 12px;
  background: var(--color-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s;
}
.search-box input:focus { border-color: var(--color-accent); }

.converter-summary {
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 2px 2px 10px;
  line-height: 1.5;
}
.converter-summary b { color: var(--color-accent); font-weight: 600; }

.converter-list { display: flex; flex-direction: column; gap: 10px; }
.muted-center { text-align: center; color: var(--color-text-muted); font-size: 12px; padding: 20px 0; }
.converter-group-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.converter-group-name { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); }
.converter-group-count { font-size: 10px; color: var(--color-text-muted); }
.converter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.converter-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.converter-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px;
  background: var(--color-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: all .15s;
  min-width: 0;
}
.converter-btn:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }
.converter-btn.active {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.converter-btn .ext { font-size: 11px; font-weight: 600; text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.converter-btn .via { font-size: 9px; color: var(--color-text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.converter-more {
  margin-top: 10px;
  width: 100%;
  padding: 7px 0;
  background: transparent;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 11px;
  transition: color .15s, border-color .15s;
}
.converter-more:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* 两步转换路径建议 */
.suggestion-box {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: var(--color-accent-bg);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
}
.suggestion-title {
  font-size: 12px; font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 8px;
}
.suggestion-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: 11px;
}
.suggestion-item + .suggestion-item { border-top: 1px dashed var(--color-border); }
.sug-ext {
  display: inline-block;
  min-width: 42px;
  padding: 1px 6px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
}
.sug-path { color: var(--color-text-secondary); flex: 1; }
.sug-path b { color: var(--color-text-primary); }
.sug-btn {
  padding: 3px 8px;
  background: var(--color-surface);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.sug-btn:hover { background: var(--color-accent); color: #fff; }

/* ========== 转换按钮 ========== */
.convert-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  border: none; border-radius: var(--radius);
  background: var(--color-accent);
  color: #fff; font-size: 14px; font-weight: 600;
  transition: background .15s, transform .05s;
}
.convert-btn:hover:not(:disabled) { background: var(--color-accent-hover); }
.convert-btn:active:not(:disabled) { transform: scale(0.99); }
.convert-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ========== 预览 / 结果 ========== */
.tabs-history {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tabs-history:hover { background: var(--color-surface-hover); color: var(--color-accent); }

/* panel-card-body 内的预览/结果容器 */
.panel-card-body #previewEmpty,
.panel-card-body #previewStage,
.panel-card-body .result-empty,
.panel-card-body .result-body {
  padding: 16px;
}

/* 预览工具栏（结果预览时显示） */
.preview-bar:not([hidden]) {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.preview-bar-label {
  flex: 1; min-width: 0;
  font-size: 12px; color: var(--color-text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preview-bar-back {
  flex-shrink: 0;
  padding: 3px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 12px;
}
.preview-bar-back:hover { color: var(--color-accent); border-color: var(--color-accent); }

.preview-empty:not([hidden]), .result-empty:not([hidden]) {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 12px;
  color: var(--color-text-muted);
}
.preview-empty:not([hidden]) { overflow-y: auto; }
.preview-empty svg, .result-empty svg { opacity: 0.5; }

/* 预览空状态：使用流程 + 可转换格式说明 */
.usage-flow {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap;
  gap: 6px 6px;
  margin-top: 2px;
}
.flow-step {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--color-surface-hover);
  border-radius: 999px;
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.flow-num {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 11px; font-weight: 600;
}
.flow-arrow { color: var(--color-text-muted); font-size: 12px; }
.guide-tagline {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, var(--color-accent), #1565c0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.preview-guide {
  width: min(540px, 100%);
  margin-top: 6px;
  display: flex; flex-direction: column; gap: 8px;
}
.guide-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: left;
}
.guide-icon {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  border-radius: 7px;
}
.guide-icon svg { opacity: 1; }
.guide-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.guide-title { font-size: 12px; font-weight: 600; color: var(--color-text-primary); }
.guide-desc { font-size: 12px; line-height: 1.62; color: var(--color-text-secondary); }

.preview-stage:not([hidden]) {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
#pane-preview .preview-empty:not([hidden]),
#pane-preview .preview-stage:not([hidden]) { flex: 1; height: auto; min-height: 0; }
.preview-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 12px;
  z-index: 2;
}
.preview-stage img, .preview-stage video {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.preview-stage iframe {
  width: 100%; height: 100%; border: none; background: #fff;
}
.preview-stage pre {
  width: 100%; height: 100%; margin: 0;
  padding: 12px; overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; color: var(--color-text-secondary);
  white-space: pre-wrap; word-break: break-all;
}

/* ========== 结果区 ========== */
.result-body:not([hidden]) { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.result-progress {
  display: flex; align-items: center; gap: 12px;
}
.result-progress progress {
  flex: 1; height: 8px;
  appearance: none;
  border: none; border-radius: 999px;
  background: var(--color-surface-hover);
  overflow: hidden;
}
.result-progress progress::-webkit-progress-bar { background: var(--color-surface-hover); border-radius: 999px; }
.result-progress progress::-webkit-progress-value { background: var(--color-accent); border-radius: 999px; transition: width .2s; }
.result-progress progress::-moz-progress-bar { background: var(--color-accent); }
.result-progress-text { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }

.result-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.result-item .icon { width: 18px; height: 18px; color: var(--color-accent); flex-shrink: 0; }
.result-item .name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item .status { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--color-surface-hover); color: var(--color-text-muted); flex-shrink: 0; }
.result-item .status.done { color: var(--color-success); background: rgba(22,163,74,0.10); }
.result-item .status.fail { color: var(--color-danger); background: rgba(220,38,38,0.08); }
.result-item .download-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--color-accent); color: #fff;
  border: none; border-radius: 6px;
  font-size: 12px;
}
.result-item .download-btn:hover { background: var(--color-accent-hover); }
.result-item .preview-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--color-surface);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 12px;
  flex-shrink: 0;
}
.result-item .preview-btn:hover { border-color: var(--color-accent); background: var(--color-accent-bg); }

.result-actions:not([hidden]) { display: flex; gap: 10px; margin-top: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-ghost { background: var(--color-surface-hover); color: var(--color-text-secondary); }
.btn-ghost:hover { color: var(--color-text-primary); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(16,24,40,0.12);
  font-size: 13px;
  z-index: 1000;
  animation: toastIn .2s ease;
}
.toast.err { border-color: var(--color-danger); color: var(--color-danger); }
.toast.ok { border-color: var(--color-success); color: var(--color-success); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 滚动条 */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ========== 文件项：增加目标格式显示 ========== */
.file-target {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.file-target:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-bg);
}
.file-target.set {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}
.file-target.empty {
  background: transparent;
  border-style: dashed;
  color: var(--color-text-muted);
}
.file-item.selected .file-target.set {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* ========== 响应式（平板 / 手机） ========== */
@media (max-width: 1200px) {
  .panel-left { flex: 0 0 28%; max-width: 380px; min-width: 280px; }
  .panel-right { flex: 0 0 24%; min-width: 240px; }
}

/* 平板：仍然三栏，但左栏去掉 max-width，更灵活 */
@media (max-width: 1024px) {
  .app-main { padding: 12px; gap: 10px; }
  .panel-left { flex: 0 0 30%; max-width: none; min-width: 240px; }
  .panel-right { flex: 0 0 24%; min-width: 220px; }
}

/* 窄屏：三栏改为上下堆叠，整页纵向滚动 */
@media (max-width: 860px) {
  .stats-bar { padding: 12px 10px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 10px; }
  .app { height: 100dvh; }
  .app-header { height: 52px; padding: 0 12px; }
  .app-logo-sub { display: none; }
  .app-header-left, .app-header-right { gap: 8px; }
  /* 窄屏：菜单收进汉堡下拉 */
  .nav-toggle { display: flex; }
  .app-nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 176px;
    padding: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
    z-index: 30;
  }
  .app-nav.open { display: flex; }
  .nav-link { padding: 9px 10px; font-size: 13px; }
  .app-nav .feedback-link { justify-content: center; margin-top: 4px; }
  .app-main {
    flex-direction: column;
    overflow: hidden auto;
    padding: 10px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .panel-left, .panel-center, .panel-right { width: 100%; flex: none; max-width: none; overflow: visible; }
  .panel-center { min-height: 40vh; }
  .panel-right { min-height: 30vh; }
  /* 目标格式列表在窄屏下固定高度并内部滚动，避免页面过长 */
  .card-grow { flex: none; }
  .card-grow .card-body { flex: none; height: 30vh; min-height: 140px; overflow-y: auto; }
  /* 上传区：移动端减少纵向占用 */
  .dropzone { padding: 16px 12px; min-height: 110px; }
  .dropzone-icon { width: 22px; height: 22px; }
  .dropzone-primary { font-size: 11px; }
  .dropzone-secondary { font-size: 10px; }
  /* 搜索框适配 */
  .search-box input { height: 28px; font-size: 11px; }
  /* 转换按钮网格：平板 3 列 */
  .converter-grid, .converter-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 文件列表 */
  .file-item { padding: 7px 9px; gap: 6px; font-size: 11px; }
  .file-ext { width: 36px; font-size: 10px; padding: 1px 3px; }
  .file-target { font-size: 10px; padding: 1px 6px; }
  .preview-guide { width: 100%; margin-top: 4px; }
  .preview-bar:not([hidden]) { padding: 6px 10px; }
  /* panel-card-body 内边距收紧 */
  .panel-card-body #previewEmpty,
  .panel-card-body #previewStage,
  .panel-card-body .result-empty,
  .panel-card-body .result-body { padding: 12px; }
}

/* 手机：进一步收紧间距与字号 */
@media (max-width: 480px) {
  .stats-bar { padding: 10px 6px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 10px; }
  .app-header { height: 50px; padding: 0 10px; }
  .app-logo { gap: 8px; }
  .app-logo-icon { width: 28px; height: 28px; }
  .app-logo-text { font-size: 14px; }
  .feedback-link { padding: 5px 10px; font-size: 11px; }
  .card-header { padding: 9px 10px 5px; }
  .card-body { padding: 0 10px 10px; }
  .card-title { font-size: 12px; }
  .card-badge { font-size: 10px; padding: 1px 6px; }
  /* 上传区 */
  .dropzone { padding: 12px 10px; min-height: 96px; }
  .dropzone-icon { width: 20px; height: 20px; margin-bottom: 4px; }
  .dropzone-primary { font-size: 11px; }
  .dropzone-secondary { font-size: 10px; }
  /* 文件列表 */
  .file-item { padding: 6px 8px; gap: 5px; font-size: 11px; }
  .file-ext { width: 32px; font-size: 9px; padding: 1px 2px; border-radius: 3px; }
  .file-size { font-size: 10px; }
  .file-target { font-size: 10px; padding: 1px 5px; }
  /* 转换目标 —— 手机改 2 列，按钮更清晰 */
  .card-grow .card-body { height: 28vh; min-height: 130px; }
  .converter-grid, .converter-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .converter-btn { padding: 7px 4px; border-radius: 6px; }
  .converter-btn .ext { font-size: 11px; }
  .converter-btn .via { font-size: 9px; }
  .converter-more { padding: 6px 0; font-size: 10px; margin-top: 8px; }
  /* 搜索框 */
  .search-box { margin-bottom: 10px; }
  .search-box input { height: 26px; font-size: 11px; padding: 0 8px 0 26px; }
  .search-box svg { left: 8px; }
  /* 转换按钮 */
  .convert-btn { height: 40px; font-size: 13px; }
  /* 结果区 */
  .result-item { padding: 8px 10px; gap: 8px; }
  .result-item .icon { width: 16px; height: 16px; }
  .result-item .name { font-size: 12px; }
  .result-item .download-btn, .result-item .preview-btn { padding: 3px 7px; font-size: 11px; }
  .preview-empty:not([hidden]) { gap: 8px; padding: 18px 12px 14px; }
  .usage-flow { gap: 4px; }
  .flow-step { padding: 3px 8px 3px 3px; font-size: 11px; }
  .flow-num { width: 18px; height: 18px; font-size: 10px; }
  .flow-arrow { font-size: 11px; }
  .guide-tagline { font-size: 12px; }
  .guide-item { padding: 9px 10px; }
  .guide-desc { font-size: 11px; }
  .toast { width: calc(100% - 32px); text-align: center; bottom: 16px; }
}

/* 目标格式「推荐」徽章 */
.converter-btn .rec-tag {
  display: inline-block;
  margin-left: 2px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  vertical-align: middle;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

/* ========== 右侧卖点展示区 ========== */
.preview-empty:not([hidden]) {
  justify-content: flex-start;
  padding: 28px 20px 20px;
  gap: 0;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent);
  background: var(--color-accent-bg);
  border: 1px solid rgba(14, 76, 162, 0.25);
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--color-accent), #1e6fd9 50%, #4a90e2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

.selling-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.selling-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.selling-item:hover {
  border-color: rgba(14, 76, 162, 0.4);
  box-shadow: 0 2px 8px rgba(14, 76, 162, 0.08);
  transform: translateY(-1px);
}

.selling-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
}
.selling-icon.s1 { background: linear-gradient(135deg, #f59e0b, #f97316); }
.selling-icon.s2 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.selling-icon.s3 { background: linear-gradient(135deg, #10b981, #059669); }
.selling-icon.s4 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.selling-icon.s5 { background: linear-gradient(135deg, #ec4899, #db2777); }
.selling-icon.s6 { background: linear-gradient(135deg, #64748b, #334155); }

.selling-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.selling-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.selling-desc {
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 使用流程 —— 紧贴卖点下方 */
.preview-empty .usage-flow {
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 14px 0;
  border-top: 1px dashed var(--color-border);
  border-bottom: 1px dashed var(--color-border);
}

/* 响应式 */
@media (max-width: 860px) {
  .selling-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 26px; }
  .preview-empty:not([hidden]) { padding: 20px 16px 16px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 22px; }
  .hero-badge { font-size: 11px; padding: 4px 10px; }
  .selling-item { padding: 10px; }
  .selling-icon { width: 28px; height: 28px; }
  .selling-title { font-size: 11px; }
  .selling-desc { font-size: 10px; }
}
