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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    color: #007bff;
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-brand span {
    color: #666;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #007bff;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* 主要内容区域 */
.main {
    margin-top: 80px;
}

/* 首页横幅 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta {
    margin-top: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #007bff;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* 物流查询区域 */
.tracking-section {
    padding: 4rem 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h3 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

.tracking-form {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.input-group {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: #007bff;
}

.input-group input {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
}

.input-group input::placeholder {
    color: #999;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 查询结果 */
.tracking-result {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.result-header {
    background: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h4 {
    color: #333;
    font-size: 1.3rem;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-label {
    color: #666;
    font-weight: 500;
}

.status-value {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Status styles based on status ID from mk_status table */
/* Status 0: Pending (待处理) */
.status-value.status-0 {
    background: #fff3cd;
    color: #856404;
}

/* Status 1: Data Transfer (数据传输) */
.status-value.status-1 {
    background: #d1ecf1;
    color: #0c5460;
}

/* Status 2: Check In (签收) */
.status-value.status-2 {
    background: #cce5ff;
    color: #004085;
}

/* Status 3: Driver Out for Delivery (司机配送中) */
.status-value.status-3 {
    background: #e7f3ff;
    color: #0056b3;
}

/* Status 4: Delivered (已送达) */
.status-value.status-4 {
    background: #d4edda;
    color: #155724;
}

/* Status 5: Failed (失败) */
.status-value.status-5 {
    background: #f8d7da;
    color: #721c24;
}

/* Default style for any new status that doesn't have specific styling yet */
.status-value[class*="status-"]:not(.status-0):not(.status-1):not(.status-2):not(.status-3):not(.status-4):not(.status-5) {
    background: #e9ecef;
    color: #495057;
}

/* 订单信息 */
.order-info {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.order-info h5 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.info-item .label {
    color: #666;
    font-weight: 500;
    min-width: 80px;
}

.info-item .value {
    color: #333;
    flex: 1;
}

/* 物流轨迹时间线 */
.tracking-timeline {
    padding: 1.5rem;
}

.tracking-timeline h5 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-item.current::before {
    background: #28a745;
    animation: pulse 2s infinite;
}

.timeline-item.completed::before {
    background: #6c757d;
}

.timeline-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #007bff;
}

.timeline-item.current .timeline-content {
    border-left-color: #28a745;
    background: #f0fff4;
}

.timeline-item.completed .timeline-content {
    border-left-color: #6c757d;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-weight: 500;
    color: #333;
}

.timeline-time {
    color: #666;
    font-size: 0.9rem;
}

.timeline-description {
    color: #666;
    font-size: 0.9rem;
}

/* 错误信息 */
.error-message {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1rem;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 模拟数据提示样式 */
.mock-data-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #90caf9;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.notice-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.75rem;
    position: relative;
}

.notice-content i.fa-info-circle {
    color: #1976d2;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notice-content span {
    color: #1565c0;
    font-size: 0.95rem;
    flex: 1;
    line-height: 1.4;
}

.notice-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notice-close:hover {
    background: rgba(0,0,0,0.1);
    color: #333;
}

.notice-close i {
    font-size: 0.9rem;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* 服务介绍 */
.services-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.service-icon {
    width: 60px;
    height: 60px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.service-card h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.service-card p {
    color: #666;
    line-height: 1.6;
}

/* 联系我们 */
.contact-section {
    padding: 4rem 0;
    background: white;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.contact-item i {
    color: #007bff;
    font-size: 1.2rem;
}

/* 页脚 */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #007bff;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        display: none;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .timeline-item {
        padding-left: 2.5rem;
    }
    
    .timeline::before {
        left: 15px;
    }
    
    .timeline-item::before {
        left: 6px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .section-header h3 {
        font-size: 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
