:root {
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --bg-color: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #333333;
    --text-muted: #666666;
    --border: rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 背景模糊形狀 (Blobs) */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(14, 165, 233, 0.4);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 350px;
    height: 350px;
    background: rgba(2, 132, 199, 0.4);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* 玻璃擬態容器 */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(to right, #FF5A5F, #4A70D0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

header .slogan {
    font-size: 18px;
    font-weight: 600;
    color: #4A70D0;
    margin-bottom: 8px;
}

/* 表單樣式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.required {
    color: var(--primary);
}

input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.2);
    background: #ffffff;
}

input::placeholder {
    color: #94a3b8;
}

/* 按鈕樣式 */
.primary-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(255, 90, 95, 0.6);
}

.primary-btn:active {
    transform: translateY(0);
}

/* 狀態切換 */
.hidden {
    display: none !important;
}

/* 載入動畫 */
#loading-section {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.05);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* 結果區塊 */
#result-section {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

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

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.result-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.result-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #4A70D0;
}

textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    outline: none;
    margin-bottom: 12px;
}

.copy-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.copy-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Responsive Web Design (RWD) for mobile devices */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .glass-panel {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    header h1 {
        font-size: 22px;
    }
    
    header p {
        font-size: 14px !important;
    }
    
    .success-icon {
        font-size: 36px;
    }
    
    .result-card {
        padding: 16px;
    }
}

.design-spec-card {
    margin: 0 0 24px;
    padding: 14px 16px;
    border: 1px solid rgba(14, 165, 233, 0.24);
    border-radius: 14px;
    background: rgba(240, 249, 255, 0.78);
}

.design-spec-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0369a1;
    font-size: 14px;
    font-weight: 700;
}

.design-spec-swatch {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 1px solid rgba(15, 23, 42, 0.25);
    border-radius: 999px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

#design-spec-text {
    margin-top: 8px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

.design-spec-note {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 600px) {
    body {
        align-items: flex-start;
        min-height: 100dvh;
        padding: 12px;
    }

    .glass-panel {
        width: 100%;
        max-width: none;
        padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
    }

    input,
    .primary-btn,
    .copy-btn {
        min-height: 48px;
    }

    .design-spec-card {
        padding: 13px 14px;
    }

    #result-image {
        max-height: 70dvh;
        object-fit: contain;
    }
}

@media (max-width: 360px) {
    .glass-panel {
        padding-left: 12px;
        padding-right: 12px;
    }

    header h1 {
        font-size: 20px;
    }
}
