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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 导航栏样式 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5aa0;
}

.nav-logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #2c5aa0;
    background: #f0f5ff;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-login {
    background: #2c5aa0;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-login:hover {
    background: #1e3d6f;
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 80px auto 20px;
    padding: 0 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 工作台样式 */
.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: #2c5aa0;
    margin-bottom: 10px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #2c5aa0;
}

.stat-icon.pending {
    background: #fff3e0;
    color: #ff9800;
}

.stat-icon.signed {
    background: #e8f5e8;
    color: #4caf50;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.quick-actions h2 {
    margin-bottom: 20px;
    color: #333;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    padding: 30px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.action-card i {
    font-size: 2.5rem;
    color: #2c5aa0;
    margin-bottom: 15px;
}

.action-card span {
    font-weight: 600;
    color: #333;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    color: #2c5aa0;
}

.btn-primary {
    background: #2c5aa0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #1e3d6f;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.search-bar input,
.search-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.search-bar input {
    flex: 1;
}

/* 网格布局 */
.template-grid,
.signature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.template-card,
.signature-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.template-card:hover,
.signature-card:hover {
    transform: translateY(-5px);
}

.template-header,
.signature-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.template-header h3,
.signature-header h3 {
    color: #333;
    margin-bottom: 5px;
}

.template-category,
.signature-type {
    color: #666;
    font-size: 0.9rem;
}

.template-content,
.signature-preview {
    padding: 20px;
    max-height: 150px;
    overflow: hidden;
}

.template-actions,
.signature-actions {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
}

/* AI生成器样式 */
.ai-generator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.ai-input-section,
.ai-output-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ai-input-section h3,
.ai-output-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#aiPrompt {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    resize: vertical;
}

.ai-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.contract-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.9rem;
}

.placeholder {
    color: #999;
    text-align: center;
    font-style: italic;
}

.ai-output-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    color: #333;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* 合同列表 */
.contract-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: #2c5aa0;
    color: white;
    border-color: #2c5aa0;
}

.contract-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contract-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.contract-meta {
    color: #666;
    font-size: 0.9rem;
}

.contract-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-draft {
    background: #fff3e0;
    color: #ff9800;
}

.status-pending {
    background: #e3f2fd;
    color: #2196f3;
}

.status-signed {
    background: #e8f5e8;
    color: #4caf50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .main-content {
        margin-top: 60px;
        padding: 0 15px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-generator {
        grid-template-columns: 1fr;
    }
    
    .template-grid,
    .signature-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .contract-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Font Awesome 本地化样式 */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    src: url('./fontawesome/webfonts/fa-solid-900.woff2') format('woff2');
}

.fas {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.fa-file-contract:before { content: "\f56c"; }
.fa-file-alt:before { content: "\f15c"; }
.fa-pen-fancy:before { content: "\f5ac"; }
.fa-check-circle:before { content: "\f058"; }
.fa-robot:before { content: "\f544"; }
.fa-copy:before { content: "\f0c5"; }
.fa-plus:before { content: "\2b"; }
.fa-stamp:before { content: "\f5bf"; }
.fa-magic:before { content: "\f0d0"; }
.fa-trash:before { content: "\f1f8"; }
.fa-check:before { content: "\f00c"; }
.fa-redo:before { content: "\f01e"; }