/* ==========================
   木作美学 - 首页样式
   ========================== */
:root {
  --bg: #3a3a3a;
  --text: #f5f5f5;
  --text-muted: #b5b5b5;
  --bar-bg: #ffffff;
  --bar-placeholder: #9a9a9a;
  --entry-bg: #2e2e2e;
  --entry-hover-bg: #262626;
  --accent-red: #e0343c;
  --wood-1: #8a6a4f;
  --wood-2: #6b4f38;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 右上角九宫格 ---------- */
.topbar {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 10;
}

.grid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s;
}

.grid-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 下拉导航菜单 */
.grid-menu {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 150px;
  padding: 8px;
  background: #2f2f2f;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
}

.grid-menu.open {
  display: block;
  animation: menu-in 0.18s ease;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: #d5d5d5;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}

.grid-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ---------- 主体布局 ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15vh;
}

/* 品牌标题 */
.brand {
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 8px;
  text-indent: 8px; /* 抵消最后一个字的字距，保持视觉居中 */
  margin-bottom: 58px;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- 客服对话输入框 ---------- */
.search-box {
  display: flex;
  align-items: center;
  width: 480px;
  max-width: 88vw;
  height: 46px;
  padding: 0 14px 0 18px;
  background: var(--bar-bg);
  border-radius: 23px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.2s;
}

.search-box:focus-within {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.icon-chat {
  color: #8a8a8a;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  height: 100%;
  margin: 0 10px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #333;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--bar-placeholder);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ---------- 快捷入口 ---------- */
.quick-entry {
  display: flex;
  align-items: flex-start;
  gap: 46px;
  margin-top: 40px;
}

.entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-muted);
  width: 68px;
}

.entry-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--entry-bg);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

/* 各入口配色 */
.icon-measure {
  background: linear-gradient(135deg, var(--wood-1), var(--wood-2));
}

.icon-design {
  background: var(--accent-red);
}

.icon-split {
  background: #1f2124;
}

.icon-install {
  background: rgba(255, 255, 255, 0.12);
  color: #e8e8e8;
}

.entry-label {
  font-size: 13px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%) translateY(16px);
  padding: 10px 22px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 20;
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero {
    padding-top: 18vh;
  }

  .brand {
    font-size: 34px;
    letter-spacing: 5px;
    text-indent: 5px;
    margin-bottom: 44px;
  }

  .quick-entry {
    gap: 30px;
  }
}
