/* Estilos adicionales para Capitales del Mundo (capitalesdelmundo.wiki) */
/* 复用原有色彩系统: --bg, --paper, --cream, --ink, --muted, --line, --violet, --lavender, --mint, --sun, --pink */

/* Topbar 单行防折行适配 */
.topbar {
  flex-wrap: nowrap;
}
.topbar-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.primary-nav {
  display: flex;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  gap: 4px;
  padding: 4px 6px;
}
.primary-nav a {
  padding: 7px 11px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .primary-nav a {
    padding: 6px 9px;
    font-size: 12px;
  }
}
@media (max-width: 960px) {
  .primary-nav {
    display: none;
  }
}

.capital-tool-wrapper {
  margin-top: 10px;
}

.search-box-card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 16px 20px;
  box-shadow: 4px 4px 0 var(--line);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-icon {
  font-size: 20px;
  color: var(--violet);
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}

.search-input::placeholder {
  color: var(--muted);
  font-weight: 500;
  opacity: 0.8;
}

.clear-search-btn {
  background: var(--wash);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.clear-search-btn:hover {
  background: var(--pink);
  transform: translateY(-1px);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.continent-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  appearance: none;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 850;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--line);
  transition: all 0.2s var(--bounce);
}

.pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--line);
}

.pill-btn.active {
  background: var(--violet);
  color: #fff;
  border-color: var(--line);
}

.view-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.view-btn {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 850;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 2px 2px 0 var(--line);
  transition: all 0.2s ease;
}

.view-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--line);
}

.view-btn.active {
  background: var(--sun);
  color: var(--ink);
}

.export-group {
  display: flex;
  gap: 8px;
}

.export-btn {
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 850;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.export-btn:hover {
  background: var(--mint);
  transform: translateY(-1px);
}

/* 首都数据表格 */
.table-responsive-wrapper {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  margin-bottom: 24px;
}

.capitals-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14.5px;
}

.capitals-table th {
  background: var(--cream);
  color: var(--ink);
  font-weight: 900;
  padding: 14px 16px;
  border-bottom: 2px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.capitals-table th:first-child {
  border-top-left-radius: 16px;
}

.capitals-table th:last-child {
  border-top-right-radius: 16px;
}

.capitals-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(55, 39, 51, 0.12);
  vertical-align: middle;
  font-weight: 600;
}

.capitals-table tr:last-child td {
  border-bottom: none;
}

.capitals-table tr:hover td {
  background: var(--wash);
}

.country-flag-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.country-flag-img {
  width: 32px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  border: 1.5px solid var(--line);
  box-shadow: 1.5px 1.5px 0 rgba(55, 39, 51, 0.18);
  display: block;
}

.flashcard-flag-img {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
  display: inline-block;
  margin-bottom: 4px;
}

.country-name-cell {
  font-weight: 850;
  color: var(--ink);
}

.capital-name-cell {
  font-weight: 850;
  color: #6f55df;
}

.continent-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--lavender);
  box-shadow: 1px 1px 0 rgba(55,39,51,0.1);
  white-space: nowrap;
}

.continent-badge.Europa { background: var(--lavender); }
.continent-badge.América { background: var(--sun); }
.continent-badge.Asia { background: var(--pink); }
.continent-badge.África { background: var(--mint); }
.continent-badge.Oceanía { background: var(--sky); }

.currency-cell {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.time-cell {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

/* 分页控件 */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1.5px solid rgba(55, 39, 51, 0.12);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  gap: 8px;
}

.page-btn {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--line);
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--sun);
  transform: translateY(-1px);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* 闪卡模式 Flashcards Grid */
.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.flashcard-item {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  perspective: 1000px;
  transition: transform 0.25s var(--bounce), box-shadow 0.25s var(--bounce);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.flashcard-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 7px 7px 0 var(--line);
}

.flashcard-flag {
  font-size: 40px;
  margin-bottom: 8px;
}

.flashcard-country {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 6px;
}

.flashcard-capital-wrapper {
  margin-top: 6px;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.flashcard-capital {
  font-size: 16px;
  font-weight: 950;
  color: var(--violet);
  background: var(--wash);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px dashed var(--violet);
}

.flashcard-hint {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  background: var(--cream);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Mini-Quiz 测验模块 */
.quiz-container {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px dashed rgba(55, 39, 51, 0.2);
}

.quiz-badge {
  background: var(--pink);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--line);
}

.quiz-scoreboard {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}

.quiz-card {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.quiz-question-flag {
  font-size: 64px;
  margin-bottom: 12px;
}

.quiz-question-text {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 950;
  color: var(--ink);
  margin-bottom: 24px;
}

.quiz-question-text span {
  color: var(--violet);
  text-decoration: underline;
  text-decoration-color: var(--sun);
  text-underline-offset: 4px;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.quiz-opt-btn {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--line);
  transition: all 0.2s var(--bounce);
  text-align: center;
}

.quiz-opt-btn:hover:not(:disabled) {
  background: var(--cream);
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 var(--line);
}

.quiz-opt-btn.correct {
  background: var(--mint) !important;
  color: #10281c !important;
  border-color: var(--line) !important;
}

.quiz-opt-btn.wrong {
  background: var(--pink) !important;
  color: #fff !important;
  border-color: var(--line) !important;
}

.quiz-feedback {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-weight: 900;
  font-size: 16px;
}

.quiz-next-btn {
  background: var(--sun);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 950;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--line);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quiz-next-btn:hover {
  background: var(--mint);
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 var(--line);
}

/* Continentes Grid Cards */
.continents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.continent-hub-card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s var(--bounce);
  position: relative;
  overflow: hidden;
}

.continent-hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 var(--line);
  color: var(--ink);
}

.continent-hub-card .card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.continent-hub-card h3 {
  font-size: 24px;
  font-weight: 950;
  margin-bottom: 6px;
}

.continent-hub-card .count-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  margin-bottom: 12px;
}

.continent-hub-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 16px;
}

.continent-hub-card .card-arrow {
  font-weight: 900;
  font-size: 13px;
  color: var(--violet);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* SEO Content Guide Section */
.guide-content-article {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: 36px;
  box-shadow: var(--shadow);
  margin-top: 36px;
}

.guide-content-article h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 950;
  margin-bottom: 18px;
}

.guide-content-article h3 {
  font-size: 22px;
  font-weight: 900;
  margin-top: 26px;
  margin-bottom: 12px;
}

.guide-content-article p {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
  font-weight: 550;
}

/* FAQ Accordion */
.faq-accordion {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.faq-item {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 3px 3px 0 var(--line);
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-question {
  padding: 18px 22px;
  font-size: 16.5px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::marker {
  display: none;
}

.faq-question:after {
  content: "+";
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 900;
  color: var(--violet);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question:after {
  transform: rotate(45deg);
  color: var(--pink);
}

.faq-answer {
  padding: 0 22px 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 550;
}

@media (max-width: 768px) {
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .continent-filters {
    justify-content: center;
  }
  .view-actions {
    justify-content: space-between;
  }
}
