/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  .market-dashboard {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .section-header {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
  }
  
  /* 库存查询横幅平板优化 */
  .banner-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }
  
  .banner-title {
    justify-content: center;
  }
  
  .banner-features {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .inventory-features {
    flex-direction: row;
    justify-content: space-around;
    flex-wrap: wrap;
  }
  
  .feature-item {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

/* 手机设备 (小于768px) */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .main-nav {
    gap: var(--space-md);
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.6rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .market-dashboard {
    grid-template-columns: 1fr;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .modal-content {
    margin: 2% auto;
    width: 98%;
    height: 96%;
  }
  
  .certificate-search-compact {
    flex-direction: column;
  }
  
  /* 优化后的库存查询横幅手机优化 */
  .banner-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
  }
  
  .banner-title {
    font-size: 2.6rem;
    justify-content: center;
  }
  
  .banner-description {
    font-size: 1.6rem;
  }
  
  .banner-features {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .banner-feature {
    justify-content: center;
  }
  
  .diamond-world {
    width: 200px;
    height: 200px;
  }
  
  .main-gem {
    font-size: 8rem;
  }
  
  .money-savings {
    top: 15%;
    right: 5%;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .money-symbol {
    font-size: 2rem;
  }
  
  .savings-text {
    font-size: 1rem;
  }
  
  .banner-button {
    padding: var(--space-md) var(--space-lg);
    font-size: 1.6rem;
  }
  
  /* 库存查询卡片手机优化 */
  .inventory-features {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .feature-item {
    justify-content: flex-start;
  }
  
  /* 证书查询引导模态框移动端优化 */
  .certificate-guide-modal {
    padding: var(--space-sm);
  }
  
  .guide-content {
    padding: var(--space-lg);
    max-width: 100%;
    margin: var(--space-sm);
  }
  
  .guide-steps {
    margin: var(--space-lg) 0;
  }
  
  .step {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
    padding: var(--space-md);
  }
  
  .guide-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .guide-btn {
    padding: var(--space-md);
  }
  
  /* 证书查询消息移动端优化 */
  .message-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }
  
  .message-close {
    margin-left: 0;
  }
}

/* 小手机设备 (小于480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-xs);
  }
  
  .hero-title {
    font-size: 2.4rem;
  }
  
  .hero-subtitle {
    font-size: 1.4rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .card-title {
    font-size: 1.8rem;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .price-range {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .stock-info {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  /* 小手机库存查询横幅优化 */
  .banner-title {
    font-size: 2rem;
  }
  
  .banner-description {
    font-size: 1.4rem;
  }
  
  .banner-button {
    padding: var(--space-md);
    font-size: 1.4rem;
  }
  
  /* 小手机证书查询优化 */
  .certificate-search-compact {
    gap: var(--space-xs);
  }
  
  .modern-select, 
  .modern-input, 
  .modern-button {
    font-size: 1.6rem;
    padding: var(--space-md);
  }
  
  /* 小手机引导模态框优化 */
  .guide-content {
    padding: var(--space-md);
  }
  
  .guide-header h3 {
    font-size: 1.8rem;
  }
  
  .guide-body p {
    font-size: 1.4rem;
  }
}

/* 电脑端优化 */
@media (min-width: 769px) {
  .guide-actions {
    flex-direction: row;
  }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-banner {
    padding: var(--space-xl) 0;
  }
  
  .modal-content {
    height: 98%;
    margin: 1% auto;
  }
  
  /* 横屏手机库存查询横幅优化 */
  .inventory-banner {
    padding: var(--space-lg) 0;
  }
  
  /* 横屏手机证书查询引导优化 */
  .certificate-guide-modal {
    padding: var(--space-xs);
  }
  
  .guide-content {
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-icon,
  .card-icon,
  .main-diamond {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* 减少动画（无障碍支持） */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 打印样式 */
@media print {
  .main-header,
  .hero-banner,
  .main-footer,
  .card-button,
  .chart-toggle-btn,
  .certificate-guide-modal,
  .certificate-message,
  .inventory-banner {
    display: none;
  }
  
  .tool-card,
  .dashboard-section,
  .news-section {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* ============================================= */
/* 比价模态框响应式设计 */
/* ============================================= */

@media (max-width: 768px) {
  .compare-modal-content {
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  
  .compare-modal-header {
    padding: var(--space-md);
  }
  
  .compare-modal-header h3 {
    font-size: 1.8rem;
  }
  
  .compare-close {
    width: 35px;
    height: 35px;
    font-size: 2rem;
  }
  
  .loading-spinner i {
    font-size: 3.2rem;
  }
  
  .loading-spinner p {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .compare-modal-header h3 {
    font-size: 1.6rem;
  }
  
  .compare-close {
    width: 32px;
    height: 32px;
    font-size: 1.8rem;
  }
  
  .loading-spinner i {
    font-size: 2.8rem;
  }
  
  .loading-spinner p {
    font-size: 1.3rem;
  }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .compare-modal-content {
    height: 98%;
    margin: 1% auto;
  }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .compare-modal-content {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* 减少动画（无障碍支持） */
@media (prefers-reduced-motion: reduce) {
  .compare-modal,
  .compare-modal-content,
  .loading-spinner i {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}