// 用户中心页面样式，负责账户、额度、兑换、趋势和流水区域的响应式布局。
.account-view {
  --account-content-max: 1200px;
  min-height: 100dvh;
  padding: var(--space-xl) var(--page-gutter);
  background: var(--web-bg);
  user-select: text;
}
.account-view ::selection {
  color: var(--web-text-strong);
  background: var(--web-brand-soft);
}
.account-view button,
.account-view :deep(.el-button) {
  user-select: none;
}
.account-dashboard {
  max-width: var(--account-content-max);
  margin-inline: auto;
  display: grid;
  grid-template-areas:
    "chart chart"
    "summary records";
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.48fr);
  align-items: stretch;
  gap: var(--space-lg);
}
.account-card header p {
  margin-top: var(--space-xs);
  color: var(--web-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
}
.summary-grid {
  grid-area: summary;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-lg);
}
.profile-card {
  order: 1;
}
.balance-card {
  order: 2;
}
.redeem-card {
  order: 3;
}
.account-card {
  min-width: 0;
  padding: var(--space-xl);
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: var(--radius-lg);
}
.redeem-card {
  grid-column: auto;
}
.account-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.account-card h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
}
.account-card header > span {
  color: var(--web-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
}
.card-state,
.section-state {
  margin-top: var(--space-lg);
}
.profile-main {
  margin-top: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.avatar-control {
  width: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
}
.avatar-button {
  width: 56px;
  height: 56px;
  padding: 0;
  position: relative;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--web-text);
  background: var(--web-raised);
  border: 1px solid var(--web-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.avatar-button:hover:not(:disabled) {
  background: var(--web-hover);
  border-color: var(--web-line-emphasis);
}
.avatar-button:disabled {
  color: var(--web-text-disabled);
  cursor: not-allowed;
}
.avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-button i {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  color: var(--web-text-strong);
  background: var(--web-primary);
  border-radius: 6px;
  font-style: normal;
}
.avatar-input {
  display: none;
}
.profile-copy {
  min-width: 0;
  flex: 1;
}
.profile-copy p {
  margin-top: var(--space-xs);
  color: var(--web-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  overflow-wrap: anywhere;
}
.username-display,
.username-edit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.username-display strong {
  min-width: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.username-display button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--web-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color 0.18s,
    background-color 0.18s;
}
.username-display button:hover:not(:disabled) {
  color: var(--web-text);
  background: var(--web-hover);
}
.username-edit {
  flex-wrap: wrap;
}
.username-field {
  width: min(220px, 100%);
  min-width: 160px;
  flex: 1 1 180px;
}
.username-field small {
  margin-top: var(--space-xs);
  display: block;
  color: var(--web-muted);
  font-size: var(--font-size-xs);
}
.username-field small.error {
  color: var(--web-danger);
}
.metric-grid {
  margin-top: var(--space-lg);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--web-line);
}
.metric-grid > div {
  min-width: 0;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
}
.metric-grid > div + div {
  border-left: 1px solid var(--web-line);
}
.metric-grid span {
  color: var(--web-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
}
.metric-grid strong {
  margin-top: var(--space-xs);
  font-size: var(--font-size-metric);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.redeem-form {
  margin-top: var(--space-lg);
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: var(--space-md);
}
.redeem-field {
  width: 100%;
  min-width: 0;
}
.redeem-field small {
  margin-top: var(--space-xs);
  display: block;
  color: var(--web-muted);
  font-size: 11px;
}
.redeem-form :deep(.el-button) {
  width: 100%;
  flex: 0 0 auto;
  margin-left: 0;
}
.redeem-form :deep(.el-button--primary.is-disabled),
.redeem-form :deep(.el-button--primary.is-disabled:hover) {
  color: var(--web-accent-muted);
  background: var(--web-brand-soft);
  border-color: var(--web-brand-soft);
  cursor: not-allowed;
}
.account-view :deep(.el-button),
.account-view :deep(.el-input__inner) {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
}
.chart-card {
  grid-area: chart;
}
.chart-card :deep(.consumption-chart) {
  margin-top: var(--space-md);
  height: 176px;
}
.records-card {
  grid-area: records;
  padding-bottom: var(--space-md);
}
.records-summary {
  margin-top: 14px;
}
.empty-state {
  padding: 48px 16px;
  color: var(--web-muted);
  line-height: 1.6;
  text-align: center;
}
.dialog-record-list {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
:global(.records-dialog.el-dialog) {
  height: min(560px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
}
:global(.records-dialog.el-dialog .el-dialog__body) {
  min-height: 0;
  padding-block: 0;
  flex: 1;
  overflow: hidden;
}
:global(.records-dialog.el-dialog .el-dialog__footer) {
  flex: 0 0 auto;
}
.avatar-preview {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--space-lg);
}
.avatar-preview img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border: 1px solid var(--web-line);
  border-radius: var(--radius-lg);
}
.avatar-preview p {
  color: var(--web-muted);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 960px) {
  .account-dashboard {
    grid-template-areas:
      "chart"
      "summary"
      "records";
    grid-template-columns: minmax(0, 1fr);
  }
  .redeem-card {
    grid-column: auto;
  }
  .summary-grid {
    height: auto;
    justify-content: flex-start;
  }
  .chart-card :deep(.consumption-chart) {
    margin-top: var(--space-sm);
    height: 190px;
  }
}
@media (min-width: 961px) and (max-height: 900px) {
  .account-view {
    padding-block: var(--space-lg);
  }
  .account-dashboard {
    gap: var(--space-md);
  }
  .chart-card :deep(.consumption-chart) {
    height: 150px;
  }
}
@media (max-width: 767px) {
  .account-view {
    padding: var(--space-lg) var(--page-gutter-mobile) 40px;
  }
  .account-card {
    padding: var(--space-xl);
  }
  .profile-main {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .password-button {
    width: 100%;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .metric-grid > div {
    padding-inline: 0;
  }
  .metric-grid > div + div {
    border-top: 1px solid var(--web-line);
    border-left: 0;
  }
  .redeem-form {
    align-items: stretch;
    flex-direction: column;
  }
  .redeem-form :deep(.el-button) {
    width: 100%;
  }
}
