:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
  --border-line: #26263a;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  width: 100%; height: 100%; position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column;
}
.screen.hidden { display: none; }

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer; outline: none;
}
.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

.hidden { display: none !important; }

/* ---- Header ---- */
.app-header {
  flex-shrink: 0;
  padding: 18px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-line);
}
.app-header.row { display: flex; align-items: center; gap: 14px; }
.app-title { font-size: 27px; font-weight: 700; letter-spacing: 0.5px; }
.app-sub { font-size: 14px; color: var(--text-secondary); margin-top: 3px; }
.header-title {
  font-size: 22px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.back-btn {
  width: 50px; height: 50px; flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 30px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 4px;
}

/* ---- Scroll area ---- */
.scroll-area {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.scroll-area > * { flex-shrink: 0; }
.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-thumb { background: #2a2a40; border-radius: 3px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }

/* ---- Hint bar ---- */
.hint-bar {
  flex-shrink: 0;
  padding: 11px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-line);
}

/* ---- Cards / list items ---- */
.card, .cmd-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  min-height: 84px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-text, .cmd-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.card-title { font-size: 19px; font-weight: 600; }
.card-meta { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.fav-card .card-title { color: var(--accent-secondary); }

.cmd-name {
  font-family: var(--mono);
  font-size: 18px; font-weight: 600;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmd-use { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.chevron { font-size: 26px; color: var(--accent); flex-shrink: 0; line-height: 1; }

/* ---- Detail ---- */
.section-label {
  font-size: 12px; letter-spacing: 1.5px; font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}
.use-text { font-size: 17px; color: var(--text-primary); line-height: 1.45; }
.code-block {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent-secondary);
  background: var(--bg-primary);
  border: 1px solid #23233a;
  border-radius: 8px;
  padding: 12px 14px;
  word-break: break-word; white-space: pre-wrap;
}
.example {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.example-desc { font-size: 14px; color: var(--text-secondary); padding: 0 2px; line-height: 1.4; }

.star-btn {
  margin-top: 8px;
  min-height: 60px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 17px; font-weight: 600;
  width: 100%;
}
.star-btn.starred { color: var(--accent-secondary); }

.empty {
  color: var(--text-secondary);
  font-size: 16px; text-align: center;
  padding: 50px 24px; line-height: 1.55;
}
