/* =============================================================================
   Container & Section
============================================================================= */

.library-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.library-section {
  margin-bottom: 64px;
}

.library-heading {
  border-left: 6px solid var(--dark-blue);
  padding: 8px 16px;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0.96px;
  color: var(--dark-blue);
  margin-bottom: 30px;
  background: #f4f6fa;
  border-radius: 0 4px 4px 0;
  letter-spacing: 0.05em;
}

/* -----------------------------------------------------------------------------
   Section 1: Tabs & Search
----------------------------------------------------------------------------- */

.library-tab-wrapper {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.library-tab-header {
  display: flex;
  border-bottom: 1px solid var(--dark-blue);
  gap: 12px;
}

.library-tab-btn {
  flex: 1;
  padding: 10px 16px;
  text-align: left;
  background: #f9f9fc;
  border: none;
  cursor: pointer;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.64px;
  color: var(--dark-blue);
  transition: all 0.3s ease;
  font-size: 16px;
  position: relative;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.library-tab-btn:hover {
  color: var(--dark-blue);
  background: rgba(11, 49, 143, 0.05);
}

.library-tab-btn.active {
  background: var(--dark-blue);
  color: #fff;
}

.library-tab-body {
  padding: 46px 40px;
  border: 1px solid #e0e0e0;
  border-top: none;
  background: #fff;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.library-tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.library-tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

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

.library-search-form {
  display: flex;
  align-items: center;
  gap: 40px;
}

.library-search-label {
  line-height: 24px;
  letter-spacing: 0.64px;
  text-wrap-mode: nowrap;
}

.library-input-group {
  display: flex;
  flex: 1;
  gap: 15px;
}

.library-input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.library-input:focus {
  outline: none;
  border-color: var(--dark-blue);
  box-shadow: 0 0 0 3px rgba(11, 49, 143, 0.1);
}

.library-select-wrapper {
  position: relative;
  min-width: 220px;
}

.library-select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  appearance: none;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  transition: border-color 0.3s;
}

.library-select:focus {
  outline: none;
  border-color: var(--dark-blue);
}

.library-submit-btn {
  background: var(--dark-blue);
  color: #fff;
  border: none;
  padding: 0 40px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.3s;
  letter-spacing: 0.05em;
  text-wrap-mode: nowrap;
  box-shadow: 0 4px 6px rgba(11, 49, 143, 0.2);
}

.library-submit-btn:hover {
  background: #1a3a7a;
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(11, 49, 143, 0.3);
}

/* -----------------------------------------------------------------------------
   Section 2: Database List
----------------------------------------------------------------------------- */

.library-db-desc {
  margin: 40px 0 24px 0;
  line-height: 20px;
  letter-spacing: 1.28px;
  text-align: center;
}

.library-db-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.library-db-card {
  display: block;
  border: 1px solid var(--dark-blue);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  margin-bottom: 15px;
}

.library-db-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-color: var(--dark-blue);
}

.library-db-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.library-db-title {
  color: var(--dark-blue);
  line-height: 24px;
  font-size: 16px;
}

.library-db-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-size: contain;
  margin-left: 10px;
  opacity: 0.8;
  transition: transform 0.3s;
}

.library-db-card:hover .library-db-icon {
  transform: translate(3px, -3px);
  opacity: 1;
}

.library-db-text {
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 1.12px;
  padding: 0 8px;
}

/* -----------------------------------------------------------------------------
   Section 3: Repository
----------------------------------------------------------------------------- */

.library-repo-desc {
  margin: 40px 0 24px 0;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 1.12px;
  text-align: left;
}

.library-repo-banner-link {
  display: block;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.library-repo-banner-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* -----------------------------------------------------------------------------
   Section 4: Announcements
----------------------------------------------------------------------------- */

.library-news-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.library-news-item {
  display: flex;
  align-items: center;
  padding: 4px 0 0 16px;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
  padding-right: 40px;
}

.library-news-item:hover {
  color: var(--dark-blue);
  background: #fdfdfd;
  padding-left: 10px;
}

.library-news-date {
  color: var(--dark-blue);
  font-weight: 700;
  width: 150px;
  flex-shrink: 0;
  font-size: 16px;
  font-family: 'Roboto', sans-serif;
}

.library-news-title {
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
}

.library-news-arrow {
  position: absolute;
  right: 15px;
  width: 10px;
  height: 10px;
  border-top: 2px solid #ccc;
  border-right: 2px solid #ccc;
  transform: rotate(45deg);
  transition: border-color 0.3s, transform 0.3s;
}

.library-news-item:hover .library-news-arrow {
  border-color: var(--dark-blue);
  transform: rotate(45deg) translate(3px, -3px);
}

.library-news-more {
  text-align: right;
  margin-top: 40px;
}

.library-more-link {
  color: var(--dark-blue);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.library-more-link:hover {
  border-bottom-color: var(--dark-blue);
}

.more-arrow {
  font-weight: 700;
  transition: transform 0.3s;
}

.library-more-link:hover .more-arrow {
  transform: translateX(5px);
}

/* =============================================================================
   @media：TB
============================================================================= */

@media (max-width: 1023px) {
  /* Section 1 */
  .library-search-form {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .library-input-group {
    flex-direction: column;
  }

  .library-submit-btn {
    padding: 8px 40px;
  }
}

/* =============================================================================
   @media：SP
============================================================================= */

@media (max-width: 767px) {
  /* Container & Section */
  .library-container {
    padding: 20px;
  }

  /* Section 1 */
  .library-tab-btn {
    flex: 1;
    font-size: 14px;
    padding: 15px 5px;
    text-align: center;
  }

  .library-tab-body {
    padding: 30px 20px;
  }

  .library-search-label {
    min-width: auto;
    margin-bottom: 5px;
  }

  .library-input-group {
    flex-direction: column;
  }

  .library-submit-btn {
    padding: 14px;
    width: 100%;
  }

  /* Section 2 */
  .library-db-grid {
    grid-template-columns: 1fr;
  }

  .library-db-desc {
    text-align: left;
  }

  /* Section 4 */
  .library-news-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-right: 30px;
  }

  .library-news-item:hover {
    padding-left: 0;
  }

  .library-news-date {
    width: auto;
  }
}
