/**
 * [INPUT]: 依赖 lore-ui.css 与 status-shell.css 的页面令牌，以及 status.ts 输出的账号身份、常显背包与日志语义
 * [OUTPUT]: 提供紧凑账号卡、头像等级身份、横向背包、日志折叠与对应响应式细节
 * [POS]: public 状态页的内容视觉层；全页画布、命令栏和分区层级由 status-shell.css 负责
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */

/* ── 账号卡片 ──────────────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.acct-card {
  min-width: 0;
  overflow: hidden;
  position: relative;
  border: 1px solid #c4d2e5;
  border-radius: 8px;
  background: rgba(251, 252, 255, 0.98);
  box-shadow: none;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 120ms var(--ease-out);
}

.acct-card::before {
  content: "";
  width: 2px;
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  z-index: 1;
  border-radius: 0 3px 3px 0;
  background: #6f8fbb;
}

.acct-card.error::before {
  background: var(--danger);
}

.acct-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.acct-card-link:focus-visible {
  outline-offset: -4px;
}

.acct-card:has(.acct-card-link:active) {
  transform: scale(0.99);
}

.acct-card-top {
  min-height: 66px;
  padding: 9px 9px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.acct-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
}

.acct-avatar {
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid #b7c9e1;
  border-radius: 50%;
  background: #e8eff9;
  object-fit: cover;
}

.acct-name-row {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 3px;
}

.acct-name-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.acct-title {
  flex: 0 1 auto;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-title.level-0,
.acct-title.level-1 { color: #2f92c3; }
.acct-title.level-2 { color: #41935f; }
.acct-title.level-3 { color: #b98912; }
.acct-title.level-4 { color: #c95049; }
.acct-title.level-5 { color: #8b55a5; }

.acct-name {
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  color: #20222b;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-level {
  min-width: 54px;
  height: 24px;
  padding: 1px 6px 1px 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 1px;
  color: #5576a4;
  border: 1px solid #a8c6ed;
  border-radius: 999px;
  background: #edf5ff;
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
}

.acct-level img {
  width: 20px;
  height: 20px;
  display: block;
}

.acct-resources {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #74798a;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.res-sep {
  color: #a0a6b5;
}

.del-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  color: #8b91a1;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  font-size: 21px;
  font-weight: 300;
  line-height: 1;
  transition: color 140ms var(--ease-out), background-color 140ms var(--ease-out), transform 100ms var(--ease-out);
}

.del-btn:active {
  transform: scale(0.92);
}

.card-section {
  min-height: 0;
  padding: 8px 11px 8px 14px;
  display: grid;
  align-content: start;
  gap: 5px;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(106, 116, 155, 0.14);
  pointer-events: none;
}

.lore-header {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.sec-row,
.lore-detail {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sec-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.sec-label {
  flex: 0 0 auto;
  color: #3f4554;
  font-size: 12px;
  font-weight: 720;
}

.lore-quality {
  min-height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 720;
}

.lore-title-sm {
  min-width: 0;
  overflow: hidden;
  color: #4b5160;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  min-height: 23px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #4b5160;
  border: 1px solid rgba(106, 116, 155, 0.14);
  border-radius: 999px;
  background: #f3f5fa;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill.dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dot-color, #9197a7);
}

.lore-rewards,
.pawn-materials {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lore-rewards {
  flex-wrap: wrap;
}

.reward-badge,
.pawn-mat-tag {
  min-height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 620;
  white-space: nowrap;
}

.reward-badge.exp { color: var(--info); background: var(--info-soft); }
.reward-badge.gem { color: var(--warning); background: var(--warning-soft); }
.reward-badge.prop { background: var(--purple-soft); }

.lore-time,
.gamble-info,
.pawn-mat-more,
.pawn-special {
  color: #74798a;
  font-size: 10px;
  white-space: nowrap;
}

.lore-time {
  flex: 0 0 auto;
}

.gamble-dice {
  color: #3f4554;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.gamble-score-text {
  color: #5576a4;
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
}

.pawn-special {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pawn-special-name {
  font-weight: 720;
}

.pawn-materials {
  overflow-x: auto;
  flex-wrap: nowrap;
  position: relative;
  z-index: 3;
  padding-bottom: 1px;
  pointer-events: auto;
  scrollbar-width: none;
  touch-action: pan-x;
  overscroll-behavior-inline: contain;
}

.pawn-materials::-webkit-scrollbar {
  display: none;
}

.pawn-mat-more {
  flex: 0 0 auto;
  font-weight: 650;
}

.pawn-mat-tag {
  flex: 0 0 auto;
  color: #4b5160;
  border: 1px solid rgba(106, 116, 155, 0.16);
  background: #f2f5fa;
}

/* ── 日志 ──────────────────────────────────────── */
.logs-section {
  margin-top: 2px;
}

.logs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.log-card {
  overflow: hidden;
  border: 1px solid #c4d2e5;
  border-radius: 8px;
  background: rgba(251, 252, 255, 0.98);
}

.log-card summary {
  min-height: 46px;
  padding: 0 42px 0 14px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 680;
}

.log-card summary::after {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  top: 50%;
  right: 18px;
  margin-top: -6px;
  border-right: 1.5px solid #73798a;
  border-bottom: 1.5px solid #73798a;
  transform: rotate(45deg);
  transition: transform 150ms var(--ease-out);
}

.log-card[open] summary::after {
  transform: rotate(225deg);
}

.log-card summary:focus-visible {
  outline-offset: -4px;
}

.log-card summary::-webkit-details-marker {
  display: none;
}

.log-summary-meta {
  color: #73798a;
  font-size: 11px;
  font-weight: 520;
}

.log-list {
  max-height: 280px;
  padding: 12px 14px;
  overflow: auto;
  border-top: 1px solid rgba(106, 116, 155, 0.14);
  background: #f2f4fa;
  scrollbar-width: thin;
}

.log-line,
.log-empty {
  color: #4b5160;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.log-line + .log-line {
  margin-top: 4px;
}

.log-time {
  color: var(--success);
}

.empty-msg {
  grid-column: 1 / -1;
  padding: 44px 24px;
  color: #73798a;
  border: 1px dashed #aebbd0;
  border-radius: 8px;
  background: rgba(248, 250, 255, 0.72);
  text-align: center;
  font-size: 13px;
}

.empty-msg a {
  color: #355f94;
}

/* ── 精细指针反馈 ──────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .acct-card:hover {
    border-color: #9eb3cf;
    box-shadow: 0 3px 10px rgba(70, 92, 130, 0.08);
    transform: translateY(-1px);
  }

  .del-btn:hover {
    color: var(--danger);
    background: var(--danger-soft);
  }

  .log-card summary:hover {
    background: rgba(85, 118, 164, 0.05);
  }
}

/* ── 响应式与偏好 ──────────────────────────────── */
@media (max-width: 900px) {
  .account-grid,
  .logs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .acct-card-top {
    min-height: 64px;
  }

  .acct-avatar {
    width: 42px;
    height: 42px;
  }

  .acct-title,
  .acct-name {
    font-size: 16px;
  }

  .lore-detail {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .log-card summary {
    min-height: 48px;
  }
}

@media (max-width: 370px) {
  .acct-level {
    min-width: 50px;
    padding-right: 4px;
  }

  .acct-level img {
    width: 18px;
    height: 18px;
  }

  .gamble-score-text,
  .gamble-dice {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .acct-card,
  .log-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #f9fbff;
  }
}

@media (prefers-contrast: more) {
  .acct-card,
  .log-card {
    border-color: #6b7690;
  }
}
