:root {
    color-scheme: light dark;
    --bg: #f7f8fa;
    --card-bg: #ffffff;
    --card-shadow: rgba(15, 23, 42, 0.08);
    --primary: #2563eb;
    --primary-light: rgba(37, 99, 235, 0.12);
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.hide {
    display: none !important;
}

body.body--lock {
    overflow: hidden;
}

.app {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 18px 48px;
}

.header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.header__title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.header__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.search input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search button {
    padding: 0 18px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search button:active {
    transform: scale(0.98);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0 18px;
}

.tag-item {
    flex: 0 1 auto;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tag-item--active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px var(--card-shadow);
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.news-card__title {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 600;
    margin: 0;
}

.news-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.news-card__labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-card__label {
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    border-radius: var(--radius-sm);
}

.news-card__brief,
.news-card__detail {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
}

.news-card__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-card__text[data-expanded="false"] .news-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.news-card__text[data-expanded="false"] .news-card__brief {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.news-card__text[data-expanded="false"] .news-card__detail {
    display: none;
}

.news-card__toggle {
    margin-top: 4px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(37, 99, 235, 0.24);
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.news-card__toggle:hover {
    background: rgba(37, 99, 235, 0.16);
    color: #1e3a8a;
}

.news-card__images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.news-card__images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: zoom-in;
}

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.skeleton-card {
    border-radius: var(--radius-lg);
    padding: 18px 18px 20px;
    background: var(--card-bg);
    border: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: 0 10px 30px var(--card-shadow);
    overflow: hidden;
}

.skeleton-line,
.skeleton-thumb {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(226, 232, 240, 0.55), rgba(148, 163, 184, 0.18));
    background-size: 200% 100%;
    animation: skeleton-loading 1.6s infinite;
}

.skeleton-line {
    height: 14px;
    border-radius: 999px;
    margin-top: 12px;
}

.skeleton-line:first-child {
    margin-top: 0;
}

.skeleton-line--wide {
    width: 90%;
}

.skeleton-line--medium {
    width: 65%;
}

.skeleton-line--narrow {
    width: 45%;
}

.skeleton-thumb {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.page-info {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
}

.loading,
.end-tips,
.empty {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 24px;
    font-size: 14px;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.modal__content {
    width: min(92%, 420px);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: 26px 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #0f172a;
}

.modal__content h1 {
    margin: 0;
    font-size: 20px;
}

.modal__content button {
    margin-top: 12px;
    align-self: flex-end;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.noscript {
    margin: 0;
    padding: 18px;
    text-align: center;
    background: #fee2e2;
    color: #991b1b;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.gallery {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
}

.gallery__overlay {
    position: absolute;
    inset: 0;
}

.gallery__inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.95);
    padding: 0;
    color: #e2e8f0;
}

.gallery__viewer {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.gallery__track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.3s ease;
    touch-action: none;
}

.gallery__slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    overflow: hidden;
}

.gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
    font-size: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.gallery__nav:hover {
    transform: translateY(-50%) scale(1.08);
    background: rgba(37, 99, 235, 0.75);
}

.gallery__nav:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.gallery__nav--prev {
    left: 14px;
}

.gallery__nav--next {
    right: 14px;
}

.gallery__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    padding: 12px 18px 18px;
    color: #cbd5f5;
    gap: 8px;
}

.gallery__title {
    flex: 1;
    overflow: hidden;
.gallery__hint {
    font-size: 13px;
    opacity: 0.75;
    white-space: nowrap;
}

    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery__counter {
    flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --card-bg: #16213d;
        --card-shadow: rgba(0, 0, 0, 0.35);
        --text: #e2e8f0;
        --text-secondary: #94a3b8;
        --border: rgba(148, 163, 184, 0.3);
    }

    .search input {
        background: rgba(15, 23, 42, 0.65);
        color: var(--text);
        border-color: var(--border);
    }

    .tag-item {
        background: rgba(15, 23, 42, 0.65);
        color: var(--text-secondary);
        border-color: var(--border);
    }

    .news-card__label {
        background: rgba(96, 165, 250, 0.16);
        color: #93c5fd;
    }

    .modal {
        background: rgba(15, 23, 42, 0.7);
    }

    .modal__content {
        background: #0f172a;
        color: var(--text);
    }

    .gallery__inner {
        background: rgba(15, 23, 42, 0.95);
    }

    .gallery__nav {
        background: rgba(15, 23, 42, 0.8);
    }
}

