:root {
  --bg-gradient: linear-gradient(135deg, #0f172a, #1e293b);
  --card-bg: rgba(255, 255, 255, 0.08);
  --text-main: #ffffff;
  --text-sub: #cbd5e1;
  --input-bg: rgba(255, 255, 255, 0.92);
  --input-text: #111827;
  --btn-bg: #facc15;
  --btn-text: #111827;
  --label-color: #e2e8f0;
  --analysis-bg: rgba(255, 255, 255, 0.06);
  --set-title-color: #fde68a;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  --footer-bg: rgba(15, 23, 42, 0.8);
}

[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-sub: #475569;
  --input-bg: #f8fafc;
  --input-text: #1e293b;
  --btn-bg: #2563eb;
  --btn-text: #ffffff;
  --label-color: #334155;
  --analysis-bg: #f1f5f9;
  --set-title-color: #1e40af;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  --footer-bg: rgba(226, 232, 240, 0.8);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 20px;
  transition: background 0.3s, color 0.3s;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 24px 100px 24px; /* Added bottom padding for footer */
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.nav-menu {
  display: flex;
  gap: 10px;
}

.nav-btn {
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--text-sub);
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--text-sub);
  color: #1e293b;
}

.nav-btn.active {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--btn-bg);
}

.settings-group {
  display: flex;
  gap: 10px;
}

.control-btn {
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--text-sub);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.control-btn:hover {
  background: var(--text-sub);
  color: #1e293b;
}

.card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

h1 {
  margin: 0 0 10px;
  font-size: 34px;
  text-align: center;
}

h2 {
  font-size: 24px;
  margin: 30px 0 15px;
  color: var(--set-title-color);
}

h3 {
  font-size: 18px;
  margin: 20px 0 10px;
}

.sub {
  text-align: center;
  color: var(--text-sub);
  margin-bottom: 28px;
  line-height: 1.6;
}

.main-content {
  color: var(--text-main);
  line-height: 1.7;
  font-size: 16px;
}

.seo-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--analysis-bg);
  line-height: 1.8;
}

.seo-section p {
  margin-bottom: 15px;
}

footer {
  margin-top: 60px;
  text-align: center;
  padding: 30px 20px;
  background: var(--footer-bg);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-sub);
}

.footer-links {
  margin-bottom: 15px;
}

.footer-links a {
  color: var(--text-main);
  text-decoration: none;
  margin: 0 10px;
}

.footer-links a:hover {
  text-decoration: underline;
}

.third-party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.third-party-card {
  background: var(--card-bg);
  border: 1px solid var(--analysis-bg);
  border-radius: 16px;
  padding: 20px;
}

.third-party-card .service-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.third-party-card .service-icon {
  font-size: 24px;
}

.third-party-card .service-name {
  font-weight: bold;
  font-size: 16px;
  color: var(--set-title-color);
}

.third-party-card .service-tag {
  display: inline-block;
  font-size: 11px;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: auto;
}

.third-party-card p {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
  margin: 0;
}

.disqus-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--analysis-bg);
}

.disqus-section h3 {
  font-size: 18px;
  color: var(--set-title-color);
  margin-bottom: 16px;
}

.tm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

@media (max-width: 760px) {
  h1 {
    font-size: 28px;
  }

  .controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-menu {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
  }

  .third-party-grid {
    grid-template-columns: 1fr;
  }
}
