/* Excel Pro 系统样式 - 参考 Art Design Pro */

/* CSS变量定义 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --primary-active: #096dd9;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --info-color: #722ed1;
    
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-disabled: #bfbfbf;
    
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-container: #f5f5f5;
    
    --border-color: #d9d9d9;
    --border-light: #f0f0f0;
    
    --sidebar-width: 256px;
    --sidebar-collapsed-width: 64px;
    --header-height: 64px;
    --footer-height: 48px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    --border-radius: 6px;
    --border-radius-lg: 8px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5715;
    color: var(--text-primary);
    background-color: var(--bg-container);
    overflow-x: hidden;
}

/* Pro布局容器 */
.pro-layout {
    min-height: 100vh;
}

/* 左侧边栏样式 */
.pro-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

/* 侧边栏头部 */
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.logo i {
    font-size: 24px;
}

.logo-text {
    transition: var(--transition);
}

.pro-sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

/* 侧边栏导航 */
.sidebar-nav {
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 4px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: #e6f7ff;
    color: var(--primary-color);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    font-size: 16px;
    margin-right: 12px;
    text-align: center;
}

.nav-text {
    flex: 1;
    transition: var(--transition);
}

.pro-sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.pro-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.pro-sidebar.collapsed .nav-icon {
    margin-right: 0;
}

/* 主布局内容区 */
.pro-layout-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.pro-sidebar.collapsed + .pro-layout-content {
    margin-left: var(--sidebar-collapsed-width);
}

.pro-layout-content.full-width,
.chajian-embed .pro-layout-content {
    margin-left: 0;
}

.chajian-embed .pro-header {
    padding-left: 24px;
}

/* 顶部导航栏 */
.pro-header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-collapse-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.breadcrumb-container .breadcrumb {
    margin: 0;
    background: none;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-action-item {
    position: relative;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.action-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.action-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--error-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-info:hover {
    background-color: var(--bg-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* 下拉菜单样式 */
.notification-dropdown,
.user-dropdown {
    min-width: 240px;
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 主内容区域 */
.pro-main-content {
    flex: 1;
    padding: 24px;
    background-color: var(--bg-container);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.pro-main-content.full-width,
.chajian-embed .pro-main-content {
    padding: 16px 24px 24px;
}

.chajian-embed .pro-main-content {
    min-height: calc(100vh - var(--footer-height));
}

.chajian-embed .pro-header {
    display: none;
}

.chajian-embed .page-header {
    margin-top: 0;
    padding-top: 0;
}

/* 页脚 */
.pro-footer {
    height: var(--footer-height);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 12px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-color);
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

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

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

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 表格样式 */
.table {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.table th {
    background-color: var(--bg-secondary);
    border: none;
    font-weight: 600;
    color: var(--text-primary);
    padding: 16px;
}

.table td {
    padding: 16px;
    border-color: var(--border-light);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* 统计卡片 */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    border: none;
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color), #ffc53d);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color), #73d13d);
}

.stat-card.error {
    background: linear-gradient(135deg, var(--error-color), #ff4d4f);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pro-sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .pro-layout-content {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .nav-text {
        display: none;
    }
    
    .pro-header {
        padding: 0 16px;
    }
    
    .pro-main-content {
        padding: 16px;
    }
    
    .user-details {
        display: none;
    }
    
    .header-actions {
        gap: 8px;
    }
}

@media (max-width: 576px) {
    .breadcrumb-container {
        display: none;
    }
    
    .footer-links {
        display: none;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 加载动画 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 上传区域样式 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background-color: var(--bg-primary);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f6ffed;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #e6f7ff;
    transform: scale(1.02);
}

.upload-content {
    max-width: 300px;
}

.upload-content h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

/* 任务列表特殊样式 */
.task-row:hover {
    background-color: var(--bg-secondary);
}

.progress {
    height: 6px;
    border-radius: 3px;
    background-color: var(--border-light);
    margin-bottom: 4px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 3px;
}

/* 状态徽章增强 */
.badge {
    font-weight: 500;
    padding: 4px 8px;
    font-size: 11px;
    letter-spacing: 0.025em;
}

/* 按钮组优化 */
.btn-group .btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-group .btn + .btn {
    margin-left: 4px;
}

/* 模态框优化 */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 16px 24px;
}

/* 通用进度条 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--bg-secondary);
}

.progress-bar {
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

/* 页面标题 */
.page-header {
    margin-bottom: 24px;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-title p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* 统计卡片增强样式 */
.stat-card .card-body {
    padding: 20px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-trend {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend i {
    font-size: 10px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* 快速操作卡片 */
.quick-action-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    cursor: pointer;
    gap: 16px;
    height: 100%;
}

.quick-action-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.action-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
}

.action-icon.warning {
    background: linear-gradient(135deg, var(--warning-color), #ffc53d);
}

.action-icon.success {
    background: linear-gradient(135deg, var(--success-color), #73d13d);
}

.action-icon.info {
    background: linear-gradient(135deg, var(--info-color), #9254de);
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.action-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.4;
}

.action-arrow {
    color: var(--text-disabled);
    font-size: 14px;
    transition: var(--transition);
}

.quick-action-card:hover .action-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.empty-state i {
    margin-bottom: 16px;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 16px;
}

/* 通知样式 */
.pro-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 320px;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    z-index: 9999;
    transform: translateX(100%);
    transition: var(--transition);
}

.pro-notification.show {
    transform: translateX(0);
}

.pro-notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.pro-notification.success {
    border-left-color: var(--success-color);
}

.pro-notification.error {
    border-left-color: var(--error-color);
}

.pro-notification.warning {
    border-left-color: var(--warning-color);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    flex-shrink: 0;
    font-size: 16px;
}

.notification-icon .fa-check-circle {
    color: var(--success-color);
}

.notification-icon .fa-times-circle {
    color: var(--error-color);
}

.notification-icon .fa-exclamation-triangle {
    color: var(--warning-color);
}

.notification-icon .fa-info-circle {
    color: var(--primary-color);
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-message {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-disabled);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.notification-close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Cookie 选择控件 */
.cookie-picker {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background-color: #f9fafb;
    margin-top: 4px;
}

.cookie-picker-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.cookie-picker-crowd-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #475569;
    font-size: 13px;
    white-space: nowrap;
}

.cookie-picker-search-group {
    flex: 1 1 260px;
}

.cookie-picker-select {
    width: 100%;
    min-height: 180px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    background-color: #fff;
}

.cookie-picker-select option {
    padding: 6px 8px;
}

.cookie-picker-empty {
    margin-top: 8px;
    padding: 12px;
    text-align: center;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
}

.cookie-picker-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
}

.cookie-picker.loading .cookie-picker-select,
.cookie-picker.loading .cookie-picker-search,
.cookie-picker.loading .cookie-picker-search-btn,
.cookie-picker.loading .cookie-picker-refresh-btn {
    opacity: 0.6;
    pointer-events: none;
}
