:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e8eef4;
  --muted: #8b9cb3;
  --accent: #5b9fd4;
  --accent-dim: #3d7aaf;
  --danger: #c75c5c;
  --success: #6cbf6c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.top-bar h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.screen.hidden {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card.subtle {
  opacity: 0.85;
  font-size: 0.9rem;
}

.card.subtle h3 {
  margin-top: 0;
  font-size: 0.95rem;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0;
}

.cheat-input {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0.35rem 0 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1a2332;
  color: var(--text);
  font-size: 0.95rem;
}

.start-preview {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* 学历 tag 颜色 */
.edu-tag {
  font-weight: 600;
}
.edu-tag-qingbei {
  color: #e8c547;
  text-shadow: 0 0 12px rgba(232, 197, 71, 0.25);
}
.edu-tag-haigui-985 {
  color: #b794f6;
}
.edu-tag-211 {
  color: #63b3ed;
}
.edu-tag-default {
  color: #f0f4f8;
  font-weight: 500;
}

.boot-fail {
  color: #f0a8a8;
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(199, 92, 92, 0.12);
}

.boot-fail code {
  font-size: 0.8rem;
  color: var(--text);
}

.hidden {
  display: none !important;
}

.resources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.res {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}

.res .label {
  display: block;
  color: var(--muted);
}

.res .value {
  font-weight: 600;
  font-size: 1.1rem;
}

.status-effects {
  margin-bottom: 1rem;
}

.status-effects-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.status-effects-hint {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}

.status-effects-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.status-effect {
  margin-bottom: 0.35rem;
}

.status-effect--debuff {
  color: #e8a0a0;
  border-left: 3px solid var(--danger);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  list-style-position: outside;
}

.status-effect--buff {
  color: #a8d4a8;
  border-left: 3px solid var(--success);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  list-style-position: outside;
}

.banner {
  background: linear-gradient(90deg, #2a3f5a, #1a2332);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.banner.hidden {
  display: none;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.day-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.day-control-row .secondary {
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
}

.action-btn {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #243044;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
}

.action-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-btn small {
  color: var(--muted);
}

button.primary {
  background: var(--accent);
  color: #0a0e14;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover {
  filter: brightness(1.08);
}

button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

button.secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

button.secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.danger {
  background: #3d2528;
  color: #f0b4b4;
  border: 1px solid #6b3d42;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.trait-picks h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.trait-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.trait-btn {
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #243044;
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}

.trait-btn.selected {
  border-color: var(--accent);
  background: #2a4a66;
}

.offer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.offer-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.trait-panel p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.trait-panel strong {
  color: var(--accent);
}

.log-panel ul {
  max-height: 180px;
  overflow-y: auto;
  padding-left: 1.1rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.company-view {
  min-height: 120px;
  margin: 1rem 0;
}

.company-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.company-logo {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.company-view .company-title {
  margin: 0;
  font-size: 1.15rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: #2d3a4d;
}

.tag.hidden-tag {
  background: #4a3d2a;
  color: #f0d9a8;
}

.tag-block {
  margin: 0.45rem 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.tag-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 0.35rem;
}

.tag-quality {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.68rem;
  vertical-align: middle;
}

.tag-q-bad {
  background: #4a2828;
  color: #f0a8a8;
}

.tag-q-normal {
  background: #3d4550;
  color: var(--muted);
}

.tag-q-good {
  background: #284a32;
  color: #a8f0c0;
}

.tag-q-excellent {
  background: linear-gradient(135deg, #4a3d18 0%, #2d2610 100%);
  color: #ffd54f;
  box-shadow: inset 0 0 0 1px rgba(255, 193, 7, 0.35);
}

.hidden-row {
  margin-top: 0.5rem;
}

.talent-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.talent-line {
  position: relative;
  margin: 0.35rem 0;
  line-height: 1.45;
}

.talent-bubble-btn {
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.talent-bubble-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.talent-bubble-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.talent-summary-btn {
  font-size: 0.86rem;
  color: var(--muted);
  border-style: dashed;
}

.talent-bubble {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 12rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  text-align: left;
  color: var(--text);
}

.talent-bubble-wide {
  max-width: min(26rem, calc(100vw - 2rem));
}

.talent-bubble-inner {
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.talent-bubble-hint-line {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.talent-bubble-hint-line:first-child {
  margin-top: 0;
}

.talent-name {
  font-weight: 600;
  margin-right: 0;
}

.talent-gold {
  color: #e8c547;
  text-shadow: 0 0 12px rgba(232, 197, 71, 0.35);
}

.talent-purple {
  color: #c78fff;
}

.talent-blue {
  color: #6eb8ff;
}

.talent-white {
  color: #cfd8e6;
}

.talent-black {
  color: #9aa7b8;
}

.apply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-inner {
  max-width: 420px;
  width: 100%;
}

.interview-result-desc {
  white-space: pre-line;
  text-align: left;
  margin: 0.5rem 0 0;
  line-height: 1.55;
}

.event-modal-card {
  text-align: center;
}

.event-modal-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  user-select: none;
}

.event-modal-card #event-title {
  margin-top: 0;
}

.event-modal-card #event-desc {
  text-align: left;
}

.offer-pick-card {
  max-width: 520px;
  margin: 0 auto;
}

.offer-pick-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
  text-align: left;
}

.offer-pick-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.12);
}

.offer-pick-row:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.offer-pick-row input {
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.offer-pick-main {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  font-size: 0.9rem;
}

.offer-pick-logo {
  margin-right: 0.35rem;
}

.offer-pick-name {
  font-weight: 600;
  color: var(--text);
}

.offer-pick-tier {
  display: inline;
}

.offer-pick-trap {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
}

.end-best-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
  margin: 0;
  margin-top: 0.35rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
}

.end-company-rating {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.end-company-rating-title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.end-stars-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.12rem;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.end-star {
  color: #f5c542;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
}

.end-star.end-star--red {
  color: #e53935;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
}

.end-company-rating--colorful .end-star {
  background: linear-gradient(
    110deg,
    #fbbf24 0%,
    #fb7185 22%,
    #a78bfa 45%,
    #38bdf8 68%,
    #4ade80 88%,
    #fbbf24 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.15));
}

.end-company-rating-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
}

.end-offer-tag {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 100%;
}

.end-offer-tag-label {
  word-break: break-word;
}

.end-offer-tag-prefix {
  font-size: 0.68rem;
  color: var(--muted);
  margin-right: 0.15rem;
}

.end-offer-tag--hidden {
  border: 1px solid var(--border);
}

.end-card {
  text-align: center;
}

.end-early-day {
  margin: 0.65rem auto 0;
  max-width: 26rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.early-settle-hint {
  margin: 0.85rem 0 0.35rem;
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.25rem;
}

.end-card-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  user-select: none;
}

.end-card #end-body,
.end-card ul {
  text-align: left;
  color: var(--muted);
}

.end-card #end-body {
  color: var(--text);
}

.end-talents {
  margin: 1rem 0;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.08);
}

.end-talents-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.end-talents-inner .talent-line {
  margin-bottom: 0.45rem;
}

.end-talents-inner .talent-line:last-child {
  margin-bottom: 0;
}

.end-talents-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  text-align: center;
}

.end-best-offer {
  margin: 1rem 0;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.12);
}

.end-best-offer-title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.end-best-offer-inner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.end-best-logo {
  font-size: 2.35rem;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.end-best-name {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.end-best-salary {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* 临界压力 / 低精力：全屏氛围（#vital-fx z-index 低于 .modal，弹窗在上） */
.vital-fx {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  overflow: hidden;
}

.vital-fx-stress,
.vital-fx-energy {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.vital-fx--stress .vital-fx-stress {
  opacity: 1;
  background:
    radial-gradient(ellipse 100% 85% at 50% 42%, rgba(255, 60, 40, 0) 0%, rgba(255, 45, 35, 0.14) 55%, rgba(130, 15, 25, 0.5) 100%),
    linear-gradient(180deg, rgba(90, 10, 15, 0.35) 0%, transparent 40%, rgba(40, 5, 10, 0.45) 100%);
  mix-blend-mode: multiply;
  animation: vital-stress-pulse 1.8s ease-in-out infinite;
}

.vital-fx--stress .vital-fx-stress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(180, 30, 40, 0.22) 100%);
  animation: vital-stress-vignette 2.4s ease-in-out infinite;
}

.vital-fx--energy .vital-fx-energy {
  opacity: 1;
  background: radial-gradient(ellipse 95% 90% at 50% 48%, rgba(30, 55, 90, 0) 35%, rgba(8, 18, 38, 0.82) 100%);
  box-shadow: inset 0 0 100px rgba(10, 25, 55, 0.65);
  animation: vital-energy-breathe 3.2s ease-in-out infinite;
}

.vital-fx--energy .vital-fx-energy::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.02) 2px,
    rgba(255, 255, 255, 0.02) 3px
  );
  opacity: 0.5;
  pointer-events: none;
}

@keyframes vital-stress-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@keyframes vital-stress-vignette {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@keyframes vital-energy-breathe {
  0%,
  100% {
    opacity: 0.88;
    filter: saturate(0.65) brightness(0.9);
  }
  50% {
    opacity: 1;
    filter: saturate(0.45) brightness(0.82);
  }
}

@keyframes vital-screen-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  15% {
    transform: translate(-2px, 1px);
  }
  30% {
    transform: translate(2px, -1px);
  }
  45% {
    transform: translate(-1px, -2px);
  }
  60% {
    transform: translate(2px, 1px);
  }
  75% {
    transform: translate(-2px, 0);
  }
}

@keyframes vital-screen-sway {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

body.vital-stress-active #app {
  animation: vital-screen-shake 0.32s linear infinite;
  will-change: transform;
}

body.vital-energy-active:not(.vital-stress-active) #app {
  animation: vital-screen-sway 2.6s ease-in-out infinite;
  will-change: transform;
}

body.vital-stress-active.vital-energy-active #app {
  animation:
    vital-screen-shake 0.32s linear infinite,
    vital-screen-sway 2.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .vital-fx--stress .vital-fx-stress,
  .vital-fx--energy .vital-fx-energy {
    animation: none;
  }

  body.vital-stress-active #app,
  body.vital-energy-active #app {
    animation: none;
  }
}

/* —— 图鉴 —— */
.codex-modal-card {
  max-width: min(560px, 100%);
  width: 100%;
  text-align: left;
}

.codex-modal-card #codex-title {
  margin-top: 0;
  text-align: center;
}

.codex-global-line {
  font-size: 0.88rem;
  margin: 0.35rem 0 0.25rem;
  line-height: 1.45;
  text-align: center;
}

.codex-tab-line {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.92rem;
  text-align: center;
}

.codex-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0 0.5rem;
  justify-content: center;
}

.codex-tabs button {
  padding: 0.35rem 0.65rem;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  cursor: pointer;
}

.codex-tabs button:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.codex-tabs button.codex-tab--active {
  border-color: rgba(100, 180, 255, 0.55);
  background: rgba(60, 120, 200, 0.22);
}

.codex-panel {
  max-height: min(52vh, 400px);
  overflow-y: auto;
  margin: 0.5rem 0 1rem;
  padding-right: 0.25rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.codex-entry {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.codex-entry:last-child {
  border-bottom: none;
}

.codex-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.codex-entry-title {
  font-weight: 600;
}

.codex-entry-emoji {
  font-size: 1.15rem;
  line-height: 1;
  user-select: none;
}

.codex-entry-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.codex-entry--locked .codex-entry-title {
  letter-spacing: 0.08em;
}

.codex-rarity-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
}

.codex-modal-card #btn-codex-close {
  width: 100%;
}
