/* Reset and Base styles */
:root {
    --color-primary: #4A90E2;
    --color-secondary: #2C3E50;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-background: #FFFFFF;
    --color-border: #E1E1E1;
    --spacing-unit: 1rem;
    --container-width: 1200px;
    --border-radius: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Header Styles */
.header {
    background-color: var(--color-background);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav__logo-img {
    height: 40px;
    width: auto;
}

.nav__logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.nav__menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav__link {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: var(--color-primary);
}

/* Hero Section */
.hero {
    padding: 100px 0 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    text-align: center;
}

.hero__content {
    max-width: 800px;
    margin: 0 auto;
}

.hero__title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-secondary);
}

.hero__description {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn--primary:hover {
    background-color: #357ABD;
}

/* Tool Section */
.tool-section {
    padding: 0 0 4rem;
}

.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: var(--color-primary);
}

.upload-input {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    gap: 1rem;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-secondary);
}

.upload-label small {
    color: var(--color-text-light);
}

/* Editor Area */
.editor-area {
    margin-top: 2rem;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
}

.editor-preview {
    position: relative;
    width: fit-content;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#previewImage {
    display: block;
    max-width: 100%;
    max-height: 80vh;
}

.resize-handles {
    position: absolute;
    border: 2px solid #2196F3;
    box-sizing: border-box;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid #2196F3;
    pointer-events: auto;
}

.resize-handle.top-left {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.resize-handle.top-right {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.resize-handle.bottom-left {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.resize-handle.bottom-right {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.editor-controls {
    max-width: 600px;
    margin: 0 auto;
}

.control-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* How it Works Section */
.how-it-works {
    padding: 6rem 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.workflow-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 4rem 0;
    position: relative;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.workflow-container::before {
    content: '';
    position: absolute;
    top: 3rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    opacity: 0.2;
    z-index: 1;
}

.workflow-item {
    text-align: center;
    position: relative;
    z-index: 2;
}

.workflow-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 25px;
    height: 25px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.workflow-emoji {
    font-size: 2rem;
    font-style: normal;
}

.workflow-item h3 {
    color: var(--color-secondary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.workflow-item p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.workflow-cta {
    text-align: center;
    margin-top: 3rem;
}

.workflow-note {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.btn--large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Responsive adjustments for How it Works */
@media (max-width: 1024px) {
    .workflow-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .workflow-container::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .how-it-works {
        padding: 4rem 0;
    }

    .workflow-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .control-group {
        grid-template-columns: 1fr;
    }

    .resize-handles {
        top: 0.5rem;
        right: 0.5rem;
    }

    .hero {
        padding: 90px 0 0;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__description {
        font-size: 1rem;
    }
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--color-secondary);
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

.feature-card p {
    color: var(--color-text-light);
    line-height: 1.6;
}

/* Extended Features */
.features-extended {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.features-extended h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
}

.features-extended > p {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Trust Indicators */
.trust-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.trust-item {
    text-align: center;
    padding: 1.5rem;
}

.trust-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.trust-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
}

.trust-item p {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* User Benefits */
.user-benefits {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 3rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-benefits h3 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.benefits-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.benefits-list li {
    padding: 0.5rem 0;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Steps Section */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-weight: bold;
}

/* Footer */
.footer {
    background-color: var(--color-secondary);
    color: white;
    padding: 4rem 0 2rem;
}

.footer__content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 2rem;
}

.footer__links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.footer__column h4 {
    margin-bottom: 1rem;
}

.footer__column ul {
    list-style: none;
}

.footer__column ul li {
    margin-bottom: 0.5rem;
}

.footer__column a {
    color: #ffffff99;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer__column a:hover {
    color: white;
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #ffffff33;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav__menu {
        display: none;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-extended h3 {
        font-size: 1.5rem;
    }

    .benefits-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .feature-card {
        padding: 1.5rem;
    }

    .trust-indicators {
        grid-template-columns: 1fr;
    }
}

/* Form Elements */
input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Accessibility */
:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* SEO Content Section */
.seo-content {
    padding: 6rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

.content-block {
    max-width: 800px;
    margin: 0 auto 4rem;
}

.content-block:last-child {
    margin-bottom: 0;
}

.content-text {
    color: var(--color-text);
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-text p {
    margin-bottom: 1.5rem;
}

.content-text h3 {
    color: var(--color-secondary);
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.benefits-checklist {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.benefits-checklist li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.benefits-checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

/* FAQ Styles */
.faq-container {
    display: grid;
    gap: 2rem;
}

.faq-item {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.faq-item h3 {
    color: var(--color-secondary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
}

.faq-item h3::before {
    content: 'Q:';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.faq-item p {
    color: var(--color-text-light);
    line-height: 1.6;
    padding-left: 2rem;
}

/* CTA Section */
.content-cta {
    text-align: center;
    max-width: 600px;
    margin: 4rem auto 0;
    padding: 3rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.content-cta h3 {
    color: var(--color-secondary);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.content-cta p {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .seo-content {
        padding: 4rem 0;
    }

    .content-block {
        padding: 0 1rem;
    }

    .content-text {
        font-size: 1rem;
    }

    .faq-item {
        padding: 1.5rem;
    }

    .content-cta {
        margin: 3rem 1rem 0;
        padding: 2rem;
    }

    .content-cta h3 {
        font-size: 1.5rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1100;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.crop-area {
    position: absolute;
    border: 2px solid #2196F3;
    cursor: move;
    box-sizing: border-box;
    background: rgba(33, 150, 243, 0.1);
    pointer-events: auto;
}

/* 网格线 */
.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.grid-line {
    position: absolute;
    background: transparent;
}

.grid-line.vertical {
    width: 1px;
    height: 100%;
    border-left: 1px dashed rgba(255, 255, 255, 0.5);
}

.grid-line.horizontal {
    width: 100%;
    height: 1px;
    border-top: 1px dashed rgba(255, 255, 255, 0.5);
}

/* 拖拽手柄 */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2196F3;
    border: 2px solid #fff;
    border-radius: 2px;
    pointer-events: auto;
}

.resize-handle.top-left {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.top-right {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.bottom-left {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.bottom-right {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.editor-tools {
    margin-top: 20px;
    text-align: center;
}

/* 更新结果预览区域样式 */
.result-preview {
    width: fit-content;
    margin: 0 auto;
    text-align: center;
}

#finalImage {
    width: 240px; /* 设置固定宽度 */
    height: 360px; /* 设置固定高度，保持2:3比例 */
    object-fit: contain; /* 确保图片不会被拉伸 */
    background: #fff;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
}

/* 更新下载按钮样式 */
#downloadBtn {
    display: block;
    margin: 0;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 1rem;
    width: 240px;
    margin: 1rem auto;
}

.button-group .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

.btn--secondary {
    background-color: #e0e0e0;
    color: var(--color-text);
}

.btn--secondary:hover {
    background-color: #d0d0d0;
}

/* Transform Showcase Styles */
.transform-showcase {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.transform-item {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.transform-image {
    width: 100%;
    max-width: 500px; /* 增加指引图片的最大宽度 */
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.transform-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 保持原有的示例图片样式 */
.transform-examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.example-item {
    text-align: center;
}

.example-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    border: 1px solid var(--color-border);
}

.example-item span {
    display: block;
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
}

/* 移除不需要的样式 */
.transform-arrow,
.transform-label {
    display: none;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .transform-examples {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .transform-item {
        flex-direction: column;
        gap: 1rem;
    }

    .transform-examples {
        grid-template-columns: 1fr;
    }

    .transform-image {
        width: 180px;
        height: 240px;
    }
}
