/* ETCA 自定义样式 */
@import url('https://cdn.jsdelivr.net/npm/qweather-icons@1.3.0/font/qweather-icons.css');

/* 页面背景图片 - 左下角显示SJZC logo */
body::before {
  content: '';
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 300px;
  height: 300px;
  background-image: url('/imgs/SJZClogo.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.2; /* 提高透明度，使logo更明显 */
  pointer-events: none; /* 确保不会影响页面交互 */
  z-index: -1; /* 放在内容后面 */
}

/* 在移动设备上调整logo大小 */
@media (max-width: 768px) {
  body::before {
    width: 150px;
    height: 150px;
    bottom: 10px;
    left: 10px;
  }
}

/* 确保logo在暗色模式下也能正常显示 */
[data-theme="dark"] body::before {
  opacity: 0.15; /* 暗色模式下提高透明度 */
}

/* 为不同页面模式调整logo位置 */
.scheme-gemini body::before {
  bottom: 30px;
  left: 30px;
}

.scheme-muse body::before,
.scheme-mist body::before {
  bottom: 20px;
  left: 20px;
}

.scheme-pisces body::before {
  bottom: 25px;
  left: 25px;
}

/* Sidebar weather item */
.siteinfo-weather .item-count {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.siteinfo-weather .weather-temp {
  font-variant-numeric: tabular-nums;
}

.siteinfo-weather .weather-qicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.13rem;
  height: 1.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-color);
}

/* ============================================================
   题库 (Question Bank) 自定义样式
   ============================================================ */

/* 通用按钮 */
.qb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.qb-btn-primary {
  background: #222;
  color: #fff;
  border-color: #222;
}

.qb-btn-primary:hover {
  background: #444;
  border-color: #444;
  color: #fff;
  text-decoration: none;
}

.qb-btn-secondary {
  background: transparent;
  color: #555;
  border-color: #ccc;
}

.qb-btn-secondary:hover {
  background: #f5f5f5;
  color: #222;
  border-color: #999;
  text-decoration: none;
}

/* 学科卡片网格 */
.qb-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.qb-subject-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.25rem;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.qb-subject-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  border-color: #d0d0d0;
  text-decoration: none;
}

.qb-subject-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7ec 100%);
  border-radius: 12px;
  font-size: 1.25rem;
  color: #444;
}

.qb-subject-info {
  flex: 1;
  min-width: 0;
}

.qb-subject-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #222;
  line-height: 1.35;
}

.qb-subject-count {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #888;
}

.qb-subject-arrow {
  flex-shrink: 0;
  color: #bbb;
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.qb-subject-card:hover .qb-subject-arrow {
  color: #666;
}

/* 试卷列表 */
.qb-back-bar {
  margin-bottom: 1rem;
}

.qb-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.qb-back-link:hover {
  color: #222;
  text-decoration: none;
}

.qb-papers-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.qb-section-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #222;
}

.qb-section-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #888;
}

.qb-papers-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qb-paper-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.qb-paper-item:hover {
  border-color: #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.qb-paper-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1;
}

.qb-paper-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 10px;
  font-size: 1rem;
  color: #666;
}

.qb-paper-detail {
  min-width: 0;
}

.qb-paper-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qb-paper-type {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #999;
  background: #f2f2f2;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.qb-paper-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* 试卷详情页 */
.qb-paper-view .post-header {
  margin-bottom: 1rem;
}

.qb-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.qb-breadcrumb a {
  color: #666;
  text-decoration: none;
}

.qb-breadcrumb a:hover {
  color: #222;
  text-decoration: underline;
}

.qb-breadcrumb-sep {
  color: #ccc;
}

.qb-breadcrumb-current {
  color: #aaa;
}

.qb-paper-title-main {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

.qb-paper-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.qb-iframe-wrapper {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

#qb-paper-iframe {
  width: 100%;
  min-height: 80vh;
  border: none;
  display: block;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .qb-subjects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .qb-paper-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .qb-paper-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .qb-paper-toolbar {
    gap: 0.5rem;
  }

  .qb-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }

  .qb-iframe-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #qb-paper-iframe {
    min-height: 50vh;
    width: 100%;
  }
}

/* ============================================================
   深色模式适配 (Dark Mode)
   ============================================================ */

[data-theme="dark"] .qb-btn-primary {
  background: #eee;
  color: #222;
  border-color: #eee;
}

[data-theme="dark"] .qb-btn-primary:hover {
  background: #fff;
  border-color: #fff;
  color: #111;
}

[data-theme="dark"] .qb-btn-secondary {
  color: #ccc;
  border-color: #666;
}

[data-theme="dark"] .qb-btn-secondary:hover {
  background: #444;
  color: #eee;
  border-color: #888;
}

[data-theme="dark"] .qb-subject-card {
  background: #333;
  border-color: #444;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

[data-theme="dark"] .qb-subject-card:hover {
  border-color: #666;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

[data-theme="dark"] .qb-subject-icon {
  background: linear-gradient(135deg, #444 0%, #3a3a3a 100%);
  color: #ddd;
}

[data-theme="dark"] .qb-subject-name {
  color: #eee;
}

[data-theme="dark"] .qb-subject-count {
  color: #aaa;
}

[data-theme="dark"] .qb-subject-arrow {
  color: #777;
}

[data-theme="dark"] .qb-subject-card:hover .qb-subject-arrow {
  color: #ccc;
}

[data-theme="dark"] .qb-back-link {
  color: #bbb;
}

[data-theme="dark"] .qb-back-link:hover {
  color: #eee;
}

[data-theme="dark"] .qb-papers-header {
  border-bottom-color: #444;
}

[data-theme="dark"] .qb-section-title {
  color: #eee;
}

[data-theme="dark"] .qb-section-meta {
  color: #999;
}

[data-theme="dark"] .qb-paper-item {
  background: #333;
  border-color: #444;
}

[data-theme="dark"] .qb-paper-item:hover {
  border-color: #666;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

[data-theme="dark"] .qb-paper-icon {
  background: #3a3a3a;
  color: #bbb;
}

[data-theme="dark"] .qb-paper-title {
  color: #e0e0e0;
}

[data-theme="dark"] .qb-paper-type {
  color: #aaa;
  background: #3a3a3a;
}

[data-theme="dark"] .qb-breadcrumb a {
  color: #bbb;
}

[data-theme="dark"] .qb-breadcrumb a:hover {
  color: #eee;
}

[data-theme="dark"] .qb-breadcrumb-sep {
  color: #666;
}

[data-theme="dark"] .qb-breadcrumb-current {
  color: #888;
}

[data-theme="dark"] .qb-paper-title-main {
  color: #eee;
}

[data-theme="dark"] .qb-iframe-wrapper {
  border-color: #444;
  background: #282828;
}
