/* styles.css - 全球邮编查询网站样式 */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
}

/* 主页英雄区样式 */
.hero-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1569466126773-842a038eae3e?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
    min-height: calc(100vh - 4rem); /* 4rem 是导航栏高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

/* 搜索容器样式 */
.search-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 输入框和按钮交互效果 */
.example-address {
    transition: all 0.2s ease;
}

.example-address:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

button[type="submit"] {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.25);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* 功能卡片样式 */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* AI徽章样式 */
.ai-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* 打字动画 */
.typing-animation::after {
    content: "|";
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {opacity: 1;}
    50% {opacity: 0;}
}

/* 结果页面样式 */
.result-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* 高亮文本样式 */
.highlight-text {
    background-color: rgba(59, 130, 246, 0.1);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
    color: #1e40af;
}

/* 加载动画 */
.loading-animation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 24px;
}

/* 提示文本样式 */
.tip-text {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.tip-text i {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.tip-text span {
    flex: 1;
}

.loading-animation div {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-radius: 50%;
    animation: loadingBounce 0.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.loading-animation div:nth-child(1) {
    animation-delay: -0.3s;
}

.loading-animation div:nth-child(2) {
    animation-delay: -0.15s;
}

.loading-animation div:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loadingBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px) scale(0.8);
        opacity: 0.5;
    }
}

/* 响应式布局调整 */
/* 小型设备 (手机, 600px 及以下) */
@media only screen and (max-width: 600px) {
    .search-container {
        padding: 1rem !important;
    }
    
    .hero-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
    
    /* 确保提示文本在手机模式下水平排列 */
    .tip-text {
        flex-direction: row !important;
    }
    
    .tip-text i {
        margin-right: 0.25rem !important;
    }
}

/* 中型设备 (平板电脑, 768px 及以下) */
@media only screen and (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.75rem !important;
    }
    
    .search-container {
        margin: 0 0.5rem;
    }
}

/* 大型设备 (笔记本/台式电脑, 992px 及以上) */
@media only screen and (min-width: 992px) {
    .search-container {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    .search-container {
        background: rgba(30, 41, 59, 0.95);
        color: #e2e8f0;
    }
    
    .search-container label {
        color: #e2e8f0;
    }
    
    .bg-gray-50 {
        background-color: #1e293b !important;
    }
    
    .text-gray-600 {
        color: #cbd5e1 !important;
    }
    
    .text-gray-700 {
        color: #e2e8f0 !important;
    }
} 