@font-face {
  font-family: "Jura";
  font-display: swap;
  src: url(../fonts/jura.woff2)
}

@font-face {
  font-family: "Merriweather";
  font-display: swap;
  src: url(../fonts/merriweather.woff2)
}

:root {
  --bg-body: #F9FAFB;
  --bg-card: #FFFFFF;
  --bg-toc: #F3F4F6;
  --text-main: #111827;
  --text-muted: #6B7280;
  --accent: #2563EB;
  --accent-hover: #1d4ed8;
  --border: #E5E7EB;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --transition: all 0.3s ease
}

[data-theme="dark"] {
  --bg-body: #111111;
  --bg-card: #1E1E1E;
  --bg-toc: #161616;
  --text-main: #C1C1C1;
  --text-muted: #9CA3AF;
  --accent: #60A5FA;
  --accent-hover: #3b82f6;
  --border: #374151;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5)
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

body {
  word-break: break-word;
  font: 1rem/1.8 "Merriweather", serif;
  background: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.3s, color 0.3s
}

a {
  text-decoration: none
}

ul,
ol {
  list-style: none
}

button {
  cursor: pointer;
  border: none;
  background: #fff0;
  font-family: "Jura", sans-serif;
  color: inherit
}

pre,
code {
  font-size: .95;
  font-family: Courier;
  background: var(--bg-card);
  overflow-x: auto;
  white-space: pre;
  width: 100%;
  box-sizing: border-box
}

pre {
  user-select: all;
  padding: 1rem;
  margin-top: 1.8rem;
  border-left: 2px solid var(--border);
  font-family: Courier
}

h1,
h2,
h3,
h4,
.logo {
  font-family: 'Merriweather', serif;
  color: var(--text-main)
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px
}

.theme-toggle {
  background: #fff0;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: .5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  transition: var(--transition)
}

.theme-toggle:hover {
  background: var(--border)
}

.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.6rem
}

.article-header {
  border-bottom: 1px solid var(--border)
}

.article-title {
  font-size: 1.8rem
}

.meta-top {
  margin-top: .4rem;
  font-size: .75rem;
  font-family: 'Jura', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px
}

.category-tag {
  color: var(--accent);
  margin-right: 10px
}

.meta-date {
  color: var(--text-muted)
}

.toc-box {
  border-bottom: 1px solid var(--border);
  margin-top: 1.8rem;
  padding-bottom: 1.8rem
}

.toc-title {
  font-size: 1.1rem;
  font-family: 'Jura', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px
}

.toc-list a {
  display: block;
  padding: 4px 0 4px 15px;
  margin-top: .4rem;
  color: var(--text-muted);
  position: relative;
  font-size: .95rem
}

.toc-list a::before {
  content: '›';
  position: absolute;
  left: 0;
  font-weight: 700
}

.toc-list a:hover {
  text-decoration: underline;
  color: var(--accent-hover)
}

.toc-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer
}

.toc-toggle-btn {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  padding: 0 10px
}

.toc-box.collapsed .toc-toggle-btn {
  transform: rotate(-90deg)
}

.toc-list {
  max-height: auto;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.4s ease;
  opacity: 1
}

.toc-box.collapsed .toc-list {
  max-height: 0;
  opacity: 0
}

.content-body p {
  margin-top: 1.8rem;
  text-align: justify;
  line-height: 2
}

.content-body h2 {
  margin: 1.8rem 0;
  font-size: 1.4rem
}

.content-body h3 {
  margin: 1.8rem 0;
  font-size: 1.2rem
}

.content-body ul,
.content-body ol {
  list-style: disc;
  margin: 0
}

.content-body li {
  margin: .8rem 1.8rem 0;
  text-align: justify
}

.content-body a {
  font-size: .8rem;
  color: var(--accent)
}

hr {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 1.8rem 0
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  margin: 1.8rem 0;
  box-shadow: var(--shadow)
}

table {
  border-collapse: collapse;
  font-size: .75rem;
  background: var(--bg-card);
  min-width: 900px;
  width: 100%
}

thead {
  background: var(--bg-toc)
}

th {
  font-family: "Jura", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: .85rem;
  color: var(--text-main);
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border)
}

td {
  padding: 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border)
}

tr:last-child td {
  border-bottom: none
}

tbody tr:nth-child(even) {
  background-color: rgb(0 0 0 / .02)
}

[data-theme="dark"] tbody tr:nth-child(even) {
  background-color: rgb(255 255 255 / .02)
}

tbody tr:hover {
  background-color: rgb(0 0 0 / .04);
  transition: background-color 0.2s ease
}

[data-theme="dark"] tbody tr:hover {
  background-color: rgb(255 255 255 / .05)
}

.share-container {
  margin-top: 1.8rem;
  border-top: 1px solid var(--border);
  padding-top: 1.8rem;
  text-align: center
}

.share-title {
  font-weight: 700;
  margin-bottom: 1.8rem;
  font-size: 1.2rem
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap
}

.share-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text-main);
  padding: .8rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 600;
  transition: var(--transition)
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px)
}

.related-section {
  margin-top: 1.8rem;
  padding-top: 1.8rem;
  margin-bottom: 1.8rem;
  border-top: 1px solid var(--border)
}

.related-header {
  margin-bottom: 1.8rem
}

.related-grid {
  display: grid;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
  box-shadow: var(--shadow)
}

.related-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent)
}

.related-category {
  font-size: .75rem;
  color: var(--accent);
  margin-bottom: .75rem;
  font-family: 'Jura', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px
}

.related-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.related-excerpt {
  font-size: .9rem;
  color: var(--text-muted);
  font-family: "Jura", sans-serif;
  margin-bottom: .4rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.related-meta {
  display: flex;
  justify-content: space-between;
  font-family: "Jura", sans-serif;
  font-size: .8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: .4rem
}

.read-more-btn {
  color: var(--accent);
  font-weight: 600
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column
}

.banner-wrapper {
  background: var(--bg-toc);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.4s ease-out
}

.banner-content-box {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: "Jura", sans-serif
}

.banner-cta-btn {
  background: var(--accent);
  color: #fff;
  padding: .4rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 700;
  transition: var(--transition)
}

.banner-cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px)
}

.banner-close-btn {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-left: auto
}

.affiliate-section {
  margin-top: 1.8rem;
  padding: 1.8rem;
  background: var(--bg-toc);
  border-radius: var(--radius)
}

.affiliate-label {
  font-family: 'Jura', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  display: block;
  text-align: center
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.8rem
}

.aff-card {
  background: var(--bg-card);
  padding: 1.8rem;
  border-radius: 8px;
  text-align: center;
  transition: var(--transition);
  display: flex;
  border: 1px solid #fff0;
  flex-direction: column;
  align-items: center
}

.aff-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow)
}

.aff-img {
  width: 60px;
  height: 60px;
  background: var(--border);
  border-radius: 50%;
  margin-top: .4rem;
  object-fit: cover
}

.aff-title {
  color: var(--text-main);
  font-size: .95rem;
  font-weight: 700;
  margin-top: .4rem
}

.aff-btn {
  font-size: .8rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: auto
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / .6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  backdrop-filter: blur(2px)
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible
}

.modal-content {
  background: var(--bg-card);
  width: 90%;
  max-width: 500px;
  padding: 1.8rem;
  border-radius: var(--radius);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.4s ease;
  box-shadow: 0 10px 25px rgb(0 0 0 / .2);
  text-align: center;
  border: 1px solid var(--border)
}

.modal-overlay.show .modal-content {
  transform: translateY(0)
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  color: var(--text-muted)
}

.modal-title {
  font-size: 1.4rem;
  margin-bottom: .6rem
}

.modal-body {
  margin-bottom: 1rem;
  color: var(--text-muted)
}

.modal-cta {
  background: var(--accent);
  color: #fff;
  padding: .8rem 2rem;
  border-radius: 30px;
  font-weight: 700;
  display: inline-block;
  font-family: 'Jura', sans-serif
}

.modal-cta:hover {
  background: var(--accent-hover)
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px)
  }
  
  to {
    opacity: 1;
    transform: translateY(0)
  }
}

footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
  font-family: "Jura", sans-serif
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center
}

.social-links a {
  margin: 0 10px;
  font-weight: 500;
  color: var(--text-main)
}

.social-links a:hover {
  color: var(--accent)
}

#toast {
  visibility: hidden;
  background: var(--text-main);
  color: var(--bg-body);
  padding: 12px;
  border-radius: 8px;
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  opacity: 0;
  transition: 0.3s;
  z-index: 1000
}

#toast.show {
  visibility: visible;
  opacity: 1
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 900;
  box-shadow: var(--shadow)
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0)
}

.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-5px)
}

.skeleton {
  background: var(--border);
  height: 200px;
  border-radius: var(--radius);
  animation: pulse 2s infinite
}

@keyframes pulse {

  0%,
  100% {
    opacity: .4
  }
  
  50% {
    opacity: .1
  }
}

@media (max-width:768px) {
  .article-title {
    font-size: 1.6rem
  }
  
  .content-body p,
  .content-body li {
    text-align: left
  }
  
  .banner-content-box {
    flex-wrap: wrap;
    text-align: left;
    gap: .5rem;
    justify-content: space-between
  }
  
  .banner-text {
    width: 100%;
    margin-bottom: .25rem
  }
  
  .banner-close-btn {
    margin-left: 0
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px
  }
}