/* ==========================================================================
   ICPEDI 资质资讯网 - 主样式表
   ========================================================================== */

/* CSS 变量 */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-secondary: #0d9488;
    --color-accent: #f59e0b;
    --color-danger: #ef4444;
    --color-success: #22c55e;

    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-light: #94a3b8;
    --color-border: #e2e8f0;
    --color-bg: #f8fafc;
    --color-bg-white: #ffffff;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --container-width: 1200px;
    --header-height: 64px;
    --transition: all 0.2s ease;
}

/* 重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* 布局工具 */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 16px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.col-main { flex: 1; min-width: 0; }
.col-side { width: 300px; flex-shrink: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-secondary); }
.text-light { color: var(--color-text-light); }
.text-primary { color: var(--color-primary); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }

/* ==========================================================================
   顶部导航
   ========================================================================== */
.header {
    background: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 24px;
}
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo:hover { color: var(--color-primary-dark); }
.logo .logo-icon {
    width: 32px; height: 32px;
    background: var(--color-primary);
    border-radius: var(--radius);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 500;
}
.nav a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.nav a.active { background: var(--color-primary); color: #fff; }

.header-search {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    width: 220px;
}
.header-search input {
    border: none;
    padding: 8px 12px;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
}
.header-search button {
    border: none;
    background: var(--color-primary);
    color: #fff;
    padding: 0 12px;
    cursor: pointer;
    font-size: 0.85rem;
}
.header-search button:hover { background: var(--color-primary-dark); }

.header-user { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary-light); }
.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-secondary:hover { background: #0f766e; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ==========================================================================
   面包屑
   ========================================================================== */
.breadcrumb {
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}
.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--color-text-light); }

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-body { padding: 20px; }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title { font-size: 1.1rem; font-weight: 600; }
.card-title a { color: var(--color-text); }
.card-title a:hover { color: var(--color-primary); }
.card-more { font-size: 0.85rem; color: var(--color-text-secondary); }

/* ==========================================================================
   首页 - Hero区域
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    color: #fff;
    padding: 48px 0;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 12px; position: relative; }
.hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 24px; position: relative; }
.hero-search {
    display: flex;
    max-width: 500px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}
.hero-search input {
    flex: 1;
    border: none;
    padding: 14px 18px;
    font-size: 1rem;
    outline: none;
    color: var(--color-text);
}
.hero-search button {
    padding: 0 28px;
    border: none;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}
.hero-search button:hover { background: #d97706; }
.hero-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.hero-tags span { font-size: 0.85rem; opacity: 0.8; }
.hero-tags a {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    padding: 2px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
}
.hero-tags a:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ==========================================================================
   资讯列表
   ========================================================================== */
.news-list .news-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}
.news-list .news-item:hover { background: var(--color-bg); }
.news-list .news-item:last-child { border-bottom: none; }
.news-thumb {
    width: 180px;
    height: 120px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--color-bg);
    flex-shrink: 0;
}
.news-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.news-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.5;
}
.news-title a { color: var(--color-text); }
.news-title a:hover { color: var(--color-primary); }
.news-summary {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}
.news-meta {
    margin-top: auto;
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--color-text-light);
}
.news-meta span { display: flex; align-items: center; gap: 4px; }
.news-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-hot { background: #fef2f2; color: var(--color-danger); }
.badge-top { background: #fffbeb; color: #d97706; }
.badge-original { background: #f0fdf4; color: var(--color-success); }

/* 资讯列表（无缩略图） */
.news-text-list .news-item {
    padding: 14px 0;
    border-bottom: 1px dashed var(--color-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.news-text-list .news-item:last-child { border-bottom: none; }
.news-text-list .news-rank {
    width: 22px; height: 22px;
    border-radius: var(--radius-sm);
    background: var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.news-text-list .news-item:nth-child(1) .news-rank { background: var(--color-danger); color: #fff; }
.news-text-list .news-item:nth-child(2) .news-rank { background: #f97316; color: #fff; }
.news-text-list .news-item:nth-child(3) .news-rank { background: var(--color-accent); color: #fff; }
.news-text-list .news-title { font-size: 0.9rem; margin: 0; flex: 1; }
.news-text-list .news-title a { color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   分类标签
   ========================================================================== */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}
.tag-cloud a:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); }

/* 分类导航 */
.cat-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.cat-nav a {
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-bg);
}
.cat-nav a:hover, .cat-nav a.active { background: var(--color-primary); color: #fff; }

/* ==========================================================================
   服务产品卡片
   ========================================================================== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.product-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); transform: translateY(-2px); }
.product-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.product-card h3 a { color: var(--color-text); }
.product-card h3 a:hover { color: var(--color-primary); }
.product-card .product-desc { font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .product-price { font-size: 1.2rem; font-weight: 700; color: var(--color-danger); }
.product-card .product-price small { font-size: 0.8rem; font-weight: 400; }
.product-card .product-provider { font-size: 0.8rem; color: var(--color-text-light); margin-top: 8px; }

/* ==========================================================================
   服务商卡片
   ========================================================================== */
.provider-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: var(--transition);
}
.provider-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.provider-logo {
    width: 64px; height: 64px;
    border-radius: var(--radius);
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700;
    flex-shrink: 0;
}
.provider-info { flex: 1; }
.provider-info h3 { font-size: 1rem; margin-bottom: 4px; }
.provider-info h3 a { color: var(--color-text); }
.provider-info h3 a:hover { color: var(--color-primary); }
.provider-info p { font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 8px; }
.provider-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--color-text-light); }

/* ==========================================================================
   文章详情
   ========================================================================== */
.article-header { margin-bottom: 24px; }
.article-header h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.4; margin-bottom: 16px; }
.article-meta { display: flex; gap: 16px; font-size: 0.85rem; color: var(--color-text-secondary); flex-wrap: wrap; }
.article-content { font-size: 1rem; line-height: 1.8; color: var(--color-text); }
.article-content p { margin-bottom: 16px; }
.article-content h2 { font-size: 1.3rem; font-weight: 600; margin: 24px 0 12px; }
.article-content h3 { font-size: 1.1rem; font-weight: 600; margin: 20px 0 10px; }
.article-content ul, .article-content ol { margin: 0 0 16px 20px; }
.article-content li { margin-bottom: 6px; }
.article-content img { border-radius: var(--radius); margin: 16px 0; }
.article-content pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: var(--radius); overflow-x: auto; font-size: 0.9rem; }
.article-content blockquote { border-left: 4px solid var(--color-primary); padding: 8px 16px; background: var(--color-bg); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 16px; color: var(--color-text-secondary); }
.article-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ==========================================================================
   分页
   ========================================================================== */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 24px 0; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center; justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--color-text);
}
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination .disabled { color: var(--color-text-light); cursor: not-allowed; }

/* ==========================================================================
   底部
   ========================================================================== */
.footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 40px 0 20px;
    margin-top: 48px;
}
.footer-top { display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 24px; }
.footer-col { flex: 1; min-width: 180px; }
.footer-col h4 { font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 12px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: #94a3b8; font-size: 0.85rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}
.footer-bottom a { color: #94a3b8; }

/* ==========================================================================
   侧边栏
   ========================================================================== */
.sidebar .card { margin-bottom: 20px; }
.sidebar .card-body { padding: 16px; }
.sidebar-title { font-size: 1rem; font-weight: 600; padding-bottom: 12px; border-bottom: 2px solid var(--color-primary); margin-bottom: 12px; }

/* ==========================================================================
   搜索页
   ========================================================================== */
.search-box {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.search-box h2 { font-size: 1.2rem; margin-bottom: 16px; }
.search-form { display: flex; gap: 8px; }
.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
}
.search-form input:focus { border-color: var(--color-primary); }

/* ==========================================================================
   空状态
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 0.95rem; }

/* ==========================================================================
   表单
   ========================================================================== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; }
.form-input, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}
.form-input:focus, .form-textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.form-textarea { resize: vertical; min-height: 100px; }

/* ==========================================================================
   用户中心
   ========================================================================== */
.user-header {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
}
.user-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 600;
}
.user-menu { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.user-menu a {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
}
.user-menu a:hover, .user-menu a.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ==========================================================================
   数据表格
   ========================================================================== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.data-table th { font-weight: 600; color: var(--color-text-secondary); background: var(--color-bg); }
.data-table tr:hover { background: var(--color-bg); }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--color-primary); }

/* 图表容器 */
.chart-container {
    background: var(--color-bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.chart-container h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.chart-box { width: 100%; height: 300px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1024px) {
    .col-side { width: 260px; }
}

@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
    .header-search { width: 100%; order: 3; }
    .nav { order: 4; width: 100%; overflow-x: auto; }
    .row { flex-direction: column; }
    .col-side { width: 100%; }
    .news-thumb { width: 120px; height: 80px; }
    .hero { padding: 32px 0; }
    .hero h1 { font-size: 1.5rem; }
    .product-grid { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.3rem; }
    .footer-top { gap: 20px; }
}

@media (max-width: 480px) {
    .news-thumb { display: none; }
    .news-meta { flex-wrap: wrap; gap: 8px; }
    .pagination a, .pagination span { min-width: 32px; height: 32px; font-size: 0.85rem; }
}
