.resource-search-panel,
.resource-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(4, 11, 26, 0.35);
}

.resource-search-panel {
  padding: 1rem;
}

.resource-search-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.8rem;
}

.resource-field {
  display: grid;
  gap: 0.35rem;
  color: var(--text-soft);
}

.resource-field span {
  font-size: 0.9rem;
  color: var(--text-main);
}

.resource-field input,
.resource-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 22, 40, 0.6);
  color: var(--text-main);
  font: inherit;
  padding: 0.6rem 0.7rem;
}

.resource-status {
  margin: 0.65rem 0 0;
  color: var(--text-soft);
  min-height: 1.2rem;
}

.resource-status.error {
  color: #ff9e9e;
}

.resource-status.success {
  color: #bfe8b8;
}

.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.resource-card {
  padding: 1.5rem 1.75rem;
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}

.resource-card-body {
  flex: 1;
  min-width: 0;
}

.resource-card h2 {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.resource-card-meta {
  margin: 0 0 0.8rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.83rem;
}

.resource-category {
  background: rgba(241, 227, 181, 0.1);
  border: 1px solid rgba(241, 227, 181, 0.3);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.resource-date {
  color: var(--text-soft);
}

.resource-description-wrap {
  position: relative;
  margin: 0 0 0.85rem;
}

.resource-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 0.96rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.resource-description-wrap.is-expanded .resource-card-description {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
}

.resource-read-more {
  display: inline-block;
  margin: 0.3rem 0 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.83rem;
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.65;
  transition: opacity 0.15s ease;
}

.resource-read-more:hover {
  opacity: 1;
}

.resource-read-more[hidden] {
  display: none;
}

.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.resource-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  background: rgba(241, 227, 181, 0.03);
}

.resource-files {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  max-width: 200px;
}

.resource-file-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 0.9rem 0.7rem;
  width: 82px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(241, 227, 181, 0.04);
  text-decoration: none;
  color: var(--text-soft);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.resource-file-tile:hover {
  background: rgba(241, 227, 181, 0.1);
  border-color: rgba(241, 227, 181, 0.45);
  color: var(--text-main);
}

.resource-file-tile svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.resource-file-label {
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}

.resource-no-files {
  color: var(--text-soft);
  margin: 0;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .resource-search-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .resource-card {
    flex-direction: column;
    gap: 1.1rem;
  }

  .resource-files {
    max-width: 100%;
    justify-content: flex-start;
  }
}
