/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    min-height: 100vh;
}

/* 导航栏样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 2rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(45deg, #2980b9, #3498db, #2980b9);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-menu a {
    color: #34495e;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-auth a {
    color: #fff;
    text-decoration: none;
    background: #3498db;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
    transition: all 0.3s ease;
}

.nav-auth a:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 页面容器样式 */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.usage-count {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* 美化工具容器 */
.tool-container {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* 美化上传区域 */
.drop-zone {
    border: 2px dashed #3498db;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.02) 0%, rgba(52, 152, 219, 0.08) 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.drop-zone:hover::before {
    transform: translateX(100%);
}

.drop-zone:hover {
    transform: translateY(-3px);
    border-color: #2980b9;
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.15);
}

.upload-icon {
    color: #3498db;
    margin-bottom: 2rem;
    transform: scale(1.2);
    transition: all 0.4s ease;
    filter: drop-shadow(0 4px 6px rgba(52, 152, 219, 0.2));
}

.drop-zone:hover .upload-icon {
    transform: scale(1.4) translateY(-8px);
    filter: drop-shadow(0 8px 12px rgba(52, 152, 219, 0.3));
}

.upload-tip {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    color: #3498db;
    margin-top: 1rem;
}

/* 美化图片列表 */
.image-list {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* 美化设置面板 */
.settings-panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem;
    margin: 3rem 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.setting-group {
    position: relative;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.setting-group label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 0 10px;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
}

/* ���化方向按钮 */
.direction-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.direction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.direction-btn .icon {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.direction-btn:hover {
    transform: translateY(-3px);
    border-color: #3498db;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.15);
}

.direction-btn.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.25);
}

.direction-btn.active .icon {
    transform: scale(1.1);
}

/* 美化滑块控件 */
.spacing-control {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    border-radius: 4px;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid #3498db;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

#spacingValue {
    min-width: 60px;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 20px;
    text-align: center;
    font-weight: 500;
    color: #3498db;
}

/* 美化颜色选择器 */
.color-control {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

input[type="color"] {
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

input[type="color"]:hover {
    transform: scale(1.1);
}

.small-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid #3498db;
    border-radius: 25px;
    background: white;
    color: #3498db;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.small-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

/* 美化网格设置 */
.grid-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-group input {
    width: 100px;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 美化结果区域 */
.result-section {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    margin-top: 3rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.result-preview {
    position: relative;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

#resultImage {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#resultImage:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.result-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* 美化按钮样式 */
.button-group {
    margin-top: 2.5rem;
    text-align: center;
}

.primary-btn,
.secondary-btn,
.danger-btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(52, 152, 219, 0.4);
}

.primary-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 8px 20px rgba(127, 140, 141, 0.3);
}

.danger-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

/* 美化通知框 */
.notice-box {
    margin-top: 4rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, #fff8e1 0%, #fffdf7 100%);
    border-radius: 20px;
    border-left: 5px solid #f39c12;
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.1);
}

.notice-box h3 {
    color: #f39c12;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notice-box h3::before {
    content: '📝';
    font-size: 1.6rem;
}

.notice-box ul {
    list-style: none;
    padding-left: 1rem;
}

.notice-box li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    color: #666;
}

.notice-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background: #f39c12;
    border-radius: 50%;
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        gap: 1rem;
        margin-top: 1rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .tool-container {
        padding: 1.5rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .settings-panel,
    .result-section {
        padding: 1.5rem;
    }
}

.hidden {
    display: none;
}

/* 底部版权样式 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin: 0.5rem 0;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 0;
        margin-top: 3rem;
    }

    .footer-content {
        padding: 0 1rem;
    }

    .footer p {
        font-size: 0.9rem;
    }
} 