/* User frontend common styles */
:root {
  --bg: #0a0a0c;
  --bg-card: #141418;
  --border: #2a2a2e;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --gold: #d4a853;
  --gold-hover: #c49b47;
  --success: #22c55e;
  --danger: #ef4444;
}
body { font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; }
.has-token #needLogin { display: none !important; }
.page-wrap { background-color: var(--bg); background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 48px 48px; }
body:not(.page-wrap) { background-color: var(--bg); background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 48px 48px; }
input, select, textarea, button { font-family: inherit; }
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; text-decoration: none; }
.muted { color: var(--text-muted); font-size: 13px; }
.hidden { display: none !important; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; color: var(--gold); text-decoration: none; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; color: var(--gold-hover); }
.brand-logo { height: 28px; width: auto; vertical-align: middle; }

.header { border-bottom: 1px solid var(--border); background: rgba(20,20,24,0.9); backdrop-filter: blur(8px); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-links { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nav-links a, .nav-links button { padding: 8px 16px; border-radius: 10px; font-weight: 500; font-size: 14px; text-decoration: none; border: none; cursor: pointer; transition: background 0.2s, color 0.2s; }
.nav-links .nav-link { color: var(--text-muted); background: var(--border); }
.nav-links .nav-link:hover { color: var(--text); background: #3f3f46; }
.nav-links .nav-link:active, .nav-links .nav-link.active { color: var(--gold); background: rgba(212,168,83,0.15); }
.btn-login { padding: 8px 20px; background: var(--gold); color: #0a0a0c; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; border: none; cursor: pointer; }
.btn-login:hover { background: var(--gold-hover); color: #0a0a0c; }
.btn-logout { padding: 8px 20px; background: var(--danger); color: #fff; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; border: none; cursor: pointer; }
.btn-logout:hover { background: #dc2626; color: #fff; }
.nav .accent { color: var(--gold); background: var(--border); }
.nav .accent:hover { color: var(--gold-hover); background: rgba(212,168,83,0.15); }
.nav .accent:active, .nav .accent.active { color: var(--gold); background: rgba(212,168,83,0.2); }

.user-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.user-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.user-modal-box {
  width: 90%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.user-modal-box .user-modal-msg {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 20px;
  white-space: pre-wrap;
  word-break: break-word;
}
.user-modal-box .user-modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.user-modal-box .user-modal-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--border);
  color: var(--text);
}
.user-modal-box .user-modal-btn:hover {
  background: #3f3f46;
}
.user-modal-box .user-modal-btn.primary {
  background: var(--accent);
  color: #fff;
}
.user-modal-box .user-modal-btn.primary:hover {
  background: var(--accent-hover);
}
.user-modal-box .user-modal-btn.danger {
  background: var(--danger);
  color: #fff;
}
.user-modal-box .user-modal-btn.danger:hover {
  background: #dc2626;
}
.user-modal-key-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 12px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
}
.user-modal-key-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.user-footer {
  margin-top: auto;
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.user-footer a { color: var(--text-muted); }
.user-footer a:hover { color: var(--text); }
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.page-wrap main { flex: 1; }

/* 统一所有页面的标题栏与主区域宽度 */
.page-wrap .header .container { max-width: 1000px; width: 100%; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.page-wrap .main-wrap { max-width: 1000px; width: 100%; margin: 0 auto; padding: 32px 24px; box-sizing: border-box; }
.user-page .container { max-width: 1000px; width: 100%; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.user-page .main-wrap { max-width: 1000px; width: 100%; margin: 0 auto; padding: 32px 24px; box-sizing: border-box; }

.brand-white { color: #fff !important; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-white:hover { color: rgba(255,255,255,0.9) !important; text-decoration: none; }
.brand-white img { flex-shrink: 0; height: 32px; width: auto; vertical-align: middle; }
