:root {
  --primary: #ff6a3d;
  --primary-dark: #e85527;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a9099;
  --border: #e6e8eb;
  --ok: #2e9e5b;
  --warn: #e8a33d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: linear-gradient(135deg, #ff8a5c, #ff6a3d);
  color: #fff;
  padding: 28px 0 22px;
}
.site-header h1 { margin: 0 0 4px; font-size: 26px; }
.site-header .subtitle { margin: 0; opacity: .92; font-size: 14px; }

.tabs { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.tabs .wrap { display: flex; gap: 8px; }
.tab-btn {
  border: none; background: none; padding: 14px 18px; font-size: 15px; cursor: pointer;
  color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

main { padding: 24px 0 40px; }

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

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.steps { margin: 0; padding-left: 20px; color: #41474e; font-size: 14px; }
.steps li { margin: 4px 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all .15s;
}
.btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-dark); color: #fff; }
.btn.ghost { background: #f0f1f3; border-color: transparent; }

.radius-control { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-left: auto; }
.radius-control input[type=range] { width: 120px; accent-color: var(--primary); }

.canvas-stage {
  position: relative; border: 2px dashed var(--border); border-radius: 10px;
  min-height: 240px; display: flex; align-items: center; justify-content: center;
  background: #fafbfc; overflow: hidden;
}
.canvas-stage canvas { max-width: 100%; display: block; touch-action: none; cursor: crosshair; }
.video-stage { flex-direction: column; }
.video-stage video { max-width: 100%; display: block; background: #000; }
.video-stage #video-canvas { position: absolute; top: 0; left: 0; cursor: crosshair; max-width: 100%; }
.placeholder { color: var(--muted); font-size: 15px; margin: 0; padding: 20px; text-align: center; }

.status { margin-top: 14px; font-size: 13px; color: var(--muted); min-height: 20px; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.err { color: #e0483d; }

.progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.progress-bar { flex: 1; height: 10px; background: #eef0f2; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--primary); transition: width .2s; }
.progress-text { font-size: 13px; color: var(--muted); min-width: 42px; text-align: right; }

.site-footer { border-top: 1px solid var(--border); padding: 18px 0; margin-top: 20px; }
.site-footer p { text-align: center; color: var(--muted); font-size: 13px; margin: 0; }
