/* 食品溯源管家页面样式 */

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

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

/* 导航栏样式 */
.navbar {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2e7d47;
}

.nav-brand i {
    color: #4caf50;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 40px;
}

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

.nav-menu a:hover,
.nav-menu a.active {
    color: #4caf50;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    cursor: pointer;
}

/* 页面头部 */
.page-header {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(-15deg);
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title i {
    font-size: 3.2rem;
    opacity: 0.9;
}

.page-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.6;
}

.stats-row {
    display: flex;
    gap: 40px;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 30px 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 140px;
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    display: inline-block;
}

.stat-suffix {
    font-size: 2rem;
    font-weight: 700;
    opacity: 0.8;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 8px;
    font-weight: 500;
}

.header-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-circle {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: float 3s ease-in-out infinite;
}

.visual-circle i {
    font-size: 5rem;
    color: white;
    opacity: 0.9;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* 主要内容 */
.main-content {
    padding: 60px 0;
}

/* 查询区域 */
.query-section {
    margin-bottom: 50px;
}

.query-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    text-align: center;
}

.query-header {
    margin-bottom: 40px;
}

.query-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 12px;
}

.query-header p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.5;
}

.query-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.input-group {
    display: flex;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 20px;
    color: #999;
    font-size: 1.2rem;
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 18px 60px 18px 55px;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #2196f3;
    background: white;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.query-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
    white-space: nowrap;
}

.query-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(33, 150, 243, 0.4);
}

.quick-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quick-demo span {
    color: #666;
    font-weight: 600;
}

.demo-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 10px 20px;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-btn:hover {
    background: #2196f3;
    border-color: #2196f3;
    color: white;
    transform: translateY(-1px);
}

/* 结果展示区 */
.results-section {
    margin-top: 50px;
}

.results-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    align-items: start;
}

/* 产品信息卡片 */
.product-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    margin-bottom: 30px;
}

.product-header {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.product-image {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 15px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.quality-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-details {
    flex: 1;
}

.product-details h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 15px;
}

.product-details p {
    margin-bottom: 8px;
    color: #666;
    font-size: 0.95rem;
}

.product-details span {
    color: #333;
    font-weight: 600;
}

.product-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.stat-box {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.stat-box .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2196f3;
    margin-bottom: 5px;
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

/* 质量监控 */
.quality-monitor {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
}

.quality-monitor h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.monitor-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.monitor-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.monitor-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.monitor-content {
    flex: 1;
}

.monitor-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.monitor-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.monitor-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    display: inline-block;
}

.monitor-status.good {
    background: #e8f5e8;
    color: #4caf50;
}

.monitor-status.warning {
    background: #fff8e1;
    color: #ff9800;
}

.monitor-status.danger {
    background: #ffebee;
    color: #f44336;
}

/* 溯源链路 */
.traceability-chain {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.chain-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chain-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1976d2;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chain-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: #1976d2;
    transform: scale(1.05);
}

.chain-timeline {
    padding: 30px;
    min-height: 600px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    margin-bottom: 30px;
    position: relative;
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.6s ease forwards;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
    animation: slideInRight 0.6s ease forwards;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 30px;
    width: 4px;
    height: calc(100% + 30px);
    background: linear-gradient(180deg, #2196f3, #1976d2);
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 20px;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
    margin-top: 15px;
}

.timeline-date {
    color: #2196f3;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.timeline-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.timeline-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 0.9rem;
}

.timeline-location i {
    color: #2196f3;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 悬浮查询按钮 */
.floating-query {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.floating-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(33, 150, 243, 0.5);
}

/* Toast 通知 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #4caf50;
}

.toast.error {
    background: #f44336;
}

.toast.warning {
    background: #ff9800;
}

.toast.info {
    background: #2196f3;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .results-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .stats-row {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .page-title {
        font-size: 2.2rem;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .query-card {
        padding: 25px;
    }
    
    .input-group {
        flex-direction: column;
        max-width: 100%;
    }
    
    .quick-demo {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-header {
        flex-direction: column;
        text-align: center;
    }
    
    .product-stats {
        grid-template-columns: 1fr;
    }
    
    .monitor-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-item {
        flex-direction: column !important;
        align-items: center;
        text-align: center;
    }
    
    .timeline-item::before {
        left: 30px;
        width: 2px;
    }
    
    .timeline-dot {
        margin: 0 0 15px 0;
    }
    
    .floating-query {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .page-header {
        padding: 50px 0;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .visual-circle {
        width: 150px;
        height: 150px;
    }
    
    .visual-circle i {
        font-size: 3rem;
    }
    
    .chain-timeline {
        padding: 20px;
    }
}
