/* ==========================================================================
   Base Styles — Reset + Typography + Layout
   ========================================================================== */

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

html {
    font-size: var(--font-size-base, 16px);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
    color: var(--color-text, #484A4F);
    background: var(--color-bg, #F3F6FE);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p { margin-bottom: 1em; }

ul, ol { list-style: none; }

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    flex: 1; /* 撑满剩余高度，内容少时 footer 仍贴底 */
}

/* Main content grows */
main[role="main"] {
    flex: 1;
    padding: 0.75rem 0;
}

/* 服务站首页 main 不需要 padding */
main[role="main"]:has(.listing-home) {
    padding: 0;
}

/* Two-column layout */
.homepage-layout,
.list-layout,
.article-layout,

.listing-detail-layout,
.detail-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 300px;
}
.listing-layout{
    display: block;
}

/* Listing post home 没有侧边栏，让卡片占满整个容器宽度 */
.listing-home .listing-layout {
    grid-template-columns: 1fr;
}



.main-content {
    min-width: 0; /* Prevent grid blowout */
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: #5f6368;
}

.breadcrumbs a {
    color: #5f6368;
}

.breadcrumbs span[aria-current] {
    color: var(--color-text, #484A4F);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .homepage-layout,
    .list-layout,
    .article-layout,
    .listing-layout,
    .listing-detail-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
}
