/* ── 全局变量 & Reset ───────────────────────────────────── */
:root {
  --bg:        #0a0a0a;
  --surface:   #111111;
  --surface2:  #1a1a1a;
  --border:    #2a2a2a;
  --text:      #f0f0f0;
  --text-dim:  #888;
  --accent:    #f5c842;
  --radius:    12px;
  --radius-sm: 8px;
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── 导航 ───────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── 语言切换器 ─────────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 2px;
  border: 1px solid var(--border);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  color: var(--bg);
}

.btn-nav-history {
  padding: 7px 14px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-nav-history:hover { color: var(--text); border-color: var(--text-dim); }

.btn-nav-cta {
  padding: 8px 18px;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn-nav-cta:hover { opacity: 0.85; }

.nav-user { display: flex; align-items: center; }

/* ── 账号下拉菜单 ────────────────────────────────────────── */
.account-wrap {
  position: relative;
}

.account-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.account-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.account-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-globe {
  font-size: 20px;
  line-height: 1;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 0;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.dropdown-user-info {
  padding: 10px 16px 8px;
}

.dropdown-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--surface2); }

.dropdown-item-icon { font-size: 15px; }

.dropdown-lang-row {
  justify-content: space-between;
  cursor: default;
}
.dropdown-lang-row:hover { background: none; }

.dropdown-lang-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.dlang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.dlang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

.dropdown-signout { color: #e05555; }
.dropdown-signout:hover { background: rgba(224,85,85,0.08); }

/* ── 按钮 ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 14px 28px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── 首页 Navbar 右侧：语言 + 会员 + 登录/头像 ─────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 语言下拉按钮 */
.nav-lang-wrap {
  position: relative;
}

.nav-lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-lang-btn:hover { color: var(--text); border-color: var(--text-dim); }
.nav-lang-btn .nav-lang-arrow { font-size: 10px; opacity: 0.6; }

.nav-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.nav-lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.nav-lang-option:hover { background: var(--surface2); }
.nav-lang-option.active { color: var(--accent); }
.nav-lang-option .nav-lang-check { font-size: 12px; color: var(--accent); }

/* 会员/定价按钮 */
.btn-nav-pricing {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.btn-nav-pricing:hover { color: var(--text); border-color: var(--text-dim); }

/* 已有会员时的高亮 */
.btn-nav-plan {
  padding: 7px 14px;
  background: rgba(245, 200, 66, 0.1);
  border: 1px solid rgba(245, 200, 66, 0.35);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.btn-nav-plan:hover { background: rgba(245, 200, 66, 0.18); }

/* 未登录的登录按钮 */
.btn-nav-signin {
  padding: 7px 16px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-nav-signin:hover { opacity: 0.85; }

/* analyze/history 页头像下拉：会员 badge */
.dropdown-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(245, 200, 66, 0.15);
  color: var(--accent);
  border: 1px solid rgba(245, 200, 66, 0.3);
  margin-left: 6px;
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ── Loading dots ────────────────────────────────────────── */
.loading-dots::after {
  content: '...';
  animation: blink 1.2s steps(3, end) infinite;
}
@keyframes blink {
  0%, 100% { content: '.'; }
  33%       { content: '..'; }
  66%       { content: '...'; }
}

.hidden { display: none !important; }
