/*
  Yap Navigation - 易编辑版样式表
  最常改的颜色在 :root 里面。
  改完保存，然后重新打包上传 Cloudflare Pages 即可。
*/

* {
  box-sizing: border-box;
}

:root {
  /* 页面基础颜色 */
  --bg: #f1f1f0;
  --text: #111111;
  --muted: #666666;
  --card: #ffffff;

  /* 常用主题色：想改卡片底色，优先改这里 */
  --blue: #1677ff;
  --red: #ff4d5a;
  --orange: #ffad00;
  --green: #16a34a;
  --black: #080808;
  --white: #ffffff;

  /* 阴影和圆角 */
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
  --radius: 18px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: url("images/soft-bg.svg") top center / 1200px 800px no-repeat, var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

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

/* 顶部大标题 */
.hero {
  width: min(820px, 92vw);
  margin: 0 auto;
  padding: 52px 0 24px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  line-height: 1.04;
  font-size: clamp(48px, 9vw, 104px);
  font-weight: 950;
  letter-spacing: 3px;
}

.hero h1 span,
.hero h1 strong {
  display: block;
}

.hero h1 strong {
  position: relative;
  width: max-content;
  margin: 26px auto 0;
  color: var(--red);
}

.hero h1 strong::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: -10px;
  height: 18px;
  background: #ffeb54;
  z-index: -1;
}

/* 搜索框 */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: min(760px, 92vw);
  height: 64px;
  margin: 56px auto 30px;
  padding: 0 18px;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.engine-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 134px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: #333333;
}

#engineIcon,
.engine-menu img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.chevron {
  color: #777777;
}

.search-box input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 18px;
}

.engine-menu {
  position: absolute;
  left: 20px;
  top: 72px;
  z-index: 20;
  display: none;
  width: 160px;
  padding: 8px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.engine-menu.show {
  display: grid;
  gap: 4px;
}

.engine-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}

.engine-menu button:hover {
  background: #f3f6ff;
}

/* 顶部分类 */
.tabs {
  display: inline-flex;
  gap: 34px;
  align-items: center;
}

.tabs button {
  position: relative;
  padding: 12px 0;
  border: 0;
  background: transparent;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}

.tabs button.active {
  color: var(--blue);
}

.tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}

/* 主内容布局 */
.container {
  width: min(1120px, 92vw);
  margin: 0 auto 70px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card,
.widget,
.mini-card,
.link-section {
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 实时热榜 */
.hot-card {
  grid-column: span 4;
  min-height: 330px;
  background: var(--black);
  color: #ffffff;
  padding: 24px;
}

.hot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hot-header h2 {
  margin: 0;
  font-size: 31px;
}

.hot-header p {
  margin: 8px 0 0;
  color: #aaaaaa;
}

.refresh-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: #1b1b1b;
  color: #ffffff;
  cursor: pointer;
}

.refresh-btn:hover {
  background: #2b2b2b;
}

.hot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.hot-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: #0b2a5a;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.hot-tabs button img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.hot-tabs button.active {
  background: var(--blue);
}

.hot-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hot-list li a {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  color: #ffffff;
  font-size: 18px;
}

.hot-list li a:hover .title {
  color: #ffd65a;
}

.rank {
  color: #e35252;
  font-weight: 900;
}

.title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.metric {
  color: #d45959;
  font-size: 16px;
  font-weight: 800;
}

.loading,
.error {
  padding: 30px 0;
  color: #aaaaaa;
  text-align: center;
}

/* 大卡片：天气 / GPT / Pinterest */
.widget {
  min-height: 142px;
  padding: 22px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.widget img {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  flex: 0 0 auto;
}

.widget:hover,
.mini-card:hover,
.link-grid a:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.13);
}

.widget h3,
.widget p {
  margin: 0;
}

.widget strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 30px;
  line-height: 1;
}

/* 大卡片颜色 */
.weather {
  background: linear-gradient(145deg, #5b7080, #9fb0b8);
}

/* GPT 大卡片颜色 */
.green {
  background: #7EA6BD;
}

/* Pinterest 大卡片颜色 */
.blue {
  background: #2286f4;
}

/* 小卡片 */
.mini-card {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  font-size: 20px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mini-card img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.mini-card span {
  display: block;
  font-size: 13px;
  opacity: 0.85;
}

.mini-card strong {
  font-size: 20px;
}

/* 小卡片颜色：想改底色就改这里 */
.red {
  background: #ff3153;
  color: #ffffff;
}

.red2 {
  background: #df1919;
  color: #ffffff;
}

.orange {
  background: #ff7a00;
  color: #ffffff;
}

.green2 {
  background: #18bf55;
  color: #ffffff;
}

.white {
  background: #ffffff;
  color: #333333;
}

.black {
  background: #070707;
  color: #ffffff;
}

/* 其它分类页 */
.hidden {
  display: none !important;
}

.link-section {
  padding: 30px;
}

.section-title h2 {
  margin: 0;
  font-size: 34px;
}

.section-title p {
  margin: 8px 0 24px;
  color: var(--muted);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.link-grid a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border-radius: 16px;
  background: #f7f7f5;
  font-size: 20px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.link-grid a img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.link-grid a:hover {
  background: #ecf2ff;
  color: var(--blue);
}

.footer {
  padding: 34px 20px 50px;
  color: var(--muted);
  text-align: center;
}

/* 手机和平板适配 */
@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: repeat(2, 1fr);
  }

  .hot-card {
    grid-column: span 2;
  }

  .hot-header {
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .hero {
    padding-top: 34px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero h1 strong {
    margin-top: 14px;
  }

  .search-box {
    height: 56px;
    margin-top: 36px;
  }

  .engine-btn {
    min-width: 70px;
  }

  #engineName {
    display: none;
  }

  .tabs {
    gap: 22px;
  }

  .tabs button {
    font-size: 16px;
  }

  .dashboard,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .hot-card {
    grid-column: span 1;
    padding: 18px;
  }

  .hot-list li a {
    grid-template-columns: 30px 1fr;
  }

  .metric {
    display: none;
  }
}
