/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航 */
.main-nav {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2563eb;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    color: #64748b;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.nav-btn.active {
    background: #2563eb;
    color: white;
}

/* 主内容 */
.main-content {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

.page-section {
    display: none;
    min-height: calc(100vh - 60px);
}

.page-section.active {
    display: block;
}

/* 首页样式 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 32px;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.features {
    padding: 80px 20px;
    background: white;
}

.features h2 {
    text-align: center;
    margin-bottom: 48px;
    font-size: 2.5rem;
    color: #1e293b;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 32px 20px;
    border-radius: 12px;
    background: #f8fafc;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.feature-card i {
    font-size: 3rem;
    color: #2563eb;
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 12px;
    color: #1e293b;
}

.feature-card p {
    color: #64748b;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* 页面头部 */
.page-header {
    text-align: center;
    padding: 48px 20px;
    background: white;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: #1e293b;
}

.page-header p {
    font-size: 1.1rem;
    color: #64748b;
}

/* 创建方法 */
.create-methods {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 32px;
}

.method-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.method-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.method-btn:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.method-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.method-btn i {
    font-size: 2rem;
    color: #2563eb;
    margin-bottom: 8px;
}

.method-btn span {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
}

.method-btn small {
    color: #64748b;
    font-size: 0.9rem;
}

.basic-info {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.basic-info h3 {
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.9rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 文件上传区域 */
.upload-method, .editor-method {
    display: none;
    margin-bottom: 32px;
}

.upload-method.active, .editor-method.active {
    display: block;
}

.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 24px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-content i {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 16px;
}

.upload-content h4 {
    color: #1e293b;
    margin-bottom: 8px;
}

.upload-content p {
    color: #64748b;
    margin-bottom: 8px;
}

.upload-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 16px 0;
}

.upload-buttons .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: #1d4ed8;
}

.file-list, .file-preview {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.file-list h4, .file-preview h4 {
    color: #1e293b;
    margin-bottom: 16px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon {
    width: 20px;
    text-align: center;
}

.file-name {
    font-weight: 500;
    color: #1e293b;
}

.file-size {
    color: #64748b;
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-actions button {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* 代码编辑器 */
.code-editor-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    margin-bottom: 24px;
}

.editor-tabs {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 0.9rem;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tab-btn.active {
    border-bottom-color: #2563eb;
    color: #2563eb;
    background: white;
}

.add-file-btn {
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    color: #64748b;
    border-radius: 0;
}

.add-file-btn:hover {
    background: #e2e8f0;
    color: #2563eb;
}

.code-editor {
    position: relative;
    height: 400px;
}

.code-textarea {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    padding: 16px;
    font-family: 'Courier New', Consolas, 'Liberation Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #fafafa;
    color: #333;
    display: none;
}

.code-textarea.active {
    display: block;
}

.code-textarea:focus {
    outline: none;
    background: white;
}

.editor-actions {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.preview-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.preview-tab {
    padding: 8px 12px;
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
}

.preview-tab.active {
    background: #2563eb;
    color: white;
}

.preview-content {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    max-height: 300px;
    overflow: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.create-actions {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* 模板网格 */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.template-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.template-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.template-card.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.template-preview {
    height: 200px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.template-preview i {
    font-size: 3rem;
    color: #94a3b8;
}

.template-info {
    padding: 20px;
}

.template-info h3 {
    margin-bottom: 8px;
    color: #1e293b;
}

.template-info p {
    color: #64748b;
    font-size: 0.9rem;
}

/* 网站列表 */
.sites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.site-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.site-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.site-info h3 {
    margin-bottom: 4px;
    color: #1e293b;
}

.site-url {
    color: #2563eb;
    font-size: 0.9rem;
    text-decoration: none;
}

.site-url:hover {
    text-decoration: underline;
}

.site-actions {
    display: flex;
    gap: 8px;
}

.site-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.site-description {
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}

.site-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    margin-top: 32px;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 24px;
}

.empty-state h3 {
    margin-bottom: 12px;
    color: #64748b;
}

.empty-state p {
    margin-bottom: 24px;
    color: #94a3b8;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    font-size: 1.2rem;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 用户网站容器 */
.user-site-container {
    padding: 0;
    background: white;
    min-height: calc(100vh - 60px);
}

.user-site-container #userSiteContent {
    width: 100%;
    height: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 12px 20px;
    }

    .nav-links {
        margin-top: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        margin-top: 100px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

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

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

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

    .step-actions {
        flex-direction: column;
        align-items: center;
    }

    .site-header {
        flex-direction: column;
        gap: 12px;
    }

    .site-actions {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .step {
        padding: 24px 20px;
    }

    .page-header {
        padding: 32px 20px;
    }

    .hero {
        padding: 60px 20px;
    }

    .features {
        padding: 60px 20px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误消息 */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
