
/* 物品网格布局 */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.item-card {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.item-info {
  flex: 1;
}

.item-name {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--text-color);
}

.item-type {
  margin-bottom: 0.5rem;
}

.item-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.item-quantity-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.quantity-display {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quantity-display strong {
  color: var(--text-color);
  font-size: 1.1rem;
}

.quantity-control {
  display: flex;
  gap: 0.5rem;
}

.quantity-control .form-control {
  flex: 1;
  min-width: 0;
}

.confirm-btn {
  white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .item-card {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .items-grid {
    grid-template-columns: 1fr;
  }
  
  .quantity-control {
    flex-direction: column;
  }
  
  .confirm-btn {
    width: 100%;
  }
}

/* 兑换管理特定样式 */
.exchange-manager .card {
  height: fit-content;
}

.progress-container {
  margin-top: 20px;
}

.progress-bar {
  height: 20px;
  background-color: #334155;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #5ba8ff);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.materials-individual-progress {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 800px;
  overflow-y: auto;
}

.materials-individual-progress::-webkit-scrollbar {
  width: 8px;
}

.materials-individual-progress::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.materials-individual-progress::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.materials-individual-progress::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

.individual-progress-title {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.individual-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.material-progress-item {
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.material-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.material-name {
  color: var(--text-color);
  font-weight: 500;
}

.material-quantity {
  color: var(--text-muted);
  font-weight: 400;
}

.requirement-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #334155;
}

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

.requirement-name {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lack-color {
  color: var(--danger-color);
}

/* 关系模态框特定样式 */
.relation-modal .material-inputs {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.notification.success {
  background-color: var(--success-color);
}

.notification.error {
  background-color: var(--danger-color);
}

/* 配置管理样式 */
.config-manager .section-title {
  font-size: 1.3rem;
  margin: 20px 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}

.config-manager .actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.config-manager .btn {
  white-space: nowrap;
}

/* 导出/导入区域 */
.export-import-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 5px;
  margin: 15px 0;
}

.export-import-section textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
  font-family: monospace;
  margin: 10px 0;
}

.export-import-section .button-group {
  margin-top: 10px;
}

/* 收集进度页面样式 */
.progress-tracker .card-body {
  padding: 1.5rem;
}

/* 收集进度汇总信息 */
.collection-summary {
  display: flex;
  justify-content: space-around;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.summary-item {
  text-align: center;
}

.summary-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.summary-label {
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 500;
}

/* 进度内容区域 */
.progress-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* 物品选择区域 */
.item-selector-section {
  background: rgba(30, 41, 59, 0.7);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.item-selector-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

/* 类型筛选下拉列表样式 */
.type-filter-wrapper {
  margin-bottom: 0.75rem;
}

.type-filter-select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  appearance: none;
}

.type-filter-select:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 搜索框样式 */
.search-box-wrapper {
  margin-bottom: 0.75rem;
  position: relative;
}

/* 搜索结果下拉列表 */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-background);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-result-item {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.search-result-item:hover {
  background: rgba(59, 130, 246, 0.2);
}

.result-name {
  font-weight: 500;
  color: var(--text-color);
  flex-grow: 1;
  margin-right: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 搜索分割线 */
.search-divider {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 1rem 0;
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* 下拉列表样式 */
.item-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.selected-item-preview {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

/* 物品图片容器 */
.item-image-container {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.item-image {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  object-fit: contain;
}

/* 物品总进度 */
.item-overall-progress {
  margin: 0.5rem 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.progress-label {
  font-weight: 500;
  color: var(--text-color);
}

.progress-percent {
  font-weight: 600;
  color: #4a90e2;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 4px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #5ba8ff);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* 下拉列表样式 */
.item-select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  appearance: none;
}

.item-select:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 下拉列表选项样式 */
.item-select option,
.type-filter-select option {
  background-color: var(--card-background);
  color: var(--text-color);
  padding: 0.5rem;
}

/* 搜索结果样式 */
.search-results h4 {
  margin: 0 0 1rem 0;
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 600;
}

.search-results-list {
  max-height: 300px;
  overflow-y: auto;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* 物品详情区域 */
.item-details-section {
  background: rgba(30, 41, 59, 0.7);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.item-details-section h3 {
  margin: 0 0 1rem 0;
  color: var(--text-color);
  font-size: 1.25rem;
  font-weight: 600;
}

.no-selection {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-header h4 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 600;
}

.item-info p {
  margin: 0.25rem 0;
  color: var(--text-color);
  font-size: 0.95rem;
}

/* 材料部分样式 */
.no-materials {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-style: italic;
}

.materials-section {
  margin-top: 1rem;
  padding-top: 1rem;
}

.materials-section h5 {
  margin: 0 0 0.75rem 0;
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 600;
}

.material-relation {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.material-relation:last-child {
  margin-bottom: 0;
}

.relation-title {
  margin: 0 0 0.5rem 0;
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.4rem;
}

.relations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.material-card {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  justify-content: space-between;
  height: 100%;
  min-height: 80px;
}

.material-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.material-card-header {
  margin-bottom: 0.2rem;
  padding-bottom: 0.2rem;
  flex-grow: 1;
}

.material-name {
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.8rem;
}

.material-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: flex-end;
}

.material-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
}

.material-quantity {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.material-status {
  font-size: 0.65rem;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  display: inline-block;
  width: fit-content;
  font-weight: 500;
}

.material-sufficient {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.material-insufficient {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* 兑换状态样式 */
.status-badge {
  font-size: 0.9rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 500;
}

.status-owned {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-exchangeable {
  background-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.status-insufficient {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* 可视化区域 */
.visualization-section {
  background: rgba(30, 41, 59, 0.7);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.visualization-section h3 {
  margin: 0 0 1rem 0;
  color: var(--text-color);
  font-size: 1.25rem;
  font-weight: 600;
}

.visualization-container {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading {
  color: var(--text-muted);
  font-style: italic;
}

.graph-container {
  width: 100%;
  height: 300px;
}

/* 图片查看器样式 */
.image-viewer .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0 auto;
}

.image-viewer .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.9);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--border-color);
}

.image-viewer .modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.image-viewer .close-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer .close-button:hover {
    color: var(--danger-color);
}

.image-viewer .image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.image-viewer .preview-image {
    max-width: 90vw;
    max-height: 80vh;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    cursor: zoom-in;
}
