/* ============================================
   黑白简约 · 半透明玻璃质感 · 高级动态
   主框架样式 (index.css)
   ============================================ */

:root {
  --bg-base: #050505;
  --bg-deep: #0a0a0c;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.22);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-muted: rgba(255, 255, 255, 0.38);
  --accent: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.35);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --blur: 24px;
  --window-dot-size: 11px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Consolas, Monaco, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; -ms-overflow-style: none; }

/* ===== 动态背景层 ===== */
body {
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  position: relative;
}

/* 动态渐变光斑背景 */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

body::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  top: -200px;
  left: -150px;
  animation: floatOrb1 18s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  bottom: -180px;
  right: -120px;
  animation: floatOrb2 22s ease-in-out infinite;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(120px, 80px) scale(1.15); }
  66% { transform: translate(60px, 200px) scale(0.9); }
}

@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-100px, -120px) scale(1.2); }
}

/* 细密噪点纹理叠加 */
.terminal-container::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ===== 主容器 ===== */
.terminal-container {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--bg-base) 0%, var(--bg-deep) 50%, #08080a 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

/* ===== 顶部玻璃导航栏 ===== */
.window-controls {
  height: 48px;
  background: rgba(20, 20, 24, 0.65);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  position: relative;
  z-index: 10;
}

.window-dot {
  width: var(--window-dot-size);
  height: var(--window-dot-size);
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
}

.window-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  filter: blur(6px);
  transition: opacity 0.3s var(--ease);
}

.window-dot:hover { transform: scale(1.15); }
.window-dot:hover::after { opacity: 0.6; }

.dot-red { background: #ff5f57; box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset; }
.dot-yellow { background: #febc2e; box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset; }
.dot-green { background: #28c840; box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset; }

.dot-green[title]:hover {
  box-shadow: 0 0 12px rgba(40, 200, 64, 0.6), 0 0 0 1px rgba(0,0,0,0.2) inset;
}

/* ===== 导航项 ===== */
.nav-container {
  display: flex;
  align-items: center;
  overflow-x: auto;
  flex-grow: 1;
  padding: 0 8px;
  scrollbar-width: none;
  justify-content: flex-end;
}

.nav-container::-webkit-scrollbar { display: none; }

.nav-item {
  padding: 7px 18px;
  margin: 0 3px;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  position: relative;
  transition: all 0.35s var(--ease);
  border: 1px solid transparent;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  z-index: -1;
}

.nav-item:hover {
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.nav-item:hover::before { opacity: 1; }

.nav-item.active {
  color: #000;
  background: linear-gradient(135deg, #ffffff 0%, #e8e8e8 100%);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.25), 0 0 0 1px rgba(255,255,255,0.1) inset;
  font-weight: 500;
}

/* ===== 内容区 ===== */
.content-frame-container {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  z-index: 5;
}

#contentFrame,
#homeFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: block;
}

#contentFrame { display: none; }

/* ===== 页脚 ===== */
footer {
  text-align: center;
  padding: 12px 20px;
  background: rgba(15, 15, 18, 0.6);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-top: 1px solid var(--glass-border);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 10;
}

footer span {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ===== 弹窗 ===== */
.visit-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  animation: popupFade 0.4s var(--ease);
}

@keyframes popupFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-content {
  background: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border-strong);
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05) inset, 0 1px 0 rgba(255,255,255,0.1) inset;
  animation: popupSlide 0.5s var(--ease);
}

@keyframes popupSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popup-content h3 {
  margin-top: 0;
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.popup-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 12px 0 20px;
  font-size: 0.92rem;
}

.popup-close {
  background: linear-gradient(135deg, #ffffff 0%, #d8d8d8 100%);
  color: #000;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 10px 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.popup-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.35);
}

/* ===== Toast 提示 ===== */
.security-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  padding: 10px 22px;
  background: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-strong);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  z-index: 9999;
  display: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.security-toast[style*="display: block"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.copy-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-strong);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 禁用选择 ===== */
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.nav-item {
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  body { padding: 0; }
  .terminal-container { width: 100vw; height: 100vh; }
  .window-controls { padding: 0 12px; height: 44px; }
  .nav-item { padding: 6px 12px; font-size: 0.82rem; margin: 0 2px; }
  footer { font-size: 0.72rem; padding: 10px 14px; }
}

@media (max-width: 480px) {
  .nav-item { padding: 5px 10px; font-size: 0.78rem; }
  .window-dot { width: 10px; height: 10px; }
}
