/* 5ke Tools 门户 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2f5bff;
  --primary-soft: #e7edff;
  --ink: #111a2e;
  --muted: #6d7689;
  --dim: #9aa4b5;
  --line: #e3e7ef;
  --bg: #eef1f6;
  --card: #ffffff;
  --lime: #c9f45d;
}
html, body { min-height: 100%; }
body {
  font-family: "Inter", "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(#d7dde8 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 20px;
  letter-spacing: .1px;
}
body.portal-loading .portal-main { visibility: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { display: block; }

.portal-nav {
  flex-shrink: 0; height: 60px; display: flex; align-items: center; gap: 22px;
  padding: 0 16px 0 20px; background: rgba(255,255,255,.94);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 14px 38px rgba(28,42,70,.08);
  backdrop-filter: blur(18px); position: sticky; top: 10px; z-index: 50;
}
.portal-brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; letter-spacing: -.6px; white-space: nowrap; }
.portal-brand i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; background: var(--primary); color: #fff; font-size: 12px; box-shadow: 0 5px 14px rgba(47,91,255,.3); }
.portal-brand small { font-size: 8px; letter-spacing: 1.3px; color: var(--dim); border: 1px solid var(--line); padding: 3px 5px; border-radius: 4px; }
.portal-links { display: flex; gap: 2px; margin-left: 8px; }
.portal-links a { font-size: 12px; color: var(--muted); padding: 7px 10px; border-radius: 8px; }
.portal-links a:hover, .portal-links a.on { background: var(--primary-soft); color: var(--primary); }
.portal-nav-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.portal-search { display: flex; align-items: center; gap: 8px; height: 32px; width: 240px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; color: var(--dim); font-size: 10px; }
.portal-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; min-width: 0; }
.portal-search kbd { font-family: inherit; font-size: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; color: var(--muted); }
.portal-user { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.portal-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#ffb56b,#ff6f5e 55%,#7c5cff); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.portal-logout { height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font-size: 9px; cursor: pointer; }
.portal-logout:hover { color: var(--ink); border-color: #c8d4ff; }

.portal-main { flex: 1; display: flex; flex-direction: column; gap: 14px; max-width: 1900px; width: 100%; margin: 0 auto; }
.portal-hero { display: grid; grid-template-columns: minmax(0,1fr) 390px; gap: 18px; min-height: 205px; }
.portal-copy { padding: 16px 4px 0; }
.portal-eyebrow { width: fit-content; display: flex; align-items: center; gap: 7px; font-size: 8px; letter-spacing: 1.5px; font-weight: 700; text-transform: uppercase; color: #4d5a3a; background: rgba(201,244,93,.5); padding: 5px 9px; border-radius: 7px; }
.portal-eyebrow i { width: 5px; height: 5px; border-radius: 50%; background: #4d7c0f; }
.portal-copy h1 { margin-top: 15px; font-size: 43px; line-height: 1.05; letter-spacing: -2px; font-weight: 760; }
.portal-copy h1 em { font-style: normal; position: relative; display: inline-block; z-index: 1; }
.portal-copy h1 em::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 3px; height: 11px; background: var(--lime); z-index: -1; border-radius: 2px; }
.portal-copy > p { margin-top: 9px; font-size: 11px; line-height: 1.6; color: #6b6a5c; max-width: 520px; }
.portal-hero-search { margin-top: 17px; display: flex; align-items: center; gap: 8px; width: 420px; max-width: 100%; height: 38px; padding: 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 20px rgba(28,42,70,.05); color: var(--dim); font-size: 11px; }
.portal-hero-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; min-width: 0; }
.portal-hero-search b { font-size: 8px; color: var(--muted); border: 1px solid var(--line); padding: 2px 5px; border-radius: 4px; font-weight: 500; }
.portal-stats { display: flex; gap: 22px; margin-top: 15px; }
.portal-stat b { display: block; font-size: 17px; letter-spacing: -.4px; color: var(--ink); }
.portal-stat span { display: block; margin-top: 1px; font-size: 8px; color: var(--dim); }
.portal-feature { position: relative; overflow: hidden; border-radius: 22px; padding: 19px 20px; background: #111a2e; color: #fff; box-shadow: 0 20px 50px rgba(15,26,51,.25); }
.portal-feature::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -90px; top: -100px; background: radial-gradient(circle, rgba(201,244,93,.32), transparent 65%); }
.portal-feature::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; left: -100px; bottom: -130px; background: radial-gradient(circle, rgba(47,91,255,.35), transparent 65%); }
.portal-feature-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; font-size: 8px; letter-spacing: 1.2px; font-weight: 700; color: var(--lime); }
.portal-feature-top span:last-child { font-size: 7px; color: #101a0a; background: var(--lime); padding: 4px 6px; border-radius: 4px; }
.portal-feature h2 { position: relative; z-index: 1; margin-top: 14px; font-size: 26px; letter-spacing: -.8px; }
.portal-feature p { position: relative; z-index: 1; margin-top: 5px; font-size: 9px; color: #93a0c0; line-height: 1.6; }
.portal-feature-tags { position: relative; z-index: 1; display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.portal-feature-tags span { font-size: 7px; color: #c3cbe0; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); padding: 3px 6px; border-radius: 4px; }
.portal-feature-btn { position: relative; z-index: 1; margin-top: 12px; height: 31px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--lime); color: #101a0a; font-size: 9.5px; font-weight: 800; cursor: pointer; }
.portal-feature-btn:disabled { opacity: .55; cursor: not-allowed; }

.portal-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.portal-chip { height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 9.5px; cursor: pointer; }
.portal-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.portal-filter .recent { margin-left: auto; font-size: 8px; color: var(--dim); }
.portal-filter .recent b { color: var(--muted); font-weight: 500; }

.portal-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; align-content: start; }
.tool-card { min-height: 150px; padding: 14px 14px 12px; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 26px rgba(28,42,70,.05); transition: .18s ease; position: relative; }
.tool-card:hover { transform: translateY(-2px); border-color: #c8d4ff; box-shadow: 0 16px 34px rgba(28,42,70,.1); }
.tool-card.soon { opacity: .72; }
.tool-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tool-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.tool-icon.blue { background: #e7edff; color: #2f5bff; }
.tool-icon.lime { background: #eefbd0; color: #4d7c0f; }
.tool-icon.coral { background: #ffe9e4; color: #d94b38; }
.tool-icon.violet { background: #f0eaff; color: #7c3aed; }
.tool-icon.amber { background: #fff2d8; color: #b45309; }
.tool-icon.teal { background: #dff7fb; color: #0e7490; }
.tool-badge { font-size: 7px; font-weight: 700; letter-spacing: .4px; padding: 3px 5px; border-radius: 4px; color: #2f5bff; background: #e7edff; }
.tool-badge.new { color: #1c2606; background: var(--lime); }
.tool-badge.hot { color: #b91c1c; background: #fee2e2; }
.tool-badge.soon { color: #6d7689; background: #f1f3f7; }
.tool-card h3 { margin-top: 9px; font-size: 13px; letter-spacing: -.2px; color: var(--ink); }
.tool-card p { margin-top: 3px; font-size: 8.5px; line-height: 1.45; color: var(--muted); }
.tool-foot { margin-top: auto; display: flex; align-items: center; gap: 5px; font-size: 7.5px; color: var(--dim); padding-top: 8px; }
.tool-foot .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--lime); flex-shrink: 0; }
.tool-foot .arrow { margin-left: auto; color: #c3cbe0; font-size: 12px; }
.tool-card.soon .tool-foot .dot { background: #c3cbe0; }
.portal-empty { display: none; padding: 50px 0; text-align: center; color: var(--dim); font-size: 12px; }
.portal-empty.show { display: block; }
.portal-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 8px; color: var(--dim); padding: 2px 4px 0; }
.portal-footer b { color: var(--muted); font-weight: 500; }
.portal-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; background: #111a2e; color: #fff; font-size: 11px; padding: 10px 16px; border-radius: 9px; box-shadow: 0 12px 30px rgba(0,0,0,.25); transition: .25s; z-index: 100; pointer-events: none; }
.portal-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.portal-loader { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 200; transition: opacity .2s; }
.portal-loader.hidden { opacity: 0; pointer-events: none; }
.portal-spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: portal-spin .7s linear infinite; }
@keyframes portal-spin { to { transform: rotate(360deg); } }

@media (max-width: 1500px) {
  .portal-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .portal-copy h1 { font-size: 39px; }
}
@media (max-width: 1100px) {
  .portal-hero { grid-template-columns: 1fr; }
  .portal-feature { min-height: 180px; }
  .portal-links { display: none; }
  .portal-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  body { padding: 10px; }
  .portal-nav { height: 56px; padding: 0 10px 0 14px; top: 6px; }
  .portal-search { width: 170px; }
  .portal-nav .portal-user span:last-child { display: none; }
  .portal-main { gap: 12px; }
  .portal-copy { padding-top: 4px; }
  .portal-copy h1 { font-size: 33px; letter-spacing: -1.4px; }
  .portal-hero { min-height: 0; }
  .portal-feature { display: none; }
  .portal-stats { margin-top: 12px; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-filter .recent { display: none; }
  .tool-card { min-height: 145px; }
}
@media (max-width: 520px) {
  .portal-search { display: none; }
  .portal-copy h1 { font-size: 30px; }
  .portal-hero-search { width: 100%; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
}
