/* 
 * 1688Manager 前台样式 - Professional Frontend Styles
 */

/* ==================== 变量定义 ==================== */
:root {
    /* 主色调 */
    --primary-color: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    
    /* 辅助色 */
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #0ea5e9;
    
    /* 中性色 */
    --bg-dark: #1e293b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

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

/* ==================== 导航栏 ==================== */
.navbar {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 0;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff !important;
}

.navbar-brand i {
    color: var(--primary-light);
}

.navbar-logo {
    max-height: 36px;
    width: auto;
    object-fit: contain;
    background: transparent !important;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: #000;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #000;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

/* ==================== 卡片 ==================== */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

/* ==================== 产品卡片 ==================== */
.product-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.placeholder-img {
    height: 200px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 标签 ==================== */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
}

.badge.bg-secondary {
    background: #e2e8f0 !important;
    color: var(--text-secondary);
}

/* ==================== 分页 ==================== */
.pagination {
    margin: 40px 0 20px;
}

.page-link {
    color: var(--text-secondary);
    border-color: var(--border-color);
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: var(--radius-md);
}

.page-link:hover {
    color: var(--primary-color);
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== 表单 ==================== */
.form-control,
.form-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h4 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ==================== 教程卡片 ==================== */
.tutorial-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tutorial-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

/* ==================== 分类筛选按钮 ==================== */
.btn-group-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-group-flex .btn {
    border-radius: var(--radius-md);
}

/* ==================== 页脚 ==================== */
footer {
    background: var(--bg-dark);
    margin-top: auto;
}

footer a:hover {
    color: var(--primary-light) !important;
    text-decoration: underline;
}

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

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

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================== 响应式 ==================== */
@media (max-width: 991px) {
    .navbar .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .navbar-collapse {
        background: var(--bg-dark);
        padding: 16px;
        margin-top: 8px;
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 767px) {
    .product-card .card-img-top {
        height: 160px;
    }
    
    .placeholder-img {
        height: 160px;
    }
}

/* ==================== 工具类 ==================== */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; }
.bg-light { background-color: var(--bg-light) !important; }
.bg-dark { background-color: var(--bg-dark) !important; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium { font-weight: 500; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
