﻿*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

input, textarea, button, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

input[type="text"], input[type="url"], input[type="date"], input[type="time"], textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

input:focus, textarea:focus {
  border-color: var(--color-primary);
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-tertiary);
}

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border-width: 0;
}

task-list-view, calendar-view,
goal-list-view, goal-detail-view, plan-detail-view,
insight-home-view, insight-tarot-view, profile-manager-view, settings-view,
note-list-view, note-detail-view, bookmark-list-view,
capsule-room-view,
journal-list-view, journal-editor-view,
chat-view,
storyboard-view, story-detail-view,
task-form-view, goal-form-view, plan-form-view,
trash-view, capture-logs-view {
  display: block;
  height: 100%;
}

/* 对话页自行管理滚动与底部输入条，宿主不滚动 */
chat-view { overflow: hidden; }

note-editor-el, bookmark-card-el, pomodoro-timer-el,
mood-selector-el, mood-heatmap-el, life-progress-el,
message-composer-view, story-timeline-el, capsule-fab-el,
quick-capture-sheet {
  display: block;
}

#router-outlet { position: relative; overflow-x: hidden; }

.page {
  width: 100%;
  min-height: 100%;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-area-bottom));
  background: var(--color-bg);
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 16px; position: sticky; top: 0;
  background: var(--color-bg); z-index: 10;
}

.page-title {
  font-size: var(--font-size-xxl); font-weight: 700; letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: var(--font-size-sm); color: var(--color-text-secondary); margin-top: 2px;
}

.section-title {
  font-size: var(--font-size-md); font-weight: 600; margin: 20px 0 12px;
}

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 16px; color: var(--color-text-secondary); text-align: center;
}

.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.3; }

.empty-state p { font-size: var(--font-size-base); line-height: 1.5; }
