:root {
  --bg: #eef8f5;
  --panel: #ffffff;
  --panel-soft: #f2faf7;
  --text: #17211f;
  --muted: #727d7a;
  --line: #dfe8e5;
  --brand: #087d68;
  --brand-dark: #064e3b;
  --brand-soft: #e2f4ee;
  --selected: #e11d48;
  --danger: #0b6b58;
  --shadow: 0 16px 42px rgba(6, 78, 59, 0.13);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 6%, rgba(8, 125, 104, 0.14), transparent 28%),
    linear-gradient(180deg, #f7fffc, var(--bg));
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.login-page,
.mobile-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fbfefd;
  border-left: 1px solid rgba(6, 78, 59, 0.14);
  border-right: 1px solid rgba(6, 78, 59, 0.14);
}

.login-page {
  display: grid;
  place-items: stretch;
  padding: 12px;
}

.login-card {
  min-height: calc(100vh - 24px);
  padding: 34px 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.16), transparent 20%),
    linear-gradient(155deg, #0b8a70, var(--brand-dark));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.login-card::after {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 10%;
  height: 110px;
  background: repeating-radial-gradient(circle at center, rgba(255,255,255,0.28) 0 1px, transparent 1px 10px);
  opacity: 0.28;
  transform: rotate(-7deg);
}

.logo-mark {
  width: 78px;
  height: 78px;
  margin: 0 auto 30px;
  display: grid;
  place-items: center;
  color: var(--brand-dark);
  background: #fff;
  border-radius: 18px;
  font-size: 36px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.login-card h1 {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 84px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
}

.google-button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 780;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
}

.google-button {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  color: var(--text);
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
  position: relative;
  z-index: 1;
}

.google-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #f5fbf9;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, #0a9277, var(--brand));
  box-shadow: 0 10px 20px rgba(8, 125, 104, 0.18);
}

.secondary-button {
  color: var(--brand-dark);
  background: #fff;
  border-color: #b9ded1;
}

.ghost-button {
  color: var(--brand);
  background: transparent;
}

.danger-button {
  width: 100%;
  color: var(--brand-dark);
  background: #eef8f4;
  border-color: #cce7dc;
}

.full-width {
  width: 100%;
}

.mobile-shell {
  position: relative;
  padding-bottom: 84px;
}

.mobile-content {
  min-height: calc(100vh - 84px);
  padding: 14px 14px 24px;
}

.mobile-app-header,
.page-header {
  min-height: 54px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.mobile-app-header h2,
.page-header h2 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.mobile-time {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brand);
  font-size: 24px;
  font-weight: 900;
}

.mobile-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  transform: translateX(-50%);
  height: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(6,78,59,0.08);
  z-index: 20;
}

.mobile-bottom-nav button {
  border: 0;
  background: transparent;
  color: #6e7775;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 800;
}

.mobile-bottom-nav span {
  font-size: 20px;
  line-height: 1;
}

.mobile-bottom-nav button.active {
  color: var(--brand);
}

.notice {
  border: 1px solid #b9ded1;
  background: #f0faf6;
  color: var(--brand-dark);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin: 6px 0 14px;
}

.step {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #8a9390;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 0;
  font-size: 11px;
  font-weight: 800;
}

.step-number {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #d8e0de;
  color: transparent;
  overflow: hidden;
}

.step.active {
  color: var(--brand);
}

.step.active .step-number {
  background: var(--brand);
}

.mobile-card,
.task-card,
.profile-card,
.account-panel,
.creation-tools,
.package-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(6, 78, 59, 0.06);
}

.step-card {
  min-height: 540px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.step-card h3,
.account-panel h3,
.page-header h2 {
  letter-spacing: 0;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.step-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.field label {
  font-size: 14px;
  font-weight: 820;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

.helper {
  color: var(--muted);
  font-size: 13px;
}

.text-count {
  text-align: right;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: auto;
}

.candidate-list,
.tasks-list,
.package-list,
.action-option-list {
  display: grid;
  gap: 10px;
}

.candidate {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.candidate.selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.radio-dot {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #b6c4c0;
  border-radius: 50%;
  margin-top: 3px;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.candidate.selected .radio-dot {
  border: 5px solid var(--brand);
}

.candidate h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.candidate p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.asset-upload-block {
  display: grid;
  gap: 14px;
}

.asset-drop {
  border: 1px dashed #a8d1c2;
  border-radius: 8px;
  background: #f5fcf9;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.primary-upload {
  min-height: 190px;
  color: var(--brand);
  cursor: pointer;
}

.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand);
  display: block;
  margin-bottom: 10px;
}

.asset-drop img,
.subject-preview img,
.task-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-drop input,
.qr-upload-row input {
  display: none;
}

.qr-upload-row {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.qr-upload-row span {
  font-weight: 850;
}

.qr-upload-row small {
  color: var(--brand);
  font-weight: 780;
}

.subject-preview {
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  margin-bottom: 14px;
}

.preview-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.style-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.style-card,
.action-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 14px;
  font-weight: 820;
}

.style-card {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  padding: 10px;
}

.style-card.selected,
.action-option.selected {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.style-card.selected {
  border-color: var(--selected);
  color: var(--text);
  background: #fff7f8;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.16);
}

.style-image-wrap {
  position: relative;
  display: block;
}

.style-copy {
  display: grid;
  gap: 9px;
  padding: 2px 2px 0;
}

.style-template-image {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--selected);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.22);
}

.style-card h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.style-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}

.style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.style-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef8f4;
  border: 1px solid rgba(8, 125, 104, 0.12);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.generation-progress {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(8, 125, 104, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fffc, #eef8f4);
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-dark);
  font-weight: 900;
}

.progress-head strong {
  font-size: 24px;
  color: var(--brand);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeae5;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b6b58, #13a07f);
  box-shadow: 0 0 18px rgba(19, 160, 127, 0.26);
}

.progress-checklist {
  display: grid;
  gap: 8px;
}

.progress-checklist span {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.action-option {
  display: grid;
  gap: 4px;
}

.action-option small {
  color: var(--muted);
  font-weight: 650;
}

.poster-frame {
  width: min(100%, 280px);
  margin: 8px auto 18px;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fcfa, #e2f4ee 55%, #0f7f6a);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  color: #12352f;
  position: relative;
}

.poster-frame.ratio-1-1 { aspect-ratio: 1 / 1; }
.poster-frame.ratio-3-4 { aspect-ratio: 3 / 4; }
.poster-frame.ratio-4-5 { aspect-ratio: 4 / 5; }
.poster-frame.ratio-9-16 { aspect-ratio: 9 / 16; }
.poster-frame.ratio-16-9 { aspect-ratio: 16 / 9; }

.poster-brand,
.poster-title,
.poster-subtitle,
.poster-bottom {
  position: relative;
  z-index: 2;
}

.poster-brand {
  font-size: 12px;
  font-weight: 850;
  color: var(--brand-dark);
}

.poster-title {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.12;
}

.poster-subtitle {
  color: #315f55;
  font-weight: 700;
  font-size: 13px;
}

.poster-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.poster-subject {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 58%;
  height: 62%;
  object-fit: cover;
  object-position: center;
  opacity: 0.96;
  border-left: 10px solid rgba(255, 255, 255, 0.7);
  border-top: 10px solid rgba(255, 255, 255, 0.7);
}

.poster-abstract {
  position: absolute;
  right: -12%;
  bottom: -6%;
  width: 70%;
  height: 58%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.58), transparent 32%),
    linear-gradient(135deg, rgba(124, 179, 164, 0.58), rgba(15, 127, 106, 0.7));
  border-radius: 42% 0 0 0;
}

.poster-cta {
  font-weight: 860;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  padding: 8px 12px;
}

.qr-box {
  width: 64px;
  height: 64px;
  border: 5px solid #173b35;
  background: #fff;
  object-fit: contain;
}

.generated-image {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.page-header {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  margin-bottom: 12px;
}

.page-header h2 {
  grid-column: 1 / -1;
  text-align: left;
  font-size: 22px;
}

.recharge-header h2 {
  grid-column: 2;
  text-align: left;
}

.creation-tools {
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 10px;
}

.search-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
}

.filter-row,
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip,
.task-meta span,
.provider-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-chip.active,
.provider-chip.ready {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.provider-chip.mock {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.task-card {
  padding: 10px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.task-thumb {
  height: 70px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.task-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.task-card .actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.task-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-panel {
  padding: 14px;
  margin-bottom: 12px;
}

.profile-main-card {
  display: grid;
  gap: 12px;
}

.profile-heading {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.avatar-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.profile-heading h3,
.section-title h3 {
  margin: 0;
  font-size: 18px;
}

.profile-heading p,
.section-title p,
.account-panel > p,
.package-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.edit-profile-button {
  grid-column: 1 / -1;
  min-height: 40px;
}

.outline-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
  cursor: pointer;
}

.credit-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #eef8f4;
}

.credit-balance-card span,
.account-info-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.credit-balance-card strong {
  font-size: 30px;
  color: var(--text);
}

.credit-balance-card small {
  color: var(--muted);
  font-weight: 900;
}

.compact-button {
  min-height: 44px;
  min-width: 112px;
}

.account-info-list {
  display: grid;
  gap: 10px;
}

.account-info-list div {
  padding: 13px;
  border-radius: 8px;
  background: #f2eee7;
}

.account-info-list strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
}

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

.profile-card {
  padding: 14px;
}

.profile-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.profile-card strong {
  font-size: 30px;
  color: #2f3940;
}

.profile-card small {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 800;
}

.provider-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  background: #fbfdfc;
  color: var(--muted);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.section-icon {
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.overview-card {
  min-height: 92px;
  padding: 14px;
  border-radius: 8px;
  background: #f2eee7;
}

.overview-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 900;
}

.overview-card strong {
  color: var(--text);
  font-size: 30px;
}

.profile-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.subsection-title {
  margin: 14px 0 10px;
  font-size: 16px;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-record,
.activity-empty,
.recharge-empty {
  border-radius: 8px;
  background: #f2eee7;
}

.activity-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
}

.activity-record strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.activity-record span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.activity-record b {
  color: var(--text);
  font-size: 18px;
}

.activity-empty {
  padding: 16px;
  color: var(--muted);
}

.recharge-empty {
  display: grid;
  gap: 12px;
  padding: 14px;
  color: var(--muted);
}

.account-operations {
  padding-bottom: 18px;
}

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

.package-card {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.package-card h4 {
  margin: 0 0 4px;
  font-size: 18px;
}

.package-card strong {
  color: var(--brand);
  font-size: 28px;
}

.package-price {
  color: var(--text);
  font-weight: 800;
}

.package-price b {
  font-size: 22px;
}

.package-card .primary-button {
  grid-column: 2;
  grid-row: 2;
}

.payment-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 420px) {
  .login-page,
  .mobile-shell {
    border: 0;
  }

  .mobile-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .step-card {
    min-height: 520px;
  }
}
