/* ============================================================
   swissgrid — 瑞士国际主义红黑网格 news theme
   prefix: sg-
   ============================================================ */

:root {
    --sg-red: #e8112d;
    --sg-black: #0a0a0a;
    --sg-white: #ffffff;
    --sg-line: #e5e5e5;
    --sg-font: "Arial Narrow", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.sg-body {
    background: var(--sg-white);
    color: var(--sg-black);
    font-family: var(--sg-font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--sg-black); text-decoration: none; transition: color .15s ease, background-color .15s ease; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------------- header ---------------- */

.sg-header { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.sg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 20px;
    border-bottom: 4px solid var(--sg-black);
}

.sg-logo-img { display: block; height: auto; }

.sg-toptitle {
    flex: 1;
    min-width: 0;
    margin: 0 24px;
    text-align: center;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--sg-red);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-topbar-mark { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sg-mark-line { width: 28px; height: 4px; background: var(--sg-red); display: inline-block; }
.sg-mark-text { font-weight: 700; font-size: 20px; }

.sg-nav-list { counter-reset: sgnav; display: flex; flex-wrap: wrap; border-bottom: 3px solid var(--sg-black); }
.sg-nav-item { counter-increment: sgnav; border-right: 1px solid var(--sg-line); }
.sg-nav-item:last-child { border-right: none; }
.sg-nav-item a { display: block; padding: 14px 18px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.sg-nav-item a::before { content: counter(sgnav, decimal-leading-zero) " "; color: var(--sg-red); font-weight: 700; margin-right: 4px; }
.sg-nav-item a:hover { background: var(--sg-red); color: var(--sg-white); }
.sg-nav-item a:hover::before { color: var(--sg-white); }

/* ---------------- shell / grid ---------------- */

.sg-shell { max-width: 1280px; margin: 0 auto; padding: 32px 24px 60px; }
.sg-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px 28px; }

.sg-block--headline { grid-column: span 8; }
.sg-block--category { grid-column: span 4; }
.sg-block--trend     { grid-column: span 4; }
.sg-block--deep       { grid-column: span 8; }
.sg-block--flash      { grid-column: span 12; }

.sg-block-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.sg-block-title { font-size: 24px; font-weight: 700; margin: 0; white-space: nowrap; }
.sg-block-rule { flex: 1; min-width: 0; height: 3px; background: var(--sg-black); }
.sg-block--headline .sg-block-rule,
.sg-block--deep .sg-block-rule { background: var(--sg-red); }

/* item list (index blocks) */

.sg-item { border-top: 1px solid var(--sg-line); }
.sg-item:first-child { border-top: none; }
.sg-item-link { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; min-width: 0; }

.sg-item-title {
    font-size: 17px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-item-list--headline .sg-item:first-child .sg-item-title { font-size: 26px; line-height: 1.3; }
.sg-item-meta { font-size: 12px; color: #6b6b6b; letter-spacing: .3px; }
.sg-item-link:hover .sg-item-title { color: var(--sg-red); }

/* category block */

.sg-cat-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--sg-black); }
.sg-cat-item a { display: block; background: var(--sg-white); color: var(--sg-black); padding: 16px 10px; text-align: center; font-size: 13px; font-weight: 700; }
.sg-cat-item a:hover { background: var(--sg-red); color: var(--sg-white); }

/* flash strip */

.sg-flash-list { display: flex; gap: 0; overflow-x: auto; border-top: 2px solid var(--sg-black); border-bottom: 2px solid var(--sg-black); }
.sg-flash-item { flex: 0 0 auto; border-right: 1px solid var(--sg-line); }
.sg-flash-item a { display: flex; flex-direction: column; gap: 4px; padding: 12px 20px; min-width: 220px; }
.sg-flash-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.sg-flash-date { font-size: 11px; color: #6b6b6b; }
.sg-flash-item a:hover { background: var(--sg-black); }
.sg-flash-item a:hover .sg-flash-title,
.sg-flash-item a:hover .sg-flash-date { color: var(--sg-white); }

/* ---------------- breadcrumb ---------------- */

.sg-crumb { font-size: 13px; padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--sg-line); color: #6b6b6b; }
.sg-crumb a { color: #6b6b6b; }
.sg-crumb a:hover { color: var(--sg-red); }
.sg-crumb-sep { margin: 0 8px; }
.sg-crumb-current { color: var(--sg-black); font-weight: 700; }
.sg-crumb-mid:hover { color: var(--sg-red); }

/* ---------------- list layout ---------------- */

.sg-list-layout,
.sg-show-layout { display: flex; align-items: flex-start; gap: 48px; }
.sg-list-main,
.sg-show-main { flex: 1; min-width: 0; }

.sg-list-headbar { display: flex; align-items: baseline; gap: 20px; padding-bottom: 16px; border-bottom: 4px solid var(--sg-black); margin-bottom: 8px; }
.sg-list-h1 { font-size: 40px; margin: 0; font-weight: 700; }
.sg-list-rule { flex: 1; min-width: 0; height: 3px; background: var(--sg-red); }

.sg-list-item { border-bottom: 1px solid var(--sg-line); }
.sg-list-item-link { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px; padding: 18px 0; min-width: 0; }

.sg-list-item-title {
    font-size: 18px;
    font-weight: 700;
    flex: 1 1 100%;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-list-item-info {
    font-size: 13px;
    color: #6b6b6b;
    flex: 1 1 100%;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-list-item-meta { font-size: 12px; color: #9a9a9a; }
.sg-list-item-link:hover .sg-list-item-title { color: var(--sg-red); }

/* pagination */

.sg-pagination { display: flex; flex-wrap: wrap; gap: 0; margin-top: 28px; border: 2px solid var(--sg-black); width: fit-content; }
.sg-page-link { padding: 8px 16px; font-size: 13px; font-weight: 700; border-right: 2px solid var(--sg-black); }
.sg-page-link:last-child { border-right: none; }
.sg-page-link:hover { background: var(--sg-red); color: var(--sg-white); }

/* ---------------- sidebar (solid color blocks) ---------------- */

.sg-sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; }
.sg-widget { padding: 22px; }
.sg-widget--black { background: var(--sg-black); }
.sg-widget--red { background: var(--sg-red); }
.sg-widget--white { background: var(--sg-white); border-top: 4px solid var(--sg-black); }

.sg-widget-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.sg-widget--black .sg-widget-title,
.sg-widget--red .sg-widget-title { color: var(--sg-white); }

.sg-widget-list li { padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.2); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.sg-widget--white .sg-widget-list li { border-bottom: 1px solid var(--sg-line); }
.sg-widget-list li a { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-widget--black .sg-widget-list li a,
.sg-widget--red .sg-widget-list li a { color: var(--sg-white); }
.sg-widget-list li a:hover { text-decoration: underline; }
.sg-widget-hits { font-size: 11px; color: #9a9a9a; flex-shrink: 0; }

/* ---------------- article (show.html) ---------------- */

.sg-article-h1 { font-size: 34px; line-height: 1.35; margin: 0 0 16px; font-weight: 700; border-bottom: 4px solid var(--sg-black); padding-bottom: 20px; }
.sg-article-meta { font-size: 13px; color: #6b6b6b; display: flex; align-items: center; margin: 16px 0 24px; }
.sg-meta-sep { width: 4px; height: 4px; background: var(--sg-red); display: inline-block; margin: 0 12px; }
.sg-cate a:hover { color: var(--sg-red); }

.sg-summary { background: #f7f7f7; border-left: 4px solid var(--sg-red); padding: 16px 20px; margin-bottom: 28px; }
.sg-summary-tag { display: inline-block; background: var(--sg-black); color: var(--sg-white); font-size: 11px; padding: 2px 8px; margin-bottom: 8px; }
.sg-summary-text { margin: 0; font-size: 14px; color: #333; }

.sg-article-body { font-size: 16px; line-height: 1.9; color: var(--sg-black); }
.sg-article-body img { max-width: 100%; height: auto; }

.sg-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 36px; background: var(--sg-black); }
.sg-prevnext-item { background: var(--sg-white); padding: 16px 18px; min-width: 0; }
.sg-prevnext-item--next { text-align: right; }
.sg-prevnext-label { display: block; font-size: 11px; color: var(--sg-red); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.sg-prevnext-link { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sg-prevnext-link:hover { color: var(--sg-red); }

/* ---------------- footer ---------------- */

.sg-footer { border-top: 4px solid var(--sg-black); margin-top: 40px; }
.sg-footer-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.sg-footer-col { padding: 30px 28px; min-width: 0; }
.sg-footer-col--black { background: var(--sg-black); color: var(--sg-white); }
.sg-footer-col--red { background: var(--sg-red); color: var(--sg-white); }
.sg-footer-col--white { background: var(--sg-white); color: var(--sg-black); border-top: none; }

.sg-footer-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 16px; }
.sg-footer-list li { padding: 6px 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-footer-col--black a,
.sg-footer-col--red a { color: rgba(255,255,255,.85); }
.sg-footer-col--white a { color: var(--sg-black); }
.sg-footer-list li a:hover { text-decoration: underline; }

.sg-copyright { max-width: 1280px; margin: 0 auto; padding: 18px 28px; border-top: 1px solid #222; background: var(--sg-black); color: #9a9a9a; font-size: 12px; text-align: center; }
.sg-copyright-text { margin: 0 0 4px; }
.sg-beian { margin: 0; }
.sg-beian a { color: #9a9a9a; }

/* ---------------- responsive ---------------- */

@media (max-width: 1024px) {
    .sg-grid { grid-template-columns: repeat(8, 1fr); gap: 32px 20px; }
    .sg-block--headline { grid-column: span 8; }
    .sg-block--category { grid-column: span 4; }
    .sg-block--trend { grid-column: span 4; }
    .sg-block--deep { grid-column: span 8; }
    .sg-block--flash { grid-column: span 8; }

    .sg-list-layout,
    .sg-show-layout { flex-direction: column; }
    .sg-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .sg-widget { flex: 1 1 240px; }
}

@media (max-width: 768px) {
    .sg-topbar { flex-wrap: wrap; gap: 12px; }
    .sg-toptitle { order: 3; flex: 1 1 100%; margin: 0; text-align: left; }

    .sg-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
    .sg-block--headline { grid-column: span 2; }
    .sg-block--category { grid-column: span 1; }
    .sg-block--trend { grid-column: span 1; }
    .sg-block--deep { grid-column: span 2; }
    .sg-block--flash { grid-column: span 2; }

    .sg-cat-list { grid-template-columns: repeat(2, 1fr); }
    .sg-sidebar { flex-direction: column; }
    .sg-widget { flex: 1 1 auto; }
    .sg-article-h1 { font-size: 26px; }
    .sg-list-h1 { font-size: 30px; }
}

@media (max-width: 480px) {
    .sg-shell { padding: 20px 16px 40px; }
    .sg-grid { grid-template-columns: 1fr; gap: 20px; }
    .sg-block--headline,
    .sg-block--category,
    .sg-block--trend,
    .sg-block--deep,
    .sg-block--flash { grid-column: span 1; }

    .sg-cat-list { grid-template-columns: 1fr 1fr; }
    .sg-footer-grid { grid-template-columns: 1fr; }
    .sg-prevnext { grid-template-columns: 1fr; }
    .sg-prevnext-item--next { text-align: left; }
    .sg-nav-item a { padding: 10px 12px; font-size: 12px; }
    .sg-item-list--headline .sg-item:first-child .sg-item-title { font-size: 20px; }
    .sg-article-h1 { font-size: 22px; }
}
