/* =================================
   固件下载页面样式 - firmware.css
================================= */

/* =================================
   页面头部区域
================================= */
.page-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1419 100%);
  padding: 120px 0 80px;
  color: white;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.page-header-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: bold;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff, var(--primary-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-description {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb .separator {
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb .current {
  color: var(--primary-color);
  font-weight: 500;
}

/* =================================
   主内容区域
================================= */
.firmware-section {
  background: #f8f9fa;
  padding: 50px 0;
  min-height: 80vh;
}

/* =================================
   左侧边栏样式
================================= */
.firmware-sidebar {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding-right: 20px;
}

.sidebar-widget {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.widget-header {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 18px 20px;
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.widget-header:hover {
  background: linear-gradient(135deg, #f0f0f0, #f8f9fa);
}

.widget-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.widget-title i:first-child {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.toggle-icon {
  transition: transform 0.3s ease;
  color: var(--text-gray);
  font-size: 1rem;
}

.widget-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.widget-content {
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.widget-content.collapsed {
  max-height: 0;
  overflow: hidden;
}

.model-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  color: var(--text-gray);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid #f8f9fa;
  font-size: 0.95rem;
  font-weight: 500;
}

.model-item:last-child {
  border-bottom: none;
}

.model-item:hover {
  background: rgba(231, 181, 40, 0.1);
  color: var(--primary-color);
  padding-left: 25px;
}

.model-item.active {
  background: var(--primary-color);
  color: #000;
  font-weight: 600;
}

.model-item i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.no-data {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-gray);
  font-style: italic;
}

/* =================================
   统计小组件
================================= */
.stats-widget .widget-content {
  padding: 20px;
}

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}

.stats-item:last-child {
  border-bottom: none;
}

.stats-label {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.stats-value {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1rem;
}

/* =================================
   右侧内容区域
================================= */
.firmware-content {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  border: 1px solid #e9ecef;
}

/* =================================
   筛选区域
================================= */
.filter-section {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-bottom: 1px solid #e9ecef;
}

.filter-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
}

.filter-status {
  color: var(--text-gray);
  font-size: 0.9rem;
  padding: 6px 12px;
  background: rgba(231, 181, 40, 0.1);
  border-radius: 15px;
  border: 1px solid rgba(231, 181, 40, 0.3);
}

.filter-form {
  padding: 25px 30px 30px;
}

.filter-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.filter-form .layui-input {
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  background: white;
  transition: var(--transition);
  font-size: 0.9rem;
}

.filter-form .layui-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(231, 181, 40, 0.1);
}

.filter-form .layui-input:disabled {
  background: #f8f9fa;
  color: var(--text-gray);
  cursor: not-allowed;
}

.filter-actions {
  margin-top: 25px;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.search-btn {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #000 !important;
  font-weight: 600 !important;
  padding: 0px 25px !important;
  border-radius: var(--border-radius) !important;
}

.search-btn:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 181, 40, 0.3);
}

.reset-btn {
  padding: 0px 25px !important;
  border-radius: var(--border-radius) !important;
}

.reset-btn:hover {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}

/* =================================
   固件列表区域
================================= */
.firmware-list-section {
  padding: 30px;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f8f9fa;
}

.result-count {
  font-size: 1rem;
  color: var(--text-gray);
}

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

.list-actions .layui-btn {
  border-radius: var(--border-radius) !important;
}

.firmware-list {
  min-height: 400px;
}

/* =================================
   固件卡片样式
================================= */
.firmware-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  transition: var(--transition);
  overflow: hidden;
}

.firmware-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

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

.firmware-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.firmware-type {
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
}

.firmware-type.install {
  background: #28a745;
}

.firmware-type.update {
  background: #007bff;
}

.download-btn {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #000 !important;
  font-weight: 600 !important;
  padding: 0px 20px !important;
  border-radius: 20px !important;
  font-size: 0.9rem !important;
}

.download-btn:hover {
  background: var(--primary-hover) !important;
  transform: scale(1.05);
}

.firmware-card-body {
  padding: 25px;
}

.firmware-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.spec-label {
  font-size: 0.8rem;
  color: var(--text-gray);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spec-value {
  font-size: 0.95rem;
  color: #333;
  font-weight: 600;
}

.firmware-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #f8f9fa;
  font-size: 0.85rem;
  color: var(--text-gray);
}

.file-size {
  font-weight: 500;
}

.download-count {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* =================================
   空状态和加载状态
================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #333;
}

.empty-state p {
  margin-bottom: 0;
  line-height: 1.6;
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: var(--primary-color);
}

.loading-spinner i {
  font-size: 2rem;
}

.loading-spinner span {
  font-size: 1rem;
  font-weight: 500;
}

/* =================================
   响应式设计
================================= */
@media (max-width: 991px) {
  .firmware-sidebar {
    padding-right: 0;
    margin-bottom: 30px;
  }

  .sidebar-widget {
    margin-bottom: 20px;
  }

  .firmware-specs {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 100px 0 60px;
  }

  .page-title {
    font-size: 2rem;
  }

  .firmware-section {
    padding: 30px 0;
  }

  .filter-header {
    padding: 20px 25px 15px;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    text-align: center;
  }

  .filter-form {
    padding: 20px 25px 25px;
  }

  .filter-actions {
    flex-direction: column;
    gap: 10px;
  }

  .filter-actions .layui-btn {
    width: 100%;
  }

  .firmware-list-section {
    padding: 25px;
  }

  .list-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    text-align: center;
  }

  .firmware-card-header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    text-align: center;
  }

  .firmware-card-body {
    padding: 20px;
  }

  .firmware-specs {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .firmware-meta {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .firmware-sidebar {
    gap: 15px;
  }

  .widget-header {
    padding: 15px;
  }

  .widget-title {
    font-size: 1rem;
  }

  .model-item {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .filter-header {
    padding: 15px 20px 10px;
  }

  .filter-header h3 {
    font-size: 1.1rem;
  }

  .filter-form {
    padding: 15px 20px 20px;
  }

  .firmware-list-section {
    padding: 20px;
  }

  .firmware-card-header {
    padding: 12px 15px;
  }

  .firmware-title {
    font-size: 1rem;
  }

  .firmware-card-body {
    padding: 15px;
  }

  .firmware-specs {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .spec-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
  }

  .spec-item:last-child {
    border-bottom: none;
  }

  .empty-state {
    padding: 40px 15px;
  }

  .empty-state i {
    font-size: 3rem;
  }

  .empty-state h3 {
    font-size: 1.3rem;
  }

  .loading-state {
    padding: 40px 15px;
  }
}

/* =================================
   动画效果
================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.firmware-card {
  animation: fadeInUp 0.3s ease-out;
}

.firmware-card:nth-child(2) {
  animation-delay: 0.1s;
}

.firmware-card:nth-child(3) {
  animation-delay: 0.2s;
}

.firmware-card:nth-child(4) {
  animation-delay: 0.3s;
}

/* =================================
   滚动条样式
================================= */
.widget-content::-webkit-scrollbar {
  width: 6px;
}

.widget-content::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.widget-content::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}