:root {
  --ink: #0a0a0a;
  --paper: #fff;
  --muted: #808080;
  --line: #e6e6e6;
  --soft: #f6f6f6;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
[data-href] { cursor: pointer; }
img { max-width: 100%; }
button { font-family: inherit; }
ul { list-style: none; }

.nav {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}
.nav-brand span { font-size: 15px; font-weight: 600; letter-spacing: 0.5px; }
.nav-menu { display: flex; gap: 2px; flex: 1; min-width: 0; }
.nav-item {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 14px;
  color: #bdbdbd;
  white-space: nowrap;
}
.nav-item:hover { color: #fff; background: #1d1d1d; }
.nav-item.active { color: #fff; font-weight: 600; }

.nav-search { flex: 1; max-width: 340px; position: relative; }
.nav-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.nav-search input::placeholder { color: #9a9a9a; }
.nav-search input:focus { border-color: #fff; }
.nav-search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

.nav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-login {
  padding: 6px 16px;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.nav-login:hover { border-color: #fff; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  max-width: 160px;
}
.user-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #333; flex-shrink: 0; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; }

.page-head {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-head .hd-ico {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff;
}
.page-head h2 { font-size: 18px; font-weight: 700; }
.page-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }

.tip {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: #555;
  margin-bottom: 14px;
}
.tip.warn { background: #fdf3f3; border-color: #f0d6d6; color: #9a3d3d; }

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 14px;
  background: #fff;
}

.form { display: flex; flex-direction: column; gap: 10px; }
.form label { font-size: 13px; font-weight: 600; color: #333; }
.ipt, .sel, .txt {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}
.ipt:focus, .sel:focus, .txt:focus { border-color: var(--ink); }
.ipt::placeholder, .txt::placeholder { color: #aaa; }
.txt { resize: vertical; min-height: 90px; font-family: inherit; line-height: 1.6; }
.sel { padding: 8px 12px; font-size: 13px; }
.form .hint { font-size: 12px; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.82; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }

.cp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.cp-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.res-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.rc {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
}
.rc .ic {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--ink);
}
.rc .body { flex: 1; min-width: 0; }
.rc .body .lb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.rc .body .val {
  font-size: 13px;
  color: #222;
  word-break: break-all;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.rc .body .val .ph { color: #aaa; }

.ic-blue, .ic-cyan, .ic-teal, .ic-indigo { background: var(--soft); color: var(--ink); }

.cover-img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #fafafa;
}

.lyric-box {
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 13px;
  color: #333;
  line-height: 1.8;
}
audio { width: 100%; max-width: 380px; height: 36px; outline: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: #444;
  border-radius: 999px;
  font-size: 12px;
}

.loading { text-align: center; padding: 56px 0; color: var(--muted); font-size: 14px; }
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 48px 0; color: var(--muted); font-size: 14px; }
.error { text-align: center; padding: 48px 0; color: #b01818; font-size: 14px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid transparent; }
.badge-free { background: #eefaf3; color: #1a7f4b; border-color: #cdeadd; }
.badge-wait { background: #fdf7e8; color: #8a6a14; border-color: #efe2c3; }
.badge-gray { background: var(--soft); color: #666; border-color: var(--line); }

.hot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hcard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.hcard h3 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.hcard h3 span { font-size: 12px; color: var(--muted); font-weight: 400; }
.hot-list li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eee; font-size: 13px; }
.hot-list li:last-child { border-bottom: none; }
.rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--soft);
  color: #555;
  font-size: 12px;
  text-align: center;
  line-height: 20px;
}
.rank.r1 { background: var(--ink); color: #fff; }
.rank.r2 { background: #444; color: #fff; }
.rank.r3 { background: #777; color: #fff; }
.hot-title { flex: 1; color: #333; cursor: pointer; line-height: 1.6; }
.hot-title:hover { color: #000; text-decoration: underline; }
.hot-err { color: #b01818; font-size: 13px; }

.game-list { display: flex; flex-direction: column; gap: 12px; }
.gcard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  background: #fff;
}
.gcard h3 { font-size: 15px; }
.gcard h3 a:hover { text-decoration: underline; }
.glink { display: inline; color: inherit; }
.glink:hover { text-decoration: underline; }
.gmeta { display: flex; flex-wrap: wrap; gap: 10px; margin: 7px 0; font-size: 12px; color: var(--muted); }
.gdesc { font-size: 13px; color: #444; line-height: 1.7; margin-bottom: 10px; }
.gcover { max-width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }

.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: none;
  z-index: 50;
}
.back-top.show { display: block; }
.back-top:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.toast-wrap {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(90vw, 400px);
}
.toast {
  pointer-events: auto;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  color: #222;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  animation: t-in 0.15s ease;
  cursor: pointer;
  max-width: 100%;
}
.toast-success { border-left: 3px solid #1a7f4b; }
.toast-error { border-left: 3px solid #b01818; }
.toast.hide { animation: t-out 0.15s ease forwards; }
@keyframes t-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes t-out { to { opacity: 0; transform: translateY(-4px); } }

.tools-head { text-align: center; padding: 30px 0 22px; }
.tools-head h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.5px; }
.tools-head p { margin-top: 6px; font-size: 13px; color: var(--muted); }

.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tool {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  transition: border-color 0.15s;
}
.tool:hover { border-color: var(--ink); }
.tool .ico {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: var(--soft);
  color: var(--ink);
}
.tool .name { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.tool .desc { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tool.soon { cursor: default; background: #fafafa; }
.tool.soon:hover { border-color: var(--line); }
.tool.soon .ico { color: #bbb; }
.tool.off { opacity: 0.5; }
.tool.off:hover { border-color: var(--line); }
.off-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: #888;
  background: #f0f0f0;
  border-radius: 999px;
  padding: 0 7px;
  vertical-align: 1px;
}
.no-result { text-align: center; padding: 30px 0; color: var(--muted); display: none; font-size: 14px; }

body.tool-off .wrap > *:not(.page-head):not(.tool-off-tip) { display: none; }
.tool-off-tip {
  padding: 70px 20px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

.ai-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  gap: 24px;
}
.ai-main { flex: 1; min-width: 0; }
.ai-hero { text-align: center; padding: 26px 0 20px; }
.ai-hero h1 { font-size: 28px; font-weight: 700; letter-spacing: 0.5px; }
.ai-hero p { margin-top: 6px; font-size: 13px; color: var(--muted); }
.ai-search { display: flex; gap: 8px; max-width: 680px; margin: 20px auto 0; }
.ai-search input {
  flex: 1;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}
.ai-search input:focus { border-color: var(--ink); }
.ai-search input::placeholder { color: #aaa; }
.ai-search button {
  height: 50px;
  padding: 0 26px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.ai-search button:hover { opacity: 0.82; }
.ai-search button:disabled { opacity: 0.4; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.chip {
  padding: 6px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }

.ai-thread { max-width: 760px; margin: 6px auto 0; }
.ask { border-top: 1px solid var(--line); padding: 18px 0; }
.ask:first-child { border-top: none; }
.ask .q { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.ask .a { font-size: 14px; color: #333; line-height: 1.75; white-space: pre-wrap; }
.result-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.result-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}
.result-tool:hover { border-color: var(--ink); }
.result-tool .ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.result-tool .tt { flex: 1; min-width: 0; }
.result-tool .tt b { display: block; font-size: 13px; }
.result-tool .tt span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-tool .arrow { color: #bbb; font-size: 14px; flex-shrink: 0; }

.ai-side { width: 280px; flex-shrink: 0; border-left: 1px solid var(--line); padding-left: 22px; }
.ai-side h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-side h3 .cnt {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  font-weight: 400;
}
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-item { padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.side-item:hover { background: var(--soft); }
.side-item .q {
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-item .t { font-size: 11px; color: #aaa; margin-top: 2px; }
.side-item.empty { padding: 24px 10px; color: var(--muted); font-size: 13px; }

.ai-gate {
  max-width: 520px;
  margin: 56px auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px 34px;
  text-align: center;
}
.ai-gate .g-ico {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin: 0 auto 16px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-gate h2 { font-size: 19px; }
.ai-gate p { font-size: 13px; color: var(--muted); margin: 8px 0 22px; line-height: 1.8; }

.site-footer { text-align: center; padding: 20px 20px 28px; font-size: 12px; color: #aaa; }

@media (max-width: 980px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .hot-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-side { display: none; }
}
@media (max-width: 900px) {
  .nav-menu { display: none; }
  .nav-search { max-width: none; }
}
@media (max-width: 640px) {
  .main { padding: 18px 14px 48px; }
  .page-head { padding: 14px; }
  .card { padding: 16px 14px; }
  .tools-head h1 { font-size: 22px; }
  .tools-grid { gap: 10px; }
  .tool { padding: 13px; }
  .nav-inner { padding: 0 14px; gap: 12px; }
  .rc { padding: 12px 14px; }
  .ai-search { flex-direction: column; }
  .ai-search button { height: 44px; }
  .result-tools { grid-template-columns: 1fr; }
}
