/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 背景装饰 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary-color), var(--warning-color));
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, 50px) scale(1.1); }
    50% { transform: translate(-30px, 80px) scale(0.9); }
    75% { transform: translate(80px, -50px) scale(1.05); }
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo svg {
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 5px;
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    align-items: start;
}

/* 控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.panel-card h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.panel-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* 输入组 */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.input-group label svg {
    color: var(--primary-color);
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 风格按钮网格 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.style-btn {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.style-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.style-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* 滑块 */
.size-value {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

/* 颜色控制 */
.color-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.color-group {
    position: relative;
}

.color-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 12px;
}

.color-picker-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 10px;
}

.color-display {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.color-display::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
                linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
    opacity: 0.1;
    z-index: -1;
}

.color-display:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.color-display:active {
    transform: scale(0.95);
}

.color-picker-container input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-picker-container input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    text-transform: uppercase;
}

.color-picker-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-secondary);
}

/* 快捷颜色按钮 */
.quick-colors {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.quick-color-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.quick-color-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
                linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
    background-size: 8px 8px;
    background-position: 0 0, 4px 4px;
    opacity: 0.15;
    z-index: 0;
}

.quick-color-btn:hover {
    transform: scale(1.15);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.quick-color-btn:active {
    transform: scale(1.05);
}

.quick-color-btn[data-color="#ffffff"] {
    border-color: #d1d5db;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 预览区域 */
.preview-section {
    position: sticky;
    top: 20px;
}

.preview-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.preview-header h2 {
    font-size: 1.5rem;
}

.info-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.preview-container {
    position: relative;
    min-height: 400px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 2px dashed var(--border-color);
    overflow: hidden;
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder svg {
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.placeholder p {
    font-size: 1.1rem;
}

.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#signatureImage {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* 使用提示 */
.tips {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.tips h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.tips ul {
    list-style: none;
}

.tips li {
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tips li::before {
    content: "✓";
    display: inline-block;
    width: 20px;
    color: var(--success-color);
    font-weight: bold;
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xl);
    transform: translateY(120px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .preview-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .panel-card {
        padding: 20px;
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }

    .toast {
        right: 15px;
        bottom: 15px;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .panel-card h2 {
        font-size: 1.3rem;
    }

    .quick-colors {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .color-picker-container {
        flex-wrap: wrap;
    }

    .color-display {
        width: 45px;
        height: 45px;
    }
}

/* 友情链接样式 */
.friend-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.friend-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(100, 116, 139, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
}

.friend-links a:hover {
    color: #6366f1;
    text-decoration: underline;
    transform: translateY(-2px);
}

.friend-links a i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.friend-links a:hover i {
    transform: scale(1.15);
}

@media (max-width: 768px) {
    .friend-links {
        margin-top: 1.5rem;
        padding-top: 1rem;
        gap: 1.5rem;
    }
    
    .friend-links a {
        font-size: 0.8125rem;
    }
}

