/*
Theme Name: Xinliceshi
Theme URI: https://github.com/goodgaogao/xinliceshi
Author: Gao Taojie
Author URI: https://github.com/goodgaogao
Description: A beautiful and responsive WordPress theme for content aggregation
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xinliceshi
Domain Path: /languages
Requires at least: 5.0
Requires PHP: 7.4
*/

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

a {
  color: #0099ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #0077cc;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

/* Header */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(20, 24, 62, 0.08);
  box-shadow: 0 6px 32px rgba(15, 34, 72, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.site-branding {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-logo a {
  font-size: 1.3rem;
  font-weight: 700;
  color: #14183e;
}

.brand-tagline {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
}

.main-navigation {
  flex: 1;
}

.main-navigation .primary-menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

.main-navigation .primary-menu li {
  position: relative;
}

.main-navigation .primary-menu a {
  color: #4b5563;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
}

.main-navigation .primary-menu a:hover,
.main-navigation .primary-menu .current-menu-item > a {
  color: #4a5ee5;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  background: none;
  border: none;
  padding: 0.25rem;
}

.mobile-menu-toggle span {
  width: 22px;
  height: 2px;
  background: #14183e;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 960px) {
  .header-content {
    padding: 0.75rem 1.25rem;
  }

  .main-navigation {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, rgba(83, 109, 255, 0.96), rgba(154, 119, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 20px 45px rgba(13, 30, 70, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(14px);
  }

  .main-navigation.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .main-navigation .primary-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .main-navigation .primary-menu a {
    color: #fdfdfd;
  }

  .main-navigation .primary-menu a:hover,
  .main-navigation .primary-menu .current-menu-item > a {
    color: #ffe0ff;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

/* Main Content */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Home Page Layout */
.home-wrapper {
  padding: 2.5rem 1.5rem;
}

.home-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
}

.home-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.home-empty-tip {
  text-align: center;
  padding: 3rem 0;
  color: #6b7280;
  background: #fff;
  border-radius: 1rem;
  border: 1px dashed #cbd5f5;
}

.home-category-block {
  background: #fff;
  border-radius: 1.3rem;
  padding: 2rem;
  box-shadow: 0 12px 40px rgba(15, 34, 72, 0.07);
  border: 1px solid rgba(83, 109, 255, 0.08);
}

.category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.category-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  color: #7c8ffe;
  margin: 0 0 0.5rem;
}

.category-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: #14183e;
}

.category-description {
  color: #4b5563;
  margin-top: 0.4rem;
}

.category-link {
  color: #4a5ee5;
  font-weight: 600;
  white-space: nowrap;
}

.category-highlights {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.category-highlights span {
  background: #f2f4ff;
  color: #4a5ee5;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.category-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.category-test-card {
  border: 1px solid rgba(20, 24, 62, 0.08);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #fafbff;
}

.category-test-card .card-subtitle {
  color: #4b5563;
  min-height: 42px;
  margin: 0;
}

.category-test-card .card-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #6b7280;
  font-size: 0.88rem;
}

.category-test-card .card-actions {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-sidebar--mobile {
  display: none;
}

.desktop-only {
  display: flex;
}

.sidebar-block {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(20, 24, 62, 0.08);
  box-shadow: 0 10px 30px rgba(15, 34, 72, 0.07);
}

.sidebar-block h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #14183e;
}

.sidebar-test-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-test-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.sidebar-test-list li h4 {
  margin: 0;
  font-size: 0.95rem;
}

.sidebar-test-list a {
  font-size: 0.85rem;
  color: #4a5ee5;
}

.sidebar-recommend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.sidebar-recommend-card {
  border: 1px solid rgba(74, 94, 229, 0.2);
  border-radius: 0.85rem;
  padding: 0.9rem;
  background: #f7f8ff;
}

.sidebar-recommend-card h4 {
  margin: 0.3rem 0 0.4rem;
}

.sidebar-recommend-card a {
  font-size: 0.85rem;
  color: #4a5ee5;
}

.sidebar-empty {
  color: #6b7280;
  margin: 1rem 0 0;
}

@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-sidebar--mobile {
    display: flex;
  }

  .desktop-only {
    display: none;
  }
}

@media (max-width: 768px) {
  .home-wrapper {
    padding: 1.5rem 1rem;
  }

  .home-category-block {
    padding: 1.5rem;
  }

  .category-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .category-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  background-color: #333;
  border-top: 1px solid #222;
  padding: 3rem 2rem;
  margin-top: 3rem;
  color: #fff;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: #fff;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #ccc;
}

.footer-section a:hover {
  color: #0099ff;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #555;
  color: #999;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 0.75rem 1rem;
    justify-content: space-between;
  }

  .site-branding {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .site-logo a {
    font-size: 1.1rem;
  }

  .brand-tagline {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .site-main {
    padding: 1.5rem 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .header-content {
    gap: 0.35rem;
  }

  .header-actions {
    width: auto;
  }
}

/* Utility buttons */
.hero-btn,
button.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #5f8bff, #8f6bff);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(95, 139, 255, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn:hover,
button.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(95, 139, 255, 0.35);
}

.ghost-btn,
button.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #555;
  font-weight: 500;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ghost-btn:hover,
button.ghost-btn:hover {
  color: #111;
  border-color: #111;
}

.is-hidden {
  display: none !important;
}

/* Home test hub */
.home-test-section {
  margin-bottom: 2.5rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eee;
  padding: 1.5rem;
}

.home-test-section .section-header {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
  flex-direction: column;
  align-items: flex-start;
}

.section-subtitle {
  color: #777;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.home-test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.home-test-card {
  background: linear-gradient(135deg, #f8fbff, #fef6ff);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(95, 139, 255, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
}

.home-test-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.home-test-card__body p {
  margin-bottom: 0.6rem;
}

.home-test-meta {
  list-style: none;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #666;
}

.home-test-card__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.test-category-page {
  padding: 0;
}

.test-category-hero {
  position: relative;
  padding: 4rem 1rem;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.test-category-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(7, 21, 65, 0.85), rgba(9, 30, 66, 0.6));
}

.test-category-hero .hero-content {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  text-align: left;
}

.test-category-hero h1 {
  font-size: 3rem;
  margin: 0.5rem 0;
}

.test-category-hero .hero-subtitle {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.test-category-hero .hero-description {
  font-size: 1rem;
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.test-category-hero .hero-stats {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.test-category-hero .hero-stats strong {
  display: block;
  font-size: 1.3rem;
}

.test-category-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: #f5f7ff;
  border-bottom: 1px solid #e0e7ff;
}

.highlight-chip {
  padding: 0.5rem 0.9rem;
  background: #fff;
  border-radius: 999px;
  color: #4a5ee5;
  font-size: 0.85rem;
  border: 1px solid rgba(74, 94, 229, 0.3);
}

.test-category-list {
  padding: 2.5rem 1rem;
  max-width: 1140px;
  margin: 0 auto;
}

.test-category-list .list-header {
  text-align: left;
  margin-bottom: 1.5rem;
}

.test-category-list .list-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
}

.test-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.test-category-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(15, 34, 72, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.test-category-card .card-subtitle {
  color: #4a5568;
  min-height: 48px;
}

.test-category-card .card-meta {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  color: #6b7280;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.test-category-card .card-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.test-category-pagination {
  margin-top: 2rem;
  text-align: center;
}

.test-category-pagination ul {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.test-category-pagination li a,
.test-category-pagination li span {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  color: #374151;
}

.test-category-pagination li span.current {
  background: #4a5ee5;
  color: #fff;
  border-color: transparent;
}

.test-category-empty {
  text-align: center;
  padding: 3rem 0;
  color: #6b7280;
}

.test-category-alt {
  padding: 2rem 1rem 4rem;
  max-width: 1140px;
  margin: 0 auto;
}

.test-category-alt h2 {
  margin-bottom: 1rem;
}

.test-category-alt .alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.test-category-alt .alt-card {
  border: 1px solid #e0e7ff;
  border-radius: 0.9rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
  background: #fff;
}

.test-category-alt .alt-card:hover {
  border-color: #7c8ffe;
  transform: translateY(-3px);
}

.test-category-alt .alt-card-body h3 {
  margin: 0.5rem 0;
}

.test-category-alt .alt-meta {
  color: #6b7280;
  font-size: 0.9rem;
}

.test-category-hero,
.test-category-highlights,
.test-category-list,
.test-category-alt {
  width: 100%;
}

@media (max-width: 768px) {
  .test-category-hero {
    padding: 3rem 1rem;
  }

  .test-category-hero h1 {
    font-size: 2.2rem;
  }

  .test-category-hero .hero-stats {
    flex-direction: column;
    gap: 0.75rem;
  }

  .test-category-card {
    padding: 1.25rem;
  }

  .test-category-card .card-actions {
    flex-direction: column;
  }
}

.test-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #5f8bff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: none;
}

/* Test detail layout */
.test-layout,
.test-quiz-layout,
.test-result-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.test-hero {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(135deg, #5b7cfa 0%, #748ffc 50%, #9775fa 100%);
  color: #fff;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.test-hero__mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.75) 100%);
}

.test-hero__content {
  position: relative;
  z-index: 2;
  max-width: 540px;
}

.paywall-hero {
  background: linear-gradient(120deg, #5f8bff, #9a77ff);
}
.paywall-card {
  background: #fff;
  border: 1px solid #eceefe;
  border-radius: 24px;
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 30px 60px rgba(20,24,62,0.08);
}
.paywall-main header h2 {
  margin-top: 0;
  font-size: 1.2rem;
}
.paywall-benefits {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: #555;
}
.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.paywall-price {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}
.paywall-price span {
  font-size: 1rem;
  margin-right: 0.35rem;
  color: #6b7280;
}
.paywall-status {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #f5f7ff;
  color: #3d4470;
}
.paywall-status.success {
  background: #ecfdf5;
  color: #047857;
}
.paywall-status.error {
  background: #fef2f2;
  color: #b91c1c;
}
.paywall-side {
  background: #f9f9ff;
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 280px;
  text-align: center;
}
.paywall-qrcode img {
  max-width: 220px;
  border-radius: 20px;
  border: 10px solid #fff;
  box-shadow: 0 12px 30px rgba(44,62,100,0.2);
}
.paywall-h5 button {
  width: 100%;
}
.paywall-progress {
  font-size: 0.95rem;
  color: #4b5563;
}
.paywall-side .is-hidden {
  display: none;
}
@media (max-width: 960px) {
  .paywall-card {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .paywall-side {
    min-height: auto;
  }
}

.test-subtitle {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.test-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.test-meta li {
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.15);
  padding: 0.7rem 1rem;
  border-radius: 12px;
  min-width: 120px;
}

.test-meta__label {
  font-size: 0.8rem;
  display: block;
  opacity: 0.8;
}

.test-cta-group {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.test-overview,
.test-sibling,
.result-detail {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #eee;
  margin-bottom: 1.5rem;
}

.test-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.test-tags span {
  padding: 0.3rem 0.8rem;
  background: #f0f4ff;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #375fff;
}

.test-summary {
  font-size: 1rem;
  color: #555;
  margin-top: 1rem;
}

.test-highlight-grid,
.result-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.test-highlight-card,
.result-insight-grid article {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 1rem;
  background: #fafafa;
  min-height: 120px;
}

.test-highlight-card .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5f8bff;
  margin-right: 0.4rem;
}

.test-sibling-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.test-sibling-card {
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  min-height: 180px;
}

.my-tests {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.my-tests-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.my-tests-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  color: #111827;
}

.my-tests .test-label {
  display: block;
  margin-bottom: 0.35rem;
}

.my-tests-body {
  min-height: 140px;
}

.my-tests-empty {
  background: #f5f7ff;
  border-radius: 14px;
  padding: 2rem 1rem;
  text-align: center;
}

.my-tests-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.my-tests-card {
  border: 1px solid #e5e8ff;
  border-radius: 16px;
  padding: 1.25rem;
  background: #fafbff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 200px;
}

.my-tests-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #1f2937;
}

.my-tests-type {
  font-size: 0.95rem;
  color: #5f8bff;
  font-weight: 600;
}

.my-tests-time {
  font-size: 0.9rem;
  color: #6b7280;
}

.my-tests-actions {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.my-tests-header-actions {
  display: flex;
  align-items: flex-start;
}

.my-tests-header-actions .ghost-btn {
  min-width: 130px;
}

.my-tests-actions .hero-btn,
.my-tests-actions .ghost-btn {
  flex: 1;
  text-align: center;
}

@media (max-width: 768px) {
  .my-tests {
    padding: 1.25rem;
  }

  .my-tests-header {
    flex-direction: column;
    align-items: stretch;
  }

  .my-tests-header-actions {
    width: 100%;
  }

  .my-tests-header-actions .ghost-btn {
    width: 100%;
    text-align: center;
  }

  .my-tests-list {
    grid-template-columns: 1fr;
  }

  .my-tests-actions {
    flex-direction: column;
  }
}

.test-sibling-card__footer a {
  font-weight: 600;
  color: #5f8bff;
}

.test-articles {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #eee;
  margin-bottom: 1.5rem;
}

.test-article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.test-article-card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 1rem;
  background: #fcfcfc;
}

.test-article-card a {
  color: #4a5ee5;
  font-weight: 600;
}

/* Quiz */
.test-quiz-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.quiz-progress {
  flex: 1;
}

.quiz-progress__track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #f0f0f0;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.quiz-progress__bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  width: 0;
  background: linear-gradient(135deg, #5f8bff, #8f6bff);
  transition: width 0.3s ease;
}

.quiz-hero {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #eee;
  margin-bottom: 1.5rem;
}

.quiz-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 1.5rem;
  display: none;
}

.quiz-card.is-active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.quiz-card__index {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.4rem;
}

.quiz-options {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.quiz-options label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid #eee;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quiz-options input {
  accent-color: #5f8bff;
}

.quiz-options input:checked + span,
.quiz-options label:hover span {
  color: #111;
  font-weight: 600;
}

.quiz-options label:hover {
  border-color: #5f8bff;
  box-shadow: 0 8px 20px rgba(95, 139, 255, 0.1);
}

.quiz-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Result page */
.result-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.result-hero h1 {
  margin-bottom: 0.4rem;
}

.result-score-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #eee;
  margin-bottom: 1.5rem;
}

.result-score {
  text-align: center;
}

.result-score strong {
  display: block;
  font-size: 3rem;
  color: #5f8bff;
}

.result-score-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.result-description {
  font-size: 1rem;
  color: #444;
}

.result-empty {
  text-align: center;
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid #eee;
  margin-bottom: 1.5rem;
}

.result-dimension-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.dimension-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-chart {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-share {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-share-link {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid #ddd;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .home-wrapper {
    grid-template-columns: 1fr;
  }

  .test-hero,
  .test-layout,
  .test-quiz-layout,
  .test-result-layout {
    padding: 1.5rem;
  }

  .quiz-actions {
    flex-direction: column;
  }

  .result-score-panel {
    flex-direction: column;
  }
}

/* 🔧 Lazy Loading Image Optimization */
img[data-src],
img.lazy-loading {
  background-color: #f0f0f0;
  background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

img.loaded {
  background: none;
  background-image: none;
  animation: none;
  opacity: 1;
}

img.load-error {
  background: #f5f5f5;
  animation: none;
  opacity: 0.5;
  border: 1px solid #ddd;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 🔧 CLS Prevention: Image Placeholder */
.image-placeholder {
  background: #f0f0f0;
  width: 100%;
  height: 0;
}
