:root {
  --mint: #3eb489;
  --mint-dark: #31997f;
  --bg-light: #d0f0e8;
  --bg-dark: #1c1c1c;
  --text-light: #333;
  --text-dark: #f0f0f0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
  background: var(--bg-light);
  color: var(--text-light);
  margin: 0;
  padding: 0;
  text-align: left;
  transition: background 0.3s, color 0.3s;
  position: relative;
}

body.has-dynamic-bg {
  background: transparent;
}

body.has-dynamic-bg::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--dynamic-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(1.5px);
  opacity: 0.4;
  z-index: -2;
  transition: opacity 1s ease-in-out;
}

body.has-dynamic-bg::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(208, 240, 232, 0.85), rgba(62, 180, 137, 0.15));
  z-index: -1;
}

body.dark-mode.has-dynamic-bg::after {
  background: linear-gradient(135deg, rgba(28, 28, 28, 0.9), rgba(62, 180, 137, 0.2));
}

body.dark-mode {
  background: var(--bg-dark);
  color: var(--text-dark);
}

header {
  background-color: rgba(62, 180, 137, 0);
  color: var(--text-light);
  padding: 15px 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

header .header-left {
  display: none;
}

header .base-btn {
  background-color: rgba(62, 180, 137, 0);
  color: var(--text-light);
  flex-shrink: 1;
  min-width: auto;
}

body.dark-mode header .base-btn {
  color: var(--text-dark);
}

header .header-right {
  width: auto;
  gap: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

a {
  text-decoration: none;
  color: var(--mint);
}

.header-left {
  width: 100%;
  flex-shrink: 0;
}

.header-left h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left h1 svg {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.base-btn {
  padding: 10px 16px;
  border: none;
  background-color: var(--mint);
  color: #fff;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  white-space: nowrap;
  box-sizing: border-box;
}

.base-btn:hover {
  background-color: var(--mint-dark);
  transform: scale(1.05);
}

.dark-mode .base-btn {
  color: var(--text-dark);
}

.dark-mode .base-btn:hover {
  color: var(--text-dark);
}

#theme-toggle .mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
}

#theme-toggle svg {
  width: 1.2em;
  height: 1.2em;
  display: block;
}

#theme-toggle .icon-moon {
  display: none;
}

#theme-toggle .icon-sun {
  display: block;
}

body.dark-mode #theme-toggle .icon-moon {
  display: block;
}

body.dark-mode #theme-toggle .icon-sun {
  display: none;
}

.api-section {
  margin: 20px auto;
  max-width: 800px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background 0.3s, color 0.3s;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  width: 100%;
}

.dark-mode .api-section {
  background: rgba(43, 43, 43, 0.95);
  color: var(--text-dark);
}

.en-hidden {
  display: none;
}

.inline-icon-svg {
  width: 1.2em;
  height: 1.2em;
  display: inline;
  margin-right: 8px;
  vertical-align: -0.125em;
}

.small-icon {
  width: 1em;
  height: 1em;
  vertical-align: text-bottom;
  display: inline-block;
  margin-right: 0.3em;
}

.small-icon-svg {
  width: 1em;
  height: 1em;
  display: inline;
  margin-right: 5px;
  vertical-align: -0.125em;
}

footer {
  padding: 20px 15px;
  text-align: center;
  margin-top: 30px;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

footer h4 {
  color: var(--text-light);
  margin: 10px 0;
  font-size: 16px;
}

.dark-mode footer h4 {
  color: var(--text-dark);
}

footer > div > a,
.footer-contact a,
.footer-icp a,
.footer-sitemap a,
.footer-links a {
  color: var(--mint);
  text-decoration: none;
  transition: color 0.3s, text-decoration 0.3s;
}

footer > div > a:hover,
.footer-contact a:hover,
.footer-icp a:hover,
.footer-sitemap a:hover,
.footer-links a:hover {
  color: var(--mint-dark);
  text-decoration: underline;
}

.dark-mode footer > div > a,
.dark-mode .footer-contact a,
.dark-mode .footer-icp a,
.dark-mode .footer-sitemap a,
.dark-mode .footer-links a {
  color: var(--mint-dark);
}

.dark-mode footer > div > a:hover,
.dark-mode .footer-contact a:hover,
.dark-mode .footer-icp a:hover,
.dark-mode .footer-sitemap a:hover,
.dark-mode .footer-links a:hover {
  color: var(--mint);
  text-decoration: underline;
}

.footer-contact,
.footer-icp,
.footer-sitemap {
  color: var(--mint);
  font-size: 14px;
  margin-top: 15px;
  display: block;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  line-height: 1;
  padding: 0 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 0;
  transform: translateY(0.15em);
  font-weight: 500;
}

.footer-links a img {
  width: 1em;
  height: 1em;
  margin-right: 5px;
  display: block;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  header {
    padding: 12px 15px;
    gap: 8px;
  }

  .header-right {
    width: 100%;
    justify-content: center;
    gap: 6px;
  }

  .header-right .base-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  header {
    padding: 10px 12px;
    gap: 6px;
  }

  .header-right .base-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .footer-links {
    gap: 10px;
    padding: 0 5px;
  }
}