/* 基础样式 */
* {
    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);
}

.nav-auth a:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 容器样式 */
.container {
    max-width: 1000px;
    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: 1.5rem 0 3rem;
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: inline-block;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.usage-count::before {
    content: '👥';
    margin-right: 0.5rem;
}

/* 工具容器样式 */
.tool-container {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.drop-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f6f8fa 0%, #f1f4f6 100%);
}

.drop-zone:hover {
    border-color: #3498db;
    background: linear-gradient(135deg, #f1f4f6 0%, #e9ecef 100%);
}

.preview-section {
    margin-top: 2rem;
}

.preview-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.preview-grid {
    position: relative;
    width: 100%;
    height: 100%;
}

#previewCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 底部版权样式 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem 0;
    margin-top: 4rem;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    color: #7f8c8d;
}

.footer-content p {
    margin: 0.8rem 0;
    font-size: 0.95rem;
}

.footer-content a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #3498db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-menu li {
        flex: 0 0 auto;
    }

    .nav-menu a {
        font-size: 0.95rem;
        white-space: nowrap;
        padding: 0.5rem 0.8rem;
    }

    .tool-container {
        padding: 1.5rem;
    }

    .grid-options {
        gap: 0.5rem;
    }

    .grid-option {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 通用工具类 */
.hidden {
    display: none;
}

/* 新增的多格切图工具特有样式 */
.grid-control {
    margin-bottom: 1.5rem;
}

.grid-options {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.grid-option {
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grid-option:hover {
    border-color: #3498db;
    color: #3498db;
}

.grid-option.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.quality-control {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quality-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quality-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.custom-size {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.custom-size input {
    width: 100px;
    padding: 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
}

/* 动态网格线样式 */
.grid-lines {
    display: grid;
    transition: all 0.3s ease;
}

.grid-lines.grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.grid-lines.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.grid-lines.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.grid-lines.grid-1x2 {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.grid-lines.grid-2x3 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

/* 按钮组样式优化 */
.button-group {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03);
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 1.2rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.primary-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.primary-btn:active {
    transform: translateY(1px);
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.3s;
}

.primary-btn:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.secondary-btn {
    background: #95a5a6;
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.secondary-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
}

.secondary-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* 切图预览区域优化 */
.result-section {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.result-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.result-section h3::before {
    content: '✨';
    font-size: 1.6rem;
}

.result-grid {
    display: grid;
    gap: 1.2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

.result-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.result-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.result-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.result-item:hover img {
    transform: scale(1.05);
}

.result-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item:hover::after {
    opacity: 1;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        padding: 1rem;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        padding: 1rem;
    }

    .result-grid {
        gap: 0.8rem;
        padding: 0.8rem;
    }

    .result-section {
        padding: 1.5rem;
        margin-top: 2rem;
    }
}

/* 使用说明样式优化 */
.notice-box {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fff8e1 0%, #fffdf7 100%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.08);
    border-left: 4px solid #f39c12;
    position: relative;
    overflow: hidden;
}

.notice-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(243, 156, 18, 0.1) 0%, transparent 70%);
    transform: translate(30%, -30%);
}

.notice-box h3 {
    color: #f39c12;
    font-size: 1.4rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
}

.notice-box h3::before {
    content: '📝';
    font-size: 1.6rem;
}

.notice-box ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1.2rem;
}

.notice-box li {
    position: relative;
    padding-left: 2.5rem;
    color: #666;
    font-size: 1.05rem;
    line-height: 1.6;
    display: flex;
    align-items: center;
    min-height: 2rem;
    transition: all 0.3s ease;
}

.notice-box li::before {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f39c12;
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
}

.notice-box li:nth-child(1)::before { content: '1'; }
.notice-box li:nth-child(2)::before { content: '2'; }
.notice-box li:nth-child(3)::before { content: '3'; }
.notice-box li:nth-child(4)::before { content: '4'; }

.notice-box li:hover {
    transform: translateX(5px);
    color: #34495e;
    background: linear-gradient(90deg, rgba(243, 156, 18, 0.05) 0%, transparent 100%);
    border-radius: 8px;
    padding-right: 1rem;
}

.notice-box li:hover::before {
    box-shadow: 0 3px 8px rgba(243, 156, 18, 0.3);
    transform: scale(1.1);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .notice-box {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    .notice-box li {
        font-size: 1rem;
        padding-left: 2.2rem;
    }

    .notice-box li::before {
        width: 22px;
        height: 22px;
        font-size: 0.85rem;
    }
}

/* 添加自定义网格布局样式 */
.custom-grid-size {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.grid-input-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: center;
}

.grid-input-group input {
    width: 80px;
    padding: 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.grid-input-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.grid-input-group span {
    color: #666;
    font-weight: 500;
    font-size: 1.2rem;
}

.grid-tip {
    margin-top: 0.8rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: center;
}

/* 动态网格线样式更新 */
.grid-lines.grid-custom {
    display: grid;
    transition: all 0.3s ease;
} 