:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #EEF2FF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

.main-content {
    background-color: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
}

.upload-section {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.upload-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.upload-icon {
    width: 1.25rem;
    height: 1.25rem;
}

input[type="file"] {
    display: none;
}

.upload-tip {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.options-section {
    margin: 1rem auto;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    max-width: 400px;
}

.option-item {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.radio-label:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.radio-label input[type="radio"] {
    width: 0;
    height: 0;
    position: absolute;
    opacity: 0;
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary);
    font-weight: 500;
}

.radio-label.shape-option {
    position: relative;
    width: 3rem;
    height: 3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.radio-label.shape-option:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.radio-label.shape-option input[type="radio"]:checked + .shape-icon {
    color: var(--primary);
}

.radio-label.shape-option input[type="radio"]:checked + .shape-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    z-index: -1;
}

.shape-icon {
    width: 1.5rem;
    height: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.shape-icon.none {
    border: 2px solid currentColor;
}

.shape-icon.rounded {
    border: 2px solid currentColor;
    border-radius: 0.375rem;
}

.shape-icon.circle {
    border: 2px solid currentColor;
    border-radius: 50%;
}

.shape-icon.heart {
    color: currentColor;
}

.shape-icon.heart::before {
    content: '♥';
    font-size: 1.5rem;
    line-height: 1;
}

.radio-label.grid-option {
    position: relative;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-label.grid-option input[type="radio"]:checked {
    color: var(--primary);
}

.radio-label.grid-option input[type="radio"]:checked + .grid-icon {
    border-color: var(--primary);
}

.radio-label.grid-option input[type="radio"]:checked + .grid-icon + span {
    color: var(--primary);
    font-weight: 500;
}

.grid-icon {
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid currentColor;
    position: relative;
    display: grid;
    gap: 1px;
}

.grid-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: currentColor;
    opacity: 0.1;
}

.grid-icon.grid-9 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.grid-icon.grid-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.preview-section {
    margin: 1.5rem 0;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 0 auto;
    max-width: 600px;
    transition: all 0.3s ease;
}

/* 4宫格特殊样式 */
.grid-container[data-grid="4"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 400px;
    gap: 1rem;
}

.grid-container[data-grid="4"] .grid-item {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.grid-item {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.grid-item:hover {
    transform: scale(1.02);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.button-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.image-item:hover {
    transform: scale(1.02);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.download-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    padding: 0.375rem;
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(0.5rem);
}

.image-item:hover .download-btn {
    opacity: 1;
    transform: translateY(0);
}

.download-btn:hover {
    background-color: var(--primary-dark);
}

.download-btn .btn-icon {
    width: 1rem;
    height: 1rem;
}

.footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .upload-section {
        padding: 1rem;
    }

    .button-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .grid-container {
        gap: 0.25rem;
    }
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
}

.nav-logo img {
    height: 2rem;
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

/* 调整主容器位置以适应导航栏 */
.container {
    margin-top: 4rem;
} 

.info-box {
    background-color: #f8fafc;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 40px;
    border-left: 4px solid #3498db;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.info-box h2 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.info-box h2 i {
    color: #3498db;
    margin-right: 10px;
}

.info-box p {
    color: #7f8c8d;
    margin: 10px 0;
    line-height: 1.6;
}

.info-box h2 {
    position: relative; /* 关键 */
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.info-box h2::after {
    content: '';
    position: absolute;
    bottom: -4px;       /* 下划线离文本的距离 */
    left: 0;
    width: 60px;        /* 下划线长度 */
    height: 2px;        /* 下划线粗细 */
    background: linear-gradient(90deg, #3498db, transparent);
}