:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 16px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 页面顶部导航 */
.page-top { margin-bottom: 20px; text-align: center; }
.page-top .back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 8px;
}
.page-top .back-link:hover { color: var(--primary); }
.page-top .page-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.page-top .page-title .page-icon { font-size: 32px; }
.page-top .page-title h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-top .page-desc { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ===== 按钮 ===== */
.big-btn {
  display: none;
  width: 100%; margin-top: 16px; padding: 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white; border: none; border-radius: 14px;
  font-size: 18px; font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
  letter-spacing: 1px;
}
.big-btn.show { display: block; }
.big-btn:active { transform: scale(0.97); opacity: 0.9; }
.big-btn:disabled { opacity: 0.5; transform: none; }
@media (min-width: 601px) {
  .big-btn { padding: 14px; font-size: 17px; }
  .big-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
  .big-btn:active { transform: translateY(0); }
}

/* ===== 进度 ===== */
.progress-card {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.progress-card.show { display: block; }
.progress-card .p-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.progress-bar { width: 100%; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-bar .fill { height: 100%; width: 0%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 4px; transition: width 0.3s; }

/* ===== 结果 ===== */
.result-card {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}
.result-card.show { display: block; }
.result-card .r-icon { font-size: 48px; margin-bottom: 8px; }
.result-card .r-title { font-size: 20px; font-weight: 700; color: var(--success); margin-bottom: 12px; }
.result-card .r-stats { display: flex; justify-content: center; gap: 24px; margin: 16px 0; }
.result-card .r-stats .s-item { text-align: center; }
.result-card .r-stats .s-item .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.result-card .r-stats .s-item .num.green { color: var(--success); }
.result-card .r-stats .s-item .num.big { font-size: 30px; }
.result-card .r-stats .s-item .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.d-btn {
  display: inline-block; margin-top: 4px; padding: 14px 48px;
  background: var(--success); color: white; border: none; border-radius: 12px;
  font-size: 17px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.d-btn:active { transform: scale(0.97); opacity: 0.9; }
@media (min-width: 601px) {
  .d-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(34,197,94,0.3); }
  .result-card .r-stats .s-item .num { font-size: 28px; }
  .result-card .r-stats .s-item .num.big { font-size: 32px; }
}

.again-btn { display: inline-block; margin-top: 12px; background: none; border: none; color: var(--primary); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ===== 相关工具 ===== */
.seo-tagline {
  max-width: 600px;
  margin: 28px auto 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.8;
}
.seo-tagline .seo-related strong { color: var(--text-muted); margin-right: 6px; }
.seo-tagline .seo-related a { color: var(--primary); text-decoration: none; margin: 0 4px; }
.seo-tagline .seo-related a:hover { text-decoration: underline; }
.seo-tagline .seo-related a:after { content: " | "; color: var(--border); margin-left: 4px; }
.seo-tagline .seo-related a:last-child:after { content: ""; }

/* ===== 错误 ===== */
.error-card {
  display: none;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius);
  padding: 20px; margin-top: 12px; text-align: center;
}
.error-card.show { display: block; }
.error-card .e-title { color: var(--error); font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.error-card .e-detail { font-size: 14px; color: #991b1b; }
.error-card .e-btn { margin-top: 12px; background: none; border: none; color: var(--primary); font-size: 14px; cursor: pointer; text-decoration: underline; }

/* ===== 提示 ===== */
.tips {
  margin-top: 16px; background: var(--card-bg); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted); line-height: 1.7;
}
.tips strong { color: var(--text); }

input[type="file"] { display: none; }

/* 多文件选择 */
.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.file-list .fl-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
}
.file-list .fl-item .fl-icon { font-size: 24px; flex-shrink: 0; }
.file-list .fl-item .fl-detail { flex: 1; min-width: 0; }
.file-list .fl-item .fl-detail .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-list .fl-item .fl-detail .size { font-size: 11px; color: var(--text-muted); }
.file-list .fl-item .del-btn { background: none; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 4px; line-height: 1; }
.file-list .fl-item .del-btn:hover { color: var(--error); }
