/* ── Header（桌面端）模块：桌面导航、语言、下载、用户下拉 ── */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-sizing: border-box;
  height: 71px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px max(32px, calc((100vw - 1200px) / 2));
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.top-header-left {
  display: flex;
  align-items: center;
  gap: 40px;
  min-width: 0;
}

/* Logo */
.top-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  width: auto;
  min-width: 98px;
}

.top-header-logo > img {
  display: block;
  width: 97.888px;
  height: 32px;
  object-fit: contain;
}

.top-header-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 6.72px;
  background: linear-gradient(225deg, #87e256 0%, #009242 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.top-header-logo-icon img {
  width: 23.75px;
  height: 23.75px;
  object-fit: contain;
  display: block;
}

.top-header-logo-text {
  height: 20px;
  width: 100px;
  flex-shrink: 0;
}

.top-header-logo-text img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Nav links */
.top-header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.top-header-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  letter-spacing: -0.15px;
  color: #101828;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.top-header-nav a:hover {
  color: #101828;
  background: rgba(16, 24, 40, 0.06);
}

/* Right actions */
.top-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.top-header-language-wrap {
  position: relative;
  flex-shrink: 0;
}

.top-header-language-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 33px;
  min-width: 58px;
  padding: 6px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #101828;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  letter-spacing: -0.15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.top-header-language-btn:hover,
.top-header-language-btn[aria-expanded="true"] {
  background: rgba(16, 24, 40, 0.06);
}

.top-header-language-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-header-language-current {
  min-width: 18px;
  text-align: center;
}

.top-header-language-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 156px;
  padding: 6px;
  background: #fff;
  border: 1px solid #ebedf4;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 11;
}

.top-header-language-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.top-header-language-option {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #101828;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-header-language-option:hover,
.top-header-language-option.is-active {
  background: rgba(16, 24, 40, 0.06);
  color: #101828;
}

[dir="rtl"] .top-header-language-menu {
  right: auto;
  left: 0;
  direction: rtl;
}

[dir="rtl"] .top-header-language-option {
  justify-content: flex-start;
  text-align: right;
  direction: rtl;
}

.top-header-btn-login,
.top-header-btn-download {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 39px;
  border-radius: 14px;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  letter-spacing: -0.15px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.top-header-btn-login {
  min-width: auto;
  padding: 9px 24px;
  border: 1px solid #ebedf4;
  background: #fff;
  color: #101828;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.top-header-btn-login:hover {
  background: #f9fafb;
  border-color: #d7dbe7;
  color: #101828;
}

.top-header-btn-download {
  gap: 8px;
  width: 141px;
  padding: 9px 24px;
  border: none;
  outline: none;
  background: linear-gradient(172deg, #b05500 12.706%, #d97a2c 87.294%);
  box-shadow: 0 4px 12px rgba(176, 85, 0, 0.35);
  color: #fff;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.top-header-btn-download:hover {
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(176, 85, 0, 0.32);
}

.top-header-btn-download-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-header-btn-download-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}


/* ── Download Dropdown ── */
/* ── Download Dropdown ── */
.top-header-download-wrap {
  position: relative;
}

.top-header-download-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 220px;
  background: #111418;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 10;
}

.top-header-download-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

[dir="rtl"] .top-header-download-dropdown {
  left: 0;
  right: auto;
  direction: rtl;
}

.top-header-dl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-family: Inter, "Segoe UI", sans-serif;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.top-header-dl-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.top-header-dl-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

[dir="rtl"] .top-header-dl-item {
  flex-direction: row;
  text-align: right;
  direction: rtl;
}


/* ── User Avatar & Dropdown ── */
/* ── User Avatar & Dropdown ── */
.top-header-user-wrap {
  position: relative;
}

.top-header-user-avatar-btn {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
  flex-shrink: 0;
}

.top-header-user-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.top-header-user-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #00a854 0%, #33cc77 100%);
  border-radius: 50%;
  text-transform: uppercase;
}

.top-header-user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 180px;
  background: #111418;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 10;
}

.top-header-user-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.top-header-user-info {
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 6px;
}

.top-header-user-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 148px;
}

.top-header-user-mail {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 148px;
  margin-top: 2px;
}

.top-header-user-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-family: Inter, "Segoe UI", sans-serif;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-header-user-logout-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

[dir="rtl"] .top-header-user-logout-btn svg {
  transform: scaleX(-1);
}

