:root {
    --primary-color: #1e3c72;
    --secondary-color: #3498db;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --text-color: #2c3e50;
    --card-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --bg-image: url('');
}

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: -1;
    transition: opacity 0.3s ease;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 1.5rem;
    color: white;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

/* Logo样式 */
.logo {
    flex: 0 0 auto;
}

.logo h1 {
    font-size: 2rem;
    margin: 0;
}

.logo .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.2rem;
}

.datetime {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.95;
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

#current-date, #current-time {
    font-family: "Segoe UI", Roboto, monospace;
}

/* 搜索框样式 */
.search-container {
    flex: 1;
    max-width: 600px;
    min-width: 300px;
}

.search-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.search-engines {
    margin-bottom: 0.6rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-engine {
    padding: 0.25rem 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    user-select: none;
}

.search-engine:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-engine.active {
    background: rgba(255, 255, 255, 0.3);
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

#searchInput {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

#searchButton {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    background: var(--secondary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#searchButton:hover {
    background-color: #2980b9;
}

/* 一言样式 */
.hitokoto-container {
    flex: 0 0 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

#hitokoto-text {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

#hitokoto-from {
    font-size: 0.85rem;
    opacity: 0.8;
    text-align: right;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.category {
    margin-bottom: 3rem;
}

.category h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.site-card {
    background: var(--card-background);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

.site-card:hover {
    transform: translateY(-3px);
}

.site-card a {
    text-decoration: none;
    color: var(--text-color);
}

.site-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.site-card p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .logo {
        text-align: center;
    }

    .search-container {
        width: 100%;
    }

    .hitokoto-container {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
}
