:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2d241f;
  background: #f7f4ef;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f7f4ef; }
button, input { font: inherit; }
.hidden { display: none !important; }

.account-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 12px max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid rgba(73, 56, 45, 0.08);
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(18px);
}

.account-brand { display: flex; align-items: center; gap: 18px; color: inherit; text-decoration: none; }
.account-brand img { width: 148px; height: auto; }
.account-brand span { display: grid; gap: 2px; padding-left: 18px; border-left: 1px solid rgba(73, 56, 45, 0.12); }
.account-brand strong { font-size: 17px; }
.account-brand small { color: #8a817a; font-size: 11px; }
.account-top-actions { display: flex; align-items: center; gap: 10px; }
.account-top-actions a { padding: 9px 14px; border: 1px solid rgba(73, 56, 45, 0.11); border-radius: 999px; background: #fff; color: #53463e; font-size: 13px; text-decoration: none; }
.account-top-actions a:hover { border-color: #7b5b48; }

.account-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  width: min(1440px, calc(100% - 48px));
  margin: 30px auto 64px;
}

.account-sidebar,
.account-content {
  border: 1px solid rgba(73, 56, 45, 0.09);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(62, 43, 31, 0.06);
}

.account-sidebar { position: sticky; top: 108px; align-self: start; padding: 18px 14px 14px; }
.account-profile { display: flex; align-items: center; gap: 12px; padding: 10px 10px 20px; border-bottom: 1px solid rgba(73, 56, 45, 0.08); }
.profile-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: #0f8b8d; color: #fff; font-weight: 700; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-profile div { display: grid; min-width: 0; gap: 3px; }
.account-profile strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.account-profile span:not(.profile-avatar) { color: #8a817a; font-size: 11px; }
#accountNav { display: grid; gap: 4px; padding: 14px 0; }
#accountNav button, .account-logout { width: 100%; min-height: 43px; padding: 10px 13px; border: 0; border-radius: 11px; background: transparent; color: #5c5049; text-align: left; cursor: pointer; }
#accountNav button:hover, #accountNav button.active { background: #f6f1eb; color: #2d211a; }
#accountNav button.active { box-shadow: inset 3px 0 #6c4d3b; font-weight: 700; }
.account-logout { margin-top: 4px; border-top: 1px solid rgba(73, 56, 45, 0.08); border-radius: 0 0 11px 11px; color: #a14335; }

.account-content { min-height: 680px; padding: 30px; }
.account-content-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.account-content-head div > span { color: #927561; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.account-content-head h1 { margin: 7px 0 0; font-size: 27px; letter-spacing: 0; }
.account-content-head p { max-width: 420px; margin: 23px 0 0; color: #8a817a; font-size: 13px; text-align: right; }
.account-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 320px; color: #8a817a; }
.account-loading span { width: 18px; height: 18px; border: 2px solid #e5ddd5; border-top-color: #6c4d3b; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.account-error, .empty-state { display: grid; place-items: center; gap: 10px; min-height: 290px; padding: 40px; border: 1px dashed rgba(73, 56, 45, 0.16); border-radius: 16px; color: #8a817a; text-align: center; }
.account-error a, .empty-state a { color: #6c4d3b; font-weight: 700; }

.works-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.work-card, .order-row, .ai-row, .coupon-card, .address-card, .settings-card { overflow: hidden; border: 1px solid rgba(73, 56, 45, 0.09); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(62, 43, 31, 0.04); }
.work-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(145deg, #ebe4dc, #f8f5f0); }
.work-cover img { width: 100%; height: 100%; object-fit: cover; }
.work-cover span { position: absolute; top: 10px; right: 10px; padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.9); color: #655247; font-size: 11px; backdrop-filter: blur(8px); }
.work-body { display: grid; gap: 11px; padding: 15px; }
.work-body h2 { margin: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.work-body time { color: #8a817a; font-size: 11px; }
.card-actions { display: flex; gap: 8px; }
.card-actions a, .card-actions button { flex: 1; padding: 9px 10px; border: 1px solid rgba(73, 56, 45, 0.12); border-radius: 10px; background: #fff; color: #4b3d35; font-size: 12px; text-align: center; text-decoration: none; cursor: pointer; }
.card-actions .primary-action { border-color: #2e2119; background: #2e2119; color: #fff; }

.data-list { display: grid; gap: 12px; }
.order-row, .ai-row, .address-card { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1.5fr) minmax(100px, .7fr) minmax(110px, .8fr) auto; align-items: center; gap: 16px; padding: 17px 18px; }
.row-main, .row-detail { display: grid; gap: 4px; min-width: 0; }
.row-main strong, .row-detail strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.row-main span, .row-detail span, .order-row time, .ai-row time { color: #8a817a; font-size: 11px; }
.status-pill { justify-self: start; padding: 6px 9px; border-radius: 999px; background: #f3eee8; color: #695345; font-size: 11px; font-weight: 700; }
.status-pill.success { background: #eaf6f0; color: #28734d; }
.status-pill.warning { background: #fff4df; color: #9a6a13; }
.row-link { padding: 8px 11px; border: 1px solid rgba(73, 56, 45, 0.12); border-radius: 9px; color: #4b3d35; font-size: 12px; text-decoration: none; white-space: nowrap; }

.coupon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.coupon-card { display: grid; grid-template-columns: 112px 1fr; min-height: 142px; }
.coupon-value { display: grid; place-items: center; align-content: center; gap: 2px; border-right: 1px dashed rgba(73,56,45,.16); background: #fbf4ea; color: #a44a35; }
.coupon-value strong { font-size: 28px; }
.coupon-value span { font-size: 11px; }
.coupon-info { display: grid; align-content: center; gap: 7px; padding: 18px; }
.coupon-info strong { font-size: 14px; }
.coupon-info span { color: #8a817a; font-size: 11px; }
.coupon-info .expired { color: #a14335; }

.address-card { grid-template-columns: minmax(130px, .7fr) minmax(180px, .7fr) minmax(280px, 2fr); }
.settings-card { max-width: 680px; padding: 24px; }
.settings-card label { display: grid; gap: 8px; margin-bottom: 16px; color: #74685f; font-size: 12px; }
.settings-card input { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid rgba(73,56,45,.14); border-radius: 11px; color: #2d241f; outline: none; }
.settings-card input:focus { border-color: #7b5b48; box-shadow: 0 0 0 3px rgba(108,77,59,.08); }
.settings-card button { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 11px; background: #2e2119; color: #fff; font-weight: 700; cursor: pointer; }
.settings-result { min-height: 20px; margin: 12px 0 0; color: #28734d; font-size: 12px; }

.creation-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.creation-toolbar > a { flex: 0 0 auto; padding: 10px 14px; border-radius: 10px; background: #2e2119; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; }
.creation-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.creation-filters button { min-height: 36px; padding: 8px 13px; border: 1px solid rgba(73,56,45,.11); border-radius: 999px; background: #fff; color: #73645b; font-size: 12px; cursor: pointer; }
.creation-filters button:hover, .creation-filters button.active { border-color: #6c4d3b; background: #f7f1eb; color: #35271f; }
.ai-creation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ai-creation-card { overflow: hidden; border: 1px solid rgba(73,56,45,.09); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(62,43,31,.04); }
.ai-creation-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f1ece5; }
.ai-creation-cover img { width: 100%; height: 100%; object-fit: cover; }
.creation-badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; background: #f4eee7; color: #634b3c; font-size: 10px; font-weight: 800; }
.ai-creation-cover .creation-badge { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); }
.creation-badge.fun { color: #8a4f1d; background: rgba(255, 245, 228, .94); }
.creation-badge.cartoon { color: #75529a; }
.creation-badge.upscale { color: #216778; }
.creation-badge.remove { color: #27714d; }
.creation-badge.scene { color: #9b611e; }
.ai-creation-body { display: grid; gap: 8px; padding: 15px; }
.ai-creation-body h2 { margin: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.ai-creation-body time { color: #8a817a; font-size: 11px; }
.ai-creation-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 4px; }
.ai-creation-actions button, .ai-creation-actions a { min-height: 36px; padding: 8px 7px; border: 1px solid rgba(73,56,45,.12); border-radius: 9px; background: #fff; color: #4b3d35; font-size: 11px; text-align: center; text-decoration: none; cursor: pointer; }
.ai-creation-actions .primary-action { border-color: #2e2119; background: #2e2119; color: #fff; }
.ai-creation-actions .danger-action { color: #a14335; }
.ai-creation-actions button:disabled { opacity: .55; cursor: wait; }
.account-shell.shared-mode { grid-template-columns: minmax(0, 1fr); max-width: 1080px; }
.shared-creation { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 28px; align-items: center; }
.shared-creation > img { width: 100%; max-height: 650px; border-radius: 18px; background: #eee8e1; object-fit: contain; box-shadow: 0 18px 48px rgba(62,43,31,.1); }
.shared-creation > div { display: grid; gap: 12px; }
.shared-creation h2 { margin: 0; font-size: 24px; }
.shared-creation time { color: #8a817a; font-size: 12px; }
.shared-creation a { width: fit-content; padding: 12px 18px; border-radius: 11px; background: #2e2119; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }

@media (max-width: 1050px) {
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-creation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-row, .ai-row { grid-template-columns: 1fr 1.2fr auto; }
  .order-row time, .ai-row time { display: none; }
}

@media (max-width: 760px) {
  .account-topbar { min-height: 68px; padding: 10px 16px; }
  .account-brand img { width: 112px; }
  .account-brand span { display: none; }
  .account-top-actions a { padding: 8px 10px; font-size: 11px; }
  .account-shell { display: block; width: calc(100% - 24px); margin: 14px auto 38px; }
  .account-sidebar { position: static; padding: 12px; }
  .account-profile { padding: 6px 6px 13px; }
  #accountNav { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px 0; }
  #accountNav button { padding: 8px 4px; text-align: center; font-size: 12px; }
  #accountNav button.active { box-shadow: inset 0 -2px #6c4d3b; }
  .account-logout { min-height: 38px; padding: 7px; text-align: center; }
  .account-content { min-height: 520px; margin-top: 12px; padding: 20px 14px; }
  .account-content-head { display: block; }
  .account-content-head h1 { font-size: 23px; }
  .account-content-head p { margin: 8px 0 0; text-align: left; }
  .works-grid, .coupon-grid { grid-template-columns: 1fr; }
  .ai-creation-grid { grid-template-columns: 1fr; }
  .creation-toolbar { align-items: stretch; flex-direction: column; }
  .creation-toolbar > a { text-align: center; }
  .shared-creation { grid-template-columns: 1fr; }
  .order-row, .ai-row, .address-card { grid-template-columns: 1fr auto; gap: 10px; }
  .order-row .row-detail, .ai-row .row-detail, .address-card .row-detail { grid-column: 1 / -1; }
  .row-link { grid-column: 1 / -1; text-align: center; }
}
