/* 重置默认样式 */
* {
    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: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

header p {
    color: #666;
}

/* 主要内容区域 */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 上传区域样式 */
.upload-section {
    grid-column: 1 / -1;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #2196F3;
    background-color: rgba(33, 150, 243, 0.05);
}

.upload-area.drag-over {
    border-color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-content img {
    width: 64px;
    height: 64px;
    opacity: 0.6;
}

.upload-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.2);
}

/* 预览区域样式 */
.preview-section {
    width: 100%;
}

.preview-layout {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto;
}

.preview-container {
    width: 1000px;
    height: 550px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    margin: 0 auto;
    position: relative;
    transition: border-color 0.3s ease;
}

.preview-container:hover {
    border-color: #2196F3;
}

.preview-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232196F3"><path d="M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z"/></svg>') center/contain no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.preview-container:hover::after {
    opacity: 0.2;
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
}

#previewCanvas:active {
    cursor: grabbing;
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
}

.control-panel {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.control-group {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 14px;
    color: #555;
}

.control-group span {
    font-size: 14px;
    color: #666;
    text-align: right;
}

.control-group input[type="range"] {
    height: 5px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    width: 100%;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #2196F3;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #1976D2;
}

.control-group input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 5px;
    background: #ddd;
}

/* 为不同的控制滑块设置不同的颜色 */
#sizeRange::-webkit-slider-thumb {
    background: #2196F3;
}

#scaleRange::-webkit-slider-thumb {
    background: #2196F3;
}

#posXRange::-webkit-slider-thumb,
#posYRange::-webkit-slider-thumb {
    background: #FF9800;
}

/* 提示信息样式 */
.tips {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #FF9800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tips p {
    margin: 0 0 8px 0;
    color: #333;
    font-weight: 500;
}

.tips ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: none;
}

.tips li {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
    position: relative;
}

.tips li:before {
    content: "•";
    color: #FF9800;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

/* 导出按钮区域样式 */
.export-section {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.export-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.export-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#exportPNG {
    background-color: #2196F3;
    color: white;
}

#exportPNG:hover:not(:disabled) {
    background-color: #1976D2;
}

#exportJPG {
    background-color: #FF9800;
    color: white;
}

#exportJPG:hover:not(:disabled) {
    background-color: #F57C00;
}

/* 加载遮罩层样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式布局 */
@media (max-width: 992px) {
    .preview-layout {
        flex-direction: column;
        align-items: center;
        padding: 15px;
    }
    
    .preview-container {
        width: 100%;
        max-width: 450px;
        height: 450px;
    }
    
    .control-panel {
        width: 100%;
        max-width: 450px;
        flex: none;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .preview-container {
        width: 100%;
        height: 320px;
    }
    
    .control-panel {
        padding: 15px;
    }
    
    .range-control {
        margin: 10px 0;
    }
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 10px;
    }

    .upload-area {
        padding: 20px;
    }

    .export-section {
        flex-direction: column;
    }

    .export-btn {
        width: 100%;
    }
}

/* 导航栏样式 */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    padding: 1rem 2rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1000;
    gap: 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2196F3;
    margin-bottom: 0;
}

.nav-logo {
    height: 40px;
    margin-right: 12px;
    transition: transform 0.3s ease;
}

.nav-brand:hover .nav-logo {
    transform: scale(1.05);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.nav-menu li {
    margin: 0;
    white-space: nowrap;
}

.nav-menu a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2196F3;
}

/* 内容页面通用样式 */
.content-page {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero区域样式 */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: #2196F3;
    margin-bottom: 1rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero-section p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeIn 1s ease-out;
}

.hero-btn {
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.primary-btn {
    background-color: #2196F3;
    color: white;
}

.secondary-btn {
    background-color: white;
    color: #2196F3;
    border: 2px solid #2196F3;
}

/* 特性展示区域样式 */
.features-section {
    padding: 4rem 2rem;
    background-color: #fff;
    text-align: center;
}

.features-section h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.feature-card {
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: #2196F3;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

.features-cta {
    margin-top: 3rem;
}

.features-cta .btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color 0.3s ease;
}

.features-cta .btn:hover {
    background-color: #1976D2;
}

/* 动画关键帧 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
        margin-bottom: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* 图文混排布局 */
.content-section {
    display: flex;
    align-items: center;
    margin: 3rem 0;
    gap: 2rem;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.content-section:hover {
    transform: translateY(-5px);
}

.content-section.image-left {
    flex-direction: row;
}

.content-section.image-right {
    flex-direction: row-reverse;
}

.content-image {
    flex: 0 0 400px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.content-image img {
    width: 100%;
    height: auto;
    display: block;
}

.content-text {
    flex: 1;
    padding: 1rem;
}

.content-text h2 {
    color: #2196F3;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.content-text p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.content-text ul {
    list-style-type: none;
    padding: 0;
}

.content-text ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.content-text ul li:before {
    content: "•";
    color: #2196F3;
    position: absolute;
    left: 0;
    top: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .content-section {
        flex-direction: column !important;
        padding: 1rem;
        margin: 2rem 0;
    }

    .content-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .content-text {
        padding: 1rem 0;
    }
}

.content-page h1 {
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.content-page h2 {
    color: #444;
    margin: 1.5rem 0 1rem;
}

.content-page h3 {
    color: #555;
    margin: 1rem 0 0.5rem;
}

/* 教程页面样式 */
.tutorial-section {
    margin-bottom: 3rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tutorial-step {
    margin-bottom: 2rem;
}

.tutorial-step ul {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.tutorial-tip {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

/* 关于我们页面样式 */
.about-section {
    margin-bottom: 3rem;
}

.about-section ul {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.about-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* 联系方式页面样式 */
.contact-section {
    margin-bottom: 3rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.contact-item {
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.social-links {
    list-style: none;
    padding: 0;
}

.social-links li {
    margin-bottom: 0.5rem;
}

.contact-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.submit-btn {
    background-color: #2196F3;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #1976D2;
}

.faq-container {
    margin-top: 2rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.faq-item h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.contact-note {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .content-page {
        padding: 1rem;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 1rem;
    }
}

/* 页脚样式 */
.footer {
    background-color: #f8f9fa;
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid #eee;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: #666;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #2196F3;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式导航栏 */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }

    .nav-toggle {
        display: block;
        position: relative;
        right: 0;
        top: 0;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        flex-direction: column;
        text-align: center;
    }

    .nav-menu.active {
        display: flex;
        align-items: center;
    }

    .nav-menu li {
        margin: 0.75rem 0;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .nav-brand {
        margin-right: 0;
        margin-bottom: 0;
    }
}