/* 制作管理监控系统 - 全局样式 */

:root {
    --primary-color: #f5f6fa;
    --secondary-color: #ffffff;
    --accent-color: #e8eaf6;
    --highlight-color: #2196F3;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --text-primary: #2c3e50;
    --text-secondary: #546e7a;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro SC', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    background-color: #e8eaf0;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 布局 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 - 深色优化 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 32px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin: 4px 0 0 0;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 12px;
}

.sidebar-menu li {
    margin: 4px 0;
}

.sidebar-menu li.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 8px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    text-align: center;
    position: relative;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: width 0.3s ease;
    z-index: -1;
}

.sidebar-menu a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-menu a:hover::before {
    width: 100%;
}

.sidebar-menu a.active {
    background-color: rgba(33, 150, 243, 0.25);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.sidebar-menu a.logout-link {
    color: rgba(255, 99, 71, 0.85);
}

.sidebar-menu a.logout-link:hover {
    background-color: rgba(255, 99, 71, 0.15);
    color: rgba(255, 99, 71, 1);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 顶部栏 - Apple风格 */
.top-bar {
    background-color: var(--card-bg);
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.top-bar h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.user-info span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 卡片 - Apple风格 */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-width: 100%;
    box-sizing: border-box;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.card-body {
    padding: 10px 0;
}

/* 统计卡片 - Apple风格 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stat-card h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 36px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

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

/* 按钮 - Apple风格 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    letter-spacing: -0.1px;
}

.btn-primary {
    background-color: #007aff;
    color: white;
}

.btn-primary:hover {
    background-color: #0051d5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-success {
    background-color: #34c759;
    color: white;
}

.btn-success:hover {
    background-color: #248a3d;
}

.btn-warning {
    background-color: #ff9500;
    color: white;
}

.btn-warning:hover {
    background-color: #c77700;
}

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

.btn-danger:hover {
    background-color: #d70015;
}

.btn-secondary {
    background-color: #f5f5f7;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-secondary:hover {
    background-color: #e8e8ed;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* 表格 - Apple风格 */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* 图表卡片样式 */
.chart-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--card-bg);
}

table thead {
    background-color: #f5f5f7;
}

table th,
table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    font-size: 13px;
}

table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    color: var(--text-primary);
    font-size: 14px;
}

table tbody tr {
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background-color: rgba(0, 122, 255, 0.04);
}

table tbody tr:last-child td {
    border-bottom: none;
}

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

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

.form-control {
    width: 100%;
    padding: 10px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

select.form-control {
    cursor: pointer;
}

/* 状态标签 - Apple风格 */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-online {
    background-color: rgba(52, 199, 89, 0.15);
    color: #248a3d;
}

.status-offline {
    background-color: rgba(255, 59, 48, 0.15);
    color: #d70015;
}

.status-active {
    background-color: rgba(0, 122, 255, 0.15);
    color: #0051d5;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    background-color: var(--accent-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--highlight-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框 - Apple风格 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.close {
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.close:hover {
    color: var(--text-primary);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--highlight-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

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

.search-bar input {
    flex: 1;
}

/* 登录页面 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* 背景图片在页面中设置 */
}

.login-box {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90%;
    backdrop-filter: blur(10px);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

    .sidebar.show {
        transform: translateX(0);
    }

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

    .stat-cards {
        grid-template-columns: 1fr;
    }
}

