/* ============================================================================
 * styles.css — Health Performance v2 手機優先深色科技風格樣式
 * ============================================================================ */

:root {
  --bg-page: #0b1120;
  --bg-surface: #111c33;
  --bg-card: #16223d;
  --bg-input: #0d1629;
  --border: rgba(148, 163, 184, 0.18);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #34d399;
  --accent-2: #38bdf8;
  --accent-glow: rgba(52, 211, 153, 0.22);
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  height: 100%;
  overflow: hidden;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 45%), var(--bg-page);
}

/* 頂部列 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
}

.icon-btn:active {
  transform: scale(0.94);
}

/* 最新健康快覽條 */
.health-strip {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  background: rgba(17, 28, 51, 0.75);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.health-strip::-webkit-scrollbar { display: none; }

.metric-pill {
  flex: 0 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 11px;
  display: flex;
  flex-direction: column;
  min-width: 78px;
}

.metric-pill .label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.metric-pill strong {
  font-size: 0.88rem;
  color: var(--accent);
  margin-top: 2px;
}

/* 主內容區 */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 24px;
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card h2, .card h3 {
  margin: 0;
  font-size: 1rem;
}

.hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 10px 0 6px;
}

.text-input, .select-input, .date-input, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-main);
  padding: 11px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.date-input {
  width: auto;
  padding: 6px 10px;
  font-size: 0.82rem;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.text-input:focus, .select-input:focus, textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* 快捷片語 */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.chip:active {
  background: rgba(56, 189, 248, 0.25);
}

/* 按鈕 */
.primary-btn {
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #062118;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.small-ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent-2);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 回饋提示盒 */
.feedback-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.feedback-box.success {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}
.feedback-box.warn {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
}
.feedback-box.error {
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.hidden {
  display: none !important;
}

/* 清單與卡片項目 */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 2px 8px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.event-list, .activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-item, .activity-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.activity-item {
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.activity-item:hover, .activity-item.selected {
  border-color: var(--accent);
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.item-title {
  font-weight: 700;
  font-size: 0.94rem;
}

.item-time {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.item-body {
  font-size: 0.86rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.tag.shoe {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.tag.pending {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.empty-state {
  text-align: center;
  padding: 20px 12px;
  color: var(--text-muted);
  font-size: 0.84rem;
  background: rgba(17, 28, 51, 0.45);
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.guide-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* 底部導覽列 */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
  backdrop-filter: blur(12px);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 6px 4px;
  border-radius: 10px;
  cursor: pointer;
}

.nav-btn .nav-icon {
  font-size: 1.2rem;
}

.nav-btn.active {
  color: var(--accent);
  background: rgba(52, 211, 153, 0.1);
}
