/**
 * 小智系统 - 公共基础样式
 * 引用: <link rel="stylesheet" href="common/xiaozhi-base.css">
 */

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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* ========== 顶部导航栏 ========== */
.header {
    height: 60px;
    background: linear-gradient(135deg, #409EFF 0%, #337ecc 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-size: 20px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ========== 主内容区 ========== */
.main-container {
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* ========== 卡片组件 ========== */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #409EFF;
    border-radius: 2px;
}

/* ========== 筛选区域 ========== */
.filter-section {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 13px;
    color: #606266;
}

/* ========== 表格增强 ========== */
.el-table {
    border-radius: 8px;
    overflow: hidden;
}

.el-table th {
    background: #f5f7fa !important;
    color: #303133;
    font-weight: 600;
}

.el-table--striped .el-table__body tr.el-table__row--striped td {
    background: #fafafa;
}

/* ========== 状态标签 ========== */
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.success { background: #f0f9eb; color: #67c23a; }
.status-tag.warning { background: #fdf6ec; color: #e6a23c; }
.status-tag.danger { background: #fef0f0; color: #f56c6c; }
.status-tag.info { background: #f4f4f5; color: #909399; }
.status-tag.primary { background: #ecf5ff; color: #409eff; }

/* ========== 按钮组 ========== */
.btn-group {
    display: flex;
    gap: 8px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #909399;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 220px;
    background: #304156;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
}

.menu-item {
    padding: 0 20px;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #bfcbd9;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(64, 158, 255, 0.1);
    color: #409EFF;
}

.menu-item.active {
    background: rgba(64, 158, 255, 0.15);
    color: #409EFF;
    border-left-color: #409EFF;
}

.menu-item i { font-size: 18px; width: 24px; text-align: center; }

.menu-group { border-bottom: 1px solid rgba(255,255,255,0.05); }

.menu-group-title {
    padding: 20px 20px 10px;
    font-size: 12px;
    color: #5a6d82;
    text-transform: uppercase;
}

/* ========== 带侧边栏的主内容区 ========== */
.main-content {
    margin-left: 220px;
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* ========== 页面标题栏 ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #303133;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #409EFF;
    border-radius: 2px;
}

/* ========== 面包屑（顶栏内） ========== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.breadcrumb .active { color: white; }

/* ========== 统计卡片行 ========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

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

.stat-card.active { border-color: #409EFF; }

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

.stat-icon.primary { background: #ecf5ff; color: #409EFF; }
.stat-icon.success { background: #f0f9eb; color: #67C23A; }
.stat-icon.warning { background: #fdf6ec; color: #E6A23C; }
.stat-icon.danger  { background: #fef0f0; color: #F56C6C; }
.stat-icon.info    { background: #f4f4f5; color: #909399; }

.stat-info { flex: 1; }
.stat-label { font-size: 13px; color: #909399; margin-bottom: 2px; }
.stat-value { font-size: 24px; font-weight: 600; color: #303133; }

/* ========== 表格容器 ========== */
.table-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

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

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions { display: flex; gap: 12px; align-items: center; }

/* ========== 顶栏用户信息 ========== */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s;
}

.user-info:hover { background: rgba(255,255,255,0.15); }

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

/* ========== 操作链接按钮 ========== */
.action-link {
    color: #409EFF;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
}

.action-link:hover { color: #66b1ff; }
.action-link.danger { color: #F56C6C; }
.action-link.danger:hover { color: #f89898; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .header { padding: 0 16px; }
    .main-container { padding: 12px; }
    .main-content { margin-left: 0; }
    .sidebar { display: none; }
    .filter-row { flex-direction: column; }
    .filter-item { width: 100%; }
    .stats-row { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   扩展组件 - 筛选项、表格列、弹窗、表单
   ══════════════════════════════════════════════════════════════════════════════ */

/* ========== 筛选项组件 ========== */

/* 筛选项容器（带收起/展开） */
.filter-section.collapsible { position: relative; }
.filter-toggle {
    position: absolute;
    right: 20px;
    top: 16px;
    color: #409EFF;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.filter-toggle:hover { color: #66b1ff; }

/* 筛选按钮组 */
.filter-buttons {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-left: auto;
}

/* 筛选项预设宽度 */
.filter-item.w-120 { width: 120px; }
.filter-item.w-160 { width: 160px; }
.filter-item.w-200 { width: 200px; }
.filter-item.w-240 { width: 240px; }
.filter-item.w-320 { width: 320px; }

/* 日期范围选择器容器 */
.filter-date-range { min-width: 360px; }

/* ========== 表格列组件 ========== */

/* 金额列（右对齐 + 等宽数字） */
.col-amount {
    text-align: right;
    font-family: 'Roboto Mono', 'SF Mono', Consolas, monospace;
    font-variant-numeric: tabular-nums;
}
.col-amount.positive { color: #67C23A; }
.col-amount.negative { color: #F56C6C; }

/* 日期列 */
.col-date {
    color: #606266;
    font-size: 13px;
    white-space: nowrap;
}

/* 图片列 */
.col-image {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background: #f5f7fa;
}

/* 图片占位符 */
.image-placeholder {
    width: 48px;
    height: 48px;
    background: #f5f7fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0c4cc;
    font-size: 20px;
}

/* 操作列 */
.col-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 操作分隔符 */
.action-divider {
    width: 1px;
    height: 14px;
    background: #dcdfe6;
}

/* 可点击数字（如：点击查看详情） */
.clickable-number {
    color: #409EFF;
    cursor: pointer;
    font-weight: 500;
}
.clickable-number:hover { text-decoration: underline; }

/* ========== 弹窗组件 ========== */

/* 弹窗头部 */
.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #ebeef5;
}

.dialog-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 弹窗内容 */
.dialog-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 弹窗底部 */
.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #ebeef5;
    background: #fafafa;
}

/* 详情弹窗 - 信息行 */
.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
    width: 100px;
    flex-shrink: 0;
    color: #909399;
    font-size: 13px;
}

.detail-value {
    flex: 1;
    color: #303133;
    font-size: 14px;
}

/* ========== 表单组件 ========== */

/* 表单行 */
.form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

/* 表单标签 */
.form-label {
    width: 100px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 12px;
    line-height: 36px;
    color: #606266;
    font-size: 14px;
}

/* 必填星号 */
.form-required::before {
    content: '*';
    color: #F56C6C;
    margin-right: 4px;
}

/* 表单内容区 */
.form-content {
    flex: 1;
    min-width: 0;
}

/* 表单提示 */
.form-tip {
    font-size: 12px;
    color: #909399;
    margin-top: 4px;
    line-height: 1.5;
}

/* 表单分组标题 */
.form-group-title {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
    padding: 16px 0 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: #409EFF;
    border-radius: 2px;
}

/* ========== 通知徽标 ========== */
.notification-btn {
    position: relative;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-btn:hover { background: rgba(255,255,255,0.25); }
.notification-btn i { font-size: 18px; color: white; }

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #F56C6C;
    border-radius: 9px;
    font-size: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 600;
}

/* ========== 表格底部 ========== */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #ebeef5;
}

.table-total {
    font-size: 14px;
    color: #606266;
}

.table-total strong {
    color: #409EFF;
    font-weight: 600;
    margin: 0 4px;
}

/* ========== 视角切换器 ========== */
.view-switcher {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 3px;
}

.view-btn {
    padding: 6px 14px;
    border-radius: 17px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.view-btn:hover { color: white; }
.view-btn.active {
    background: white;
    color: #409EFF;
    font-weight: 500;
}

/* ========== 权限提示横幅 ========== */
.permission-banner {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-banner.info { background: #ecf5ff; border: 1px solid #b3d8ff; color: #409eff; }
.permission-banner.warning { background: #fdf6ec; border: 1px solid #faecd8; color: #e6a23c; }
.permission-banner.danger { background: #fef0f0; border: 1px solid #fbc4c4; color: #f56c6c; }

/* ========== Tab 切换 ========== */
.tab-nav {
    display: flex;
    border-bottom: 1px solid #e4e7ed;
    background: white;
    padding: 0 20px;
}

.tab-item {
    padding: 14px 20px;
    font-size: 14px;
    color: #606266;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.3s;
}

.tab-item:hover { color: #409EFF; }
.tab-item.active {
    color: #409EFF;
    border-bottom-color: #409EFF;
    font-weight: 500;
}

/* ========== 进度条 ========== */
.progress-bar {
    height: 6px;
    background: #ebeef5;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-bar-inner.primary { background: #409EFF; }
.progress-bar-inner.success { background: #67C23A; }
.progress-bar-inner.warning { background: #E6A23C; }
.progress-bar-inner.danger { background: #F56C6C; }

/* ══════════════════════════════════════════════════════════════════════════════
   扩展组件 V2 — 社媒部选品通用化提取 (2026-02-10)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ========== 页面标题 - 渐变图标变体 ========== */
.page-title .icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #409EFF 0%, #337ecc 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

/* ========== 统计卡片行 - Flex 变体 ========== */
/* 用于不确定卡片数量的场景，比 grid 4列更灵活 */
.stats-row-flex {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.stats-row-flex .stat-card { flex: 1; }

/* ========== 筛选区域 - 水平布局变体 ========== */
/* label 在左、input 在右的紧凑行内布局 */
.filter-section.horizontal .filter-item {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.filter-section.horizontal .filter-label {
    white-space: nowrap;
}

/* ========== 关键词标签 ========== */
.keyword-tag {
    display: inline-block;
    background: #ecf5ff;
    color: #409EFF;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin: 1px 2px;
}

/* ========== 产品图缩略图 ========== */
.product-image {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.product-image:hover {
    transform: scale(1.1);
}

/* ========== 状态标签 - 扩展色 ========== */
.status-tag.info-light { background: #e8f4fd; color: #5dade2; }
.status-tag.success-dark { background: #e8f8e0; color: #27AE60; }
.status-tag.secondary { background: #ebeef0; color: #6c757d; }

/* ========== 紧凑型搜索+筛选横条 ========== */
.top-bar {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.top-bar-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.top-bar-actions {
    flex-shrink: 0;
}

/* ========== 通用禁用态 ========== */
.btn-disabled {
    color: #c0c4cc !important;
    cursor: not-allowed !important;
}

/* ========== Tab 切换 - 橙色主题变体 ========== */
.tab-item.orange:hover { color: #E6A23C; }
.tab-item.orange.active {
    color: #E6A23C;
    border-bottom-color: #E6A23C;
    font-weight: 500;
}

/* ========== 表单分节标题（带蓝色左边框） ========== */
.form-section {
    font-size: 14px;
    font-weight: 600;
    color: #303133;
    margin: 16px 0 12px;
    padding-left: 10px;
    border-left: 3px solid #409EFF;
}

.form-section:first-child { margin-top: 0; }

/* ========== 产品名称文字 ========== */
.product-name {
    font-weight: 500;
    color: #303133;
}

/* ========== 图片缩略占位（无图时） ========== */
.image-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0c4cc;
    font-size: 20px;
}

/* ========== 版本切换器（顶栏内） ========== */
.version-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 3px;
}

.version-btn {
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: transparent;
    font-family: inherit;
}

.version-btn:hover { color: white; }
.version-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: #409EFF;
    font-weight: 600;
}

/* ========== 卡片式 Tab（全宽等分） ========== */
.card-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.card-tab {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    font-size: 14px;
    color: #606266;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    background: white;
    position: relative;
}

.card-tab:hover { color: #E6A23C; background: #fffbf0; }
.card-tab.active {
    color: #E6A23C;
    font-weight: 600;
    border-bottom-color: #E6A23C;
    background: #fffbf0;
}

.card-tab .tab-count {
    font-size: 12px;
    color: #909399;
    margin-left: 4px;
}

.card-tab.active .tab-count { color: #E6A23C; }

/* ========== 删除操作链接（红色） ========== */
.action-link.remove { color: #F56C6C; }
.action-link.remove:hover { color: #f78989; }

/* ========== stat-icon 扩展色（业务场景） ========== */
.stat-icon.all { background: #ecf5ff; color: #409EFF; }
.stat-icon.review { background: #fdf6ec; color: #E6A23C; }
.stat-icon.reviewed { background: #f4f4f5; color: #909399; }
.stat-icon.toship { background: #fef0f0; color: #F56C6C; }
.stat-icon.shipped { background: #f0f9eb; color: #67C23A; }

/* ========== 响应式补充 - Flex 统计行 ========== */
@media (max-width: 1024px) {
    .stats-row-flex { flex-wrap: wrap; }
    .stats-row-flex .stat-card { flex: 1 1 calc(50% - 6px); min-width: calc(50% - 6px); }
}

@media (max-width: 768px) {
    .stats-row-flex .stat-card { flex: 1 1 100%; }
    .top-bar { flex-wrap: wrap; }
    .card-tabs { flex-direction: column; }
}
