/******************************************************************************
 * @file    adu-layout.css
 * @brief   Adu Network Studio — 统一页面布局系统
 *
 * @details 本文件提供所有页面布局组件，合并自：
 *          - theme.css (navbar-theme / hero-theme / footer-theme)
 *          - public-content.css (site-shell / page-grid / content-hero / surface-panel / site-footer)
 *          - assets/index/style.css (首页固定导航 / hero区域)
 *
 * @version  1.0.0
 ******************************************************************************/

/* ============================================================
   1. Site Shell — 页面外围容器
   ============================================================ */

.site-shell {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 24%),
        radial-gradient(circle at left 20%, rgba(56, 189, 248, 0.09), transparent 20%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 16%, #f8fafc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .site-shell {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 30%),
        radial-gradient(circle at left 20%, rgba(14, 165, 233, 0.06), transparent 25%),
        linear-gradient(180deg, #09090b 0%, #0c0c10 16%, #09090b 100%);
}


/* ============================================================
   2. Navbar — 统一导航栏
   ============================================================ */

.navbar-adu {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 1020;
}

[data-theme="dark"] .navbar-adu {
    background: rgba(9, 9, 11, 0.88);
    border-bottom-color: var(--border-default);
}

.navbar-adu .navbar-brand {
    color: var(--navbar-text) !important;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-adu .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 0.9rem;
}

.navbar-adu .nav-link {
    color: var(--navbar-text-muted) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.navbar-adu .nav-link:hover {
    color: var(--navbar-text) !important;
    background: var(--bg-muted);
}

.navbar-adu .nav-link.active {
    color: var(--accent-primary) !important;
    background: var(--accent-subtle);
}

/* Theme toggle in navbar */
.navbar-adu .theme-toggle {
    background: var(--bg-muted);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 1rem;
}

.navbar-adu .theme-toggle:hover {
    background: var(--bg-emphasis);
    border-color: var(--border-strong);
    color: var(--text-primary);
}


/* ============================================================
   3. Hero — 统一Hero区域
   ============================================================ */

.content-hero {
    background: var(--hero-bg);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-default);
}

/* Subtle grid pattern */
.content-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--border-default) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
}

/* Blue accent glow */
.content-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Hero grid — two columns */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
    position: relative;
    z-index: 1;
}

.hero-panel {
    padding: 0.5rem 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-full);
    background: var(--accent-muted);
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.hero-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3rem);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    letter-spacing: -0.03em;
}

.hero-lead {
    color: var(--text-muted);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Hero side panel */
.hero-side-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
}

.hero-side-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-card {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--bg-surface1);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.metric-card strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.metric-card span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}


/* ============================================================
   4. Page Grid — 内容页双栏布局
   ============================================================ */

.page-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

.main-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 5rem;
}


/* ============================================================
   5. Surface Panels — 内容面板（玻璃效果）
   ============================================================ */

.surface-panel {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .surface-panel {
    background: rgba(24, 24, 27, 0.82);
    border-color: rgba(63, 63, 70, 0.5);
}

.sidebar-panel {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .sidebar-panel {
    background: rgba(24, 24, 27, 0.82);
    border-color: rgba(63, 63, 70, 0.5);
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* ============================================================
   6. Feed Stack — 侧边栏链接列表
   ============================================================ */

.feed-stack {
    display: flex;
    flex-direction: column;
}

.count-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-muted);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.count-link:hover {
    color: var(--accent-primary);
    padding-left: 0.35rem;
}

.count-link.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.count-link:last-child {
    border-bottom: none;
}


/* ============================================================
   7. Rank List — 排行榜列表
   ============================================================ */

.rank-list {
    display: flex;
    flex-direction: column;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-muted);
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.rank-item:hover {
    color: var(--accent-primary);
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-xs);
    background: var(--bg-muted);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-index,
.rank-item:nth-child(2) .rank-index,
.rank-item:nth-child(3) .rank-index {
    background: var(--accent-primary);
    color: #fff;
}

.rank-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* ============================================================
   8. Article Prose — 文章排版
   ============================================================ */

.article-prose {
    line-height: 1.85;
    color: var(--text-secondary);
}

.article-prose h2 {
    color: var(--text-primary);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-prose h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-prose p {
    margin-bottom: 1rem;
}

.article-prose ul,
.article-prose ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.article-prose li {
    margin-bottom: 0.5rem;
}

.article-prose img {
    max-width: 100%;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.article-prose pre {
    background: var(--bg-muted);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 1.5rem 0;
}

.article-prose code {
    background: var(--bg-muted);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-xs);
    font-size: 0.875em;
    color: var(--accent-primary);
}

.article-prose pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.article-prose blockquote {
    border-left: 4px solid var(--accent-primary);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--bg-subtle);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-tertiary);
}

.article-prose hr {
    border: none;
    height: 1px;
    background: var(--border-default);
    margin: 2rem 0;
}


/* ============================================================
   9. Footer — 统一页脚
   ============================================================ */

.footer-adu {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    margin-top: auto;
}

.footer-adu a {
    color: var(--footer-text-muted);
    transition: color 0.2s ease;
}

.footer-adu a:hover {
    color: var(--accent-primary);
}

.footer-adu-wrap {
    max-width: var(--home-shell-width);
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-adu-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.footer-adu-section {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.footer-adu-section h4 {
    margin: 0 0 0.85rem;
    color: var(--footer-text);
    font-size: 0.95rem;
    font-weight: 600;
}

.footer-adu-section p,
.footer-adu-section li {
    color: var(--footer-text-muted);
    font-size: 0.875rem;
    line-height: 1.7;
}

.footer-adu-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-adu-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 2rem;
    font-size: 0.85rem;
    color: var(--footer-text-muted);
}

.footer-adu-bottom .beian-icon {
    height: 14px;
    width: auto;
    vertical-align: -2px;
    margin-right: 0.2rem;
}


/* ============================================================
   10. Breadcrumb
   ============================================================ */

.breadcrumb-adu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
}

.breadcrumb-adu a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-adu a:hover {
    color: var(--accent-primary);
}

.breadcrumb-adu .separator {
    color: var(--text-subtle);
    font-size: 0.7rem;
}

.breadcrumb-adu .current {
    color: var(--text-primary);
    font-weight: 600;
}


/* ============================================================
   11. Section Divider
   ============================================================ */

.section-divider {
    position: relative;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(37, 99, 235, 0.2) 20%,
        rgba(37, 99, 235, 0.4) 50%,
        rgba(37, 99, 235, 0.2) 80%,
        transparent
    );
    margin: 0 auto;
    max-width: var(--home-shell-width);
}


/* ============================================================
   12. Responsive
   ============================================================ */

@media (max-width: 980px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .page-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-stack {
        position: static;
    }
}

@media (max-width: 768px) {
    .content-hero {
        padding: 2.5rem 0 2rem;
    }

    .content-hero .hero-title {
        font-size: 1.75rem;
    }

    .content-hero .hero-lead {
        font-size: 0.95rem;
    }

    .surface-panel {
        padding: 1.5rem;
    }

    .footer-adu-main {
        grid-template-columns: 1fr;
    }

    .footer-adu-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}


/* ============================================================
   13. Chip Cloud — 标签云
   ============================================================ */

.chip-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
