* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

:root {
--bg: #f4efe7;
--surface: #ffffff;
--surface-soft: #fbf7f0;
--surface-muted: #f3ede2;
--border: rgba(104, 76, 43, 0.12);
--text: #221a12;
--text-soft: #6d604f;
--text-faint: #9b8d7a;
--primary: #c4682c;
--primary-deep: #9c4a18;
--danger: #d9485f;
--shadow: 0 24px 60px rgba(53, 35, 16, 0.12);
--radius-sm: 10px;
--radius-md: 14px;
--radius-lg: 16px;
--radius-xl: 20px;
--radius-pill: 999px;
--shadow-card: 0 14px 36px rgba(34, 26, 18, 0.05);
--shadow-card-soft: 0 6px 20px rgba(34, 26, 18, 0.05);
--shadow-floating: 0 10px 24px rgba(34, 26, 18, 0.05);
--shadow-primary: 0 16px 30px rgba(196, 104, 44, 0.22);
--shadow-primary-soft: 0 10px 22px rgba(156, 74, 24, 0.18);
--ring-primary: 0 0 0 4px rgba(196, 104, 44, 0.08);
}

html,
body {
min-height: 100%;
font-family: "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
font-size: 14px;
color: var(--text);
background:
  radial-gradient(circle at top left, rgba(255, 205, 148, 0.35), transparent 26%),
  linear-gradient(180deg, #f9f5ef 0%, #f1ebe2 100%);
}

body {
line-height: 1.5;
-webkit-user-select: none;
user-select: none;
}

input,
textarea {
-webkit-user-select: text;
user-select: text;
}

button,
input,
textarea {
font: inherit;
}

.app {
min-height: 100vh;
max-width: 100%;
margin: 0 auto;
background: transparent;
display: flex;
flex-direction: column;
}

.page {
display: none;
}

.page-active {
display: flex;
flex-direction: column;
min-height: 0;
flex: 1;
}

.main {
flex: 1;
overflow-y: auto;
padding-bottom: 120px;
}

.mobile-form-card,
.mobile-result-card {
  margin: 10px 16px 0;
  padding: 8px 0 0;
  border-radius: var(--radius-xl);
background: rgba(255, 255, 255, 0.9);
border: 1px solid rgba(104, 76, 43, 0.08);
box-shadow: var(--shadow-card);
}

.mobile-result-card {
  min-height: calc(100vh - 52px - 96px);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header {
position: sticky;
top: 0;
z-index: 120;
min-height: 68px;
padding: 14px 16px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
background: rgba(255, 252, 248, 0.88);
backdrop-filter: blur(14px);
border-bottom: 1px solid var(--border);
}

.header-brand {
min-width: 0;
display: flex;
align-items: center;
gap: 12px;
}

.brand-icon {
width: 40px;
height: 40px;
display: block;
flex-shrink: 0;
}

.brand-copy {
min-width: 0;
}

.brand-eyebrow {
display: block;
font-size: 11px;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--text-faint);
}

.brand-copy h1 {
font-size: 20px;
font-weight: 700;
}

.header-avatar-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-floating);
}

.sub-header {
  position: sticky;
  top: 0;
  z-index: 110;
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.page-active > .header ~ .sub-header {
  top: 68px;
}

.sub-header h1 {
font-size: 16px;
font-weight: 600;
}

.back-btn {
position: absolute;
left: 16px;
font-size: 20px;
cursor: pointer;
}

.section {
margin: 0;
padding: 12px 16px;
border-radius: 0;
background: transparent;
border: none;
box-shadow: none;
}

.section-bottom {
margin-bottom: 0;
}

.section-title {
font-size: 14px;
font-weight: 600;
margin-bottom: 6px;
}

.material-scroll {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}

.material-list {
display: flex;
gap: 12px;
}

.material-chip {
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-width: 78px;
min-height: 82px;
padding: 12px 16px;
border: 1px solid rgba(104, 76, 43, 0.12);
 border-radius: var(--radius-lg);
background: var(--surface-soft);
cursor: pointer;
transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.material-chip.selected {
color: #fff;
border-color: transparent;
background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
 box-shadow: var(--shadow-primary-soft);
}

.material-icon {
font-size: 22px;
margin-bottom: 5px;
}

.material-chip.selected .material-icon {
filter: brightness(1.1);
}

.material-name {
font-size: 11px;
font-weight: 500;
}

.text-input,
.login-input,
.size-input-wrap,
.quality-chip,
.upload-btn,
.content-input-panel {
  background: #fff;
}

.text-input,
.login-input,
.size-input-wrap,
.quality-chip,
.content-input-panel {
  border: 1px solid rgba(104, 76, 43, 0.14);
}

.text-input {
width: 100%;
min-height: 96px;
 padding: 12px 14px;
  border-radius: var(--radius-lg);
color: var(--text);
line-height: 1.7;
resize: none;
outline: none;
}

.text-input:focus {
  border-color: var(--primary);
 box-shadow: var(--ring-primary);
}

.text-input.error {
border-color: var(--danger);
box-shadow: none;
}

.content-input-panel {
  border-radius: var(--radius-xl);
overflow: hidden;
min-height: 200px;
display: flex;
flex-direction: column;
}

.content-input-panel:focus-within {
border-color: var(--primary);
box-shadow: var(--ring-primary);
}

.content-input-panel.error {
border-color: var(--danger);
box-shadow: none;
}

.text-input-merged {
min-height: 148px;
flex: 1;
border: none;
border-radius: 0;
box-shadow: none;
}

.text-input-merged:focus {
border: none;
box-shadow: none;
}

.content-panel-upload-row {
padding: 8px 12px 12px;
}

.text-counter {
  display: none;
}

.text-counter.over {
color: var(--danger);
}

.upload-area {
display: flex;
flex-wrap: wrap;
gap: 8px;
}

.upload-area-inline {
min-height: 64px;
flex-wrap: nowrap;
align-items: flex-start;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
}

.upload-btn {
width: 106px;
height: 106px;
border: 1px dashed rgba(104, 76, 43, 0.2);
 border-radius: var(--radius-lg);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
background: var(--surface-soft);
color: var(--text-faint);
cursor: pointer;
}

.upload-area-inline .upload-btn,
.upload-area-inline .upload-thumb {
width: 72px;
height: 72px;
 border-radius: var(--radius-md);
flex: 0 0 72px;
}

.upload-area-inline .upload-btn {
gap: 2px;
font-size: 11px;
}

.upload-area-inline .upload-plus {
font-size: 22px;
}

.upload-plus {
font-size: 26px;
line-height: 1;
}

.upload-thumb {
width: 86px;
height: 86px;
position: relative;
overflow: hidden;
 border-radius: var(--radius-lg);
 border: 1px solid rgba(104, 76, 43, 0.12);
}

.upload-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}

.upload-remove {
position: absolute;
top: 6px;
right: 6px;
width: 22px;
height: 22px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 12px;
background: rgba(22, 18, 14, 0.88);
cursor: pointer;
}

.upload-hint {
color: var(--text-faint);
font-size: 11px;
margin-left: 8px;
white-space: nowrap;
}

.size-row {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
max-width: 100%;
}

.size-input-wrap {
flex: 1;
min-width: 0;
height: 46px;
padding: 0 8px;
display: flex;
align-items: center;
border-radius: var(--radius-md);
}

.size-input-wrap:focus-within {
border-color: var(--primary);
box-shadow: var(--ring-primary);
}

.size-input-wrap.error {
border-color: var(--danger);
box-shadow: none;
}

.size-input {
flex: 1;
width: 0;
min-width: 0;
border: none;
outline: none;
background: transparent;
 font-size: 14px;
text-align: center;
}

input[type="number"].size-input::-webkit-outer-spin-button,
input[type="number"].size-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

input[type="number"].size-input {
-moz-appearance: textfield;
}

.size-step {
width: 36px;
height: 36px;
flex-shrink: 0;
border: none;
border-radius: 10px;
background: rgba(196, 104, 44, 0.08);
color: var(--primary-deep);
font-size: 18px;
line-height: 1;
cursor: pointer;
}

.size-unit,
.size-x,
.size-hint {
color: var(--text-faint);
}

.size-unit {
flex-shrink: 0;
margin: 0 4px;
font-size: 13px;
}

.size-x {
flex-shrink: 0;
}

.size-hint {
margin-top: 8px;
font-size: 12px;
}

.size-hint.error {
color: var(--danger);
}

.quality-row {
display: flex;
gap: 8px;
}

.quality-chip {
flex: 1;
height: 40px;
border-radius: var(--radius-md);
color: var(--text);
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}

.quality-chip.active {
color: #fff;
border-color: transparent;
background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
box-shadow: 0 4px 12px rgba(156, 74, 24, 0.18);
}

.quality-hint {
margin-top: 8px;
font-size: 12px;
color: var(--text-faint);
}

.btn-primary,
.btn-action,
.error-btn,
.btn-tweak,
.btn-share {
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary,
.btn-tweak,
.btn-share {
  width: 100%;
}

.mobile-action-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
padding: 12px 16px 16px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(14px);
border-top: 1px solid var(--border);
}

.btn-primary {
height: 50px;
border: none;
border-radius: var(--radius-lg);
color: #fff;
font-size: 16px;
background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
box-shadow: var(--shadow-primary);
}

.btn-primary:disabled {
opacity: 0.55;
cursor: not-allowed;
box-shadow: none;
}

.btn-action {
height: 48px;
border-radius: var(--radius-md);
font-size: 14px;
}

.btn-download {
color: #fff;
border: none;
background: linear-gradient(135deg, #24201c 0%, #4a3d30 100%);
}

.btn-regen {
border: 1px solid rgba(104, 76, 43, 0.16);
background: rgba(255, 255, 255, 0.92);
color: var(--text);
}

.btn-cancel {
border: 1px solid var(--border);
background: var(--surface-soft);
color: var(--text-soft);
}

.error-msg {
min-height: 0;
margin-top: 6px;
color: var(--danger);
font-size: 12px;
text-align: center;
}

.error-msg:empty {
display: none;
}

.loading-wrap,
.error-state,
.result-wrap {
width: 100%;
}

.loading-wrap {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80px 40px;
}

.loading-anim {
width: 60px;
height: 60px;
border: 3px solid rgba(0, 0, 0, 0.07);
border-top-color: var(--primary);
border-radius: 50%;
animation: spin 1s linear infinite;
}

@keyframes spin {
to {
  transform: rotate(360deg);
}
}

.loading-text {
margin-top: 18px;
font-size: 16px;
font-weight: 600;
}

.loading-sub {
margin-top: 4px;
color: var(--text-faint);
font-size: 12px;
}

.error-state {
display: flex;
flex-direction: column;
align-items: center;
padding: 48px 20px;
text-align: center;
}

.error-icon {
font-size: 48px;
margin-bottom: 14px;
}

.error-title {
font-size: 16px;
font-weight: 600;
margin-bottom: 8px;
}

.error-desc {
margin-bottom: 20px;
font-size: 12px;
color: var(--text-soft);
}

.error-btn {
padding: 10px 24px;
border: none;
border-radius: 12px;
background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
color: #fff;
}

.result-wrap {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
padding: 0;
border-radius: 0;
background: transparent;
border: none;
box-shadow: none;
}

.result-img-area {
width: 100%;
aspect-ratio: 1 / 1;
overflow: hidden;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #4b5563 0%, #374151 48%, #1f2937 100%);
box-shadow: inset 0 0 0 1px rgba(104, 76, 43, 0.08);
}

.result-img-area img {
width: 100%;
display: block;
max-width: 100%;
max-height: 100%;
object-fit: contain;
}

.result-dots {
display: flex;
gap: 6px;
margin: 14px 0 10px;
}

.detail-meta {
display: grid;
gap: 0;
width: 100%;
}

.detail-meta-row {
display: flex;
gap: 12px;
align-items: flex-start;
padding: 12px 0;
border-bottom: 1px solid rgba(104, 76, 43, 0.08);
}

.detail-meta-row:last-child {
border-bottom: none;
padding-bottom: 0;
}

.detail-meta-label {
flex-shrink: 0;
width: 60px;
font-size: 12px;
color: var(--text-faint);
}

.detail-meta-value {
flex: 1;
font-size: 14px;
color: var(--text);
line-height: 1.6;
word-break: break-all;
}

.result-dot {
width: 7px;
height: 7px;
padding: 0;
border: none;
border-radius: 50%;
background: rgba(104, 76, 43, 0.2);
cursor: pointer;
}

.result-dot.active {
background: var(--primary);
}

.result-quality-hint {
color: var(--text-faint);
font-size: 11px;
}

.detail-actions {
width: 100%;
display: flex;
gap: 12px;
margin-top: 16px;
}

.detail-actions-primary .btn-action {
flex: 1;
}

.btn-tweak {
 height: 48px;
color: #fff;
border: none;
background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
box-shadow: 0 8px 20px rgba(196, 104, 44, 0.18);
}

.btn-tweak:disabled {
opacity: 0.55;
cursor: not-allowed;
box-shadow: none;
}

.btn-share {
 height: 48px;
border: 1px solid rgba(104, 76, 43, 0.16);
background: rgba(255, 255, 255, 0.92);
color: var(--text);
}

.modify-modal-body {
display: flex;
flex-direction: column;
gap: 16px;
}

.modify-modal-body .login-input {
margin-bottom: 0;
}

.modify-textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 1px solid rgba(104, 76, 43, 0.14);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.6;
}

.modify-textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring-primary);
}

.modify-hint {
  margin-top: -2px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

.history-empty-actions {
  width: 100%;
  max-width: 280px;
  margin-top: 18px;
}

.history-empty-actions .btn-primary {
  width: 100%;
}

.detail-share-btn {
margin-top: 10px;
}

.detail-login-btn {
  margin-top: 10px;
}

.card {
  margin: 10px 16px 0;
  padding: 18px;
  border-radius: var(--radius-xl);
background: rgba(255, 255, 255, 0.9);
border: 1px solid rgba(104, 76, 43, 0.08);
box-shadow: var(--shadow-card);
}

.mine-main {
padding: 10px 0 96px;
}

.mine-profile {
display: flex;
flex-direction: column;
align-items: center;
padding: 28px 18px;
}

.mine-avatar {
width: 64px;
height: 64px;
margin-bottom: 12px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #2e2218 0%, #7a4e2f 100%);
border: none;
color: #fff;
font-size: 28px;
}

.mine-name {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mine-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
}

.mine-hint {
margin-top: 4px;
color: var(--text-soft);
font-size: 12px;
}

.mine-login-btn {
margin-top: 12px;
padding: 8px 28px;
font-size: 14px;
}

.help-page-content {
padding: 16px;
}

.help-section {
display: flex;
gap: 12px;
margin-bottom: 28px;
}

.help-step-num {
flex-shrink: 0;
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--primary);
color: #fff;
font-size: 14px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
margin-top: 2px;
}

.help-step-body {
flex: 1;
min-width: 0;
}

.help-step-title {
font-size: 14px;
font-weight: 600;
color: var(--text);
margin-bottom: 6px;
}

.help-step-desc {
font-size: 12px;
color: var(--text-soft);
line-height: 1.6;
margin-bottom: 12px;
}

.help-screenshot {
width: 100%;
border-radius: 10px;
border: 1px solid var(--border);
display: block;
margin-top: 4px;
}

.help-divider {
height: 1px;
background: var(--border);
margin: 8px 0 24px;
}

.help-faq-title {
font-size: 14px;
font-weight: 600;
color: var(--text);
margin-bottom: 16px;
}

.help-faq-item {
margin-bottom: 16px;
}

.help-faq-q {
font-size: 14px;
font-weight: 600;
color: var(--text);
margin-bottom: 4px;
}

.help-faq-a {
font-size: 12px;
color: var(--text-soft);
line-height: 1.6;
}

.points-card {
display: flex;
align-items: center;
justify-content: space-between;
}

.points-info {
display: flex;
align-items: baseline;
gap: 4px;
}

.points-num {
font-size: 36px;
font-weight: 700;
}

.points-label {
color: var(--text-faint);
}

.recharge-btn {
padding: 10px 18px;
border: none;
border-radius: 12px;
background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
color: #fff;
cursor: pointer;
font-weight: 600;
}

.menu-section {
padding: 2px 6px;
}

.menu-item {
display: flex;
align-items: center;
padding: 14px 12px;
border-bottom: 1px solid rgba(104, 76, 43, 0.08);
cursor: pointer;
}

.menu-item:last-child {
border-bottom: none;
}

.menu-icon {
font-size: 20px;
margin-right: 12px;
}

.menu-text {
flex: 1;
font-size: 15px;
}

.menu-arrow {
color: var(--text-faint);
}

.logout-btn {
width: calc(100% - 32px);
height: 48px;
margin: 16px 16px 0;
border-radius: 14px;
border: 1px solid rgba(217, 72, 95, 0.32);
color: var(--danger);
background: #fff;
cursor: pointer;
font-size: 15px;
font-weight: 600;
}

.invite-page-content {
padding: 10px 0 96px;
}

.invite-hero {
padding: 22px 18px;
background: linear-gradient(135deg, #fffaf4 0%, #fff 100%);
}

.invite-hero-title {
font-size: 18px;
font-weight: 700;
margin-bottom: 6px;
}

.invite-hero-desc {
color: var(--text-soft);
font-size: 13px;
line-height: 1.7;
}

.invite-stats {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
padding: 16px 10px;
}

.invite-stat {
display: flex;
flex-direction: column;
align-items: center;
gap: 3px;
}

.invite-stat-num {
font-size: 24px;
font-weight: 700;
color: var(--primary-deep);
}

.invite-stat-label {
font-size: 12px;
color: var(--text-soft);
}

.invite-card-title {
font-size: 15px;
font-weight: 600;
margin-bottom: 12px;
}

.invite-link-box {
padding: 12px;
border: 1px solid rgba(104, 76, 43, 0.12);
border-radius: 12px;
background: var(--surface-soft);
color: var(--text-soft);
font-size: 13px;
line-height: 1.6;
word-break: break-all;
user-select: text;
-webkit-user-select: text;
}

.invite-copy-btn {
width: 100%;
margin-top: 12px;
}

.invite-rule-item {
display: flex;
gap: 12px;
padding: 12px 0;
border-bottom: 1px solid rgba(104, 76, 43, 0.08);
}

.invite-rule-item:last-child {
border-bottom: none;
padding-bottom: 0;
}

.invite-rule-index {
flex-shrink: 0;
width: 24px;
height: 24px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
background: rgba(196, 104, 44, 0.12);
color: var(--primary-deep);
font-size: 12px;
font-weight: 700;
}

.invite-rule-title {
font-size: 14px;
font-weight: 600;
margin-bottom: 3px;
}

.invite-rule-desc {
font-size: 12px;
color: var(--text-soft);
line-height: 1.65;
}

.login-form-modal {
margin-bottom: 8px;
}

.login-input {
width: 100%;
height: 46px;
margin-bottom: 12px;
padding: 0 14px;
border-radius: var(--radius-md);
outline: none;
}

.login-input:focus {
border-color: var(--primary);
box-shadow: var(--ring-primary);
}

.invite-register-hint {
margin: -2px 0 12px;
padding: 9px 12px;
border-radius: var(--radius-sm);
background: rgba(196, 104, 44, 0.1);
color: var(--primary-deep);
font-size: 12px;
line-height: 1.5;
}

.login-switch {
text-align: center;
margin-top: 8px;
}

.login-switch span {
color: var(--primary-deep);
cursor: pointer;
font-size: 12px;
}

.history-list {
  padding: 12px 16px 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.history-card {
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-card-soft);
  overflow: hidden;
}

.history-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.history-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.history-card-empty {
  color: var(--text-faint);
  font-size: 12px;
}

.history-card-label {
  padding: 0 10px 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 32px 96px;
}

.history-empty-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7ed 0%, #fae7d1 48%, #f4d1b1 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 12px 30px rgba(196, 104, 44, 0.10);
}

.history-empty-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.history-empty-desc {
  color: var(--text-faint);
  font-size: 13px;
}

.history-retry-btn {
  margin-top: 16px;
  min-width: 140px;
}

.history-load-more-wrap {
  padding: 4px 16px 100px;
}

.history-load-more-btn {
  width: 100%;
  height: 46px;
}

.history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-xl);
background: #fff;
box-shadow: var(--shadow-card-soft);
}

.history-thumb {
width: 72px;
height: 72px;
flex: 0 0 72px;
border-radius: 14px;
overflow: hidden;
background: var(--surface-soft);
color: var(--text-faint);
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}

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

.history-info {
flex: 1;
min-width: 0;
}

.history-scene,
.history-prompt,
.history-size,
.history-date {
display: block;
}

.history-scene {
font-size: 15px;
font-weight: 600;
}

.history-prompt,
.history-size,
.history-date {
margin-top: 4px;
color: var(--text-soft);
font-size: 12px;
}

.modal {
position: fixed;
inset: 0;
z-index: 200;
display: flex;
align-items: flex-end;
justify-content: center;
background: rgba(26, 18, 12, 0.38);
}

.modal-content {
width: 100%;
max-width: 500px;
padding: 22px 20px 26px;
background: #fff;
  border-radius: 20px 20px 0 0;
animation: slideUp 0.3s ease;
}

@keyframes slideUp {
from {
  transform: translateY(100%);
}

to {
  transform: translateY(0);
}
}

.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}

.modal-header h3 {
font-size: 18px;
font-weight: 600;
}

.modal-close {
font-size: 24px;
color: var(--text-faint);
cursor: pointer;
}

.balance-info {
margin-bottom: 16px;
color: var(--text-soft);
}

.package-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 20px;
}

.package-item {
width: calc(50% - 5px);
padding: 16px;
border: 1px solid rgba(104, 76, 43, 0.14);
border-radius: 16px;
background: var(--surface-soft);
text-align: center;
cursor: pointer;
}

.package-item.selected {
border: 2px solid var(--primary);
background: rgba(196, 104, 44, 0.08);
}

.package-points {
font-size: 18px;
font-weight: 700;
}

.package-price {
margin-top: 4px;
color: var(--danger);
}

.confirm-actions {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
margin-top: 20px;
}

.contact-content {
text-align: center;
padding: 8px 0;
}

.contact-content p {
color: var(--text-soft);
margin-bottom: 16px;
}

.contact-wechat {
display: inline-block;
padding: 10px 24px;
margin-bottom: 16px;
border: 1px dashed rgba(104, 76, 43, 0.2);
border-radius: 12px;
background: var(--surface-soft);
font-size: 16px;
font-weight: 600;
letter-spacing: 0.04em;
}

.contact-qr {
margin: 0 auto 16px;
width: 180px;
height: 180px;
border-radius: 16px;
background: var(--surface-soft);
border: 1px dashed rgba(104, 76, 43, 0.2);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}

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

.global-toast {
position: fixed;
left: 50%;
bottom: 110px;
transform: translateX(-50%) translateY(12px);
max-width: calc(100vw - 32px);
padding: 12px 16px;
border-radius: 14px;
background: rgba(34, 26, 18, 0.92);
color: #fff;
font-size: 14px;
line-height: 1.4;
box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease, transform 0.2s ease;
z-index: 320;
}

.global-toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}

.fullscreen-viewer {
position: fixed;
inset: 0;
z-index: 400;
background: rgba(0, 0, 0, 0.95);
display: flex;
align-items: center;
justify-content: center;
}

.fullscreen-close {
position: absolute;
top: 16px;
right: 16px;
z-index: 410;
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.15);
color: #fff;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}

.fullscreen-img-wrap {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}

.fullscreen-img-wrap img {
max-width: 100vw;
max-height: 100vh;
object-fit: contain;
}

@media (min-width: 768px) {
  .main {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .mobile-form-card,
  .mobile-result-card {
    margin: 10px 0 0;
  }

  .card {
    margin: 10px 0 0;
  }

  .history-list {
    padding: 12px 0 24px;
  }
}

@media (min-width: 960px) {
  .main {
    max-width: 960px;
  }

  .history-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .main {
    padding-bottom: 104px;
  }

  .mobile-form-card {
    padding: 8px 0 0;
    border-radius: 20px;
    overflow: hidden;
  }

  .size-row {
    gap: 6px;
  }

  .size-step {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}
