:root {
  --line: #06c755;
  --bg: #f6f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #888;
  --border: #e5e5ea;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
}
.hello {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border-radius: 16px;
}
.hello .avatar img {
  width: 44px; height: 44px; border-radius: 50%;
  background: #ddd;
}
.name { font-weight: 600; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.tile {
  background: var(--card);
  border-radius: 16px;
  padding: 24px 16px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  border: 1px solid var(--border);
}
.tile > div:first-child { font-size: 32px; margin-bottom: 6px; }
.tile:active { transform: scale(0.98); }

/* page-level utility classes */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.btn {
  display: inline-block;
  padding: 12px 18px;
  background: var(--line);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
}
.btn[disabled] { background: #aaa; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.input, textarea, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--card);
  color: var(--text);
}
textarea { min-height: 100px; resize: vertical; }
.preview {
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  display: flex;
  justify-content: center;
}
.preview img { max-width: 100%; max-height: 50vh; display: block; }
.row { display: flex; gap: 8px; margin-bottom: 12px; }
.back {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.log {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  min-height: 80px;
  margin-top: 12px;
}
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #ccc;
  border-top-color: var(--line);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rec-dot {
  display: inline-block; width: 10px; height: 10px;
  background: #e02; border-radius: 50%; margin-right: 8px;
  animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse { 50% { opacity: 0.3; } }
