/* ===========================================================
   不干眼星球 · 专业人士网页设计系统
   与小程序 src/app.scss 保持 1:1 一致（rpx ÷ 2 = px）
   =========================================================== */

:root {
  /* --- 背景层 --- */
  --bg: #F2F2F7;
  --bg-card: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #EFEFF4;

  /* --- 文字（iOS 系统色）--- */
  --ink: #000000;
  --ink-secondary: #3C3C43;
  --ink-muted: #8E8E93;
  --ink-faint: #C7C7CC;
  --ink-disabled: #D1D1D6;

  /* --- Apple Health 渐变色 --- */
  --health-1: #FF3B30;
  --health-2: #FF9500;
  --health-3: #FFCC00;
  --health-4: #34C759;
  --health-5: #5AC8FA;

  /* --- 品牌 --- */
  --brand: #FF9500;
  --brand-deep: #FF6B00;
  --brand-soft: #FFF3E0;

  /* --- 干预横条 --- */
  --intv-drug: #8E8E93;
  --intv-device: #5AC8FA;
  --intv-home: #AF52DE;
  --intv-self: #34C759;

  /* --- 专业人士端强调色（绿，与患者端橙区分）--- */
  --accent: #0A5C44;
  --accent-soft: rgba(10, 92, 68, 0.08);

  /* --- 间距 --- */
  --s-1: 2px;
  --s-2: 4px;
  --s-3: 6px;
  --s-4: 8px;
  --s-5: 10px;
  --s-6: 12px;
  --s-7: 16px;
  --s-8: 24px;
  --s-9: 32px;

  /* --- 圆角 --- */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
  --r-2xl: 14px;
  --r-pill: 999px;

  /* --- 字号 --- */
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 17px;
  --fs-lg: 21px;
  --fs-xl: 28px;
  --fs-xxl: 40px;
  --fs-display: 50px;

  /* --- 阴影 --- */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.08);

  /* --- 动效 --- */
  --press-scale: 0.97;
  --press-opacity: 0.7;
  --press-duration: 120ms;
  --press-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-duration: 300ms;
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* --- 布局 --- */
  --nav-w: 220px;
  --content-max: 1120px;
}

/* ===========================================================
   Reset
   =========================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
    'Microsoft YaHei', sans-serif;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 数字统一等宽，避免跳动 */
.tnum {
  font-variant-numeric: tabular-nums;
}

/* ===========================================================
   通用组件
   =========================================================== */

.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: var(--s-6);
}

/* --- 排版 --- */
.t-eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.t-title {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.t-sub {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  line-height: 1.55;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 36px;
  padding: 0 var(--s-6);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: transform var(--press-duration) var(--press-ease),
    opacity var(--press-duration) var(--press-ease),
    background-color var(--press-duration) var(--press-ease);
}

.btn:active {
  transform: scale(var(--press-scale));
  opacity: var(--press-opacity);
}

.btn--primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn--ghost {
  background: var(--bg-tertiary);
  color: var(--ink-secondary);
}

.btn--brand {
  background: var(--brand);
  color: #FFFFFF;
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* --- 标签 --- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.tag--neutral {
  background: var(--bg-tertiary);
  color: var(--ink-muted);
}

.tag--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag--brand {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.tag--danger {
  background: rgba(255, 59, 48, 0.12);
  color: #D70015;
}

/* --- 表单 --- */
.field {
  margin-bottom: var(--s-5);
}

.field-label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-secondary);
  margin-bottom: var(--s-2);
}

.field-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--s-4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--bg-tertiary);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--press-duration) var(--press-ease),
    background-color var(--press-duration) var(--press-ease);
}

.field-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}

.field-input::placeholder {
  color: var(--ink-faint);
}

/* --- 表格 --- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-muted);
  font-size: var(--fs-xs);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--bg-tertiary);
  white-space: nowrap;
}

.table td {
  padding: var(--s-4);
  border-bottom: 1px solid var(--bg-tertiary);
  color: var(--ink-secondary);
}

.table tbody tr {
  transition: background-color var(--press-duration) var(--press-ease);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* --- 空状态 --- */
.empty {
  padding: var(--s-9) var(--s-6);
  text-align: center;
}

.empty-icon {
  font-size: var(--fs-xxl);
  line-height: 1;
  margin-bottom: var(--s-4);
  opacity: 0.4;
}

.empty-text {
  display: block;
  font-size: var(--fs-base);
  color: var(--ink-muted);
  margin-bottom: var(--s-1);
}

.empty-hint {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-faint);
}

/* --- 加载 --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-9);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- 提示条 --- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
  color: var(--ink-secondary);
  line-height: 1.55;
}

.notice--warn {
  background: rgba(255, 149, 0, 0.1);
}

.notice--danger {
  background: rgba(255, 59, 48, 0.08);
}
