/* 软件工厂管理系统 - 主样式文件 */

/* 全局样式 */
* {
    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: #333;
    background: #f5f7fa;
    min-height: 100vh;
}

/* 后台管理系统布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 左侧边栏 */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h1 {
    font-size: 18px;
    color: white;
    margin: 0;
}

.sidebar-header h1 a {
    color: white;
    text-decoration: none;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 25px;
}

.menu-section-title {
    padding: 10px 20px;
    font-size: 11px;
    color: #95a5a6;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: #34495e;
    border-left-color: #3498db;
}

.menu-item.active {
    background: #34495e;
    border-left-color: #3498db;
    color: #3498db;
}

.menu-item-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.menu-item-text {
    font-size: 14px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.top-navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-left h2 {
    font-size: 22px;
    color: #2c3e50;
    margin: 0;
}

.navbar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    object-fit: cover;
}

/* 用户下拉菜单 */
.user-info {
    position: relative;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

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

.user-dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.user-dropdown-role {
    font-size: 12px;
    color: #999;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: #f5f5f5;
}

.user-dropdown-item.danger {
    color: #e74c3c;
}

.user-dropdown-item.danger:hover {
    background: #ffebee;
}

.user-dropdown-icon {
    font-size: 16px;
}

/* 自定义确认对话框 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.confirm-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.confirm-dialog {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirm-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.confirm-icon {
    font-size: 24px;
}

.confirm-body {
    padding: 24px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.confirm-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 8px 20px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.confirm-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.confirm-btn-cancel:hover {
    background: #e8e8e8;
}

.confirm-btn-confirm {
    background: #e74c3c;
    color: white;
}

.confirm-btn-confirm:hover {
    background: #c0392b;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 25px;
    margin-bottom: 25px;
}

.card-header {
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card.blue {
    border-left: 4px solid #3498db;
}

.stat-card.green {
    border-left: 4px solid #2ecc71;
}

.stat-card.orange {
    border-left: 4px solid #f39c12;
}

.stat-card.purple {
    border-left: 4px solid #9b59b6;
}

.stat-icon {
    font-size: 42px;
    margin-right: 20px;
    opacity: 0.7;
}

.stat-info h3 {
    font-size: 32px;
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-weight: 700;
}

.stat-info p {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
}

/* 快速操作网格 */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s;
    display: block;
}

.action-card:hover {
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.action-icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: block;
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.action-desc {
    font-size: 13px;
    color: #7f8c8d;
    display: block;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.info-table thead {
    background: #f8f9fa;
}

.info-table thead th {
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 2px solid #ecf0f1;
    font-size: 13px;
}

.info-table tbody tr:hover {
    background: #f8f9fa;
}

.info-table th,
.info-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.info-table th {
    font-weight: 600;
    color: #7f8c8d;
    background: #f8f9fa;
    width: 180px;
    font-size: 13px;
}

.info-table td {
    color: #2c3e50;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #d6eaf8;
    color: #2980b9;
}

.badge-success {
    background: #d5f4e6;
    color: #27ae60;
}

.badge-danger {
    background: #fadbd8;
    color: #c0392b;
}

.badge-warning {
    background: #fcf3cf;
    color: #d68910;
}

/* 登录/注册页面样式 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    max-width: 450px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.auth-header p {
    color: #7f8c8d;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 12px;
}

.form-actions {
    margin-top: 25px;
}

.form-actions .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-bottom: 10px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.form-footer a {
    color: #3498db;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* 提示信息 */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-error {
    background: #fadbd8;
    color: #c0392b;
    border-left-color: #e74c3c;
}

.alert-success {
    background: #d5f4e6;
    color: #27ae60;
    border-left-color: #2ecc71;
}

.alert-info {
    background: #d6eaf8;
    color: #2980b9;
    border-left-color: #3498db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
        transition: transform 0.3s;
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid,
    .action-grid {
        grid-template-columns: 1fr;
    }

    .top-navbar {
        padding: 12px 15px;
    }

    .content-area {
        padding: 15px;
    }
}
