:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2329;
  --text-sub: #646a73;
  --border: #e5e6eb;
  --primary: #3370ff;
  --primary-d: #2860e1;
  --accent: #7c3aed;
  --shadow: 0 4px 18px rgba(31, 35, 41, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-size: 30px;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.brand-text h1 { font-size: 22px; margin: 0 0 4px; }
.brand-text p { font-size: 13px; color: var(--text-sub); margin: 0; max-width: 560px; line-height: 1.5; }
.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.back-link:hover { background: #f0f4ff; }

.app-main { flex: 1; }

/* 模型加载条 */
.model-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.model-bar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.model-status { font-size: 14px; font-weight: 600; }
.model-pct { font-size: 14px; color: var(--primary); font-variant-numeric: tabular-nums; }
.progress {
  height: 8px;
  background: #eef0f4;
  border-radius: 99px;
  margin: 12px 0 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width .25s ease;
}
.model-detail { font-size: 12px; color: var(--text-sub); min-height: 16px; }
.model-bar.ready { border-color: #c9e6c9; }
.model-bar.ready .model-status { color: #1a8a3a; }

/* 上传区 */
.drop-zone {
  background: var(--card);
  border: 2px dashed #c4c9d4;
  border-radius: var(--radius);
  padding: 54px 20px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  box-shadow: var(--shadow);
}
.drop-zone:hover, .drop-zone:focus { border-color: var(--primary); background: #f7faff; outline: none; }
.drop-icon { font-size: 40px; margin-bottom: 10px; }
.drop-title { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.drop-sub { font-size: 13px; color: var(--text-sub); margin: 0 0 18px; }

/* 按钮 */
.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--primary-d); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:not(:disabled):hover { filter: brightness(1.08); }
.btn-ghost { background: #eef1f6; color: var(--text); }
.btn-ghost:not(:disabled):hover { background: #e2e7f0; }

/* 工作区 */
.workspace { margin-top: 6px; }
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.compare-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.compare-label { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; font-weight: 600; }
.compare-box {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  background: repeating-conic-gradient(#f0f1f4 0% 25%, #fff 0% 50%) 50% / 22px 22px;
  border-radius: 10px;
  overflow: hidden;
}
.compare-box img { max-width: 100%; max-height: 420px; display: block; border-radius: 6px; }
.compare-placeholder { color: #a8abb2; font-size: 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 14px; }

.log {
  font-size: 13px;
  color: var(--text-sub);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 20px;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow);
}
.note { font-size: 12px; color: var(--text-sub); line-height: 1.6; margin-top: 14px; }

.app-footer { text-align: center; color: var(--text-sub); font-size: 12px; margin-top: 28px; }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .compare { grid-template-columns: 1fr; }
  .brand-text p { display: none; }
}
