/* ==============================
   eenano.com 综合门户 CSS Design System
   ============================== */

/* ---- 设计变量 ---- */
:root {
    --primary: #E53935;
    --primary-dark: #C62828;
    --primary-light: #FFCDD2;
    --accent: #FF6F00;
    --bg-body: #f0f2f5;
    --bg-white: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #e8e8e8;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: all 0.25s ease;
    --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

a {
    transition: var(--transition);
}

img {
    max-width: 100%;
}

/* ---- 顶部信息条 ---- */
#top-bar {
    background: #f5f5f5;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

#top-bar a:hover {
    color: var(--primary) !important;
}

/* ---- 品牌 Header ---- */
#site-header {
    background: var(--bg-white);
    padding: 12px 0;
    border-bottom: 2px solid var(--primary);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    gap: 0;
}

.logo-ee {
    font-size: 34px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -2px;
    line-height: 1;
}

.logo-nano {
    font-size: 34px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
}

.logo-dot {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1;
}

.logo-desc-box {
    height: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-title {
    font-size: 16px;
    color: #333;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
    letter-spacing: 1px;
    margin-top: 1px;
}

/* ---- 搜索框 ---- */
.header-search {
    flex: 1;
}

.search-form {
    border: 2px solid var(--primary);
    border-radius: 2px;
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
}

.search-form:focus-within {
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

.search-type-select {
    padding: 7px 14px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    user-select: none;
}

.search-input {
    border: none;
    outline: none;
    padding: 7px 14px;
    font-size: 13px;
    background: transparent;
    min-width: 0;
}

.search-btn {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 7px 22px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

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

/* 主题hover动画通用类 */
.hover-scale {
    transition: transform 0.2s;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ---- 主导航 ---- */
#main-nav {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 12px rgba(229, 57, 53, 0.3);
}

.nav-inner {
    display: flex;
    align-items: stretch;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 22px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    color: #fff;
    background: var(--primary-dark);
}

.nav-item.active::after {
    display: none;
}

/* 下拉菜单 */
.nav-dropdown {
    position: relative;
}

.dropdown-menu-custom {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 480px;
    background: var(--bg-white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 16px;
    z-index: 1050;
    animation: fadeDown 0.2s ease;
}

.nav-dropdown:hover .dropdown-menu-custom {
    display: block;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.dropdown-item-custom {
    display: block;
    padding: 8px 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.dropdown-item-custom:hover {
    background: var(--primary-light);
    color: var(--primary);
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- 主体区域 ---- */
.site-main {
    padding: 24px 0 40px;
    min-height: 60vh;
}

main>.container,
main>.container-fluid {
    padding: 0 15px 0;
}

/* ---- 通用卡片 ---- */
.card-block {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

/* 区块标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    padding-left: 10px;
    border-left: 4px solid var(--primary);
    line-height: 1;
}

.section-more {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.section-more:hover {
    color: var(--primary);
}

/* ---- 文章卡片项 ---- */
.article-item {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: var(--transition);
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover {
    background: #fafafa;
}

.article-thumb {
    width: 160px;
    min-width: 160px;
    height: 110px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-item:hover .article-thumb img {
    transform: scale(1.05);
}

.article-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 6px;
}

.article-title a {
    color: var(--text-primary);
    text-decoration: none;
}

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

.article-summary {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.article-meta .cat-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 3px;
    font-size: 11px;
    text-decoration: none;
    margin-right: 8px;
}

.article-meta .cat-tag:hover {
    background: var(--primary);
    color: #fff;
}

/* ---- 轮播焦点图 ---- */
.hero-carousel .carousel-item {
    height: 380px;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    padding: 40px 20px 16px;
}

.hero-caption h5 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ---- 今日头条列表 ---- */
.headline-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.headline-list li {
    padding: 9px 0;
    border-bottom: 1px dashed #eee;
    display: flex;
    align-items: flex-start;
}

.headline-list li:last-child {
    border-bottom: none;
}

.headline-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 7px;
    margin-right: 8px;
    flex-shrink: 0;
}

.headline-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* ---- 热门排行 ---- */
.rank-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: var(--transition);
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-item:hover {
    background: #fafafa;
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    margin-top: 1px;
}

.rank-num.top {
    background: var(--primary);
}

.rank-num.normal {
    background: #ccc;
    color: #666;
}

.rank-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* ---- 标签云 ---- */
.tag-cloud-item {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition);
    background: #fafafa;
}

.tag-cloud-item:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ---- 频道专栏区域 ---- */
.channel-section {
    margin-bottom: 24px;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 20px;
}

.channel-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.channel-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.channel-card-img {
    height: 120px;
    overflow: hidden;
    background: var(--bg-body);
}

.channel-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.channel-card:hover .channel-card-img img {
    transform: scale(1.08);
}

.channel-card-body {
    padding: 10px 12px;
}

.channel-card-body h6 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.4;
}

.channel-card-body h6 a {
    color: var(--text-primary);
    text-decoration: none;
}

.channel-card-body h6 a:hover {
    color: var(--primary);
}

.channel-card-body .meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- 广告位 ---- */
.ad-placeholder {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #dee2e6;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.ad-placeholder i {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ---- Footer ---- */
#site-footer {
    margin-top: auto;
}

.footer-main {
    background: #1a1a2e;
    padding: 48px 0 32px;
    color: rgba(255, 255, 255, 0.65);
}

.footer-brand {
    margin-bottom: 16px;
}

.footer-brand .logo-ee {
    font-size: 28px;
}

.footer-brand .logo-nano {
    font-size: 28px;
    color: #fff;
}

.footer-brand .logo-dot {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
}

.footer-desc {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 16px;
    max-width: 300px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-right: 8px;
    transition: var(--transition);
    font-size: 16px;
}

.footer-social a:hover {
    background: var(--primary);
    color: #fff;
}

.footer-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--primary);
}

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

.footer-links li {
    margin-bottom: 8px;
    font-size: 13px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
    padding-left: 4px;
}

.footer-contact li {
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom {
    background: #12122a;
    padding: 16px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- 面包屑 ---- */
.breadcrumb {
    font-size: 13px;
    padding: 8px 0;
}

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

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

/* ---- gridview/yii overrides ---- */
.grid-view th,
.grid-view td:last-child {
    white-space: nowrap;
}

.grid-view .filters input,
.grid-view .filters select {
    min-width: 50px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

a.asc:after,
a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* ---- 响应式 ---- */
@media (max-width: 991px) {
    .logo-slogan {
        display: none;
    }

    .header-search {
        max-width: 320px;
    }

    .dropdown-menu-custom {
        min-width: 320px;
    }

    .dropdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .channel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    #site-header {
        padding: 12px 0;
    }

    .logo-ee,
    .logo-nano {
        font-size: 24px;
    }

    .header-search {
        display: none;
    }

    .nav-inner {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .dropdown-menu-custom {
        display: none !important;
    }

    .article-thumb {
        width: 100px;
        min-width: 100px;
        height: 75px;
    }

    .hero-carousel .carousel-item {
        height: 220px;
    }

    .channel-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        padding: 32px 0 16px;
    }
}