/* ============================================
   快递查询H5 - 用户端样式
   设计风格: 现代简洁，渐变配色，流畅动画
   ============================================ */

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #06B6D4;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #F0F2FF;
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Hero区域 */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--secondary) 100%);
    padding: 48px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    position: relative;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    position: relative;
    margin-bottom: 32px;
}

.hero-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    position: relative;
}

/* 查询卡片 */
.search-card {
    max-width: 480px;
    margin: -36px auto 24px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    position: relative;
    z-index: 10;
}

/* Tab切换 */
.tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(79,70,229,0.15);
}

/* 搜索输入 */
.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--gray-800);
    background: var(--gray-50);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 18px;
    pointer-events: none;
}

.search-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.35);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.search-btn .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 提示 */
.search-hint {
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    margin-top: 12px;
}

/* 结果区域 */
.results-section {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 32px;
}

.result-count {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
    padding-left: 4px;
}

.result-count span {
    color: var(--primary);
    font-weight: 600;
}

/* 订单卡片 */
.order-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.order-card:active {
    transform: scale(0.99);
}

.order-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
}

.order-product {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-0 { background: #FEF3C7; color: #92400E; }
.status-badge.status-1 { background: #DBEAFE; color: #1E40AF; }
.status-badge.status-2 { background: #E0E7FF; color: #4338CA; }
.status-badge.status-3 { background: #D1FAE5; color: #065F46; }
.status-badge.status-4 { background: #ECFDF5; color: #059669; }
.status-badge.status-5 { background: #FEE2E2; color: #991B1B; }

.order-body {
    padding: 16px 20px;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.order-info-row .label {
    color: var(--gray-500);
}

.order-info-row .value {
    color: var(--gray-700);
    font-weight: 500;
}

.express-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
}

/* 物流时间线 */
.logistics-section {
    border-top: 1px solid var(--gray-100);
    padding: 16px 20px;
}

.logistics-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
    padding-left: 8px;
}

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

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--gray-200);
}

.timeline-item:first-child .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item:first-child .timeline-content {
    color: var(--gray-800);
    font-weight: 500;
}

.timeline-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-bottom: 2px;
}

.timeline-content {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.timeline-location {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state .icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state .title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state .desc {
    font-size: 13px;
    color: var(--gray-400);
}

/* 错误提示 */
.alert-msg {
    max-width: 480px;
    margin: 16px auto;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: none;
}

.alert-msg.error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    display: block;
}

.alert-msg.success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
    display: block;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 12px;
    color: var(--gray-400);
}

/* 动画 */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

/* 折叠展开 */
.order-card .logistics-section {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.order-card.expanded .logistics-section {
    max-height: 2000px;
    padding: 16px 20px;
}

.expand-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--gray-50);
    border: none;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.expand-btn:hover {
    background: var(--gray-100);
}

/* 响应式 */
@media (max-width: 360px) {
    .hero-title { font-size: 24px; }
    .search-card { padding: 20px 16px; }
    .order-body { padding: 12px 16px; }
}
