/* ============================================================
   手作时光 - Claymorphism 2.0 · Vibrant Playful Theme
   Design System: ui-ux-pro-max
   Style: Claymorphism (soft 3D, chunky, playful, bubbly)
   Typography: Amatic SC / Cabin
   ============================================================ */

/* ---- Reset & Base ---- */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Cabin', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(135deg, #FFF0F3 0%, #E8F4FD 35%, #FFF8E1 65%, #F0FFF4 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.font-hand {
    font-family: 'Amatic SC', 'Noto Serif SC', cursive;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ---- Claymorphism 2.0 Core ---- */

.clay-card {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        6px 6px 12px rgba(180, 160, 200, 0.18),
        -4px -4px 10px rgba(255, 255, 255, 0.9),
        inset 2px 2px 4px rgba(255, 255, 255, 0.95),
        inset -2px -2px 4px rgba(180, 160, 200, 0.08);
    backdrop-filter: blur(8px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clay-card:hover {
    transform: translateY(-3px);
    box-shadow:
        8px 8px 18px rgba(180, 160, 200, 0.22),
        -5px -5px 12px rgba(255, 255, 255, 0.95),
        inset 2px 2px 4px rgba(255, 255, 255, 0.95),
        inset -2px -2px 4px rgba(180, 160, 200, 0.08);
}

.clay-card-selected {
    border-color: rgba(251, 113, 133, 0.5);
    box-shadow:
        6px 6px 14px rgba(251, 113, 133, 0.2),
        -3px -3px 10px rgba(255, 255, 255, 0.9),
        inset 2px 2px 6px rgba(251, 113, 133, 0.08),
        inset -1px -1px 3px rgba(255, 255, 255, 0.95);
}

/* ---- Buttons ---- */

.clay-btn {
    border-radius: 16px;
    border: 3px solid transparent;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        4px 4px 10px rgba(180, 160, 200, 0.2),
        -2px -2px 8px rgba(255, 255, 255, 0.85),
        inset 1px 1px 2px rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease-out;
}

.clay-btn:active {
    transform: scale(0.97);
    box-shadow:
        2px 2px 5px rgba(180, 160, 200, 0.15),
        -1px -1px 4px rgba(255, 255, 255, 0.6),
        inset 2px 2px 5px rgba(180, 160, 200, 0.12);
}

.clay-btn-primary {
    background: linear-gradient(135deg, #E11D48 0%, #DB2777 50%, #EA580C 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.clay-btn-primary:hover {
    background: linear-gradient(135deg, #BE123C 0%, #BE185D 50%, #C2410C 100%);
}

.clay-btn-secondary {
    background: rgba(255, 255, 255, 0.75);
    color: #6B4D34;
    border-color: rgba(255, 255, 255, 0.6);
}

.clay-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* ---- Input ---- */

.clay-input {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 16px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 2px 2px 6px rgba(180, 160, 200, 0.1),
        inset -1px -1px 3px rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.clay-input:focus {
    border-color: rgba(251, 113, 133, 0.4);
    box-shadow:
        inset 2px 2px 6px rgba(180, 160, 200, 0.1),
        inset -1px -1px 3px rgba(255, 255, 255, 0.9),
        0 0 0 3px rgba(251, 113, 133, 0.12);
    outline: none;
}

/* ---- Badge ---- */

.clay-badge {
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        3px 3px 8px rgba(180, 160, 200, 0.15),
        -2px -2px 5px rgba(255, 255, 255, 0.8),
        inset 1px 1px 2px rgba(255, 255, 255, 0.6);
}

/* ---- Header & Bottom Bar ---- */

.clay-header {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    border-bottom: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 4px 16px rgba(180, 160, 200, 0.1),
        inset 0 -1px 0 rgba(255, 255, 255, 0.6);
}

.clay-bottom-bar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-top: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 -4px 16px rgba(180, 160, 200, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ---- Step Indicators ---- */

.clay-step {
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        3px 3px 8px rgba(180, 160, 200, 0.15),
        -2px -2px 5px rgba(255, 255, 255, 0.85),
        inset 1px 1px 2px rgba(255, 255, 255, 0.6);
}

.clay-step-active {
    background: linear-gradient(135deg, #E11D48, #DB2777);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        3px 3px 10px rgba(225, 29, 72, 0.3),
        -2px -2px 5px rgba(255, 255, 255, 0.8),
        inset 1px 1px 3px rgba(255, 255, 255, 0.35);
}

.clay-step-done {
    background: linear-gradient(135deg, #34D399, #6EE7B7);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        3px 3px 10px rgba(52, 211, 153, 0.3),
        -2px -2px 5px rgba(255, 255, 255, 0.8),
        inset 1px 1px 3px rgba(255, 255, 255, 0.35);
}

/* ---- Decorative Blobs (playful background) ---- */

.clay-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

.clay-blob-1 {
    width: 300px; height: 300px;
    background: #FBBF24;
    top: -50px; right: -80px;
}

.clay-blob-2 {
    width: 250px; height: 250px;
    background: #A78BFA;
    bottom: 20%; left: -60px;
}

.clay-blob-3 {
    width: 200px; height: 200px;
    background: #6EE7B7;
    top: 40%; right: -40px;
}

/* ---- Scrollbar ---- */

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ---- Text Utilities ---- */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Flash Messages ---- */

.flash-msg {
    animation: flashIn 0.3s ease-out, flashOut 0.5s ease-in 4s forwards;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flashOut {
    to {
        opacity: 0; transform: translateY(-10px);
        height: 0; padding: 0; margin: 0; border: 0; overflow: hidden;
    }
}

/* ---- Animations ---- */

.animate-bounce-clay {
    animation: bounceClay 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceClay {
    0% { opacity: 0; transform: scale(0.3) rotate(-5deg); }
    50% { opacity: 1; transform: scale(1.08) rotate(1deg); }
    70% { transform: scale(0.96) rotate(-0.5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---- Card Selection ---- */

.product-card input:checked + div,
.bag-type-card input:checked + div {
    border-color: rgba(251, 113, 133, 0.5);
}

/* ---- Image Placeholder ---- */

.img-placeholder {
    background: linear-gradient(135deg, #FFF0F3 0%, #E8F4FD 100%);
}

/* ---- Upload Zone ---- */

.upload-zone {
    border: 3px dashed rgba(251, 113, 133, 0.4);
    border-radius: 20px;
    transition: all 0.2s;
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #FB7185;
    background-color: rgba(251, 113, 133, 0.05);
}

/* ---- Loading ---- */

.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255, 240, 243, 0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 44px; height: 44px;
    border: 4px solid #E8F4FD;
    border-top-color: #FB7185;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---- Sticky Header ---- */

#sticky-header {
    transition: box-shadow 0.2s;
}
#sticky-header.scrolled {
    box-shadow: 0 4px 20px -4px rgba(180, 160, 200, 0.12);
}

/* ---- Form Controls ---- */

input[type="radio"] { accent-color: #FB7185; }
input[type="checkbox"] { accent-color: #FB7185; }

@supports selector(:has(*)) {
    label:has(input:checked) .peer-checked\:border-rose {
        border-color: #FB7185;
    }
}

/* ---- Secret Code Glow ---- */

.secret-code-glow {
    text-shadow: 0 0 24px rgba(251, 113, 133, 0.35);
}

/* ---- Lazy Load Images ---- */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([data-src]) {
    opacity: 1;
}

/* ---- Upload Progress ---- */

.upload-progress {
    height: 4px;
    background: #E8F4FD;
    border-radius: 2px;
    overflow: hidden;
}
.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FB7185, #FBBF24);
    border-radius: 2px;
    transition: width 0.3s;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .font-hand { letter-spacing: 0.01em; }
    .pb-24 { padding-bottom: 7rem; }
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- Print ---- */

@media print {
    nav, footer, .no-print, button, form { display: none !important; }
    body { background: white; }
    .clay-card { box-shadow: none !important; border: 1px solid #eee !important; }
}
