/* 组件样式 */

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--dark);
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-dark);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray);
}

.form-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* 提示消息 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast i {
    font-size: 20px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--info); }

.toast p {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 16px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 合同审查页面 */
.contract-types {
    margin-bottom: 40px;
}

.contract-types h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.type-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.type-card:hover {
    border-color: var(--primary);
}

.type-card.active {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

.type-icon {
    width: 56px;
    height: 56px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: var(--primary);
}

.type-card.active .type-icon {
    background: var(--primary);
    color: var(--white);
}

.type-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.type-card p {
    font-size: 13px;
    color: var(--gray);
}

/* 上传区域 */
.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    background: var(--white);
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.02);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.upload-area h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--gray);
    margin-bottom: 20px;
}

.file-info {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.file-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.file-text p {
    font-size: 13px;
    color: var(--gray);
}

/* 审查进度 */
.analysis-progress {
    margin-bottom: 40px;
}

.progress-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    box-shadow: var(--shadow);
}

.progress-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.progress-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.progress-card p {
    color: var(--gray);
    margin-bottom: 24px;
}

.progress-bar {
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 审查结果 */
.analysis-result {
    margin-bottom: 40px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.result-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 12px;
}

/* 风险概览 */
.risk-overview {
    margin-bottom: 32px;
}

.overview-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.overview-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.risk-badge {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.risk-badge.high { background: var(--danger); }
.risk-badge.medium { background: var(--warning); }
.risk-badge.low { background: var(--success); }

.overview-stats {
    display: flex;
    gap: 24px;
}

.overview-stats .stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--light);
}

.overview-stats .stat.high { background: #ffebee; }
.overview-stats .stat.medium { background: #fff3e0; }
.overview-stats .stat.low { background: #e8f5e9; }

.stat-count {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.overview-stats .stat.high .stat-count { color: var(--danger); }
.overview-stats .stat.medium .stat-count { color: var(--warning); }
.overview-stats .stat.low .stat-count { color: var(--success); }

.stat-label {
    font-size: 13px;
    color: var(--gray);
}

/* 条款详情 */
.clauses-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clause-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.clause-card.high { border-left: 4px solid var(--danger); }
.clause-card.medium { border-left: 4px solid var(--warning); }
.clause-card.low { border-left: 4px solid var(--success); }

.clause-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--gray-light);
}

.clause-risk {
    display: flex;
    align-items: center;
    gap: 8px;
}

.risk-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.risk-dot.high { background: var(--danger); }
.risk-dot.medium { background: var(--warning); }
.risk-dot.low { background: var(--success); }

.risk-text {
    font-size: 13px;
    font-weight: 500;
}

.clause-card.high .risk-text { color: var(--danger); }
.clause-card.medium .risk-text { color: var(--warning); }
.clause-card.low .risk-text { color: var(--success); }

.clause-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.clause-body {
    padding: 24px;
}

.clause-section {
    margin-bottom: 20px;
}

.clause-section:last-child {
    margin-bottom: 0;
}

.clause-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clause-section h4 i {
    color: var(--primary);
}

.clause-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-dark);
}

.clause-text {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius);
    font-style: italic;
}

.legal-section {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    font-size: 14px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.category-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-dark);
    white-space: nowrap;
}

.filter-group select {
    padding: 10px 16px;
    font-size: 14px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 文章卡片 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-category {
    padding: 8px 16px;
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
}

.article-content {
    padding: 20px;
}

.article-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-content p {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 12px;
}

.article-meta i {
    margin-right: 4px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 8px;
    font-size: 11px;
    background: var(--light);
    color: var(--gray-dark);
    border-radius: 4px;
}

/* 文章详情 */
.article-detail {
    padding: 40px 0;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
}

.article-main {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-light);
}

.article-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 16px 0;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 16px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--white);
}

.category-badge.rent { background: #4CAF50; }
.category-badge.internship { background: #FF9800; }
.category-badge.labor { background: #2196F3; }

.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--gray-dark);
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--dark);
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.article-body th,
.article-body td {
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    text-align: left;
}

.article-body th {
    background: var(--light);
    font-weight: 600;
}

.article-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-light);
}

.article-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-section h2 i {
    color: var(--primary);
}

.case-example,
.legal-basis,
.advice-content {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.7;
}

.lesson-box {
    background: #e8f5e9;
    padding: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--success);
}

/* 侧边栏 */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.sidebar-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.sidebar-card p {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 16px;
}

.related-article,
.related-case {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.related-article:last-child,
.related-case:last-child {
    border-bottom: none;
}

.related-article h4,
.related-case h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-article span {
    font-size: 12px;
    color: var(--gray);
}

.related-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray);
}

/* 案例卡片 */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.case-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.case-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.case-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
}

.case-type,
.case-risk {
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    color: var(--white);
}

.case-content {
    padding: 16px;
}

.case-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray);
}

.case-meta i {
    margin-right: 4px;
}

/* 案例详情 */
.case-detail {
    padding: 40px 0;
}

.case-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
}

.case-main {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

.case-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-light);
}

.case-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.type-badge,
.risk-badge {
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--white);
}

.type-badge.rent { background: #4CAF50; }
.type-badge.internship { background: #FF9800; }
.type-badge.labor { background: #2196F3; }
.risk-badge.high { background: var(--danger); }
.risk-badge.medium { background: var(--warning); }
.risk-badge.low { background: var(--success); }

.case-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--gray);
}

.case-section {
    margin-bottom: 32px;
}

.case-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
}

.case-section h2 i {
    color: var(--primary);
}

.section-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray-dark);
}

.section-content blockquote {
    background: var(--light);
    padding: 16px 20px;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    font-style: italic;
}

.lesson-section {
    background: #e8f5e9;
    padding: 24px;
    border-radius: var(--radius-lg);
}

/* 常见问题 */
.faq-section {
    padding: 60px 0;
    background: var(--white);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.faq-item {
    padding: 24px;
    background: var(--light);
    border-radius: var(--radius-lg);
}

.faq-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.faq-item p {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
}

/* 关于我们 */
.about-section {
    padding: 60px 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-mission,
.about-values,
.about-features,
.about-disclaimer,
.about-contact {
    margin-bottom: 48px;
}

.about-mission h2,
.about-values h2,
.about-features h2,
.about-disclaimer h2,
.about-contact h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
}

.about-mission p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-dark);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.value-item {
    text-align: center;
    padding: 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.value-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: var(--white);
}

.value-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.value-item p {
    font-size: 14px;
    color: var(--gray);
}

.about-features ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-features li {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.about-features li i {
    color: var(--success);
    font-size: 20px;
    margin-top: 2px;
}

.about-features li h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.about-features li p {
    font-size: 14px;
    color: var(--gray);
}

.disclaimer-box {
    background: #fff3e0;
    padding: 24px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--warning);
}

.disclaimer-box p {
    font-size: 14px;
    margin-bottom: 12px;
}

.disclaimer-box ul {
    padding-left: 20px;
}

.disclaimer-box li {
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 8px;
}

.contact-info {
    display: flex;
    gap: 32px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--gray-dark);
}

.contact-item i {
    color: var(--primary);
}

/* 响应式 */
@media (max-width: 1024px) {
    .article-layout,
    .case-layout {
        grid-template-columns: 1fr;
    }

    .articles-grid,
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .type-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .category-filters {
        flex-wrap: wrap;
    }

    .articles-grid,
    .cases-grid {
        grid-template-columns: 1fr;
    }

    .overview-stats {
        flex-direction: column;
    }

    .result-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

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

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

    .contact-info {
        flex-direction: column;
        gap: 16px;
    }
}
