/* 基础样式 */
* {
    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: 1rem;
    opacity: 0.8;
}

/* 按钮样式 */
.primary-btn, .secondary-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #3498db;
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.primary-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.secondary-btn {
    background: #95a5a6;
    color: white;
}

.secondary-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* 底部版权样式 */
.footer {
    background: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer p {
    color: #7f8c8d;
    margin: 0.5rem 0;
}

.footer a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #3498db;
}

/* 工具容器样式 */
.tool-container {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.notice-box {
    background: linear-gradient(135deg, #fff8e1 0%, #fffdf7 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 3rem;
    border-left: 4px solid #f39c12;
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.08);
}

.notice-box h3 {
    color: #f39c12;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.notice-box h3::before {
    content: '📝';
    font-size: 1.6rem;
}

.notice-box ul {
    list-style: none;
    padding: 0;
}

.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: 6px;
    height: 6px;
    background: #f39c12;
    border-radius: 50%;
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hidden {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .edit-container {
        grid-template-columns: 1fr;
    }

    .preview-area {
        min-height: 300px;
    }

    .ratio-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .size-inputs {
        flex-wrap: wrap;
    }

    .lock-ratio {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* 上传区域样式优化 */
.upload-section {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.drop-zone {
    border: 2px dashed #3498db;
    border-radius: 12px;
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(52, 152, 219, 0.02);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: #2980b9;
    background: rgba(52, 152, 219, 0.05);
    transform: translateY(-2px);
}

.drop-zone.dragover {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.05);
    animation: pulse 1.5s infinite;
}

.upload-icon {
    color: #3498db;
    margin-bottom: 1.5rem;
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: scale(1.3);
}

.upload-tip {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 1rem;
    background: rgba(52, 152, 219, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

/* 编辑区域样式优化 */
.edit-section {
    margin-top: 3rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.edit-container {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.preview-area {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    min-height: 450px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#previewImage {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 裁剪框样式优化 */
.crop-box {
    position: absolute;
    border: 2px solid #3498db;
    background: rgba(52, 152, 219, 0.1);
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.crop-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.crop-box .handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
}

.crop-box .handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

/* 控制面板样式优化 */
.control-panel {
    background: #ffffff;
    padding: 1.8rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    background: #f8f9fa;
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.control-group label {
    display: block;
    color: #34495e;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* 比例选择按钮组优化 */
.ratio-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.5rem;
}

.ratio-option {
    padding: 0.6rem 0.4rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: center;
}

.ratio-option:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.ratio-option.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 500;
}

/* 输出设置样式优化 */
.size-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.8rem;
}

.size-inputs input {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.size-inputs input:focus {
    border-color: #3498db;
    outline: none;
}

/* 质量滑块样式优化 */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* 结果预览区域优化 */
.result-section {
    margin-top: 2.5rem;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.result-preview {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#resultImage {
    max-width: 100%;
    height: auto;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 响应式优化 */
@media (max-width: 1024px) {
    .edit-container {
        grid-template-columns: 1fr;
    }
    
    .preview-area {
        min-height: 350px;
    }
    
    .control-panel {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .upload-section,
    .edit-section,
    .result-section {
        padding: 1.5rem;
    }
    
    .ratio-options {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .size-inputs {
        grid-template-columns: 1fr;
    }
    
    .size-inputs span {
        text-align: center;
    }
} 