/* 基础样式 */
* {
    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);
}

.nav-auth a:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* 容器样式 */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.usage-count {
    text-align: center;
    color: #7f8c8d;
    margin: 1.5rem 0 3rem;
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: inline-block;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.usage-count::before {
    content: '👥';
    margin-right: 0.5rem;
}

/* 底部版权样式 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    color: #7f8c8d;
}

.footer-content p {
    margin: 0.8rem 0;
    font-size: 0.95rem;
}

.footer-content a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #3498db;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #3498db;
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.primary-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.secondary-btn {
    background: #3498db;
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.secondary-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.secondary-btn:disabled {
    background: #bdc3c7;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-menu li {
        flex: 0 0 auto;
    }

    .nav-menu a {
        font-size: 0.95rem;
        white-space: nowrap;
        padding: 0.5rem 0.8rem;
    }

    .button-group {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }
}

/* 动画效果 */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 拖拽样式 */
.grid-cell.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* 使用说明样式 */
.notice-box {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fff8e1 0%, #fffdf7 100%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.08);
    border-left: 4px solid #f39c12;
}

.notice-box h3 {
    color: #f39c12;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.notice-box h3::before {
    content: '📝';
    font-size: 1.6rem;
}

.notice-box ul {
    list-style: none;
    padding: 0;
}

.notice-box li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    color: #666;
}

.notice-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    background: #f39c12;
    border-radius: 50%;
}

/* 工具容器样式 */
.tool-container {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* 输入区域样式 */
.input-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(52, 152, 219, 0.1);
}

#textInput {
    width: 100%;
    height: 150px;
    padding: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    resize: vertical;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #2c3e50;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

#textInput:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#textInput::placeholder {
    color: #95a5a6;
    font-size: 1rem;
}

/* 样式控制区域 */
.style-controls {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.control-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.control-group label {
    color: #34495e;
    font-weight: 500;
    min-width: 85px;
    font-size: 0.95rem;
}

.control-group input[type="color"] {
    width: 45px;
    height: 35px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.control-group select {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #2c3e50;
    font-size: 0.95rem;
    cursor: pointer;
}

/* 预览区域样式 */
.preview-section {
    margin-top: 3rem;
    text-align: center;
}

.preview-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.preview-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    background: #e0e0e0;
    padding: 3px;
    border-radius: 16px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
    aspect-ratio: 1;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.grid-cell {
    background: white;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    word-break: break-all;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: move;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.grid-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-cell:hover::before {
    opacity: 1;
}

.grid-cell:hover {
    transform: scale(0.98);
    background: #f8f9fa;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.grid-cell.dragging {
    opacity: 0.8;
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* 拖拽时的占位样式 */
.grid-cell.drag-over {
    background: #f1f8ff;
    border: 2px dashed #3498db;
}

/* 生成后的效果 */
.preview-grid.generated .grid-cell {
    animation: fadeIn 0.5s ease backwards;
}

.preview-grid.generated .grid-cell:nth-child(1) { animation-delay: 0s; }
.preview-grid.generated .grid-cell:nth-child(2) { animation-delay: 0.1s; }
.preview-grid.generated .grid-cell:nth-child(3) { animation-delay: 0.2s; }
.preview-grid.generated .grid-cell:nth-child(4) { animation-delay: 0.3s; }
.preview-grid.generated .grid-cell:nth-child(5) { animation-delay: 0.4s; }
.preview-grid.generated .grid-cell:nth-child(6) { animation-delay: 0.5s; }
.preview-grid.generated .grid-cell:nth-child(7) { animation-delay: 0.6s; }
.preview-grid.generated .grid-cell:nth-child(8) { animation-delay: 0.7s; }
.preview-grid.generated .grid-cell:nth-child(9) { animation-delay: 0.8s; }

/* 响应式优化 */
@media (max-width: 768px) {
    .preview-grid {
        gap: 2px;
        padding: 2px;
    }

    .grid-cell {
        padding: 0.8rem;
        min-height: 90px;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
  