/* 基础样式 */
* {
    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;
}

/* 导航栏和底部版权样式与之前相同 */

/* 工具容器样式 */
.tool-container {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* 编辑区域样式 */
.edit-section {
    margin-top: 2rem;
}

.edit-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.preview-area {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 400px;
    position: relative;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#imageCanvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.text-overlay {
    position: absolute;
    cursor: move;
    min-width: 100px;
    min-height: 30px;
    user-select: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(52, 152, 219, 0.3);
    border-radius: 4px;
    padding: 8px;
}

.text-content {
    padding: 8px;
    outline: none;
    white-space: pre-wrap;
    font-family: inherit;
    transition: all 0.3s ease;
}

.text-content:focus {
    border: 2px dashed #3498db;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
}

.resize-handle {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: #3498db;
    border: 2px solid white;
    border-radius: 50%;
    cursor: se-resize;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.resize-handle:hover {
    transform: scale(1.2);
}

/* 添加文字层控制按钮样式 */
.text-layer-controls {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    top: -30px;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.text-overlay:hover .text-layer-controls {
    opacity: 1;
}

.layer-control-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-control-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.delete-layer {
    background: rgba(231, 76, 60, 0.9);
}

.delete-layer:hover {
    background: #c0392b;
}

/* 控制面板样式 */
.control-panel {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    color: #34495e;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

/* 字体选择器 */
select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

select:focus {
    border-color: #3498db;
    outline: none;
}

/* 颜色控制 */
.color-control {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-presets {
    display: flex;
    gap: 0.5rem;
}

.color-btn {
    width: 35px;
    height: 35px;
    border: 3px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-btn.active {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 白色按钮特殊处理 */
.color-btn[data-color="#ffffff"] {
    background: #ffffff;
    border: 3px solid #e0e0e0;
}

.color-btn[data-color="#ffffff"].active {
    border-color: #3498db;
}

/* 颜色预设容器样式 */
.color-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-top: 0.5rem;
}

/* 效果选项 */
.effect-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
}

.effect-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 0.8rem;
    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);
}

/* 结果区域样式 */
.result-section {
    margin-top: 2rem;
    text-align: center;
}

.result-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

#resultImage {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none;
}

/* 导航栏样式 */
.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;
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
}

.usage-count {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

/* 上传区域美化 */
.drop-zone {
    border: 3px 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));
}

/* 编辑区域美化 */
.edit-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.preview-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    min-height: 450px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 控制面板美化 */
.control-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.control-group {
    position: relative;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.control-group label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 0 10px;
    color: #2c3e50;
    font-weight: 600;
}

/* 美化滑块样式 */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 美化颜色选择器 */
.color-control {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
}

.color-btn {
    width: 35px;
    height: 35px;
    border: 3px solid white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* 美化按钮 */
.button-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    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 {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(52, 152, 219, 0.4);
}

.secondary-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 8px 20px rgba(127, 140, 141, 0.3);
}

.secondary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(127, 140, 141, 0.4);
}

/* 结果区域美化 */
.result-section {
    margin-top: 3rem;
    padding: 2.5rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.result-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
}

#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);
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .edit-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .preview-area {
        min-height: 350px;
    }

    .button-group {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }
}

/* 底部版权样式 */
.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) {
    .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;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu::-webkit-scrollbar {
        height: 3px;
    }

    .nav-menu::-webkit-scrollbar-thumb {
        background: #3498db;
        border-radius: 3px;
    }

    .nav-menu a {
        font-size: 1rem;
        white-space: nowrap;
    }

    .nav-auth {
        margin-left: auto;
    }

    .footer {
        padding: 1.5rem 0;
        margin-top: 3rem;
    }

    .footer-content {
        padding: 0 1rem;
    }

    .footer p {
        font-size: 0.9rem;
    }
}

/* 描边控制样式 */
.stroke-color-control {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.stroke-width-control {
    margin-top: 1rem;
}

.stroke-width-control label {
    display: block;
    margin-bottom: 0.5rem;
    color: #34495e;
    font-weight: 500;
}

/* 美化滑块样式 */
.stroke-width-control input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

.stroke-width-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stroke-width-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(52, 152, 219, 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.6rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 800;
}

.notice-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.notice-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.notice-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.1);
}

.notice-icon {
    font-size: 2rem;
    line-height: 1;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.notice-text h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.notice-text p {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .notice-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .notice-item {
        padding: 1rem;
    }

    .notice-icon {
        font-size: 1.5rem;
        padding: 0.8rem;
    }
}

/* 美化工具按钮 */
.tool-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tool-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.tool-btn svg {
    width: 24px;
    height: 24px;
}

.tool-btn.add-text {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.2);
}

.tool-btn.add-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.3);
    background: linear-gradient(135deg, #2c3e50 0%, #2c3e50 100%);
}

.tool-btn.generate {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.tool-btn.generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #2980b9 0%, #2980b9 100%);
}

.tool-btn:active {
    transform: translateY(1px);
}

/* 按钮图标动画 */
.tool-btn:hover svg {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tool-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tool-btn {
        width: 100%;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* 添加字体引入 */
@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Dancing+Script:wght@400;700&family=Lobster&display=swap');

/* 美化字体选择器 */
.font-select {
    position: relative;
    width: 100%;
}

select#fontFamily {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 3rem;
}

select#fontFamily:hover {
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
}

select#fontFamily:focus {
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* 字体预览样式 */
select#fontFamily option {
    padding: 1rem;
}

select#fontFamily option[value="Microsoft YaHei"] { font-family: "Microsoft YaHei"; }
select#fontFamily option[value="SimSun"] { font-family: "SimSun"; }
select#fontFamily option[value="KaiTi"] { font-family: "KaiTi"; }
select#fontFamily option[value="FangSong"] { font-family: "FangSong"; }
select#fontFamily option[value="SimHei"] { font-family: "SimHei"; }
select#fontFamily option[value="Arial"] { font-family: "Arial"; }
select#fontFamily option[value="Times New Roman"] { font-family: "Times New Roman"; }
select#fontFamily option[value="Impact"] { font-family: "Impact"; }
select#fontFamily option[value="Comic Sans MS"] { font-family: "Comic Sans MS"; }
select#fontFamily option[value="Pacifico"] { font-family: "Pacifico"; }
select#fontFamily option[value="Dancing Script"] { font-family: "Dancing Script"; }
select#fontFamily option[value="Lobster"] { font-family: "Lobster"; } 