/**
 * [INPUT]: 依赖 lore-ui.css 的视觉令牌与 account-detail.ts 输出的账号、祈愿语义结构
 * [OUTPUT]: 提供单账号页面的紧凑主栅格、复合账号身份、账号工具条、异常空状态与扁平祈愿分区
 * [POS]: public 模块的账号详情基础布局层；定义稳定字号与账号资源骨架，App 首页和弹层视觉由后续职责样式扩展
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */

.container {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.error-card {
  min-height: 300px;
  padding: 36px 24px;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
  text-align: center;
}

.error-card-content {
  max-width: 440px;
}

.error-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.16;
  letter-spacing: 0;
}

.error-card p {
  margin: 14px 0 26px;
  color: var(--muted);
  font-size: 13px;
}

/* ── 账号头部 ──────────────────────────────────── */
.user-header {
  grid-column: 1 / -1;
  min-height: 108px;
  padding: 14px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 20px;
  align-items: center;
  overflow: visible;
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.user-header::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -80px;
  top: -150px;
  border-radius: 50%;
  display: none;
  pointer-events: none;
}

.user-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  grid-template-rows: auto auto auto;
  column-gap: 16px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  grid-column: 1;
  grid-row: 1;
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.user-name {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.16;
  letter-spacing: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.user-email {
  grid-column: 1;
  grid-row: 3;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.remark-editor {
  max-width: none;
  margin: 0;
  grid-column: 2;
  grid-row: 1 / 4;
  padding: 3px;
  display: flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.remark-editor:focus-within {
  border-color: rgba(47, 111, 176, 0.42);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 111, 176, 0.08);
}

.remark-editor input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  color: var(--ink);
  border: 0;
  background: transparent;
  font-size: 13px;
}

.mini-link {
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--accent-strong);
  border: 1px solid rgba(155, 61, 42, 0.2);
  border-radius: 6px;
  background: var(--accent-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}

.mini-link:active {
  transform: scale(0.97);
}

.user-resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.res-item {
  min-width: 0;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  text-align: center;
}

.res-item + .res-sep + .res-item {
  border-left: 1px solid var(--line);
}

.res-value {
  font-size: 25px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.res-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.res-sep {
  display: none;
}

/* ── 栅格编排 ──────────────────────────────────── */
.section-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wish-section {
  grid-column: 1 / 8;
  grid-row: 3 / span 2;
}

.lore-section {
  grid-column: 8 / -1;
  grid-row: 3;
}

.gamble-section {
  grid-column: 8 / -1;
  grid-row: 4;
}

.pawn-section {
  grid-column: 1 / 8;
  grid-row: 5 / span 2;
}

.automation-section {
  grid-column: 8 / -1;
  grid-row: 5;
}

.readtime-section {
  grid-column: 8 / -1;
  grid-row: 6;
}

.section-header {
  min-height: 36px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.section-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
}

.section-subtitle {
  color: var(--muted);
  font-size: 11px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.section-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.section-footer .btn {
  width: 100%;
}

.section-footer-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 10px;
}

.status-pill {
  min-height: 26px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.dot::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dot-color, var(--faint));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot-color, var(--faint)) 12%, transparent);
}

/* ── 祈愿 ──────────────────────────────────────── */
.wish-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.wish-summary-item {
  min-height: 58px;
  padding: 10px;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.wish-summary-item + .wish-summary-item {
  border-left: 1px solid var(--line);
}

.wish-summary-item span {
  font-size: 20px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.wish-summary-item small {
  color: var(--muted);
  font-size: 11px;
}

.wish-auto-row {
  margin-top: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.wish-auto-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wish-auto-row strong {
  font-size: 13px;
  font-weight: 680;
}

.wish-auto-row span {
  color: var(--muted);
  font-size: 11px;
}

.wish-limited-inventory {
  margin-top: 12px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.wish-limited-list,
.wish-result-grid,
.wish-history-grid {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wish-limited-chip,
.wish-result-chip {
  min-height: 34px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  border: 1px solid color-mix(in srgb, var(--wish-quality, var(--line-strong)) 26%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--wish-quality, #fff) 7%, #fff);
  font-size: 12px;
}

.wish-limited-chip > span,
.wish-result-chip > span {
  color: var(--wish-quality, var(--accent));
  font-size: 11px;
  font-weight: 720;
}

.wish-limited-chip strong {
  font-size: 12px;
}

.wish-limited-chip small {
  color: var(--muted);
  font-size: 11px;
}

.wish-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wish-result {
  min-height: 54px;
  margin-top: 12px;
  padding: 10px;
  display: grid;
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--surface-muted);
}

.wish-empty,
.wish-empty-cell {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.wish-note {
  margin-top: 10px;
  color: var(--warning);
  font-size: 12px;
}

.q-limit { --wish-quality: #c64d21; }
.q-purple { --wish-quality: #7654a0; }
.q-blue { --wish-quality: #2f6fb0; }
.q-green { --wish-quality: #267a55; }
.q-grey,
.q-gray { --wish-quality: #77787d; }

.disclosure {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
}

.disclosure summary {
  min-height: 44px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.disclosure summary:focus-visible {
  outline-offset: -4px;
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure summary > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.disclosure summary strong {
  font-size: 13px;
  font-weight: 680;
}

.disclosure summary small {
  color: var(--muted);
  font-size: 11px;
}

.disclosure-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  border-radius: 5px;
  background: var(--surface-muted);
  transition: transform 180ms var(--ease-out);
}

.disclosure[open] .disclosure-icon {
  transform: rotate(180deg);
}

.disclosure-content {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.wish-stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wish-table-title {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
}

.wish-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 12px;
}

.wish-table th,
.wish-table td {
  padding: 7px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.wish-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.wish-quality-pill {
  color: var(--wish-quality, var(--ink-2));
  font-weight: 680;
}

.wish-prop-name {
  color: var(--wish-quality, var(--ink-2));
  font-weight: 650;
}

.wish-history {
  margin-top: 18px;
}

.wish-recent-chip {
  margin: 0;
}

