:root {
  --account-page: #f8f5ef;
  --account-ink: #252525;
  --account-muted: #6f706b;
  --account-line: rgba(37,37,37,.1);
  --account-accent: #a9774c;
  --account-panel: rgba(255,255,255,.9);
  --account-shadow: 0 18px 48px rgba(37,37,37,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--account-page);
  color: var(--account-ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.account-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-copy,
.balance-card,
.login-notice,
.image-workspace,
.account-panel {
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: var(--account-panel);
  box-shadow: var(--account-shadow);
}

.hero-copy {
  padding: 24px;
}

.hero-copy span,
.balance-card span,
.panel-head span {
  color: var(--account-accent);
  font-size: 12px;
  font-weight: 900;
}

.hero-copy h1 {
  margin: 10px 0 8px;
  font-size: 32px;
  line-height: 1.12;
}

.hero-copy p {
  margin: 0;
  color: var(--account-muted);
  line-height: 1.7;
}

.balance-card {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 22px;
}

.balance-card strong {
  font-size: 38px;
  line-height: 1;
}

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

.balance-actions a,
.balance-actions button,
.login-notice button,
.toolbar-actions button,
.image-card-actions button,
.image-card-actions a,
.thumb-actions a,
.thumb-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #252525;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.balance-actions button,
.toolbar-actions button,
.image-card-actions button,
.image-card-actions a.secondary,
.thumb-actions a,
.thumb-actions button {
  border: 1px solid var(--account-line);
  background: rgba(255,255,255,.82);
  color: var(--account-ink);
}

.toolbar-actions button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.image-card-actions button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.image-card-actions button.danger,
.thumb-actions button.danger {
  border-color: rgba(164,61,50,.22);
  background: rgba(255,246,243,.82);
  color: #8f3328;
}

.image-card-actions button.danger:hover,
.thumb-actions button.danger:hover {
  background: #8f3328;
  color: #fff;
}

.login-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.login-notice span {
  flex: 1;
  color: var(--account-muted);
}

.login-notice[hidden] { display: none; }

.image-workspace {
  padding: 18px;
}

.image-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.image-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.image-toolbar strong {
  font-size: 22px;
}

.image-toolbar span,
.data-row span,
.compact-row span,
.empty,
.image-card-meta,
.image-card-title span {
  color: var(--account-muted);
  font-size: 13px;
  line-height: 1.5;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-actions select {
  min-height: 38px;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: rgba(255,255,255,.8);
  color: var(--account-ink);
  font: inherit;
  padding: 0 12px;
}

#downloadPageBtn {
  border-color: rgba(169,119,76,.28);
  background: #252525;
  color: #fff;
}

.image-package-list {
  display: grid;
  gap: 14px;
}

.image-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: rgba(255,255,255,.66);
}

.image-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.image-card-title {
  display: grid;
  gap: 4px;
}

.image-card-title strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}

.suite-index {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(169,119,76,.18);
  border-radius: 999px;
  background: rgba(169,119,76,.08);
  color: #7a5635;
  font-size: 12px;
  font-weight: 900;
}

.image-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37,37,37,.08);
}

.task-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c6a15b, #252525);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
}

.thumb-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.thumb-card.pending .thumb-frame {
  border-style: dashed;
  background:
    linear-gradient(110deg, rgba(255,255,255,.18) 8%, rgba(255,255,255,.62) 18%, rgba(255,255,255,.18) 33%),
    linear-gradient(135deg, rgba(169,119,76,.09), rgba(37,37,37,.04));
  background-size: 220% 100%, 100% 100%;
  animation: account-card-breathe 2.4s ease-in-out infinite, account-card-shimmer 2.8s linear infinite;
}

.thumb-card.failed {
  padding: 8px;
  border: 1px solid rgba(164,61,50,.22);
  border-radius: 8px;
  background: rgba(255,246,243,.72);
}

.thumb-card label {
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.thumb-frame {
  position: relative;
  display: block;
  aspect-ratio: var(--thumb-ratio, 1 / 1);
  overflow: hidden;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: #f3efe7;
  color: inherit;
  text-decoration: none;
}

.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-placeholder {
  display: grid;
  gap: 8px;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--account-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.thumb-placeholder b,
.thumb-placeholder small {
  display: block;
}

.thumb-placeholder b {
  color: var(--account-ink);
  font-size: 14px;
}

.thumb-placeholder small {
  max-width: 12em;
  line-height: 1.45;
}

.thumb-name {
  min-width: 0;
  color: var(--account-ink);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb-actions a {
  min-height: 32px;
  font-size: 12px;
}

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

.thumb-actions button {
  min-height: 32px;
  font-size: 12px;
}

@keyframes account-card-breathe {
  0%, 100% { opacity: .78; }
  50% { opacity: 1; }
}

@keyframes account-card-shimmer {
  0% { background-position: 220% 0, 0 0; }
  100% { background-position: -220% 0, 0 0; }
}

.thumb-actions a,
.thumb-actions button {
  flex: 1 1 72px;
}

.thumb-error {
  margin: 0;
  color: #a43d32;
  font-size: 12px;
  line-height: 1.45;
}

.image-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--account-line);
  border-radius: 10px;
  background: rgba(255,255,255,.72);
}

.pagination-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.pagination-copy strong {
  white-space: nowrap;
}

.pagination-copy span {
  color: var(--account-muted);
  font-size: 13px;
}

.image-pagination select {
  min-height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: #fff;
  color: var(--account-ink);
  font-weight: 800;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.pagination-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: #fff;
  color: var(--account-ink);
  font-weight: 900;
}

.pagination-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 18px 18px;
}

.account-panel {
  min-height: 180px;
  padding: 18px;
  box-shadow: none;
}

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

.panel-head strong {
  font-size: 17px;
}

.profile-list,
.data-list,
.compact-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-list div,
.data-row,
.compact-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: rgba(255,255,255,.62);
}

.profile-list dt {
  color: var(--account-muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-list dd {
  margin: 0;
  font-weight: 900;
}

.data-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.data-row strong,
.compact-row strong {
  display: block;
  margin-bottom: 4px;
}

.data-row em {
  color: var(--account-accent);
  font-style: normal;
  font-weight: 900;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--account-line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #252525;
  color: #fff;
  box-shadow: var(--account-shadow);
  font-weight: 800;
}

.toast.error {
  background: #8f3328;
}

@media (max-width: 860px) {
  .account-shell {
    width: min(100vw - 24px, 1180px);
    padding-top: 20px;
  }

  .account-hero,
  .image-toolbar,
  .image-card-head,
  .account-grid,
  .data-row {
    grid-template-columns: 1fr;
  }

  .toolbar-actions,
  .image-card-actions,
  .image-pagination,
  .pagination-copy {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .image-card-actions,
  .pagination-actions {
    justify-content: stretch;
  }

  .toolbar-actions > *,
  .image-card-actions > *,
  .pagination-actions > *,
  .image-pagination select {
    flex: 1 1 160px;
  }

  .login-notice {
    align-items: stretch;
    flex-direction: column;
  }
}
