/* ==========================================================================
   AICMS 前台核心样式表 (Google SEO & Core Web Vitals 优化版)
   视觉主题：纯白主背景 (#ffffff) + 层次灰 (#f8f9fa / #6b7280) + 沉稳黑 (#111111)
   设计目标：零外部框架阻塞、零布局偏移(CLS=0)、语义化结构与移动端触控友好
   ========================================================================== */

/* 1. 公共设计常量（CSS 变量统一管理，便于迁移与主题维护） */
:root {
    /* 背景色阶 */
    --bg-primary: #ffffff;          /* 页面主背景：纯白 */
    --bg-secondary: #f8f9fa;        /* 次级区块背景：极浅灰 */
    --bg-tertiary: #f1f3f5;         /* 悬浮/代码块背景：浅灰 */
    --bg-dark: #111111;             /* 头部与深色强调背景：纯黑 */
    --bg-dark-sub: #1f2227;         /* 推广横幅/页脚深灰黑背景 */

    /* 文字色阶 */
    --text-primary: #111111;        /* 一级标题与核心正文：深黑 */
    --text-secondary: #374151;      /* 二级正文与长文阅读：炭灰 */
    --text-muted: #6b7280;          /* 元信息/时间/辅助说明：中灰 */
    --text-inverse: #ffffff;        /* 深色背景上的反白文字 */
    --text-inverse-muted: #d1d5db;  /* 深色背景上的次要文字 */

    /* 边框与分割线 */
    --border-light: #e5e7eb;        /* 常规细边框 */
    --border-medium: #d1d5db;       /* 卡片悬浮边框 */
    --border-dark: #2d3139;         /* 深色区域分割线 */

    /* 强调色（用于推广横幅、推荐配置卡片与核心转化按钮） */
    --accent-highlight: #fde047;    /* 礼券高亮亮金黄 */
    --accent-price: #e1251b;        /* 价格与主推醒目京东红 */
    --accent-promo-start: #b91c1c;  /* 礼券横幅渐变起始深红 */
    --accent-promo-mid: #e1251b;    /* 礼券横幅渐变主红 */
    --accent-promo-end: #f97316;    /* 礼券横幅渐变活力橙 */
    --accent-blue: #1d4ed8;         /* 轻量云科技蓝强调色 */
    --accent-gold: #b45309;         /* 企业旗舰珀金强调色 */
    --promo-bg-tint: #fff8f6;       /* 推广区暖色浅底衬托 */
    --promo-border-tint: #fed7aa;   /* 推广区暖色细边框 */

    /* 布局尺寸与圆角 */
    --container-max: 1120px;        /* 桌面端最大阅读容器宽度 */
    --article-max: 840px;           /* 文章详情最佳阅读宽度 */
    --radius-sm: 4px;               /* 小圆角 */
    --radius-md: 8px;               /* 卡片标准圆角 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

    /* 字体栈：优先使用系统原生无衬线字体，零网络字体加载延迟，保障 LCP */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* 2. 基础重置与全局排版 */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* 3. 无障碍跳转链接（Google Lighthouse 可访问性与 SEO 推荐） */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
    outline: 2px solid var(--accent-highlight);
}

/* 4. 响应式容器 */
.main-container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .main-container {
        padding: 0 24px;
    }
}

/* 主内容区自动撑开页脚 */
main.main-container {
    flex: 1;
    padding-top: 28px;
    padding-bottom: 48px;
}

/* 5. 语义化站点头部与主导航 (<header> + <nav>) */
.site-header {
    background-color: var(--bg-dark);
    color: var(--text-inverse);
    border-bottom: 1px solid var(--border-dark);
    padding: 16px 0 0 0;
}

.header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-inverse);
}

/* 固定宽高比防止图片加载引起 CLS 布局偏移 */
.brand-logo {
    display: block;
    width: 120px;
    height: 30px;
    object-fit: contain;
}

.brand-tagline {
    font-size: 0.875rem;
    color: var(--text-inverse-muted);
    border-left: 1px solid var(--border-dark);
    padding-left: 12px;
    display: none;
}

@media (min-width: 640px) {
    .brand-tagline {
        display: inline-block;
    }
}

/* 主导航栏：保证移动端触控目标 >= 44px */
.site-nav {
    border-top: 1px solid var(--border-dark);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.nav-item a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 6px 14px;
    color: var(--text-inverse-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-item a:hover,
.nav-item a:focus {
    color: var(--text-inverse);
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-item a[aria-current="page"],
.nav-item a.active {
    color: var(--text-inverse);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.14);
}

/* 6. 顶部云产品推广与配置推荐区块 (<aside class="promo-aside">) */
.promo-aside {
    background: linear-gradient(180deg, var(--promo-bg-tint) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--promo-border-tint);
    padding-bottom: 26px;
}

/* 礼券横幅：高转化红橙渐变 + 亮金胶囊行动点缀 */
.promo-banner {
    background: linear-gradient(90deg, var(--accent-promo-start) 0%, var(--accent-promo-mid) 50%, var(--accent-promo-end) 100%);
    color: var(--text-inverse);
    text-align: center;
    padding: 13px 16px;
    margin-bottom: 22px;
    box-shadow: 0 2px 10px rgba(225, 37, 27, 0.18);
}

.promo-banner-text {
    font-size: 0.975rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.promo-tag {
    display: inline-block;
    background-color: var(--accent-highlight);
    color: #7c2d12;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 8px;
    vertical-align: middle;
}

.promo-banner-link {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.16);
    color: var(--accent-highlight);
    font-weight: 800;
    text-decoration: none;
    border: 1px solid var(--accent-highlight);
    border-radius: 999px;
    padding: 2px 12px;
    margin: 0 6px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.promo-banner-link:hover {
    background-color: var(--accent-highlight);
    color: #991b1b;
    transform: translateY(-1px);
}

/* 推荐服务器卡片网格 */
.servers-wrapper {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .servers-wrapper {
        padding: 0 24px;
    }
}

.server-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 768px) {
    .server-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.server-card {
    background: var(--bg-primary);
    border: 1px solid #fecaca;
    border-top: 4px solid var(--accent-price);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(225, 37, 27, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* 第二张卡片（科技蓝主题色条） */
.server-card.card-blue {
    border-color: #bfdbfe;
    border-top: 4px solid var(--accent-blue);
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.06);
}

/* 第三张卡片（企业金主题色条） */
.server-card.card-gold {
    border-color: #fde68a;
    border-top: 4px solid var(--accent-gold);
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.06);
}

.server-card:hover {
    border-color: var(--accent-price);
    box-shadow: 0 8px 24px rgba(225, 37, 27, 0.14);
    transform: translateY(-3px);
}

.server-card.card-blue:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.14);
}

.server-card.card-gold:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 8px 24px rgba(180, 83, 9, 0.14);
}

.server-card .badge {
    position: absolute;
    top: 14px;
    right: 16px;
    background: linear-gradient(135deg, #e1251b 0%, #f97316 100%);
    color: var(--text-inverse);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.server-card.card-blue .badge {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
}

.server-card.card-gold .badge {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

.server-card .server-title {
    display: block;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-right: 82px;
}

.server-card .server-specs {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.65;
    margin-bottom: 16px;
    flex: 1;
    list-style: none;
    background-color: #f8fafc;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.server-card .server-specs li {
    margin-bottom: 4px;
}

.server-card .server-specs li:last-child {
    margin-bottom: 0;
}

.server-card .server-specs strong {
    color: var(--text-primary);
    font-weight: 600;
}

.server-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-light);
}

.server-card .server-price {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--accent-price);
    line-height: 1.1;
}

.server-card .server-price .period {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 2px;
}

.server-card .buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #e1251b 0%, #f97316 100%);
    color: var(--text-inverse);
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(225, 37, 27, 0.25);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.server-card.card-blue .buy-btn {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 3px 10px rgba(29, 78, 216, 0.25);
}

.server-card.card-gold .buy-btn {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.25);
}

.server-card .buy-btn:hover,
.server-card .buy-btn:focus {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(225, 37, 27, 0.35);
}

/* 7. 面包屑导航 (<nav aria-label="面包屑导航">) */
.breadcrumb-nav {
    margin-bottom: 20px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--border-medium);
    margin-right: 6px;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.breadcrumb-item[aria-current="page"] {
    color: var(--text-muted);
    font-weight: 500;
}

/* 8. 页面主标题区（确保每页唯一 H1 视觉突出且语义清晰） */
.page-hero {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 32px;
}

.page-hero h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.page-hero .hero-desc {
    color: var(--text-secondary);
    font-size: 0.975rem;
    line-height: 1.65;
}

.page-hero .hero-meta {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .page-hero {
        padding: 28px 32px;
    }

    .page-hero h1 {
        font-size: 2rem;
    }
}

/* 区块二级标题 */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 2px solid var(--bg-dark);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 9. 语义化文章列表与卡片 (<article class="article-card">) */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.article-card-title {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
}

.article-card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-card-title a:hover {
    color: #4b5563;
    text-decoration: underline;
}

.article-card .meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
    font-size: 0.825rem;
    margin-bottom: 10px;
}

.article-card .meta-category {
    display: inline-block;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.78rem;
}

.article-card .meta-category:hover {
    background-color: var(--bg-dark);
    color: var(--text-inverse);
}

.article-card-summary {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    margin: 0;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 64px 20px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-muted);
}

/* 10. 文章详情页排版 (<article class="article-detail">) */
.article-detail {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px 20px;
}

@media (min-width: 768px) {
    .article-detail {
        padding: 36px 44px;
    }
}

.article-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
    margin-bottom: 28px;
}

.article-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .article-title {
        font-size: 2.15rem;
    }
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.article-meta a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
}

.article-meta a:hover {
    background: var(--bg-dark);
    color: var(--text-inverse);
}

/* 文章正文富文本内容（针对可读性与 SEO 语义标签深度优化） */
.article-body {
    line-height: 1.85;
    color: var(--text-secondary);
    font-size: 1.05rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.4;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.article-body h2 {
    font-size: 1.5rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.article-body h3 {
    font-size: 1.25rem;
}

.article-body h4 {
    font-size: 1.1rem;
}

.article-body p {
    margin-bottom: 1.25em;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.25em 1.5em;
}

.article-body li {
    margin-bottom: 0.5em;
}

.article-body strong {
    font-weight: 700;
    color: var(--text-primary);
}

.article-body a {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body a:hover {
    color: var(--text-muted);
}

.article-body blockquote {
    margin: 1.5em 0;
    padding: 14px 20px;
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--bg-dark);
    color: var(--text-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 20px 0;
    display: block;
}

/* 正文表格样式 */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.925rem;
    border: 1px solid var(--border-light);
    display: block;
    overflow-x: auto;
}

@media (min-width: 768px) {
    .article-body table {
        display: table;
    }
}

.article-body thead {
    background-color: var(--bg-secondary);
}

.article-body th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-bottom: 2px solid var(--border-medium);
}

.article-body td {
    padding: 10px 15px;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.article-body tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

.article-body tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* 代码与代码块样式 */
code {
    background-color: var(--bg-tertiary);
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.2em 0.45em;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

pre {
    margin: 1.5em 0;
    overflow-x: auto;
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

pre code {
    display: block;
    padding: 16px 20px;
    white-space: pre;
    background-color: transparent;
    border-left: 4px solid var(--bg-dark);
    line-height: 1.6;
}

/* 11. 相关文章推荐区块 (<aside class="related-articles">) */
.related-articles {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin-top: 36px;
}

.related-title {
    margin: 0 0 16px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.related-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 768px) {
    .related-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.related-item a {
    display: block;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.925rem;
    font-weight: 500;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.related-item a:hover {
    border-color: var(--bg-dark);
    color: var(--text-primary);
}

/* 12. 语义化分页导航组件 (<nav class="pagination-nav">) */
.pagination-nav {
    margin: 40px 0 12px 0;
}

.pagination {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    min-width: 42px;
    min-height: 42px;
    text-align: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.925rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-primary);
}

.page-link.active,
.page-link[aria-current="page"] {
    background: var(--bg-dark);
    color: var(--text-inverse);
    border-color: var(--bg-dark);
    font-weight: 700;
    cursor: default;
}

.page-dots {
    padding: 8px 6px;
    color: var(--text-muted);
}

/* 13. 语义化页脚 (<footer class="site-footer">) */
.site-footer {
    background-color: var(--bg-dark);
    color: var(--text-inverse-muted);
    padding: 28px 0;
    margin-top: auto;
    border-top: 1px solid var(--border-dark);
    font-size: 0.875rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        text-align: left;
    }
}

.footer-links a {
    color: var(--text-inverse);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-inverse-muted);
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.8;
}
