/* 共用组件样式（hl- 前缀）：卡片、按钮、输入框、提示条、分段选择。取值全部来自 theme.css 变量。
   不负责：页面布局（间距、栅格仍用 Tailwind 工具类）；组件的组合方式见 docs/design/ui-guidelines.md。 */

.hl-card { background: var(--hl-surface); border: 1px solid var(--hl-border); border-radius: var(--hl-radius-card); padding: 16px; }
.hl-card-tight { padding: 12px; }
.hl-card-empty { border: 1px dashed var(--hl-border-strong); border-radius: var(--hl-radius-card); padding: 24px 16px;
  text-align: center; font-size: 0.875rem; color: var(--hl-text-3); }

/* 按钮：默认 44px 高；主操作加 hl-btn-lg。disabled 统一 40% 透明 */
.hl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--hl-hit); padding: 0 16px;
  border-radius: var(--hl-radius); border: 1px solid transparent; font-size: 1rem; line-height: 1.25; cursor: pointer; }
.hl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hl-btn:focus-visible, .hl-input:focus-visible { outline: 2px solid var(--hl-brand); outline-offset: 2px; }
.hl-btn-lg { min-height: var(--hl-hit-lg); }
.hl-btn-block { width: 100%; }
.hl-btn-primary { background: var(--hl-brand); color: #fff; }
.hl-btn-secondary { background: var(--hl-surface); color: var(--hl-text-2); border-color: var(--hl-border-strong); }
.hl-btn-danger { background: var(--hl-surface); color: var(--hl-danger); border-color: var(--hl-danger-border); }
.hl-btn-warn { background: #b45309; color: #fff; }
.hl-btn-sm { font-size: 0.875rem; padding: 0 12px; }

/* 输入框：16px 字号避免 iOS 聚焦时自动放大；文字与底色显式指定，暗色模式下也可读 */
.hl-input { display: block; width: 100%; min-height: var(--hl-hit); padding: 8px 12px; background: var(--hl-surface); color: #1c1917;
  border: 1px solid var(--hl-border-strong); border-radius: var(--hl-radius); font-size: 1rem; }
.hl-input:disabled { background: var(--hl-fill-soft); }
.hl-label { display: block; font-size: 0.875rem; color: var(--hl-text-2); }
.hl-label > .hl-input { margin-top: 4px; }

/* 提示条：error 用于失败（role=alert），warn 用于需核对，ok 用于成功，info 用于说明 */
.hl-notice { border: 1px solid; border-radius: var(--hl-radius); padding: 12px 16px; font-size: 0.875rem; }
.hl-notice-error { background: var(--hl-danger-soft); border-color: var(--hl-danger-border); color: var(--hl-danger); }
.hl-notice-warn { background: var(--hl-warn-soft); border-color: var(--hl-warn-border); color: var(--hl-warn); }
.hl-notice-ok { background: var(--hl-brand-soft); border-color: #6ee7b7; color: var(--hl-brand); }
.hl-notice-info { background: var(--hl-info-soft); border-color: var(--hl-info-border); color: var(--hl-info); }

/* 行内文字状态（不带底色）：用在卡片内的一行错误/成功/辅助说明 */
.hl-text-error { color: var(--hl-danger); font-size: 0.875rem; }
.hl-text-ok { color: var(--hl-brand-text); font-size: 0.875rem; }
.hl-text-muted { color: var(--hl-text-3); font-size: 0.875rem; }

/* 不确定时长的流动进度条（识别中）：减少动画偏好时变成静态淡色条 */
.hl-indeterminate { position: relative; height: 4px; border-radius: 2px; background: var(--hl-fill-soft); overflow: hidden; }
.hl-indeterminate::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 2px; background: var(--hl-brand); animation: hl-slide 1.3s ease-in-out infinite; }
@keyframes hl-slide { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .hl-indeterminate::after { animation: none; left: 0; width: 100%; opacity: 0.35; } }

/* 开关（专业模式等）：role="switch" 的按钮；按钮本身 44px 高保证好点，里面的滑轨 32px */
.hl-switch { flex: none; width: 60px; height: var(--hl-hit); background: transparent; border: 0; display: flex; align-items: center; justify-content: flex-end; cursor: pointer; }
.hl-switch-track { position: relative; width: 52px; height: 32px; border-radius: 999px; background: var(--hl-border-strong); transition: background 0.15s; }
.hl-switch-knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.hl-switch[aria-checked="true"] .hl-switch-track { background: var(--hl-brand); }
.hl-switch[aria-checked="true"] .hl-switch-knob { transform: translateX(20px); }
.hl-switch:focus-visible { outline: 2px solid var(--hl-brand); outline-offset: 2px; border-radius: 12px; }

/* 分段选择（7/30/90 天、饮食|训练|体重）：选中 = 主色底白字 */
.hl-seg { min-height: var(--hl-hit); padding: 0 12px; border: 1px solid var(--hl-border-strong); border-radius: var(--hl-radius);
  background: var(--hl-surface); color: var(--hl-text-2); font-size: 0.875rem; }
.hl-seg[aria-pressed="true"], .hl-seg.is-active { background: var(--hl-brand); border-color: var(--hl-brand); color: #fff; }
