/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  scroll-behavior: smooth;
  background-color: #393e46;
}

/* 导航栏 */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(57,62,70,0.1);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  color: white;
  z-index: 999;
  transition: top 0.3s ease;
}

#navbar div a {
  color: white;
  margin-left: 20px;
  text-decoration: none;
}

/* 全屏大图封面 */
.hero {
  width: 100%;
  height: 100vh;
  background: #000 url("../images/bg.png") center/cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  text-align: center;
}

/* ==============================
   核心：电脑一行，手机强制 4+4 两行
   ============================== */
.hero h1 {
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255,255,255,0.9);
  color: #f0f5ffd9;
  font-weight: normal;
  font-size: 75px;
  margin-bottom: 15px;
  line-height: 1.2;
  text-align: center;
  /* 电脑端：强制一行 */
  white-space: nowrap;
}

/* 手机端（≤768px）：强制两行 4+4 */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 48px !important;
    /* 手机端：允许换行，强制按 HTML 结构显示 */
    white-space: pre-line !important;
  }
}

/* ==============================
   侧边栏：平滑滑入滑出动画
   ============================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 100vh;
  background: rgba(20,20,25,0.9);
  backdrop-filter: blur(10px);
  z-index: 998;
  padding-top: 90px;
  overflow: hidden;
  transition: all 0.5s ease;
  transform: translateX(0);
  opacity: 1;
}
.sidebar:hover {
  width: 240px;
}
.sidebar a {
  display: flex;
  align-items: center;
  height: 55px;
  padding: 0 25px;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar a:hover {
  background: rgba(255,255,255,0.08);
}
.sidebar::after {
  content: ">";
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 22px;
  font-weight: bold;
  pointer-events: none;
}

/* 滑出隐藏：向左平滑消失 */
.sidebar.hide {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

/* 内容区 */
.section {
  padding: 100px 120px;
  max-width: 1200px;
  margin: 0 auto;
}

.section h2 {
  font-size: 32px;
  margin-bottom: 20px;
  color: #ffffffb3;
}

.section p {
  font-size: 17px;
  line-height: 1.7;
  color: #ffffffb3;
}

/* 毛玻璃遮罩层 */
.glass-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.glass-overlay.active {
  transform: translateY(0);
  opacity: 1;
}

.glass-content {
  width: 100%;
  max-width: 800px;
  padding: 60px 20px;
  color: #fff;
  text-align: center;
  position: relative;
}

.glass-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.glass-close:hover {
  opacity: 1;
}

.about-me h2 {
  font-size: 36px;
  margin-bottom: 20px;
}

.about-me a {
  color: inherit;
  text-decoration: underline;
}

.about-me p {
  font-size: 18px;
  line-height: 1.8;
  max-width: 600px;
  margin: 10px auto;
}

/* 轻提示弹窗 */
.toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

/* 工具面板整体遮罩 */
.tool-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 20, 25, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.tool-overlay.active {
  transform: translateY(0);
  opacity: 1;
}

/* 工具内容容器 */
.tool-container {
  width: 100%;
  max-width: 1200px;
  padding: 80px 20px 40px;
  color: #fff;
  position: relative;
}

.tool-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: rgba(255, 0, 50, 0.2);
  border: 1px solid rgba(255, 0, 50, 0.5);
  color: #fff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tool-close:hover {
  background: rgba(255, 0, 50, 0.4);
  border-color: #ff0032;
}

.tool-title {
  font-size: 36px;
  text-align: center;
  margin-bottom: 40px;
  color: #ffffff;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.tool-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-4px);
}

.tool-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.tool-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #fff;
}

.tool-card p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.tool-footer {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 30px;
}

/* 工具内容切换 */
.tool-content {
  display: none;
}

.tool-content.active {
  display: block;
}

#toolGrid.hidden {
  display: none;
}

.tool-back {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 20px;
}

#tool-leftcheck {
  margin-top: 30px;
}
.left-check-box {
  margin-top: 50px;
  text-align: center;
}

.progress-bar-bg {
  width: 80%;
  max-width: 400px;
  margin: 20px auto;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 8px;
  width: 0%;
  background: #00ff7f;
  transition: width 0.15s ease;
}

#leftTip {
  margin-bottom: 18px;
}

#leftResult {
  margin-top: 20px;
  height: 40px;
}

#startLeftCheck {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 10px 24px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

#startLeftCheck:hover {
  background: rgba(255,255,255,0.2);
}

#startLeftCheck:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==============================
🔥 统一所有弹窗：从上往下毛玻璃动画 + 最高层级 永远盖住导航栏
============================== */
.glass-overlay,
.tool-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999 !important; /* 保证盖住导航栏 */
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease !important;
  background: rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  overflow-y: auto;
}

.glass-overlay.active,
.tool-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}