/* ========== Base Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f7f8fa;
    color: #333;
    line-height: 1.7;
    min-width: 1400px;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: #333;
    transition: color 0.15s;
}

a:hover {
    color: #0084ff;
}

img {
    max-width: 100%;
    display: block;
}

/* ========== Fixed Side Ads ========== */
.ad-fixed-left,
.ad-fixed-right {
    position: fixed;
    top: 0;
    width: 160px;
    height: 100vh;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
    gap: 20px;
    background: #f7f8fa;
}

.ad-fixed-left {
    left: 0;
    border-right: 1px solid #eee;
}

.ad-fixed-right {
    right: 0;
    border-left: 1px solid #eee;
}

.ad-side-item {
    position: relative;
    width: 160px;
    overflow: hidden;
    line-height: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.ad-label {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 2px;
    z-index: 1;
}

.ad-side-item img {
    width: auto;
    height: auto;
    max-width: 160px;
}

/* ========== Page Wrapper (margin for side ads) ========== */
.page-wrapper {
    margin: 0 160px;
    background: #fff;
    min-height: 100vh;
}

/* ========== Top Bar ========== */
.top-bar {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    font-size: 12px;
}

.top-bar-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-left a,
.top-bar-right a {
    color: #999;
}

.top-bar-left a:hover,
.top-bar-right a:hover {
    color: #0084ff;
}

.top-date {
    color: #bbb;
}

/* ========== Main Navigation ========== */
.header {
    background: #fff;
    border-bottom: 2px solid #0084ff;
}

.header-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    height: 48px;
    display: flex;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-right: 32px;
    flex-shrink: 0;
}

.logo:hover {
    color: #333;
}

.nav {
    display: flex;
    gap: 0;
    flex: 1;
}

.nav-link {
    padding: 12px 16px;
    font-size: 14px;
    color: #555;
}

.nav-link:hover {
    color: #0084ff;
}

.nav-link.active {
    color: #0084ff;
    font-weight: 600;
}

.header-right {
    flex-shrink: 0;
}

.search-box {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
}

.search-box input {
    border: none;
    outline: none;
    padding: 5px 10px;
    font-size: 13px;
    width: 180px;
}

.search-btn {
    background: #0084ff;
    color: #fff;
    border: none;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
}

.search-btn:hover {
    background: #0073e6;
}

/* ========== Header Banner Ad ========== */
.ad-top-banner {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.ad-top-banner-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 32px;
    display: flex;
    justify-content: center;
}

.ad-placeholder-h {
    position: relative;
    overflow: hidden;
    line-height: 0;
    width: 100%;
    cursor: pointer;
}

.ad-img-h {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 120px;
}

/* ========== Main Layout ========== */
.main-wrapper {
    max-width: 100%;
    margin: 16px auto;
    padding: 0 32px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ========== Center Content ========== */
.content {
    flex: 1;
    min-width: 0;
}

/* ========== Article Cards ========== */
.article-list {
    display: flex;
    flex-direction: column;
}

.article-card {
    display: flex;
    gap: 18px;
    padding: 18px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.article-card:first-child {
    border-radius: 6px 6px 0 0;
}

.article-card:last-of-type {
    border-radius: 0 0 6px 6px;
}

.article-card:hover {
    background: #fafbfc;
}

.card-img {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    flex: 1;
    min-width: 0;
}

.card-body h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
}

.card-body h3 a {
    color: #333;
}

.card-body h3 a:hover {
    color: #0084ff;
}

.excerpt {
    color: #999;
    font-size: 13px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #bbb;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-item {
    white-space: nowrap;
}

.cat-label {
    display: inline-block;
    padding: 1px 8px;
    background: #f0f0f0;
    color: #666;
    border-radius: 2px;
    font-size: 12px;
}

.cat-label.hot {
    background: #fff0f0;
    color: #e74c3c;
}

/* ========== In-Feed Ads ========== */
.infeed-ad {
    background: #fff;
    border-bottom: 1px solid #eee;
}

.infeed-ad-inner {
    position: relative;
    line-height: 0;
    cursor: pointer;
}

.infeed-ad-inner img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 120px;
}

/* ========== Friend Links ========== */
.friendlinks-bar {
    background: #fff;
    padding: 12px 20px;
    font-size: 12px;
    color: #999;
    border-radius: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.friendlinks-label {
    color: #999;
}

.friendlinks-bar a {
    color: #666;
    font-size: 12px;
}

.friendlinks-bar a:hover {
    color: #0084ff;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    padding-bottom: 20px;
}

.page-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    color: #666;
    background: #fff;
}

.page-btn:hover {
    border-color: #0084ff;
    color: #0084ff;
}

.page-btn.active {
    background: #0084ff;
    color: #fff;
    border-color: #0084ff;
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #ccc;
    padding: 0 2px;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 320px;
    flex-shrink: 0;
}

.sidebar-widget {
    background: #fff;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

/* ========== Author Card ========== */
.master-card {
    text-align: center;
    padding: 20px 16px;
}

.master-avatar-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
}

.master-avatar-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.master-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.master-quote {
    font-size: 12px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 14px;
}

.master-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.master-btn {
    display: block;
    padding: 7px 16px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.master-btn:hover {
    border-color: #0084ff;
    color: #0084ff;
}

.master-btn-primary {
    background: #0084ff;
    color: #fff !important;
    border-color: #0084ff;
}

.master-btn-primary:hover {
    background: #0073e6;
}

/* ========== Right Square Ad ========== */
.ad-square-widget {
    padding: 0;
    overflow: hidden;
    position: sticky;
    top: 14px;
}

.ad-placeholder-square {
    position: relative;
    line-height: 0;
    cursor: pointer;
}

.ad-img-square {
    width: 100%;
    height: auto;
}

/* ========== Trending List ========== */
.hot-list {
    list-style: none;
}

.hot-list li {
    padding: 7px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.hot-list li a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.hot-list li a:hover {
    color: #0084ff;
}

.rank {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    background: #f0f0f0;
    color: #999;
    margin-top: 1px;
}

.rank-1 { background: #0084ff; color: #fff; }
.rank-2 { background: #5cadff; color: #fff; }
.rank-3 { background: #92c4ff; color: #fff; }

/* ========== Latest Comments ========== */
.comment-list {
    list-style: none;
}

.comment-list li {
    padding: 7px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

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

.comment-user {
    color: #0084ff;
    margin-right: 4px;
}

.comment-text {
    color: #666;
}

/* ========== Tag Cloud ========== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 3px 10px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
}

.tag:hover {
    background: #0084ff;
    color: #fff;
}

/* ========== Footer Banner Ad ========== */
.ad-footer-banner {
    background: #fff;
    border-top: 1px solid #e8e8e8;
}

.ad-footer-banner-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 32px;
    display: flex;
    justify-content: center;
}

/* ========== Footer ========== */
.footer {
    background: #333;
    color: #999;
}

.footer-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 28px 32px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-col h4 {
    color: #ddd;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.7;
}

.footer-col a {
    display: block;
    font-size: 13px;
    color: #999;
    padding: 2px 0;
}

.footer-col a:hover {
    color: #0084ff;
}

.footer-bottom {
    text-align: center;
    padding: 14px 32px;
    border-top: 1px solid #444;
    font-size: 12px;
    color: #666;
}

/* ========== Back to Top ========== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 192px;
    width: 36px;
    height: 36px;
    background: #fff;
    color: #999;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    color: #0084ff;
    border-color: #0084ff;
}
