/* ============================================================================
   组件层：卡片、打卡圆环、进度、日历、列表行、弹窗、Toast、图表、图片上传
   ========================================================================== */

/* ------------------------------------------------------------------ 卡片 -- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .24s cubic-bezier(.2, .8, .3, 1), box-shadow .24s, border-color .24s;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-ring);
  }
}

.card + .card { margin-top: 16px; }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 0;
  flex-wrap: wrap;
}

.card__title {
  font-size: 15.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.card__emoji { font-size: 17px; }

.card__extra {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card__body { padding: 14px 18px 18px; }
.card__body--flush { padding: 12px 0 0; }
.card__body--flush .card__head + & { padding-top: 10px; }

.card__hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: -4px;
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------- 页头 -- */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ 通用栅格 -- */

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack--sm { gap: 7px; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

@media (max-width: 860px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .grid--auto, .grid--wide { gap: 11px; }
}

@media (max-width: 420px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------------------------------------------------------------- 统计块 -- */

.stat {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-softer);
  border: 1px solid var(--line);
  transition: transform .2s, background .2s;
}

@media (hover: hover) { .stat:hover { transform: translateY(-2px); } }

.stat__label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  margin-bottom: 3px;
}

.stat__value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat__unit {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  margin-left: 3px;
}

.stat--good .stat__value { color: var(--good); }
.stat--warn .stat__value { color: var(--warn); }
.stat--danger .stat__value { color: var(--danger); }
.stat--primary .stat__value { color: var(--primary-dark); }

/* ---------------------------------------------------------- 打卡圆环 -- */

.ring {
  position: relative;
  flex: none;
  width: var(--ring-size, 34px);
  height: var(--ring-size, 34px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: transform .2s cubic-bezier(.3, 1.3, .5, 1);
}

/* 扩大触摸热区但不改变视觉尺寸 */
.ring::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
}

.ring svg { width: 100%; height: 100%; display: block; overflow: visible; }

.ring__circle {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.9;
  transition: fill .26s ease, stroke .26s ease;
}

.ring__tick {
  fill: none;
  stroke: #fff;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  transition: stroke-dashoffset .32s cubic-bezier(.3, 1.3, .5, 1) .06s;
}

.ring.is-checked .ring__circle {
  fill: var(--primary);
  stroke: var(--primary);
}

.ring.is-checked .ring__tick { stroke-dashoffset: 0; }

.ring.is-checked {
  filter: drop-shadow(0 3px 8px var(--primary-ring));
}

.ring:active { transform: scale(.9); }

.ring.is-pop { animation: ringPop .36s cubic-bezier(.3, 1.3, .5, 1); }

@keyframes ringPop {
  0% { transform: scale(1); }
  38% { transform: scale(1.2); }
  68% { transform: scale(.94); }
  100% { transform: scale(1); }
}

/* 只读完成点 */
.dot {
  flex: none;
  width: var(--dot-size, 20px);
  height: var(--dot-size, 20px);
  border-radius: 50%;
  border: 1.8px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.dot.is-done {
  background: var(--primary);
  border-color: var(--primary);
}

/* ------------------------------------------------------- 圆环进度条 -- */

.rp {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
}

.rp__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.rp__track { fill: none; stroke: var(--primary-soft); }

.rp__value {
  fill: none;
  stroke: var(--primary);
  transition: stroke-dashoffset .7s cubic-bezier(.3, .9, .3, 1);
}

.rp__center { position: relative; text-align: center; line-height: 1.15; }
.rp__num { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rp__label { font-size: 10.5px; color: var(--text-3); font-weight: 650; }

/* ---------------------------------------------------------- 线性进度条 -- */

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

.bar {
  flex: 1;
  min-width: 60px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary-softer);
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width .55s cubic-bezier(.3, .9, .3, 1);
}

.bar__text {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.bar__text b { color: var(--text); }

/* ------------------------------------------------------------ 分段控件 -- */

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  max-width: 100%;
  border-radius: 999px;
  background: var(--primary-softer);
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }

.segmented__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}

.segmented__item.is-active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.segmented__emoji { font-size: 14px; }

/* ---------------------------------------------------------- 标签胶囊 -- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  background: var(--primary-softer);
  border: 1px solid var(--line);
  transition: background .2s, color .2s, transform .15s;
}
.chip.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary-ring);
}
@media (hover: hover) { .chip:hover { transform: translateY(-1px); } }

/* -------------------------------------------------------------- 列表行 -- */

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), box-shadow .2s, background .2s, border-color .2s;
}

@media (hover: hover) {
  .row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-ring);
  }
}

.row.is-done { background: var(--primary-softer); }

.row__main { flex: 1; min-width: 0; }

.row__title {
  font-size: 14.5px;
  font-weight: 650;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.row.is-done .row__title {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--primary-light);
  text-decoration-thickness: 2px;
}

.row__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
}

.row__meta b { color: var(--primary-dark); font-variant-numeric: tabular-nums; }

.row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

/* 图标小按钮 */
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-3);
  transition: background .18s, color .18s, transform .18s;
}
@media (hover: hover) {
  .icon-btn:hover { background: var(--primary-soft); color: var(--primary-dark); transform: scale(1.08); }
}
.icon-btn.is-danger:hover { background: rgba(255, 107, 138, .12); color: var(--danger); }

@media (max-width: 860px) {
  .icon-btn { width: 40px; height: 40px; font-size: 16px; }
}

/* --------------------------------------------------------- 动作卡片 -- */

.ex-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), box-shadow .2s, border-color .2s;
  position: relative;
}

@media (hover: hover) {
  .ex-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-ring);
  }
}

.ex-card__thumb {
  flex: none;
  width: 66px;
  height: 66px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: linear-gradient(140deg, var(--primary-softer), var(--primary-soft));
  border: 1px dashed var(--line-strong);
  overflow: hidden;
}

.ex-card__thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

.ex-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }

.ex-card__name {
  font-size: 14.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ex-card__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-3);
}

.ex-card__kcal {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.ex-card__tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .2s;
}

@media (hover: hover) { .ex-card:hover .ex-card__tools { opacity: 1; } }
@media (hover: none) { .ex-card__tools { opacity: 1; position: static; margin-left: auto; } }

/* ------------------------------------------------------------ 日历 -- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cal-head__title {
  font-size: 16.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.cal__weekday {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  padding: 2px 0 4px;
}

.cal__cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 13px;
  border: 1.5px solid transparent;
  /* 无记录的日期也给一点底色，日历才读得出格子 */
  background: var(--primary-softer);
  font-weight: 700;
  color: var(--text);
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), box-shadow .2s, border-color .2s, background .2s;
}

.cal__cell[data-level="1"] { background: var(--lvl-1); }
.cal__cell[data-level="2"] { background: var(--lvl-2); }
.cal__cell[data-level="3"] { background: var(--lvl-3); }
.cal__cell[data-level="4"] { background: var(--lvl-4); color: #fff; }

.cal__cell[data-level="3"] .cal__num,
.cal__cell[data-level="3"] .cal__pct { color: #4A2530; }
.cal__cell[data-level="4"] .cal__num,
.cal__cell[data-level="4"] .cal__pct { color: #fff; }

.cal__cell.is-out { opacity: .3; }

.cal__cell.is-today {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.cal__cell.is-selected {
  border-color: var(--primary-dark);
  transform: scale(1.04);
  box-shadow: var(--shadow);
}

.cal__cell.is-future { color: var(--text-3); }

@media (hover: hover) {
  .cal__cell:hover { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-sm); }
}

.cal__num { font-size: 13.5px; line-height: 1; font-variant-numeric: tabular-nums; }

.cal__pct {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-2);
  opacity: .9;
  line-height: 1;
}

.cal__flag {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 8px;
  line-height: 1;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 12px;
  justify-content: flex-end;
}

.cal-legend__box {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
}

/* 鼓励语横幅 */
.quote {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-softer) 70%, #fff);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.quote::after {
  content: '';
  position: absolute;
  right: -34px;
  top: -34px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: .55;
}

.quote__text {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.quote__sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  position: relative;
  z-index: 1;
}

.quote__ring { position: relative; z-index: 1; }

/* ------------------------------------------------------------ 弹窗 -- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(63, 44, 52, .42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .22s ease;
}

.modal-overlay.is-open { opacity: 1; }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(.97);
  transition: transform .26s cubic-bezier(.2, .9, .3, 1.15);
  overflow: hidden;
}

.modal-overlay.is-open .modal { transform: none; }

.modal--sm { max-width: 398px; }
.modal--lg { max-width: 700px; }

.modal__form { display: flex; flex-direction: column; min-height: 0; }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 6px;
  flex: none;
}

.modal__title {
  font-size: 16.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.modal__emoji { font-size: 18px; }

.modal__close {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-3);
  font-size: 15px;
  transition: background .18s, color .18s;
}
@media (hover: hover) {
  .modal__close:hover { background: var(--primary-soft); color: var(--primary-dark); }
}

.modal__body {
  padding: 10px 20px 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  flex: none;
}

.modal__text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  padding: 4px 0 8px;
}

@media (max-width: 640px) {
  .modal-overlay { align-items: flex-end; padding: 0; }

  .modal {
    max-width: none;
    border-radius: 22px 22px 0 0;
    max-height: 90dvh;
    transform: translateY(100%);
  }

  .modal__head { padding-top: 22px; }

  .modal__head::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--line-strong);
  }

  .modal__foot {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fff;
  }

  .modal__foot .btn { flex: 1; }
}

/* ------------------------------------------------------------- Toast -- */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

@media (max-width: 860px) {
  .toast-host { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
}

.toast {
  padding: 10px 19px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 650;
  color: #fff;
  background: rgba(63, 44, 52, .93);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  text-align: center;
}

.toast.is-in { opacity: 1; transform: none; }
.toast--success { background: rgba(60, 178, 122, .96); }
.toast--error { background: rgba(240, 92, 124, .96); }

/* ----------------------------------------------------------- 空状态 -- */

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-3);
}

.empty__emoji { font-size: 38px; margin-bottom: 10px; opacity: .85; }
.empty__title { font-size: 14.5px; font-weight: 750; color: var(--text-2); }
.empty__desc { font-size: 12.5px; margin-top: 5px; line-height: 1.65; }
.empty .btn { margin-top: 14px; }

/* ------------------------------------------------------- 图片选择器 -- */

.picker { display: flex; flex-direction: column; gap: 10px; }

.picker__preview {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--line-strong);
  background: linear-gradient(140deg, var(--primary-softer), var(--primary-soft));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.picker__preview img { width: 100%; height: 100%; object-fit: cover; }
.picker__placeholder { font-size: 42px; opacity: .8; }

.picker__hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--text-2);
  background: rgba(255, 255, 255, .88);
}

.picker__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.picker__status { font-size: 12px; font-weight: 650; color: var(--text-3); }
.picker__status.is-ok { color: var(--good); }
.picker__status.is-error { color: var(--danger); }
.picker__status.is-busy { color: var(--info); }
.picker__note { font-size: 11px; color: var(--text-3); line-height: 1.6; }

/* -------------------------------------------------------------- 图表 -- */

.chart { width: 100%; position: relative; }
.chart__svg { width: 100%; height: 100%; display: block; overflow: visible; }

.chart__grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.chart__axis {
  font-size: 11px;
  fill: var(--text-3);
  font-family: var(--font);
}

.chart__unit { font-size: 10px; fill: var(--text-3); font-family: var(--font); }

.chart__bar {
  transition: opacity .2s;
  opacity: .92;
}
@media (hover: hover) { .chart__bar:hover { opacity: 1; } }

.chart--empty {
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary-softer);
  border: 1px dashed var(--line-strong);
}

.chart__empty-text { font-size: 13px; color: var(--text-3); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 9px; height: 9px; border-radius: 50%; }

/* ------------------------------------------------------ 运动体感选择 -- */

.feeling {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.feeling__opt {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  background: var(--primary-softer);
  border: 1px solid var(--line);
  transition: background .2s, color .2s, transform .15s;
}

.feeling__opt.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary-ring);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------ 时间线 -- */

.timeline { display: flex; flex-direction: column; gap: 0; }

.tl-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.tl-item:last-child { border-bottom: none; }

.tl-item__dot {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--primary-softer);
}

.tl-item__body { flex: 1; min-width: 0; }
.tl-item__title { font-size: 13.5px; font-weight: 700; }
.tl-item__meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ------------------------------------------------------------ 设置项 -- */

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px dashed var(--line);
}
.setting-item:last-child { border-bottom: none; }

.setting-item__label { font-size: 14px; font-weight: 700; }
.setting-item__desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.6; }
.setting-item__control { flex: none; }

@media (max-width: 640px) {
  .setting-item { flex-direction: column; align-items: stretch; gap: 9px; }
  .setting-item__control { align-self: flex-start; }
}

/* 主题色选择 */
.swatches { display: flex; gap: 9px; flex-wrap: wrap; }

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  transition: transform .18s, border-color .18s;
  position: relative;
}
.swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--text), 0 4px 12px rgba(0, 0, 0, .14);
  transform: scale(1.08);
}

@media (hover: hover) { .swatch:hover { transform: scale(1.1); } }

/* 账号信息块 */
.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-softer));
  border: 1px solid var(--line);
}

.profile__avatar {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 6px 16px var(--primary-ring);
}

.profile__name { font-size: 16px; font-weight: 800; }
.profile__mail { font-size: 12.5px; color: var(--text-2); word-break: break-all; }

/* ---------------------------------------------------------- 详情面板 -- */

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 12px;
}

.detail-head__date { font-size: 16px; font-weight: 800; }

.kv { display: flex; gap: 8px; flex-wrap: wrap; }

.kv__item {
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  background: var(--primary-softer);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 650;
}
.kv__item b { color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* 模块小节标题 */
.sub-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 9px;
}

.sub-title__count {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-3);
  background: var(--primary-softer);
  padding: 1px 8px;
  border-radius: 999px;
}

/* 提示条 */
.tip {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-softer);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.65;
}
.tip__emoji { flex: none; font-size: 15px; }

/* 骨架屏 */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--primary-softer) 25%, var(--primary-soft) 37%, var(--primary-softer) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  height: 62px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
