/* ========================================
   津城惠生活 - 精确对齐版
   ======================================== */

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

:root {
    --primary: #1e88e5;
    --primary-light: #42a5f5;
    --primary-dark: #1565c0;
    --bg: #f5f7fa;
    --surface: #fff;
    --text: #212121;
    --text-light: #757575;
    --border: #e3f2fd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

/* ====== 页面容器 ====== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ====== 顶部导航栏 ====== */
.top-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 20px 0;
}

.header-row {
    display: flex;
    align-items: center;
}

/* 左侧：Logo + 搜索框 */
.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 50px;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    white-space: nowrap;
}

.search-box {
    display: flex;
    background: #fff;
    border-radius: 25px;
    width: 400px;
    height: 44px;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0 18px;
    font-size: 1rem;
    outline: none;
    border-radius: 25px 0 0 25px;
}

.search-box button {
    background: var(--primary-dark);
    border: none;
    padding: 0 20px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    color: #fff;
}

/* 右侧：日期 */
.header-right {
    width: 200px;
    flex-shrink: 0;
    text-align: right;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.date-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.4;
}

.date-info .date {
    font-size: 1rem;
    font-weight: 500;
}

.date-info .weekday {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ====== 分类导航 ====== */
.category-nav {
    background: var(--surface);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-row {
    display: flex;
    align-items: center;
}

.nav-left {
    flex: 1;
}

/* 导航项均匀分布，首字贴左，活字贴右 */
.nav-list {
    display: flex;
    list-style: none;
    justify-content: space-between;
}

.nav-list li {
    flex: 1;
    text-align: center;
}

.nav-list a {
    display: block;
    padding: 16px 0;
    font-size: 1.05rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

/* 占位，保持右侧对齐 */
.nav-right {
    width: 324px;
    flex-shrink: 0;
}

/* ====== 主内容区 ====== */
.main-content {
    padding: 24px 0;
}

.content-row {
    display: flex;
    align-items: stretch;
}

/* 左侧新闻 */
.news-section {
    flex: 1;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.section-header .icon { color: var(--primary); }
.section-header .more {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-light);
}

.news-list {
    list-style: none;
    flex: 1;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #fafafa;
    cursor: pointer;
}

.news-item:hover { background: #f8fbfe; }

.news-item::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
}

.news-item-content { flex: 1; }

.news-item-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.news-item:hover .news-item-title { color: var(--primary-dark); }

.news-item-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.news-item-tag {
    padding: 2px 8px;
    background: rgba(30,136,229,0.08);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary-dark);
}

.news-item.is-top::before { display: none; }
.news-item.is-top .news-item-title::before {
    content: '置顶';
    padding: 2px 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-right: 10px;
}

.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { margin-bottom: 8px; }
.empty-state-desc { font-size: 0.9rem; color: var(--text-light); }

/* 右侧边栏 */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    margin-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.sidebar-title {
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

/* 生活服务 - 2行3列布局，防止溢出 */
.service-list { 
    padding: 14px; 
}
.service-list ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0;
    padding: 0;
}
.service-list li {
    margin: 0;
    padding: 0;
}
.service-list li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: #f8fbfe;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    text-align: center;
    gap: 6px;
}
.service-list li a:hover { background: var(--border); color: var(--primary-dark); }
.service-list li a svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }

.qrcode-section { 
    padding: 20px; 
    text-align: center; 
}

.qrcode-section .qrcode-item {
    margin-bottom: 20px;
}

.qrcode-section .qrcode-item:last-child {
    margin-bottom: 0;
}

.qrcode-section .qrcode {
    width: 160px;
    height: 160px;
    background: #f8fbfe;
    border-radius: 8px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
}
.qrcode-section .qrcode img { width: 100%; height: 100%; border-radius: 8px; }
.qrcode-section .text { font-size: 0.9rem; font-weight: 500; }
.qrcode-section .subtext { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }

/* ====== 分页 ====== */
.pagination-wrapper { padding: 20px; display: flex; justify-content: center; }
.pagination { display: flex; gap: 8px; list-style: none; }
.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}
.page-item:hover .page-link { border-color: var(--primary); color: var(--primary-dark); }
.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ====== 页脚 ====== */
.site-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    padding: 32px 0 24px;
    margin-top: 40px;
}

.footer-links { text-align: center; margin-bottom: 14px; }
.footer-links a { opacity: 0.9; font-size: 0.9rem; margin: 0 5px; }
.footer-links .divider { opacity: 0.5; margin: 0 10px; }

.footer-copyright { text-align: center; }
.footer-copyright p { margin: 4px 0; font-size: 0.85rem; opacity: 0.85; }
.footer-copyright .icp { opacity: 0.6; font-size: 0.8rem; }

/* ====== 响应式 ====== */
@media (max-width: 1200px) {
    .page-container { padding: 0 20px; }
}

@media (max-width: 992px) {
    .content-row { flex-direction: column; }
    .sidebar { margin-left: 0; margin-top: 24px; width: 100%; }
    .nav-right { display: none; }
}

@media (max-width: 768px) {
    .header-row { flex-direction: column; gap: 16px; }
    .header-left { flex-direction: column; width: 100%; }
    .search-box { width: 100%; }
    .header-right { width: 100%; padding-left: 0; text-align: center; }
    .nav-list { flex-wrap: wrap; }
    .nav-list li { flex: 0 0 auto; }
    .service-list ul { grid-template-columns: repeat(2, 1fr); }
}
