/* 工具箱门户样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f5f6f7;
  color: #23282d;
  font-size: 15px;
  line-height: 1.6;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

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

/* 顶栏 */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e3e6e8;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner { height: 58px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.brand-mark {
  width: 28px; height: 28px;
  background: #2c3e50; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 14px;
}
.userbox { display: flex; align-items: center; gap: 10px; }

.chip {
  font-size: 13px;
  background: #eef0f2;
  border: 1px solid #e3e6e8;
  padding: 4px 12px;
  border-radius: 999px;
  color: #57606a;
}
.chip-blue { background: #e8f0fd; border-color: #c4d8f7; color: #1a6fd4; font-weight: 600; }
.chip-red { background: #fdecec; border-color: #f3c4bf; color: #d43a3a; font-weight: 600; }

/* 汉堡菜单 */
.usermenu { position: relative; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid #e3e6e8; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
  min-width: 120px; z-index: 50;
}
.usermenu-pop[hidden] { display: none; }
.usermenu-pop button {
  border: none; background: none; text-align: left;
  padding: 8px 12px; font-size: 14px; border-radius: 6px;
  cursor: pointer; font-family: inherit; color: #23282d;
}
.usermenu-pop button:hover { background: #f0f2f4; }

/* 密码输入行（带显示切换按钮） */
.pwrow { position: relative; }
.pwrow input { padding-right: 58px; }
.pwbtn {
  position: absolute; right: 6px; top: 20px; transform: translateY(-50%);
  border: none; background: none; color: #2c3e50;
  font-size: 12.5px; cursor: pointer; padding: 4px 6px; font-family: inherit;
}
.pwbtn:hover { text-decoration: underline; }

/* 按钮 */
.btn {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 14px;
  cursor: pointer;
  background: none;
  font-family: inherit;
}
.btn-primary { background: #2c3e50; color: #fff; }
.btn-primary:hover { background: #22303e; }
.btn-ghost { border-color: #d6dade; color: #57606a; background: #fff; }
.btn-ghost:hover { background: #f0f2f4; }
.btn-block { width: 100%; }

/* 激活条 */
.activate-bar { background: #fdf6e9; border-bottom: 1px solid #f0e2c8; }
.activate-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; flex-wrap: wrap; font-size: 14px; color: #8a6d3b; }
.redeem-form { display: flex; gap: 8px; }
.redeem-form input {
  border: 1px solid #e0d5bd; border-radius: 6px;
  padding: 7px 12px; font-size: 14px; width: 230px;
  background: #fff; font-family: inherit;
}

/* 工具分组 */
.group { margin-top: 34px; }
.group-title { font-size: 15px; font-weight: 600; color: #57606a; margin-bottom: 14px; padding-left: 2px; display: flex; align-items: center; gap: 8px; }
.group-logo { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  background: #fff;
  border: 1px solid #e3e6e8;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); transform: translateY(-1px); }
.card-icon { font-size: 26px; line-height: 1; }
.card-icon img { width: 32px; height: 32px; object-fit: contain; }
.card-name { font-size: 15px; font-weight: 600; }
.card-desc { font-size: 12.5px; color: #8b949e; }
.card-locked .card-desc { color: #b08a4f; }
.card-desc.desc-go { color: #1a6fd4; font-weight: 600; }
.card-desc.desc-lock { color: #d43a3a; font-weight: 600; }
.card-expire { font-size: 11.5px; color: #1a7f4b; font-weight: 600; }

.empty {
  text-align: center;
  color: #8b949e;
  padding: 80px 0;
  background: #fff;
  border: 1px dashed #d6dade;
  border-radius: 8px;
  margin-top: 34px;
}

/* 页脚 */
.foot { margin-top: 60px; padding: 20px 0; border-top: 1px solid #e3e6e8; background: #fff; }
.foot .wrap { display: flex; justify-content: space-between; font-size: 13px; color: #8b949e; }
.foot a:hover { color: #2c3e50; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(20, 24, 28, .45); }
.modal-box {
  position: relative;
  background: #fff; border-radius: 10px;
  width: 360px; max-width: calc(100vw - 40px);
  padding: 26px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
}
.modal-box h3 { font-size: 17px; margin-bottom: 6px; }
.modal-tip { font-size: 13px; color: #8b949e; margin-bottom: 16px; }
.modal-box input {
  width: 100%; border: 1px solid #d6dade; border-radius: 6px;
  padding: 10px 12px; font-size: 15px; margin-bottom: 12px; font-family: inherit;
}
.modal-box input:focus { outline: none; border-color: #2c3e50; }
.modal-x {
  position: absolute; top: 12px; right: 14px;
  border: none; background: none; font-size: 22px; color: #8b949e; cursor: pointer;
}

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #23282d; color: #fff;
  padding: 9px 20px; border-radius: 6px;
  font-size: 14px; z-index: 200;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* 顶部横向分类导航（桌面与移动端通用） */
.catnav { position: sticky; top: 58px; z-index: 9; background: #f5f6f7; padding: 10px 0; }
.catnav-inner { display: flex; gap: 8px; overflow-x: auto; padding: 0 20px; max-width: 1120px; margin: 0 auto; scrollbar-width: none; }
.catnav-inner::-webkit-scrollbar { display: none; }
.catnav-item { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #e3e6e8; border-radius: 999px; padding: 6px 15px; font-size: 13px; color: #57606a; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.catnav-item:hover { border-color: #c9ced2; }
.catnav-item.on { background: #2c3e50; border-color: #2c3e50; color: #fff; font-weight: 600; }
.catnav-item img { width: 16px; height: 16px; object-fit: contain; border-radius: 3px; }

.group { scroll-margin-top: 110px; }

@media (max-width: 640px) {
  .activate-inner { flex-direction: column; align-items: stretch; }
  .redeem-form input { width: 100%; flex: 1; }

  .wrap { padding: 0 16px; }
  .topbar-inner { height: 52px; }
  .brand { font-size: 16px; }
  .chip { font-size: 12px; padding: 3px 10px; }

  /* 移动端导航吸顶位置与间距 */
  .catnav { top: 52px; padding: 8px 0 10px; }
  .catnav-inner { padding: 0 16px; -webkit-overflow-scrolling: touch; }

  /* 分组标题：加粗且大于工具名 */
  .group { margin-top: 20px; scroll-margin-top: 116px; }
  .group-title { font-size: 17px; font-weight: 700; color: #23282d; margin-bottom: 10px; }
  .group-logo { width: 20px; height: 20px; }

  /* 一行3个气泡卡片 */
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card { border: none; border-radius: 14px; padding: 12px 4px 10px; align-items: center; text-align: center; gap: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
  .card-icon { font-size: 24px; }
  .card-icon img { width: 30px; height: 30px; }
  .card-name { font-size: 11.5px; font-weight: 500; line-height: 1.3; }
  .card-desc { font-size: 10.5px; }
  .card-expire { font-size: 10px; }

  .foot { margin-top: 40px; }
}
