/* 基础样式 */
* {
    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 2rem;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.usage-count {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* 工具容器样式 */
.tool-container {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* 上传区域样式 */
.upload-section {
    margin-bottom: 2rem;
}

.drop-zone {
    border: 2px dashed #3498db;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(52, 152, 219, 0.1) 100%);
}

.drop-zone:hover {
    border-color: #2980b9;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(52, 152, 219, 0.15) 100%);
}

.upload-icon {
    color: #3498db;
    margin-bottom: 1rem;
}

.upload-tip {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 编辑区域样式 */
.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;
}

/* 水印覆盖层样式 */
.watermark-overlay {
    position: absolute;
    cursor: move;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 30px;
}

.watermark-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.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);
}

.rotate-handle {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 20px;
    height: 20px;
    background: #3498db;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 控制面板样式 */
.control-panel {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
}

.watermark-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.type-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #e0e0e0;
    color: #666;
}

.type-btn.active {
    background: #3498db;
    color: white;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    color: #34495e;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

/* 输入控件样式 */
input[type="text"],
select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
}

/* 滑块样式 */
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: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* 颜色控制样式 */
.color-control {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
}

.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(52, 152, 219, 0.15);
}

/* 白色按钮特殊处理 */
.color-btn[data-color="#ffffff"] {
    background: #ffffff;
    border: 3px solid #e0e0e0;
}

.color-btn[data-color="#ffffff"].active {
    border-color: #3498db;
}

/* 水印模式选项 */
.pattern-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.pattern-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* 工具按钮样式 */
.tool-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.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 ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.tool-btn svg {
    width: 24px;
    height: 24px;
}

.tool-btn.apply {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
}

.tool-btn.generate {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.tool-btn.reset {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

.tool-btn.reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b 0%, #c0392b 100%);
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 结果区域样式 */
.result-section {
    margin-top: 3rem;
    text-align: center;
}

.result-preview {
    margin-top: 1.5rem;
}

.result-preview img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-controls {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.result-controls button {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.result-controls button svg {
    width: 24px;
    height: 24px;
}

.primary-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
    background: linear-gradient(135deg, #2980b9 0%, #2980b9 100%);
}

.secondary-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.2);
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(127, 140, 141, 0.3);
    background: linear-gradient(135deg, #7f8c8d 0%, #7f8c8d 100%);
}

.result-controls button:active {
    transform: translateY(1px);
}

/* 使用说明样式 */
.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;
}

/* 底部版权样式 */
.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;
}

/* 辅助类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@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;
    }

    .edit-container {
        grid-template-columns: 1fr;
    }

    .tool-buttons {
        flex-direction: column;
    }

    .notice-content {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
} 