/* 基本重置與行動優化 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji"; color: #121212; background: #fafafa; }
:root { --accent: #0d6efd; --accent-2: #6c757d; --panel-bg: #ffffff; --border: #e5e7eb; --stage-bg: #0b1020; }

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--panel-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.app-header h1 { font-size: 20px; margin: 0; }
.header-actions { display: flex; gap: 8px; }

.app-main { display: grid; grid-template-columns: 380px 1fr; gap: 12px; padding: 12px; }
@media (max-width: 960px) { .app-main { grid-template-columns: 1fr; } }

.panel { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.stage-panel { display: flex; flex-direction: column; gap: 8px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
input, select { padding: 8px 10px; font-size: 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }

.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
button { padding: 10px 14px; font-size: 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; }
button.secondary { background: #edf2ff; color: #1d3b8b; border-color: #cbd5e1; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.hint { font-size: 12px; color: #555; margin-top: 6px; }
.config-info { font-size: 12px; color: #333; margin-top: 8px; background: #f8fafc; padding: 8px; border-radius: 8px; border: 1px dashed var(--border); }

.stage { position: relative; width: 100%; height: 70vh; height: 70dvh; background: var(--stage-bg); border-radius: 12px; overflow: hidden; touch-action: manipulation; user-select: none; }
.target { position: absolute; border-radius: 50%; background: #e11d48; box-shadow: 0 0 0 2px rgba(255,255,255,0.8); }
.fixation { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 40px; font-weight: 600; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 20px; }

.progress { font-size: 14px; color: #333; }

#resultsPanel { display: none; }
#resultsPanel.show { display: block; }
#summary { overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; }
.table th, .table td { border: 1px solid var(--border); padding: 6px 8px; text-align: right; }
.table th { background: #f1f5f9; text-align: center; }

.raw { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: #111827; background: #f8fafc; border: 1px solid var(--border); padding: 8px; border-radius: 8px; max-height: 260px; overflow: auto; }

.app-footer { padding: 12px; text-align: center; color: #6b7280; }

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  font-size: 15px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
button.copied {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #059669 !important;
}

