/* 自動補樣式：js/screens/me.js（_build/style.py） */
/* ==========================================================================
   js/screens/me.js 補樣式
   ========================================================================== */

/* ---------- 通用文字工具類 ---------- */
.u-text-2 {
  color: var(--text-2);
}

.u-text-3 {
  color: var(--text-3);
}

.u-strong {
  font-weight: 600;
  color: var(--text);
}

.u-strong > svg {
  display: inline-block;
  vertical-align: -3px;
  margin-right: var(--sp-1);
  color: var(--primary);
}

.u-footnote {
  font-size: var(--fs-footnote);
  line-height: var(--lh-footnote);
}

/* ---------- 隱私說明（details 內的條列） ---------- */
.c-privacy-notes {
  margin: var(--sp-2) 0 0;
  padding: 0 0 0 var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--fs-footnote);
  line-height: 1.55;
  color: var(--text-2);
}

.c-privacy-notes li::marker {
  color: var(--primary);
}

/* ---------- 摺疊區 ---------- */
.s-me__details {
  border-radius: var(--r-input);
  background: var(--surface-2);
  padding: 0 var(--sp-4);
}

.s-me__details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--tap);
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-callout);
  line-height: var(--lh-callout);
  font-weight: 600;
  color: var(--primary);
  border-radius: var(--r-sm);
  user-select: none;
}

.s-me__details > summary::-webkit-details-marker {
  display: none;
}

.s-me__details > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--dur-2) var(--ease);
}

.s-me__details[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.s-me__details > summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.s-me__details[open] {
  padding-bottom: var(--sp-3);
}

/* ---------- 連結列 ---------- */
.s-me__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  padding: var(--sp-2) var(--sp-1);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  border-radius: var(--r-sm);
  transition: background var(--dur-1) var(--ease);
}

.s-me__row + .s-me__row {
  border-top: 1px solid var(--divider);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.s-me__row > svg {
  flex: none;
  color: var(--primary);
}

.s-me__row > svg:last-child {
  margin-left: auto;
  color: var(--text-3);
}

.s-me__row > .u-text-3 {
  flex: none;
  font-size: var(--fs-footnote);
  line-height: var(--lh-footnote);
}

.s-me__row > .u-text-3 + svg:last-child {
  margin-left: 0;
}

.s-me__row:active {
  background: var(--surface-2);
}

.s-me__row:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.s-me__row-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 隱私卡中的遮蔽入口：與上方內容分隔 */
.c-privacy-line ~ .s-me__row,
.s-me__details ~ .s-me__row {
  margin-top: var(--sp-2);
  border-top: 1px solid var(--divider);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}

/* ---------- 療程狀態說明 ---------- */
.s-me__status-note {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-input);
  background: var(--surface-2);
  font-size: var(--fs-callout);
  line-height: 1.55;
}

/* 暫停療程：以柔和底色標示，不使用警示色 */
body.is-paused .s-me__status-note {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ---------- 裝置能力清單 ---------- */
.s-me__caps {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--sp-1);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 var(--sp-4);
}

.s-me__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 40px;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--divider);
  font-size: var(--fs-callout);
  line-height: 1.35;
}

.s-me__cap-name {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.s-me__cap-status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--r-chip);
  border: 1px solid transparent;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--fs-caption);
  line-height: 16px;
  font-weight: 600;
  letter-spacing: var(--ls-caption);
  white-space: nowrap;
}

.s-me__cap-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.s-me__cap.is-verified .s-me__cap-status {
  background: var(--primary-soft);
  color: var(--primary);
}

.s-me__cap.is-notVerified .s-me__cap-status {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}

.s-me__cap.is-notVerified .s-me__cap-status::before {
  background: transparent;
  border: 1.5px solid currentColor;
}

.s-me__cap.is-unsupported .s-me__cap-status {
  background: transparent;
  color: var(--text-3);
  border: 1px dashed var(--text-3);
}

.s-me__cap.is-unsupported .s-me__cap-status::before {
  border-radius: 1px;
  height: 2px;
  width: 8px;
}

.s-me__cap.is-unsupported .s-me__cap-name {
  color: var(--text-2);
}

/* ---------- 滑鼠 hover ---------- */
@media (hover: hover) and (pointer: fine) {
  .s-me__row:hover {
    background: var(--surface-2);
  }

  .s-me__details > summary:hover {
    color: var(--primary-strong);
  }
}

/* ---------- 平板與桌面 ---------- */
@media (min-width: 600px) {
  .s-me__row {
    padding-inline: var(--sp-2);
  }
}

@media (min-width: 1024px) {
  .s-me__status-note {
    font-size: var(--fs-body);
  }
}

/* ---------- 矮螢幕 ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  .s-me__row {
    min-height: 44px;
  }

  .s-me__caps {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* ---------- 減少動態 ---------- */
@media (prefers-reduced-motion: reduce) {
  .s-me__row,
  .s-me__details > summary::after {
    transition-duration: 0.01ms !important;
  }
}
