* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: #f4f4f4;
}

body {
    display: flex;
    flex-direction: column;
}

header {
    background: #e7e7e7;
    border-bottom: 5px dashed #333;
    padding: 20px;
    text-align: center;
}

header h1 {
    margin: 0 0 15px 0;
}

.header-tools {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box {
    padding: 8px 15px;
    border: 2px solid #333;
    border-radius: 20px;
    font-size: 14px;
    width: 400px;
    max-width: 100%;
    outline: none;
    transition: all 0.3s ease;
}

.search-box:focus {
    border-color: #0056b3;
    box-shadow: 0 0 8px rgba(0, 86, 179, 0.3);
}

.home-btn {
    padding: 8px 20px;
    background: #ff69b4;
    color: #ffffff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
}

.home-btn:hover {
    background: #ff85c1;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 105, 180, 0.6);
}

.new-version-btn {
    padding: 8px 20px;
    background: #0056b3;
    color: #ffffff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.new-version-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 86, 179, 0.5);
}

main {
    flex: 1;
    padding: 20px;
}

article {
    margin-bottom: 20px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

article:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

article:nth-child(1) { animation-delay: 0.1s; }
article:nth-child(2) { animation-delay: 0.2s; }
article:nth-child(3) { animation-delay: 0.3s; }
article:nth-child(4) { animation-delay: 0.4s; }
article:nth-child(5) { animation-delay: 0.5s; }
article:nth-child(6) { animation-delay: 0.6s; }
article:nth-child(7) { animation-delay: 0.7s; }
article:nth-child(8) { animation-delay: 0.8s; }

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.quote-meta {
    flex: 1;
    min-width: 200px;
}

.quote-title {
    font-family: 'Lucida Handwriting', cursive;
    font-size: 18px;
    color: #333;
    margin: 0 0 5px 0;
    font-weight: bold;
}

.quote-author {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.quote-source {
    font-size: 12px;
    padding: 4px 10px;
    background: #0056b3;
    color: #fff;
    border-radius: 12px;
    white-space: nowrap;
    align-self: flex-start;
}

.quote-content {
    line-height: 2;
    color: #333;
    white-space: pre-line;
    font-size: 15px;
    border-left: 4px solid #0056b3;
    padding-left: 15px;
    margin: 10px 0;
}

.quote-note {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin-top: 10px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 16px;
}

footer {
    text-align: center;
    padding: 10px 0;
    background: #e7e7e7;
    border-top: 5px dashed #333;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 0;
}

/* 自定义顶部滚动条 */
.top-scrollbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: #e7e7e7;
    z-index: 1000;
}

/* 滚动条 */
.top-scrollbar::after {
    content: '';
    display: block;
    height: 100%;
    width: 100%;
    background: #333;
    transition: width 0.2s ease;
}

/* 基本链接样式 */
a {
    text-decoration: none;
    color: #000000;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

a:active {
    color: #003d80;
}

footer a {
    margin: 0 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-box {
        width: 100%;
    }
    
    article {
        padding: 15px;
    }
    
    .quote-content {
        font-size: 14px;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    html, body {
        background: #1a1a1a;
    }

    header {
        background: #2c2c2c;
        border-bottom-color: #3c3c3c;
    }

    header h1 {
        color: #ffffff;
    }

    .search-box {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: #3c3c3c;
    }

    .search-box::placeholder {
        color: #666;
    }

    .search-box:focus {
        border-color: #e0e0e0;
        box-shadow: 0 0 8px rgba(224, 224, 224, 0.15);
    }

    .home-btn {
        background: #ff69b4;
        box-shadow: 0 2px 8px rgba(255, 105, 180, 0.4);
    }

    .home-btn:hover {
        background: #ff85c1;
        box-shadow: 0 4px 16px rgba(255, 105, 180, 0.6);
    }

    .new-version-btn {
        background: #0056b3;
    }

    .new-version-btn:hover {
        background: #1976d2;
        box-shadow: 0 4px 16px rgba(0, 86, 179, 0.6);
    }

    article {
        background: #2c2c2c;
        border-color: #3c3c3c;
    }

    article:hover {
        border-color: #e0e0e0;
        box-shadow: 4px 4px 10px rgba(224, 224, 224, 0.08);
    }

    .quote-header {
        border-bottom-color: #3c3c3c;
    }

    .quote-title {
        color: #ffffff;
    }

    .quote-author {
        color: #999;
    }

    .quote-source {
        background: #0056b3;
        color: #ffffff;
    }

    .category-badge {
        background: #3c3c3c;
        color: #e0e0e0;
    }

    .quote-content {
        color: #b0b0b0;
    }

    .quote-content strong {
        color: #ffffff;
    }

    .quote-note {
        color: #666;
    }

    .no-results,
    .loading {
        color: #666;
    }

    footer {
        color: #999;
    }

    footer {
        background: #2c2c2c;
        border-top-color: #3c3c3c;
    }

    footer a {
        color: #999;
    }

    footer a:hover {
        color: #e0e0e0;
    }

    .quote-meta {
        color: #666;
        border-top-color: #3c3c3c;
    }

    .top-scrollbar {
        background: #2c2c2c;
    }

    #topScrollbarThumb {
        background: #3c3c3c;
    }

    .top-scrollbar::after {
        background: #e0e0e0;
    }

    a {
        color: #e0e0e0;
    }

    a:hover {
        color: #58a6ff;
    }

    a:active {
        color: #79b8ff;
    }
}
