/* ============================================================
   浮生录 V0.3 · 样式 02  components.css
   ============================================================ */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 253, 246, .92), rgba(231, 221, 201, .92));
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: .1em;
  transition: transform .12s, box-shadow .16s, background .16s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, var(--shadow);
}
.btn:hover { background: linear-gradient(180deg, rgba(255, 254, 248, .98), rgba(226, 214, 190, .95)); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-primary { color: #fdf7ea; background: linear-gradient(180deg, #b05539, #94402c); border-color: #7f3626; }
.btn-primary:hover { background: linear-gradient(180deg, #bb5f42, #9e4630); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .5); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn-sm { padding: 6px 11px; font-size: 13px; letter-spacing: .06em; }
.btn-block { display: flex; width: 100%; }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 253, 245, .96), rgba(246, 239, 225, .96));
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 15px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card::after {
  content: ""; position: absolute; inset: 3px; border: 1px solid var(--line-soft); border-radius: 2px; pointer-events: none;
}
.card-flat { box-shadow: none; background: rgba(255, 253, 245, .7); }
.card-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding-bottom: 7px; margin-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}
.card-title h2 { font-size: 15.5px; letter-spacing: .16em; }
.card-title .meta { font-size: 11.5px; color: var(--ink-4); letter-spacing: .08em; }

/* ---------- 章节标题 ---------- */
.sec-title {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 0 9px;
  font-size: 12.5px; letter-spacing: .26em; color: var(--ink-3);
}
.sec-title::before { content: ""; width: 3px; height: 13px; background: var(--cinnabar); opacity: .75; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* ---------- 标签 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: 12px; letter-spacing: .06em;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, .55);
  color: var(--ink-2);
}
.chip-strong { border-color: rgba(165, 70, 47, .45); color: var(--cinnabar); background: rgba(165, 70, 47, .06); }
.chip-jade { border-color: rgba(74, 107, 91, .45); color: var(--jade); background: rgba(74, 107, 91, .07); }
.chip-gold { border-color: rgba(168, 133, 63, .45); color: var(--gold); background: rgba(168, 133, 63, .08); }

/* ---------- 属性条 ---------- */
.meter { display: grid; grid-template-columns: 42px 1fr 34px; align-items: center; gap: 8px; margin-bottom: 7px; }
.meter-label { font-size: 12.5px; color: var(--ink-3); letter-spacing: .08em; }
.meter-track { height: 7px; background: rgba(43, 38, 32, .1); border-radius: 6px; overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, #5b6b5b, #79875f); border-radius: 6px; transition: width .4s ease; }
.meter-fill.warm { background: linear-gradient(90deg, #9a5334, #c0764f); }
.meter-fill.cool { background: linear-gradient(90deg, #45596b, #6c8199); }
.meter-val { text-align: right; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 增益/损失 ---------- */
.deltas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.delta {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; font-size: 12px; border-radius: 2px;
  border: 1px solid transparent;
}
.delta.up { color: #3f6047; background: rgba(74, 107, 91, .1); border-color: rgba(74, 107, 91, .3); }
.delta.down { color: #96402c; background: rgba(165, 70, 47, .09); border-color: rgba(165, 70, 47, .3); }

/* ---------- 判定明细 ---------- */
.rollbox {
  font-size: 12.5px; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: 2px;
  padding: 9px 11px; margin-top: 10px;
  background: rgba(255, 255, 255, .4);
}
.rollbox .row { display: flex; justify-content: space-between; gap: 8px; }
.rollbox b { color: var(--ink); font-weight: 600; }
.rollbox .ok { color: var(--jade); }
.rollbox .no { color: var(--cinnabar); }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px dashed var(--line-soft);
}
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-size: 14px; }
.list-row .sub { font-size: 11.5px; color: var(--ink-4); }
.list-row .value { font-variant-numeric: tabular-nums; font-size: 13.5px; }

/* ---------- 头像 ---------- */
.avatar {
  position: relative;
  display: block;
  background: var(--paper-3) center/cover no-repeat;
  border: 1px solid var(--line);
  filter: sepia(.04) contrast(1.02);
}
.avatar-frame {
  position: relative; padding: 5px;
  background: linear-gradient(180deg, rgba(255, 253, 245, .95), rgba(240, 232, 216, .95));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.avatar-frame .avatar { width: 100%; aspect-ratio: 3 / 4; }
.avatar-lg { width: 100%; aspect-ratio: 3 / 4; }

/* ---------- 弹层 ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 74px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast {
  max-width: 88%; padding: 8px 14px; font-size: 13px; color: #fbf6e9;
  background: rgba(43, 38, 32, .88); border-radius: 3px;
  animation: toastIn .22s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.modal-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(30, 25, 20, .42);
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
}
.modal {
  width: 100%; max-width: 440px; max-height: 82vh; overflow: auto;
  background: linear-gradient(180deg, #fbf7ec, #efe6d2);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 16px; box-shadow: 0 12px 40px rgba(30, 25, 20, .3);
}

/* ---------- 空态 ---------- */
.empty { padding: 22px 0; text-align: center; color: var(--ink-4); font-size: 13px; letter-spacing: .1em; }
