*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ================= 主题颜色体系 ================= */
:root {
    --sakura:    #c8a882;
    --sakura-lt: #f0e8da;
    --blush:     #e8d8c4;
    --cream:     #faf6f0;
    --gold:      #a8885a;
    --gold-lt:   #ede0cc;
    --text:      #2e2418;
    --text-soft: rgba(46,36,24,0.50);
    --glass:     rgba(255,253,248,0.52);
    --glass-b:   rgba(255,253,248,0.78);
    --blur:      blur(18px);
    --radius:    18px;
    --shadow:    0 8px 32px rgba(120,90,50,0.12);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
    min-height: 100vh;
    background-color: #f0ede8;
    background-image:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(220,210,195,0.60) 0%, transparent 65%),
        radial-gradient(ellipse 60% 50% at 85% 20%, rgba(200,220,210,0.40) 0%, transparent 60%),
        radial-gradient(ellipse 70% 55% at 50% 90%, rgba(215,205,190,0.45) 0%, transparent 65%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 16px 56px;
    overflow-x: hidden;
}

button, input, select, textarea {
    font-family: inherit;
}

.petal {
    position: fixed; pointer-events: none; z-index: 0; opacity: 0;
    font-size: 20px; animation: petFloat linear infinite;
}
@keyframes petFloat {
    0%   { opacity: 0; transform: translateY(-30px) rotate(-10deg) scale(0.8); }
    8%   { opacity: 0.72; }
    88%  { opacity: 0.52; }
    100% { opacity: 0; transform: translateY(100vh) rotate(15deg) scale(1.05) translateX(35px); }
}

header { position: relative; z-index: 2; text-align: center; margin-bottom: 28px; }
.logo-sub { font-size: 11px; letter-spacing: 4px; color: var(--gold); margin-bottom: 10px; display: block; font-weight: 700; }
header h1 { font-size: 22px; font-weight: 900; color: var(--text); letter-spacing: 1px; line-height: 1.35; margin-bottom: 6px; }
.tagline { font-size: 11px; color: var(--text-soft); font-weight: 500; letter-spacing: 0.8px; }
.divider-sakura { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px auto 0; color: var(--gold); font-size: 16px; }
.divider-sakura::before, .divider-sakura::after { content: ''; width: 38px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.divider-sakura::after { background: linear-gradient(90deg, var(--gold), transparent); }

main {
    position: relative; z-index: 2; width: 100%; max-width: 420px;
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255,255,255,0.75); border-radius: 24px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.9);
    padding: 26px 22px 28px; overflow: hidden;
    transition: all 0.3s ease;
}

.upload-zone {
    border: 1.5px dashed var(--sakura); border-radius: var(--radius); padding: 26px 16px;
    text-align: center; cursor: pointer; transition: all 0.3s ease;
    background: rgba(240,230,215,0.30); margin-bottom: 16px; position: relative; overflow: hidden;
}
.upload-zone:hover { border-color: var(--gold); background: rgba(225,210,188,0.38); transform: translateY(-2px); box-shadow: 0 6px 22px rgba(160,120,70,0.15); }
.upload-zone #upload-icon i { color: var(--text-soft); font-size: 32px; display: block; margin-bottom: 8px; }
#upload-text { font-size: 13px; color: var(--text-soft); font-weight: 700; letter-spacing: 0.5px; }
#file-upload { display: none; }

.section-ja { font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--gold); text-align: center; margin-bottom: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.section-ja::before, .section-ja::after { content: '✦'; font-size: 7px; color: var(--sakura); }

/* 🌟 加入Flex布局保证图标和文字完美对齐 */
.btn-primary {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; background: linear-gradient(135deg, #b8895a 0%, #9a6a38 60%, #7a4e22 100%);
    color: #fff; font-weight: 700; font-size: 14px; padding: 14px;
    border-radius: 14px; border: none; cursor: pointer; transition: all 0.28s ease;
    box-shadow: 0 4px 18px rgba(154,106,56,0.38), inset 0 1px 0 rgba(255,255,255,0.22); letter-spacing: 1px;
}
.btn-primary i { font-size: 18px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(154,106,56,0.52); }

#step-loading { text-align: center; padding: 56px 0; }
.loader-ring { width: 50px; height: 50px; margin: 0 auto 18px; position: relative; }
.loader-ring::before, .loader-ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; }
.loader-ring::before { border: 2.5px solid var(--blush); }
.loader-ring::after { border: 2.5px solid transparent; border-top-color: var(--gold); border-right-color: var(--gold); animation: spin 1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-dots { font-size: 13px; color: var(--text-soft); font-weight: 700; letter-spacing: 1px; }
.loading-dots span { animation: blink 1.4s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{ opacity:0.2; } 40%{ opacity:1; } }

.fade-in { animation: fadeUp 0.45s cubic-bezier(0.22,1,0.36,1); }
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }

.result-title { font-size: 15px; font-weight: 700; text-align: center; color: var(--text); margin-bottom: 16px; letter-spacing: 1px; }

/* ================= 画布与控制面板 (全新响应式布局) ================= */
.editor-area {
    display: flex;
    flex-direction: column; /* 🌟 关键：从左右排列改为上下排列 */
    justify-content: center; 
    align-items: center;
    gap: 15px; 
    margin-bottom: 20px;
    width: 100%;
}

.mockup-container {
    position: relative; 
    width: 100%;    /* 🌟 占满卡片宽度 */
    height: 360px;  /* 🌟 高度缩短，变成偏正方形，适合衣服/帽子 */
    background: rgba(255,255,255,0.4); 
    border: 2px dashed rgba(200,168,120,0.5); /* 加个虚线框增加质感 */
    overflow: hidden;
    border-radius: 24px;
    transition: transform 0.4s ease;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mockup-mask {
    position: absolute; top:0; left:0; width:100%; height:100%;
    z-index: 10;
    object-fit: contain; /* 🌟 核心：确保图片完整显示，不被裁剪 */
    pointer-events: none; transition: opacity 0.3s ease;
}

#sticker-canvas {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 20;
}

.sticker-instance {
    position: absolute; width: 100px; 
    object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
    transform-origin: center center; cursor: grab;
    user-select: none; -webkit-user-select: none;
}
.sticker-instance:active { cursor: grabbing; }
.active-sticker {
    outline: 2px dashed var(--gold); outline-offset: 4px;
    /* 彻底去掉了 filter 属性，消除棕色扩散阴影 */
}

/* 控制面板变宽 */
.control-panel {
    background: rgba(245,238,228,0.55); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(200,168,120,0.30); 
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(120, 90, 50, 0.06); 
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%; /* 🌟 占满卡片宽度 */
    flex-shrink: 0;
}

/* 🌟 新增：按钮横向排列行 */
.ctrl-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
}

.panel-title { font-size: 13px; color: #7a5228; font-weight: 700; letter-spacing: 1px; text-align: center; margin-bottom: 4px; }

/* 调整按钮样式适配横向排版 */
.icon-btn {
    flex: 1; /* 🌟 自动平分宽度 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* 缩小一点图标和文字的间距 */
    background: rgba(255, 252, 245, 0.75); 
    border: 1px solid rgba(180, 148, 100, 0.35); 
    border-radius: 10px;
    padding: 10px 4px; /* 减小内边距 */
    color: #4a3827; 
    font-size: 12px; /* 稍微缩小字体 */
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn i { font-size: 16px; }
.icon-btn:hover:not(:disabled) { background: rgba(255, 252, 245, 0.95); color: #2e2418; border-color: rgba(168, 136, 90, 0.65); }
.icon-btn:active:not(:disabled) { transform: scale(0.96); }
.icon-btn:disabled { opacity: 0.6; cursor: not-allowed; background: rgba(255, 252, 245, 0.4); border-color: rgba(180, 148, 100, 0.2); }
.danger-btn:hover:not(:disabled) { color: #ff4d4f; background: #fff1f0; border-color: #ffa39e; }
/* ================= 底部表单与结算区 ================= */
.form-panel {
    background: rgba(245,238,228,0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(200,168,120,0.30); border-radius: var(--radius); padding: 16px 14px; margin-bottom: 14px;
}

.ja-select, .ja-input { width: 100%; border: 1px solid rgba(180,148,100,0.35); padding: 11px 13px; border-radius: 12px; outline: none; background: rgba(255,252,245,0.75); font-size: 13px; color: var(--text); font-weight: 500; transition: all 0.22s; margin-bottom: 9px; appearance: none; -webkit-appearance: none; }
.ja-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a8885a'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.ja-select:focus, .ja-input:focus { border-color: rgba(168,136,90,0.65); background: rgba(255,252,245,0.95); box-shadow: 0 0 0 3px rgba(200,168,120,0.18); }
.ja-select:disabled { background: rgba(255,252,245,0.35); color: var(--text-soft); cursor: not-allowed; }

/* 🌟 加入Flex布局保证图标和文字完美对齐 */
.btn-order { 
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; background: linear-gradient(135deg, #5c3a1a 0%, #8a5a28 55%, #b8895a 100%); 
    color: #fdf6ec; font-weight: 700; font-size: 14px; letter-spacing: 1px; padding: 14px; 
    border-radius: 14px; border: none; cursor: pointer; transition: all 0.28s ease; 
    box-shadow: 0 4px 20px rgba(90,58,26,0.34), inset 0 1px 0 rgba(255,255,255,0.15); margin-bottom: 8px; 
}
.btn-order i { font-size: 18px; }
.btn-order:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(90,58,26,0.52); }

.btn-reset { 
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; background: transparent; color: var(--text-soft); font-size: 13px; 
    font-weight: 600; padding: 8px; border-radius: 12px; border: none; cursor: pointer; transition: all 0.2s; 
}
.btn-reset i { font-size: 16px; }
.btn-reset:hover { color: var(--text); background: rgba(210,185,148,0.25); }

.checkout-panel { background: rgba(236,252,238,0.50); border: 1px solid rgba(134,210,144,0.35); border-radius: var(--radius); padding: 20px 16px; text-align: center; margin-bottom: 14px; }
.order-code-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.72); border: 1px solid rgba(134,210,144,0.40); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
#display-order-code { font-size: 15px; font-family: 'Courier New', monospace; font-weight: 700; color: #2d6a3f; letter-spacing: 0.5px; }
#copy-btn { background: rgba(180,240,190,0.45); color: #2d6a3f; border: 1px solid rgba(100,200,120,0.40); padding: 6px 13px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
#copy-btn:hover { background: rgba(180,240,190,0.75); }
#copy-btn.copied { background: #3a7a4e; color: #fff; }

.btn-buy-base {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; background: var(--text); color: #fdf6ec; font-weight: 700;
    font-size: 14px; letter-spacing: 1px; padding: 14px; border-radius: 14px;
    text-decoration: none; transition: all 0.28s ease; box-shadow: 0 4px 18px rgba(46, 36, 24, 0.25);
    margin-top: 15px;
}
.btn-buy-base i { font-size: 18px; }
.btn-buy-base:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(46, 36, 24, 0.4); background: #000000; }

.hidden { display: none !important; }
/* ================= 画布默认提示文字 ================= */
.mockup-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #7a5228;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.6;
    width: 80%;
    pointer-events: none; /* 让鼠标穿透它，不影响拖拽 */
    z-index: 5;
    transition: opacity 0.3s ease;
}
/* ================= 网站底部 (Footer) 样式 ================= */
.site-footer {
    width: 100%;
    padding: 30px 16px 20px;
    margin-top: 30px; /* 和上面的卡片保持距离 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 2;
    position: relative;
}

.social-links { 
    display: flex; 
    gap: 16px; 
    justify-content: center; 
}

.social-icon {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(46, 36, 24, 0.08); /* 适配页面的大地色系 */
    color: var(--text);
    transition: all 0.3s ease; text-decoration: none;
}
.social-icon:hover { 
    background: var(--text); 
    color: #fff; 
    transform: translateY(-2px); 
}

.footer-links {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px;
    font-size: 11px; font-weight: 400;
}
.footer-links a { 
    color: var(--text-soft); 
    text-decoration: none; 
    transition: color 0.3s; 
}
.footer-links a:hover { color: var(--text); }

.copyright { 
    font-size: 10px; 
    color: var(--text-soft); 
    margin-top: 8px; 
}

/* ================= 弹窗 (Modal) 样式 ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
    z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-window {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -45%);
    width: 90%; max-width: 500px;
    background: #1c1c1c; /* 使用深色背景，兼容你官网代码里的白色字体 */
    color: #fff;
    border-radius: 20px; padding: 32px 24px;
    z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.modal-window.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }

.modal-close-btn {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,0.1); border: none; color: #fff;
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.2); }
/* ================= 结算按钮状态控制 ================= */
.btn-order:disabled {
    background: #d1d5db !important; 
    color: #9ca3af !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

/* 填完邮箱后激活的绿色 */
.btn-order.active-green {
    background: linear-gradient(135deg, #3a7a4e 0%, #5a9a6e 100%) !important;
    box-shadow: 0 4px 20px rgba(58,122,78,0.34) !important;
    color: #fff !important;
}
/* ================= 进度条样式 ================= */
#step-loading { text-align: center; padding: 46px 0; }

.progress-container {
    width: 85%;
    max-width: 320px;
    height: 14px;
    background: rgba(200, 168, 120, 0.2);
    border-radius: 20px;
    margin: 0 auto 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c8a882, #a8885a);
    border-radius: 20px;
    transition: width 0.4s ease-out; /* 让进度条涨起来很丝滑 */
}

.progress-text {
    font-size: 16px;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.progress-warning {
    font-size: 12px;
    color: #e53e3e; /* 醒目的红色警告 */
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(229, 62, 62, 0.1);
    padding: 8px 14px;
    border-radius: 8px;
    display: inline-flex;
}
.progress-warning i { font-size: 16px; }

/* ================= 表单漏选报错样式 ================= */
.error-border {
    border-color: #ff4d4f !important;
    background: rgba(255, 77, 79, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.15) !important;
    animation: shake-error 0.4s ease-in-out;
}

@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
/* ================= 按钮 Loading 旋转动画 ================= */
.ph-spin {
    display: inline-block; /* 必须加上这个，图标才能旋转 */
    animation: spin 1s linear infinite; /* 1秒转一圈，匀速，无限循环 */
}
