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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

.scan-section, .query-section, .result-section {
    margin-bottom: 30px;
}

h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.scan-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

#video {
    width: 100%;
    height: auto;
    display: block;
}

.scan-region {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid #d32f2f;
    border-radius: 12px;
    background: rgba(211, 47, 47, 0.1);
}

.scan-region::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d32f2f, transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.scan-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.input-group {
    display: flex;
    gap: 10px;
}

#tracking-number {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#tracking-number:focus {
    outline: none;
    border-color: #d32f2f;
}

.result-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

#result-content {
    font-size: 14px;
    line-height: 1.8;
}

.tracking-info {
    margin-bottom: 20px;
}

.tracking-info p {
    margin-bottom: 8px;
}

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

.tracking-info .value {
    color: #333;
    font-weight: 600;
}

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

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

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d32f2f;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #d32f2f;
}

.timeline-item.current::before {
    background: #28a745;
    box-shadow: 0 0 0 2px #28a745;
}

.timeline-item .time {
    color: #999;
    font-size: 12px;
    margin-bottom: 4px;
}

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

.timeline-item.current .status {
    color: #d32f2f;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px;
}

.loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d32f2f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border-radius: 8px;
}

@media (max-width: 480px) {
    .container {
        border-radius: 0;
        margin: 0;
    }

    .main-content {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}