/* 重置浏览器默认样式 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* 基准字体大小 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ffe3e3 0%, #fffbe0 50%, #e3ffe3 100%);
    min-height: 100vh;
}

/* 通用样式 */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

/* PC端样式（默认样式，>= 1024px）*/
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    color: #e57373;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.search-container {
    flex: 1;
    max-width: 500px;
    min-width: 200px;
}

.search-wrapper {
    display: flex;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    padding-right: 50px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    color: #e57373;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #e57373;
    opacity: 0.7;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ffe3e3;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fffbe0;
    color: #81c784;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #e3ffe3;
}

.no-results {
    margin-top: 15px;
    padding: 10px 15px;
    text-align: center;
    color: #e57373;
    font-weight: 500;
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.article-card {
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    height: 100%;
    background: rgba(255,255,255,0.4);
    border-radius: 15px;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
}

.article-title {
    color: #e57373;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.article-meta {
    font-size: 0.9em;
    color: #81c784;
    margin-bottom: 10px;
}

.article-summary {
    color: #333;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.loading {
    text-align: center;
    padding: 40px;
    grid-column: 1 / -1;
    color: #e57373;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e57373;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.article-content {
    padding: 40px;
    margin: 20px 0;
    color: #333;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin-bottom: 20px;
    color: #e57373;
}

.article-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.back-button {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 20px;
    color: #e57373;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background: #fffbe0;
}

/* 平板端样式（768px - 1023px）*/
@media screen and (max-width: 1023px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 15px;
        margin-bottom: 20px;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .article-card {
        padding: 15px;
    }

    .article-title {
        font-size: 1.3em;
    }

    .search-container {
        max-width: 400px;
    }
}

/* 移动端样式（<= 767px）*/
@media screen and (max-width: 767px) {
    html {
        font-size: 14px; /* 调整基准字体大小 */
    }

    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 10px;
        gap: 10px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .search-container {
        width: 100%;
        max-width: 100%;
    }

    .search-wrapper {
        margin: 0 10px;
    }

    .search-input {
        padding: 8px 35px 8px 15px;
        font-size: 1em;
        border-radius: 20px;
    }

    .search-button {
        width: 30px;
        height: 30px;
        right: 3px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px 0;
    }

    .article-card {
        padding: 12px;
        border-radius: 12px;
    }

    .article-title {
        font-size: 1.2em;
        margin-bottom: 8px;
    }

    .article-meta {
        font-size: 0.8em;
        margin-bottom: 8px;
    }

    .article-summary {
        font-size: 0.9em;
        -webkit-line-clamp: 2;
    }

    .loading {
        padding: 20px;
    }

    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }

    .no-results {
        margin: 10px;
        padding: 8px 12px;
        font-size: 0.9em;
        border-radius: 6px;
    }

    .article-content {
        padding: 15px;
        margin: 10px 0;
    }

    .article-content h1 {
        font-size: 1.5em;
    }

    .article-content h2 {
        font-size: 1.3em;
    }

    .article-content h3 {
        font-size: 1.1em;
    }

    .article-content p {
        margin-bottom: 10px;
        line-height: 1.6;
    }

    .back-button {
        padding: 8px 15px;
        margin-bottom: 15px;
        font-size: 0.9em;
        border-radius: 20px;
    }
}

/* 超小屏幕设备（<= 375px）*/
@media screen and (max-width: 375px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 5px;
    }

    .header {
        padding: 8px;
        gap: 8px;
        margin-bottom: 10px;
    }

    .header h1 {
        font-size: 1.3em;
    }

    .search-wrapper {
        margin: 0 5px;
    }

    .search-input {
        padding: 6px 30px 6px 10px;
    }

    .search-button {
        width: 25px;
        height: 25px;
    }

    .articles-grid {
        gap: 10px;
    }

    .article-card {
        padding: 10px;
        border-radius: 10px;
    }

    .article-title {
        font-size: 1.1em;
        margin-bottom: 6px;
    }

    .article-meta {
        font-size: 0.75em;
        margin-bottom: 6px;
    }

    .article-summary {
        font-size: 0.85em;
    }
}