/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根元素样式 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-color: #333;
    --text-muted: #6c757d;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 容器样式 */
.container {
    width: 100%;
    padding: 0 20px;
    margin: 0;
}

/* 页面头部 */
.header {
    background-color: #fff;
    box-shadow: var(--shadow);
    padding: 12px 0;
    margin-bottom: 0;
    flex-shrink: 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: var(--text-muted);
    font-size: 14px;
}

.admin-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 14px;
}

.admin-link:hover {
    background-color: var(--light-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

/* 页面底部 */
.footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

/* 登录页面样式 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-title {
    text-align: center;
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

/* 表单样式 */
.login-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 13px;
}

.form-input {
    width: 100%;
    max-width: 300px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.3s, box-shadow 0.3s;
    height: 32px;
    line-height: 20px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

/* 三列布局（用于技术领域等） */
.form-row.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* 表单列样式 */
.form-col {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row.form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #357abd;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background-color: #218838;
}

.btn-block {
    width: 100%;
    padding: 12px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* 消息提示样式 */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

/* 管理面板样式 */
.admin-panel {
    width: 100%;
    margin: 0;
}

.page-title {
    font-size: 24px;
    margin-bottom: 20px;
    margin-top: 0;
    color: var(--text-color);
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.register-form {
    margin-top: 15px;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-bottom: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.data-table thead {
    background-color: var(--light-color);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: var(--light-color);
}

.text-center {
    text-align: center;
}

/* 导航链接样式 */
.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: var(--light-color);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* 标签页导航样式 */
.tab-nav {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    flex-shrink: 0;
}

.tab-nav-container {
    width: 100%;
    margin: 0;
    padding: 0 20px;
}

.tab-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.tab-item {
    position: relative;
    margin-right: 0;
}

.tab-link {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    background-color: var(--light-color);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s;
    position: relative;
}

.tab-link:hover {
    background-color: #e9ecef;
}

.tab-link.active {
    color: var(--primary-color);
    background-color: #fff;
    font-weight: 500;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-item:first-child .tab-link {
    border-left: none;
}

.tab-item:last-child .tab-link {
    border-right: none;
}

/* 概览区域样式 */
.overview-section {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 48px;
    opacity: 0.9;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 客户管理区域样式 */
.companies-section {
    margin-bottom: 20px;
}

.companies-section .card-title {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

/* 主要情况表页面特殊样式 */
body.company-main-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.company-main-page .main-content {
    flex: none;
    overflow: visible;
    padding: 20px 0;
}

body.company-main-page .main-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

body.company-main-page .card {
    max-width: 1000px;
    margin: 0 auto 20px;
}

/* 表单输入框在主要情况表页面中的最大宽度 */
body.company-main-page .form-input {
    max-width: 280px;
}

body.company-main-page .form-row.form-row-3 .form-input {
    max-width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header .page-title {
    margin-bottom: 0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* 当模态框显示时，使用flex布局居中 */
.modal[style*="display: flex"],
.modal[style*="display:block"] {
    display: flex !important;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
}

/* 大尺寸模态框（如研发活动表单） */
.modal-content[style*="max-width: 900px"] {
    max-width: 900px;
    width: 90%;
    margin: 20px auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* 按钮小尺寸 */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

/* 欢迎区域样式 */
.welcome-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.welcome-title {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.welcome-desc {
    font-size: 18px;
    color: var(--text-muted);
}

/* 功能导航卡片样式 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.feature-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.feature-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* 快速操作样式 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.action-card {
    background: var(--light-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.action-card:hover {
    background: #fff;
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.action-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.action-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .card {
        padding: 20px 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-header .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .welcome-title {
        font-size: 28px;
    }
    
    .welcome-desc {
        font-size: 16px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .tab-list {
        flex-wrap: wrap;
    }
    
    .tab-link {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .tab-nav-container {
        padding: 0 10px;
    }
}

