/* ========================================
   股票指标网 - 最终稳定版
   解决列表页右侧留白：统一在 .excerpt 上控制内边距
   ======================================== */

/* CSS 变量定义 */
:root {
    --primary-color: #2c7da0;
    --primary-dark: #1f5068;
    --primary-light: #61a5c2;
    --secondary-color: #f4a261;
    --text-dark: #2d3e50;
    --text-light: #6c757d;
    --bg-gray: #f8f9fa;
    --border-color: #e9ecef;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

/* 头部 */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo a {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo img {
    height: 36px;
    width: auto;
    vertical-align: middle;
}

.brand {
    font-size: 14px;
    color: var(--text-light);
    border-left: 2px solid var(--border-color);
    padding-left: 12px;
    margin-left: 8px;
}

.site-navbar {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.site-navbar li a {
    padding: 8px 16px;
    border-radius: 40px;
    font-weight: 500;
    display: inline-block;
}

.site-navbar li a:hover {
    background-color: rgba(44,125,160,0.1);
    color: var(--primary-color);
}

/* 面包屑 */
.breadcrumbs {
    background: transparent;
    padding: 20px 0 8px;
    font-size: 13px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.breadcrumbs a {
    color: var(--text-light);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

/* 主布局 */
.container.clearfix {
    display: flex;
    gap: 32px;
    margin-top: 24px;
    margin-bottom: 48px;
}

.content-wrap {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* 内容卡片 */
.content {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 32px;
    overflow: hidden;
}

/* 分类标题 */
.catleader {
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.catleader h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
}

/* 文章列表 - 统一右侧留白控制 */
.excerpt {
    display: flex;
    gap: 24px;
    /* 关键：右侧内边距 20px，保证文字不贴边，且不依赖子元素 */
    padding: 24px 20px 24px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.excerpt:hover {
    transform: translateX(4px);
}

/* 缩略图区域 */
.excerpt .focus {
    flex-shrink: 0;
    width: 240px;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.excerpt .focus img,
.excerpt .focus .thumb,
.excerpt .focus a img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background-color: #f0f2f5;
    border-radius: var(--radius-sm);
}

/* 文字区域（无需额外 padding，由父级 .excerpt 的 padding 提供右侧留白） */
.excerpt-body {
    flex: 1;
}

.excerpt h2 {
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.excerpt h2 a {
    color: var(--text-dark);
}

.excerpt h2 a:hover {
    color: var(--primary-color);
}

.excerpt .meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.excerpt .meta i {
    margin-right: 4px;
    width: 14px;
}

.excerpt .note {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* 分页 */
.pagination {
    margin-top: 32px;
    text-align: center;
}

.pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    flex-wrap: wrap;
}

.pagination ul li a,
.pagination ul li span {
    display: inline-block;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination ul li.active span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination ul li a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 侧边栏组件 */
.widget {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    overflow: hidden;
}

.widget h3 {
    font-size: 18px;
    font-weight: 600;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.widget h3:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20px;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.textwidget {
    padding: 16px 20px;
    color: var(--text-light);
    font-size: 14px;
}

.widget_text .textwidget ul {
    list-style: none;
}

.widget_text .textwidget li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.widget_text .textwidget li:last-child {
    border-bottom: none;
}

.widget_text .textwidget li a {
    display: block;
    font-weight: 500;
    transition: var(--transition);
}

.widget_text .textwidget li a:hover {
    color: var(--primary-color);
    padding-left: 6px;
}

.widget_tags .items {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.widget_tags .items a {
    background: var(--bg-gray);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    transition: var(--transition);
}

.widget_tags .items a:hover {
    background: var(--primary-color);
    color: white;
}

.widget_ui_asb .item img {
    width: 100%;
    display: block;
    border-radius: var(--radius-sm);
}

/* 文章详情页 */
.article-header {
    text-align: center;
    margin-bottom: 32px;
}

.article-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-meta {
    color: var(--text-light);
    font-size: 14px;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
}

.article-content h2,
.article-content h3 {
    margin: 32px 0 16px;
    font-weight: 700;
}

.article-content p {
    margin-bottom: 1.2em;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 20px auto;
    display: block;
}

.code-block {
    background: #1e2a3a;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    margin: 24px 0;
}

.post-copyright {
    background: #eef2f5;
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin: 32px 0;
}

.relates {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.relates .title h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.relates ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    list-style: none;
}

.relates li a {
    display: block;
    padding: 10px 0 10px 20px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition);
}

.relates li a:before {
    content: "▹";
    position: absolute;
    left: 8px;
    color: var(--primary-color);
}

.relates li a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-top: 40px;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* 响应式布局 */
@media (max-width: 992px) {
    .container.clearfix {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        order: 2;
    }
    .content-wrap {
        order: 1;
    }
    .excerpt {
        flex-direction: column;
        gap: 16px;
        /* 移动端取消右侧内边距，因为缩略图占满宽度，依赖 .content 的 padding 即可 */
        padding: 20px 0;
    }
    .excerpt .focus {
        width: 100%;
    }
    .excerpt .focus img,
    .excerpt .focus .thumb,
    .excerpt .focus a img {
        height: auto;
        max-height: 220px;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
    }
    .site-navbar {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 12px;
        gap: 4px;
    }
    .site-navbar li a {
        padding: 6px 12px;
        font-size: 14px;
    }
    .brand {
        display: none;
    }
    .content {
        padding: 20px;
    }
    .article-title {
        font-size: 28px;
    }
    .relates ul {
        grid-template-columns: 1fr;
    }
    .excerpt h2 {
        font-size: 18px;
    }
    .excerpt .note {
        font-size: 13px;
        -webkit-line-clamp: 2;  /* 限制2行 */
    }
    /* 新增：减小面包屑与内容的间距 */
    .breadcrumbs {
        margin-bottom: 0px;
    }
    .container.clearfix {
        margin-top: 0px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    .excerpt .focus img,
    .excerpt .focus .thumb,
    .excerpt .focus a img {
        max-height: 180px;
    }
    .pagination ul li a,
    .pagination ul li span {
        padding: 6px 12px;
        font-size: 13px;
    }
    .widget h3 {
        font-size: 16px;
    }
}

@media (hover: none) and (pointer: coarse) {
    a,
    button,
    .pagination a,
    .widget a {
        touch-action: manipulation;
    }
}