/* CSS resets and base styles */
:root {
    --bg-url: url('http://cdn-hsyq-static.shanhutech.cn/bizhi/staticwp/202506/38951ecd526114cbc0e8e3f518aaca37--1892050873.jpg'); /* 确保这里的图片路径是正确的 */
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --card-bg: #2c303a;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #e84393;
    --shadow-dark: rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    background-color: transparent;
    padding: 2.5rem;
    border-radius: 1.5rem;
    text-align: center;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    animation: fadeIn 0.8s ease-in-out;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header .clock {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-color);
    margin-bottom: 0rem;
}

.header .date {
     font-size: clamp(0.9rem, 2vw, 1.1rem);
     margin-bottom: 1.5rem;
     /* 【修改】调整颜色并增强阴影以提高可读性 */
     color: #e0e0e0;
     text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.search-wrapper {
    margin-bottom: 2.5rem;
    position: relative;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    box-shadow: 0 0 0 2px var(--accent-color);
    background-color: #3a3e4a;
    border-color: var(--accent-color);
}

.category {
    margin-bottom: 2.5rem;
    text-align: left;
}

.category h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    /* 【修改】增强阴影以提高可读性 */
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

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

.link-item {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex; 
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    box-shadow: 0 4px 10px var(--shadow-dark);
}

.link-item:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 0 15px -2px var(--accent-color), 0 8px 25px var(--shadow-dark);
    border-color: var(--accent-color);
    background-color: #3a3e4a;
}

.link-item a {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0.5rem;
}

.link-item-icon-wrapper {
    width: 36px;
    height: 36px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-item img, .fallback-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-light);
    background-color: white;
}

.fallback-icon {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.fa-icon {
    font-size: 30px;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 3px var(--shadow-dark);
    transition: color 0.3s ease;
}

.link-item:hover .fa-icon {
    color: var(--accent-color);
}

.link-item a span {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    text-shadow: 0 1px 2px var(--shadow-dark);
}

.footer {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-shadow: 0 1px 3px var(--shadow-dark);
}

.no-results {
    display: none;
    padding: 2rem;
    color: var(--text-secondary);
    background-color: var(--card-bg);
    border-radius: 1rem;
}

@media (max-width: 768px) {
    body { padding: 1rem; }
    .container { padding: 1.5rem; }
    .links-grid { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
}