:root {
  color-scheme: dark;
  --bg: #111216;
  --panel: #181b22;
  --panel-2: #20232b;
  --line: #303641;
  --text: #f5f7fb;
  --muted: #9aa4b5;
  --soft: #c9d0dc;
  --green: #20d1a1;
  --gold: #d7b15f;
  --red: #d85b4c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(32, 209, 161, 0.12), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(216, 91, 76, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  aspect-ratio: 9 / 16;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 16px clamp(10px, 3.6vw, 14px) 28px;
  background:
    linear-gradient(180deg, rgba(17, 18, 22, 0.92), rgba(17, 18, 22, 0.98)),
    var(--bg);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 20%, rgba(32, 209, 161, 0.18), transparent 34%),
    #0f1014;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(100%, 390px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 34, 0.98);
}

.login-card h1 {
  margin-bottom: 8px;
}

.login-card p {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  margin: 16px 0 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

.login-card button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #071313;
  font-weight: 900;
}

.login-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 12px;
}

.eyebrow,
.hero-tag {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--green);
  font-weight: 800;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 18px;
  border: 1px solid rgba(215, 177, 95, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(24, 27, 34, 0.74), rgba(18, 20, 25, 0.96)),
    url("https://images.unsplash.com/photo-1462331940025-496dfbfc7564?auto=format&fit=crop&w=900&q=80");
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -30px -50px 32%;
  height: 150px;
  background: linear-gradient(90deg, transparent, rgba(32, 209, 161, 0.18), transparent);
  transform: rotate(-12deg);
}

.hero h2 {
  position: relative;
  max-width: 330px;
  font-size: 24px;
  line-height: 1.18;
}

.hero p:last-child {
  position: relative;
  max-width: 340px;
  margin-top: 10px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 14px 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 22, 27, 0.94);
  backdrop-filter: blur(10px);
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented button.active {
  background: rgba(32, 209, 161, 0.16);
  color: var(--green);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.section-head h3 {
  font-size: 18px;
}

.section-head span,
.section-head button {
  flex: 0 1 auto;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.card,
.tool-card,
.job-card,
.news-card,
.generator {
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 34, 0.94);
}

.card h4,
.tool-card h4,
.job-card h4,
.news-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.card p,
.tool-card p,
.job-card p,
.news-card p,
.output {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.6;
}

.meta {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 4px 8px;
  border: 1px solid rgba(32, 209, 161, 0.28);
  border-radius: 999px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.radar-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.radar-item b {
  color: var(--gold);
  font-size: 13px;
}

.radar-item p {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.45;
}

label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

textarea,
select {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--panel-2);
  color: var(--text);
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary,
.button-row button,
.card button,
.tool-card button,
.text-btn {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  font-weight: 800;
}

.primary {
  width: 100%;
  margin: 2px 0 10px;
  background: var(--green);
  color: #071313;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.button-row button,
.card button,
.tool-card button {
  width: 100%;
  margin-top: 11px;
  border: 1px solid var(--line);
  background: #242832;
  color: var(--text);
}

.job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.job-top span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(215, 177, 95, 0.32);
  border-radius: 999px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 360px) {
  h1 {
    font-size: 23px;
  }

  .hero h2 {
    font-size: 21px;
  }

  .segmented {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px;
  }

  .segmented button {
    min-height: 36px;
    font-size: 11px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .radar-item {
    grid-template-columns: 1fr;
  }
}

.job-card b {
  color: var(--text);
}

.job-card button,
.news-card button {
  width: 100%;
  min-height: 40px;
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #242832;
  color: var(--text);
  font-weight: 800;
}

.link-list {
  display: grid;
  gap: 8px;
}

.job-link-list {
  margin-top: 8px;
  margin-bottom: 8px;
}

.news-grid {
  display: grid;
  gap: 10px;
}

.live-actions {
  margin: -2px 0 10px;
}

.live-actions button {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(32, 209, 161, 0.38);
  border-radius: 7px;
  background: rgba(32, 209, 161, 0.12);
  color: var(--green);
  font-weight: 800;
}

.news-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 27, 34, 0.96), rgba(19, 21, 26, 0.96));
}

.news-card a,
.job-card a {
  color: var(--green);
  text-decoration: none;
  font-weight: 800;
}

.link-list a {
  display: block;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #13151a;
  color: var(--text);
  text-decoration: none;
}

.link-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.rank-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #13151a;
  color: var(--text);
  text-decoration: none;
}

.rank-item span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.rank-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.7;
}

.clean-list li + li {
  margin-top: 6px;
}

.output {
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #13151a;
  white-space: pre-wrap;
}

.tool-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.tool-filter button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
}

.tool-filter button.active {
  border-color: rgba(32, 209, 161, 0.5);
  color: var(--green);
}

.text-btn {
  background: transparent;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: white;
  font-size: 13px;
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 760px) {
  .app-shell {
    width: min(100vw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100vw * 9 / 16));
    aspect-ratio: 16 / 9;
    padding: 18px clamp(18px, 2.4vw, 28px) 30px;
  }

  .inspiration-grid,
  #toolList,
  #trainingList,
  #templateList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card,
  .tool-card {
    margin-bottom: 0;
  }
}
