/* ========================================
   21GZ.CN - 广州本地信息化门户
   全局样式表
   ======================================== */

/* CSS 变量 */
:root {
    --primary: #C41E3A;        /* 中国红/木棉红 */
    --primary-dark: #9B1630;
    --primary-light: #E8475F;
    --secondary: #D4A843;      /* 金色 */
    --accent: #2E8B57;         /* 岭南绿 */
    --bg: #F5F5F5;
    --bg-white: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #E8E8E8;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
    --max-width: 1200px;
}

/* 重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-width: 320px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   顶部工具栏
   ======================================== */
.top-bar {
    background: #1a1a1a;
    color: #ccc;
    font-size: 0.8rem;
    padding: 6px 0;
}

.top-bar .container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.city-label {
    color: var(--secondary);
    font-weight: 600;
}

/* ========================================
   主导航
   ======================================== */
.main-header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo a {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.logo-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: -4px;
}

.main-nav ul {
    display: flex;
    gap: 4px;
}

.main-nav a {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: rgba(196, 30, 58, 0.06);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.search-box input {
    border: none;
    background: transparent;
    padding: 8px 16px;
    width: 200px;
    font-size: 0.9rem;
    outline: none;
}

.search-box button {
    border: none;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* ========================================
   英雄区域
   ======================================== */
.hero {
    position: relative;
    height: 420px;
    overflow: hidden;
}

.hero-slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 20px 0;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin-bottom: 30px;
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ========================================
   快速入口
   ======================================== */
.quick-entry {
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.quick-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: block;
}

.quick-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.quick-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.quick-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ========================================
   主要内容区域
   ======================================== */
.main-content {
    padding: 40px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

/* 板块卡片 */
.section-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.section-title-center {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text);
}

/* ========================================
   新闻列表
   ======================================== */
.news-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item.featured {
    display: flex;
    gap: 20px;
    padding-top: 0;
}

.news-img {
    width: 240px;
    min-height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.news-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.news-tag.hot { background: #FFF0F0; color: var(--primary); }
.news-tag:not(.hot) { background: #F0F4FF; color: #3B5998; }

.news-info h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.5;
}

.news-info h3 a:hover {
    color: var(--primary);
}

.news-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.6;
}

.news-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ========================================
   数据网格
   ======================================== */
.data-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.data-card {
    text-align: center;
    padding: 20px 12px;
    background: linear-gradient(135deg, #FFF5F5 0%, #FFF0F3 100%);
    border-radius: var(--radius);
    border: 1px solid #FDD;
}

.data-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.data-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.data-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ========================================
   侧边栏
   ======================================== */
.sidebar-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.sidebar-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

/* 城市名片 */
.city-card-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
}

.city-card-item:last-child {
    border-bottom: none;
}

.city-card-item .label {
    color: var(--text-muted);
}

.city-card-item .value {
    font-weight: 600;
    color: var(--text);
}

/* 热门列表 */
.hot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    transition: var(--transition);
}

.hot-item:hover {
    color: var(--primary);
    padding-left: 4px;
}

.hot-rank {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.hot-item:nth-child(1) .hot-rank,
.hot-item:nth-child(2) .hot-rank,
.hot-item:nth-child(3) .hot-rank {
    background: var(--primary);
}

.hot-item:nth-child(n+4) .hot-rank {
    background: #999;
}

/* 工具列表 */
.tool-item {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    transition: var(--transition);
}

.tool-item:hover {
    color: var(--primary);
    padding-left: 4px;
}

/* ========================================
   特色板块
   ======================================== */
.features {
    padding: 50px 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 260px;
    cursor: pointer;
    display: block;
}

.feature-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.feature-card:hover .feature-img {
    transform: scale(1.08);
}

.feature-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.feature-overlay h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.feature-overlay p {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ========================================
   页脚
   ======================================== */
.main-footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 50px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.footer-col p {
    font-size: 0.85rem;
    line-height: 1.8;
    color: #999;
}

.footer-domain {
    color: var(--secondary) !important;
    font-weight: 600;
    margin-top: 8px;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #999;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--secondary);
}

.footer-bottom {
    border-top: 1px solid #333;
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .quick-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 20px;
    }

    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .news-item.featured {
        flex-direction: column;
    }

    .news-img {
        width: 100%;
        min-height: 200px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        display: none;
    }
}
