* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --menu-width: 250px;
    --header-height: 70px;
    --transition-speed: 0.3s;
}

body {
    background-color: #f5f7f9;
    color: var(--text-color);
    line-height: 1.6;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--menu-width);
    background: var(--secondary-color);
    color: white;
    transition: transform var(--transition-speed);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

.logo-version {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .4px;
    color: rgba(255, 255, 255, .92);
    background: linear-gradient(135deg, rgba(91,153,190,.55), rgba(52,152,219,.35));
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.logo-version i { margin-right: 4px; opacity: .85; }

.menu {
    list-style: none;
    padding: 20px 0;
}

.menu a {
    text-decoration:none;
    color: white;
}

.menu-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
    background-color: var(--primary-color);
    border-left: 4px solid white;
}

.menu-item i {
    margin-right: 15px;
    font-size: 1.2rem;
}

.menu-item a {
    text-decoration:none;
    color: white;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏样式 */
.header {
    height: var(--header-height);
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 100;
}

.hamburger-menu {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
}

.header-controls {
    display: flex;
    align-items: center;
}

.dropdown {
    position: relative;
    margin-left: 20px;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    background: var(--light-bg);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.dropdown-toggle:hover {
    background: #e9ecef;
}

.dropdown-toggle i {
    margin-left: 8px;
    font-size: 0.9rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px 0;
    margin-top: 5px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.dropdown-item:hover {
    background-color: var(--light-bg);
}

.dropdown-item a {
    text-decoration:none;
    color: #333;
}

.user-profile {
    display: flex;
    align-items: center;
    margin-left: 25px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 10px;
}

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

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.stat-card {
    text-align: center;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

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

.stat-card p {
    color: #6c757d;
}

.content-header {
    margin-bottom: 25px;
}

/* 标题区带操作按钮时：标题靠左、按钮靠右同一行；窄屏自动换行。
   只给加了 with-actions 类的页面生效，不影响纯标题页面。 */
.content-header.with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.content-header.with-actions > div:first-child {
    flex: 1 1 auto;
    min-width: 240px;
}
.content-header.with-actions > .btn,
.content-header.with-actions > a.btn {
    flex: 0 0 auto;
    white-space: nowrap;
    align-self: center;
}

.content-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

thead th {
    background-color: var(--light-bg);
    font-weight: 600;
}

tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--success-color);
}

.status-pending {
    background-color: rgba(243, 156, 18, 0.2);
    color: var(--warning-color);
}

.status-inactive {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--accent-color);
}

.action-buttons button {
    padding: 6px 10px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: var(--light-bg);
    transition: background-color var(--transition-speed);
}

.action-buttons button:hover {
    background-color: #e2e6ea;
}

.action-buttons .edit-btn {
    color: var(--primary-color);
}

.action-buttons .delete-btn {
    color: var(--accent-color);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: flex;
    margin: 0 -10px;
}

.form-col {
    flex: 1;
    padding: 0 10px;
}

.checkbox-group, .radio-group {
    margin-bottom: 15px;
}

.checkbox-label, .radio-label {
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.checkbox-input, .radio-input {
    margin-right: 3px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

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

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

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

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

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        height: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .hamburger-menu {
        display: block;
    }
    
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .overlay.show {
        display: block;
    }
    
    .form-row {
        flex-direction: column;
        margin: 0;
    }
    
    .form-col {
        padding: 0;
        margin-bottom: 15px;
    }
}

    /* 表格宽度固定方案 */
    .table-container {
        overflow-x: auto;
        width: 100%;
    }
    
    .table-container table {
        table-layout: fixed; /* 关键：使用固定布局 */
        width: 100%; /* 确保表格填满容器 */
        min-width: 800px; /* 设置最小宽度，确保列宽生效 */
        border-collapse: collapse;
    }
    
    .table-container th,
    .table-container td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 8px 12px;
    }
    
    /* 确保操作按钮在移动端也正常显示 */
    .action-buttons {
        display: flex;
        gap: 8px;
    }
    
    .action-buttons button {
        white-space: nowrap;
        padding: 6px 12px;
    }
    

@media (max-width: 768px) {
    .header {
        padding: 0 15px;
    }
    
    .content {
        padding: 15px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .dropdown-toggle span {
        display: block;
    }
    
    .dropdown-toggle i {
        margin-left: 0;
    }
    
    .table-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    }
}

/* ===== 一级可折叠菜单（当前项目 / 资产管理）===== */
.menu-group { display: block; }
.menu-group-head {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #fff;
    transition: background-color var(--transition-speed);
    user-select: none;
}
.menu-group-head:hover { background-color: rgba(255, 255, 255, 0.1); }
.menu-group-head i:first-child { margin-right: 15px; font-size: 1.2rem; }
.menu-group-head span { flex: 1; }
.menu-arrow { margin-left: auto; font-size: .85rem; transition: transform .2s ease; opacity: .8; }
.menu-group.open .menu-arrow { transform: rotate(180deg); }
/* 展开态一级菜单（AI短视频/AI漫剧）不加背景，样式与「资产管理」一致；hover 仍有轻微反馈 */
.menu-group.open > .menu-group-head { background-color: transparent; }
/* AI漫剧：一级菜单标题样式 */
.menu-group-head.proj-menu-head { color: #fff; text-decoration: none; }
/* 「当前项目」二级项：沿用二级菜单统一样式，仅超长项目名省略 */
.menu-sub.proj-sub li a.proj-cur-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-sub {
    display: none;
    list-style: none;
    margin: 0;
    padding: 4px 0 6px 0;
    background: rgba(0, 0, 0, 0.16);
}
.menu-group.open > .menu-sub { display: block; }
.menu-sub li a {
    display: block;
    padding: 10px 18px 10px 52px;
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.3;
    transition: background-color var(--transition-speed);
}
.menu-sub li a i { margin-right: 8px; font-size: .95rem; }
.menu-sub li a:hover { background-color: rgba(255, 255, 255, 0.1); color: #fff; }
.menu-sub li a.active {
    background-color: var(--primary-color);
    border-left: 3px solid #fff;
    color: #fff;
    padding-left: 49px;
}
.menu-welcome { cursor: default; }
.menu-welcome:hover { background-color: transparent; }

/* ===== 「当前项目」二级菜单：编号 + 进度提示（始终展开） ===== */
.menu-sub.proj-sub li a {
    font-size: 14.5px;          /* 主题文字适当变大 */
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .3px;
}
.menu-sub.proj-sub li a .np-label {
    display: inline-block;
    margin-left: 2px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}
/* 进度文字颜色：未开始=红，全相等=绿，不一致=黄 */
.np { font-weight: 600; }
.np-none { color: #ff6b6b; }        /* 未开始（红） */
.np-good { color: #51cf66; }        /* 分数全相等（绿） */
.np-warn { color: #ffd43b; }        /* 分数不一致（黄） */
/* 高亮行上进度文字保证可读 */
.menu-sub li a.active .np-none { color: #ffd7d7; }
.menu-sub li a.active .np-good { color: #d3ffd9; }
.menu-sub li a.active .np-warn { color: #fff3b0; }

/* ===== 导航字体统一：所有菜单文字与「当前项目」一致（括号内进度数字除外） ===== */
.menu .menu-item:not(.menu-welcome) > span,
.menu .menu-group-head > span,
.menu .menu-sub li a {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .3px;
}
/* 括号内的进度数字/文字保持原样，不参与统一 */
.menu .menu-sub li a .np-label,
.menu .menu-sub li a .np {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0;
}

/* ===== 短视频特效网格：热门特效 / 我的作品，PC 每行 4 个、手机每行 2 个 ===== */
.fx-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
@media (max-width: 768px){
    .fx-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
