/* 优化版CSS - 确保每行4个链接 */
:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --text-dark: #1f2937;
    --text-light: #4b5563;
    --bg-light: #f5f7fa;
    --border-color: #e5e7eb;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础布局 */
body {
    background: linear-gradient(135deg, var(--bg-light) 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    flex: 1;
}

/* 顶部标题区域 */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

h1 {
    font-size: clamp(1.875rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 1rem;
}

/* 时间显示 */
.time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#current-time {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
}

/* 搜索区域 */
.search-section {
    margin-bottom: 3rem;
}

.search-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 9999px;
    padding: 0.25rem;
    box-shadow: var(--shadow-light);
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.search-box form {
    display: flex;
    width: 100%;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.search-box input[type="text"] {
    flex-grow: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    min-width: 0;
    flex-shrink: 1;
}

.search-box button[type="submit"] {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: white;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-box button[type="submit"]:hover {
    opacity: 0.9;
}

/* 内容区块 */
.content-sections {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 区块标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    flex-wrap: wrap;
}

/* 链接容器 - 确保每行4个链接 */
.links-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
    /* 移除背景色 */
    width: 100%;
    margin: 0;
    padding: 0;
    /* 确保完全左对齐 */
    text-align: left;
}

/* 链接项 - 确保内容左对齐 */
.links-wrapper .nav-item {
    text-align: left;
    justify-content: flex-start;
    padding-left: 0;
}

/* 链接项 - 精确控制每行4个 */
.links-wrapper .nav-item {
    flex: 0 0 calc(25% - 1rem); /* 25%宽度减去间距 */
    min-width: calc(25% - 1rem); /* 确保最小宽度 */
    margin-bottom: 0.5rem;
    text-align: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
    /* 确保链接内容不会超出 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 防止内容溢出 */
    max-width: 100%;
    /* 匹配图片中的卡片样式 */
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    min-width: 200px;
    /* 图片中的具体样式 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-dark);
    gap: 0.5rem;
}

.links-wrapper .nav-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 响应式调整 */
@media (max-width: 1280px) {
    .links-wrapper .nav-item {
        flex: 0 0 calc(33.333% - 1rem); /* 3个链接每行 */
    }
}

@media (max-width: 1024px) {
    .links-wrapper .nav-item {
        flex: 0 0 calc(50% - 1rem); /* 2个链接每行 */
    }
}

@media (max-width: 768px) {
    .links-wrapper .nav-item {
        flex: 0 0 100%; /* 1个链接每行 */
        max-width: 100%;
    }
}

/* 卡片样式 */
.card {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    min-height: 180px;
    justify-content: center;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

/* 卡片图标 */
.card-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 0.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background-color: rgba(0, 0, 0, 0.1);
}

/* 卡片标题 */
.card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 导航项 */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-dark);
    gap: 0.5rem;
    min-height: 48px;
    flex-wrap: nowrap;
    /* 确保链接精确控制宽度 */
    width: 100%;
    max-width: fit-content;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateX(5px);
}

.nav-item img {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    flex-shrink: 0;
}

/* 页脚 */
footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 响应式优化 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.875rem;
    }
    
    .time-display {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-box button[type="submit"] {
        width: 100%;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}

/* HTML类名映射 */
.text-4xl {
    font-size: 2.25rem;
    font-weight: 700;
}

.text-5xl {
    font-size: 3rem;
    font-weight: 700;
}

.text-xl {
    font-size: 1.25rem;
    font-weight: 500;
}

.text-gray-700 {
    color: #4b5563;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-10 {
    margin-bottom: 2.5rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

.mb-16 {
    margin-bottom: 4rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.p-6 {
    padding: 1.5rem;
}

.text-center {
    text-align: center;
}

.bg-white {
    background-color: #fff;
}

.hover\:bg-white:hover {
    background-color: #fff;
}

.shadow-md {
    box-shadow: var(--shadow-light);
}

.hover\:shadow-md:hover {
    box-shadow: var(--shadow-light);
}

.rounded-full {
    border-radius: 9999px;
}

.w-16 {
    width: 4rem;
}

.h-16 {
    height: 4rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.font-semibold {
    font-weight: 600;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.bg-opacity-70 {
    background-color: rgba(255, 255, 255, 0.7);
}

.hover\:bg-opacity-100:hover {
    background-color: rgba(255, 255, 255, 1);
}

.transition {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.text-gray-600 {
    color: #4b5563;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.border-t {
    border-top-width: 1px;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.pb-8 {
    padding-bottom: 2rem;
}

/* 图标 */
.fa-shopping-cart,
.fa-search,
.fa-clock,
.fa-cart-plus,
.fa-handshake,
.fa-truck-fast {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* 其他基础样式 */
.hidden {
    display: none;
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
