/* Vivi工作台 - 核心样式 */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #95a5a6;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --top-bar-height: 70px;
    --border-radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1a1f37 0%, #2d3561 100%);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

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

.nav-title {
    padding: 0 20px 10px;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

.sidebar.collapsed .nav-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    margin: 2px 10px;
    border-radius: 8px;
}

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

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.nav-text {
    margin-left: 12px;
    white-space: nowrap;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar.collapsed .nav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px;
    min-width: 8px;
    height: 8px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.user-details {
    overflow: hidden;
}

.user-name {
    font-weight: 500;
    white-space: nowrap;
}

.user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.sidebar.collapsed .user-details {
    display: none;
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* 顶部栏 */
.top-bar {
    height: var(--top-bar-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

.current-date {
    color: var(--secondary);
    font-size: 14px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 25px;
    padding: 5px 15px;
    width: 280px;
}

.search-box input {
    border: none;
    background: none;
    flex: 1;
    padding: 8px;
    font-size: 14px;
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

/* 页面容器 */
.page-container {
    padding: 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

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

.stat-change {
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
}

/* 仪表盘网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

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

.card-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.card-more {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

.card-more:hover {
    text-decoration: underline;
}

.card-body {
    padding: 20px;
    min-height: 200px;
}

/* 快捷操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s;
}

.quick-action-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

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

/* 占位符 */
.placeholder {
    text-align: center;
    padding: 100px;
    color: var(--secondary);
    background: white;
    border-radius: var(--border-radius);
}

/* 快捷操作区样式 */
.quick-actions-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quick-actions-group {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.group-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* 平台网格 */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.platform-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.platform-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--platform-color, #667eea);
}

.platform-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.platform-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.platform-arrow {
    color: #ccc;
    font-size: 14px;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 15px 10px;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-card:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

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

.tool-name {
    font-size: 12px;
}

/* 创建按钮 */
.create-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.create-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.create-btn:hover {
    background: #667eea;
    color: white;
}

.create-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.create-live .create-icon { background: #fee; }
.create-video .create-icon { background: #e3f2fd; }
.create-template .create-icon { background: #f3e5f5; }

.create-btn:hover .create-icon {
    background: rgba(255,255,255,0.2);
}

.create-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.create-title {
    font-size: 14px;
    font-weight: 500;
}

.create-desc {
    font-size: 11px;
    opacity: 0.7;
}

/* 计算器样式 */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.calc-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calc-row label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.calc-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* 任务卡片（在UI组件中定义，这里是补充样式） */
.task-card {
    cursor: pointer;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        display: none;
    }
    
    .top-bar {
        padding: 0 15px;
    }
    
    .page-container {
        padding: 15px;
    }
}
