
:root {
  --bg: #eef4ff;
  --surface: #ffffff;
  --surface-soft: #f4f7ff;
  --surface-strong: #f8fbff;
  --text: #111827;
  --muted: #556a81;
  --border: rgba(96, 108, 132, 0.16);
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 30px rgba(15, 23, 42, 0.08);
  --accent: #4f67ff;
  --accent-soft: rgba(79, 103, 255, 0.16);
  --button-bg: #4f67ff;
  --button-text: #ffffff;
  --hero-bg: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,246,255,0.95));
  --page-tone: rgba(79, 103, 255, 0.08);
  --header-bg: rgba(255, 255, 255, 0.88);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --card-bg: #ffffff;
  --card-border: rgba(96, 108, 132, 0.12);
  --radius: 34px;
}

html.dark {
  --bg: #0b1223;
  --surface: #111827;
  --surface-soft: #181f2f;
  --surface-strong: #1f293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.15);
  --accent: #7c9cff;
  --accent-soft: rgba(124, 156, 255, 0.18);
  --button-bg: #7c9cff;
  --button-text: #111827;
  --hero-bg: linear-gradient(180deg, rgba(17,24,39,0.96), rgba(24,32,46,0.95));
  --page-tone: rgba(79, 103, 255, 0.12);
  --header-bg: rgba(17, 24, 39, 0.94);
  --nav-bg: rgba(255, 255, 255, 0.08);
  --card-bg: #111827;
  --card-border: rgba(148, 163, 184, 0.16);
}

body.discipline-1 {
  --accent: #dc2626;
  --accent-soft: rgba(220, 38, 38, 0.16);
  --page-tone: rgba(254, 226, 226, 0.28);
  --nav-bg: rgba(220, 38, 38, 0.14);
  --header-bg: rgba(254, 226, 226, 0.18);
  --button-bg: #dc2626;
  --button-text: #ffffff;
  --card-border: rgba(220, 38, 38, 0.16);
}

body.discipline-2 {
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.16);
  --page-tone: rgba(219, 234, 254, 0.28);
  --nav-bg: rgba(37, 99, 235, 0.14);
  --header-bg: rgba(219, 234, 254, 0.18);
  --button-bg: #2563eb;
  --button-text: #ffffff;
  --card-border: rgba(37, 99, 235, 0.16);
}

body.discipline-3 {
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.16);
  --page-tone: rgba(254, 243, 199, 0.28);
  --nav-bg: rgba(217, 119, 6, 0.14);
  --header-bg: rgba(254, 243, 199, 0.18);
  --button-bg: #d97706;
  --button-text: #ffffff;
  --card-border: rgba(217, 119, 6, 0.16);
}

body.discipline-4 {
  --accent: #16a34a;
  --accent-soft: rgba(22, 163, 74, 0.16);
  --page-tone: rgba(209, 250, 229, 0.28);
  --nav-bg: rgba(22, 163, 74, 0.14);
  --header-bg: rgba(209, 250, 229, 0.18);
  --button-bg: #16a34a;
  --button-text: #ffffff;
  --card-border: rgba(22, 163, 74, 0.16);
}

html.dark body.discipline-1 {
  --accent: #fca5a5;
  --accent-soft: rgba(248, 113, 113, 0.14);
  --page-tone: rgba(220, 38, 38, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(17, 24, 39, 0.94);
  --button-bg: #fb7185;
  --button-text: #111827;
}

html.dark body.discipline-2 {
  --accent: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --page-tone: rgba(37, 99, 235, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(17, 24, 39, 0.94);
  --button-bg: #60a5fa;
  --button-text: #111827;
}

html.dark body.discipline-3 {
  --accent: #fdba74;
  --accent-soft: rgba(251, 146, 60, 0.14);
  --page-tone: rgba(217, 119, 6, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(17, 24, 39, 0.94);
  --button-bg: #f59e0b;
  --button-text: #111827;
}

html.dark body.discipline-4 {
  --accent: #86efac;
  --accent-soft: rgba(134, 239, 172, 0.14);
  --page-tone: rgba(22, 163, 74, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(17, 24, 39, 0.94);
  --button-bg: #4ade80;
  --button-text: #111827;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  padding-bottom: 95px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, var(--page-tone), transparent 34%),
              radial-gradient(circle at bottom right, rgba(75, 192, 192, 0.14), transparent 20%),
              var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.navbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  scroll-snap-type: x mandatory;
}

.nav-links::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--nav-bg);
  opacity: 0.35;
  pointer-events: none;
}

.nav-links a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  scroll-snap-align: start;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--button-text);
  background: var(--button-bg);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.nav-links a[data-discipline="1"] {
  color: #b91c1c;
}

.nav-links a[data-discipline="2"] {
  color: #1d4ed8;
}

.nav-links a[data-discipline="3"] {
  color: #b45309;
}

.nav-links a[data-discipline="4"] {
  color: #166534;
}

.nav-links a[data-discipline="all"] {
  color: var(--accent);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  min-width: 220px;
  width: 260px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--card-border);
}

.search-box input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0.9rem 2.8rem 0.9rem 1rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
}

button,
.controls button,
.lang-select,
.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}

button:hover,
.controls button:hover,
.lang-select:hover,
.icon-toggle:hover {
  transform: translateY(-1px);
}

.lang-select {
  min-width: 4rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--card-border);
}

main {
  max-width: 1180px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.hero {
  display: grid;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 36px;
  background: var(--hero-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.hero p {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.carousel {
  margin-top: 1.75rem;
}

.carousel-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.carousel-card,
.article-card,
.article-detail,
.no-results {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  border-radius: 30px;
}

.carousel-card {
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.carousel-card:hover {
  transform: translateY(-3px);
}

.card-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1rem;
}

.carousel-card h2,
.article-card h3,
.article-detail h1 {
  margin: 0;
  line-height: 1.2;
}

.carousel-card h2 a,
.article-card h3 a {
  color: var(--text);
}

.carousel-card p,
.article-card p,
.article-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.order-section {
  margin-top: 1.75rem;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.controls .info {
  color: var(--muted);
}

.controls select,
.controls button {
  min-width: 170px;
}

.list-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.article-card {
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
}

.article-card .meta,
.article-detail .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.article-card .meta span,
.article-detail .meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.article-card .discipline,
.article-detail .discipline {
  color: var(--surface);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
}

.article-detail {
  display: grid;
  gap: 1.5rem;
  padding: 2rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.article-detail h1,
.article-detail p,
.article-detail .meta,
.article-detail .article-content {
  color: var(--text);
}

.article-detail .discipline {
  background: var(--accent-soft);
  color: var(--accent);
}

.article-meta-wrap {
  display: grid;
  gap: 1rem;
}

.article-content {
  display: grid;
  gap: 1rem;
  color: var(--muted);
  line-height: 1.85;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}

.back-link:hover {
  transform: translateY(-1px);
}

.no-results {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.tag-1 {
  background: rgba(254, 226, 226, 0.5);
  color: #b91c1c;
}

.tag-2 {
  background: rgba(219, 234, 254, 0.65);
  color: #1d4ed8;
}

.tag-3 {
  background: rgba(254, 243, 199, 0.65);
  color: #b45309;
}

.tag-4 {
  background: rgba(209, 250, 229, 0.75);
  color: #166534;
}

.article-card[data-discipline="1"] {
  border-color: rgba(220, 38, 38, 0.16);
}

.article-card[data-discipline="2"] {
  border-color: rgba(37, 99, 235, 0.16);
}

.article-card[data-discipline="3"] {
  border-color: rgba(217, 119, 6, 0.16);
}

.article-card[data-discipline="4"] {
  border-color: rgba(22, 163, 74, 0.16);
}

.page-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 15;
  padding: 0.9rem 1.25rem;
  background: var(--header-bg);
  border-top: 1px solid var(--border);
}

.footer-bar {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.footer-link:hover {
  background: var(--surface-soft);
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .carousel-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .navbar,
  main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .search-box {
    width: 100%;
    min-width: auto;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls select,
  .controls button {
    width: 100%;
  }

  .page-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    border-top: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(18px);
  }
}
