/*
 * idea-notebook-mvp · Step 6 demo v1 · style.css
 *
 * 遵守 visual_tolerance：
 *   capture-input: position=center-top, size=[600,80] baseline, color baseline=#ffffff
 *   recall-bubble: opacity baseline=0.7, position=adjacent_to_capture_bottom
 *
 * 遵守 structural_contract:
 *   capture-input 视觉独立不被 recall-bubble 抢焦点
 *   recall-bubble 不遮挡 capture-input
 */

:root {
  --bg: #f9f7f2;
  --fg: #2a2a2a;
  --fg-muted: #8a8a8a;
  --accent: #3b82f6;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.08);
  --shadow-soft: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-float: 0 4px 16px rgba(0,0,0,0.08);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

main#note-capture-unit {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px 160px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ---- capture-input ---- */

section#capture-area {
  width: 100%;
}

#capture-input {
  width: 100%;
  min-height: 80px;            /* visual_tolerance.size baseline */
  max-height: 50vh;
  padding: 20px 24px;
  font-size: 18px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  resize: none;                /* 动态由 JS 控制高度 */
  outline: none;
  transition: box-shadow 150ms ease;
}

#capture-input:focus {
  box-shadow: var(--shadow-float);
  border-color: var(--accent);
}

#capture-input::placeholder {
  color: var(--fg-muted);
}

#capture-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--fg-muted);
  text-align: right;
  opacity: 0.6;
}

/* ---- recall-bubble ---- */

section#recall-area {
  margin-top: 32px;            /* visual_tolerance.spacing baseline=16, 这里放宽到 32 */
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recall-bubble {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  opacity: 0;                  /* initial for fade-in */
  transform: translateY(4px);
  animation: bubble-fade-in 300ms ease-out forwards;
  cursor: default;
  max-width: 100%;
  overflow: hidden;
}

.recall-bubble.dismissing {
  animation: bubble-fade-out 500ms ease-out forwards;
}

.recall-bubble-label {
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.recall-bubble-text {
  font-size: 14px;
  color: var(--fg);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recall-bubble-time {
  font-size: 10px;
  color: var(--fg-muted);
  margin-top: 4px;
  opacity: 0.6;
}

@keyframes bubble-fade-in {
  to {
    opacity: 0.7;              /* visual_tolerance.opacity baseline */
    transform: translateY(0);
  }
}

@keyframes bubble-fade-out {
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ---- dev-panel（生产要删） ---- */

aside#dev-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.9);
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--fg-muted);
  z-index: 999;
}

#dev-panel button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

#dev-panel button:hover {
  background: rgba(0,0,0,0.03);
}

/* ---- 响应式（移动端友好） ---- */

@media (max-width: 600px) {
  main#note-capture-unit {
    padding: 40px 16px 120px;
  }
  #capture-input {
    font-size: 16px;           /* iOS 防缩放 */
    padding: 16px 18px;
  }
  aside#dev-panel {
    font-size: 11px;
    padding: 8px 12px;
  }
}
