/* 职场生存档案：保留牛马插画，以工牌、日程卡和清楚的操作层级组织界面。 */
:root {
  --bg: #17232f;
  --bg-2: #202f3e;
  --panel: #283b4d;
  --panel-2: #1d2c3a;
  --line: #456078;
  --ink: #f3f5f5;
  --ink-dim: #bbcad4;
  --ink-faint: #95aab9;
  --paper: #f1eee4;
  --yellow: #f4c66b;
  --gold: #f4c66b;
  --teal: #86bce3;
  --green: #6dcc9c;
  --red: #f17e83;
  --shadow: rgba(7, 16, 24, .28);
}

html, body { background: var(--bg); }
body { animation: none; }
#app { background: var(--bg); box-shadow: none; }
.screen.active { animation: none; }

/* 工牌式首屏：两行标题固定断句，主要入口与工具入口分层。 */
#screen-title {
  padding: 20px 24px 68px;
  justify-content: center;
}
#screen-title .title-inner { padding-top: env(safe-area-inset-top, 0px); }
.title-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 360px);
  margin: 0 auto 14px;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--line);
  color: var(--yellow);
  font: 600 12px/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: .04em;
}
.title-kicker span { color: var(--ink-faint); font-family: inherit; font-size: 11px; }
#title-canvas {
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  filter: none;
  transform: none;
  transition: none;
  will-change: auto;
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(44px, 12vw, 60px);
  font-weight: 900;
  letter-spacing: .075em;
  line-height: 1.06;
  text-shadow: 0 3px 0 #0d1923;
  transform: none;
  transition: none;
}
.logo > span { display: block; white-space: nowrap; }
.logo .logo-2 {
  color: var(--ink);
  font-size: .62em;
  letter-spacing: .11em;
  line-height: 1.3;
  text-shadow: none;
}
.subtitle {
  margin: 12px 0 22px;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: .04em;
  transform: none;
  transition: none;
}
#screen-title .menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 360px);
  max-width: 360px;
}
#screen-title .menu .btn {
  min-width: 0;
  min-height: 44px;
  padding: 10px 5px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 8px;
}
#screen-title .menu #btn-new,
#screen-title .menu #btn-continue {
  grid-column: 1 / -1;
  min-height: 50px;
  font-size: 16px;
}
#btn-new { animation: none; }
#btn-continue:not(:disabled) { background: #314a60; border-color: #6794b5; }
.title-tip {
  max-width: 360px;
  margin: 18px auto 0;
  min-height: 36px;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}
.title-credit { color: var(--ink-faint); letter-spacing: .08em; font-size: 11px; }

/* 实色面板替代常驻玻璃和光晕，交互反馈只在操作时发生。 */
.btn, .btn-icon, .qbtn, .action-btn,
.op-card, .op-planner, .op-exec, .stat,
.shop-card, .invest-card, .arcade-card, .ach-card, .codex-card {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: none;
}
.btn, .btn-icon, .qbtn { border-width: 1px; border-bottom-width: 3px; }
.btn:active { margin-bottom: 0; transform: translateY(1px); border-bottom-width: 3px; }
.btn-primary, .op-exec {
  color: #24303a;
  background: var(--yellow);
  border-color: #bc9549;
  text-shadow: none;
}
.btn-good { background: #377555; border-color: #5fa983; color: #fff; }
.hud, .sub-header, #screen-arcade .sub-header,
.overlay, #btn-mute, #ach-pop, .mg-box.mg-app .mg-head {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.hud, .sub-header { background: var(--bg); box-shadow: none; }
.hud { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.hud-day { color: var(--ink); }
.hud-money { background: #2e3d46; border: 0; border-radius: 6px; font-variant-numeric: tabular-nums; }
.hud-level { color: var(--ink-dim); }
#scene { border-color: var(--line); border-radius: 10px; box-shadow: none; animation: none; transform: none; }
.scene-wrap::after, .scene-wrap::before { display: none; }
.scene-time, .daily-chip { background: #17232feb; box-shadow: none; border-radius: 6px; }
.stat { background: var(--panel-2); border-color: #304757; border-radius: 7px; }
.stat-label b { font-variant-numeric: tabular-nums; }
.stat-bar { background: #13212c; border: 0; }
.stat-fill.low { animation: none; }
.qbtn { border-radius: 7px; }
.qbtn .qb-ic { filter: none; }
.panel { background: var(--panel-2); border-color: #304757; box-shadow: none; border-radius: 10px; }
.narr { color: var(--ink-dim); }
.op-top { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.op-top span { color: var(--ink); }
.op-card { border-radius: 9px; border-bottom-width: 3px; }
.op-card.selected { background: #354757; border-color: var(--yellow); box-shadow: inset 3px 0 0 var(--yellow); filter: none; }
.op-card:active { transform: translateY(1px); }
.op-card-ic { background: #1b2c3c; border-radius: 7px; box-shadow: none; }
.op-card-tag { color: var(--teal); background: #203749; border-radius: 4px; }
.op-card-name { color: var(--ink); }
.op-risk i.on { background: var(--yellow); box-shadow: none; }
.op-planner { background: transparent; }
.op-forecast span { color: var(--ink-dim); border: 0; border-radius: 4px; background: #293d4e; }
.op-forecast .op-estimate {
  display: block;
  flex: 1 1 100%;
  padding: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  white-space: normal;
}
.op-estimate-note { display: block; flex: 1 1 100%; color: var(--ink-faint); font-size: 10px; line-height: 1.35; }
.preview-gain { color: var(--green); }
.preview-cost { color: var(--ink-dim); }
.op-exec { border-radius: 9px; border-bottom-width: 3px; }
.op-exec:active { transform: translateY(1px); border-bottom-width: 3px; }
.work-goal {
  flex: none;
  margin: 0 0 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--teal);
  border-radius: 0 5px 5px 0;
  color: var(--ink-dim);
  background: #263b4b;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.work-goal strong, .work-goal b { color: var(--ink); font-weight: 700; }
.work-goal > strong { margin-right: 7px; }
.work-goal small { font-size: inherit; }
.work-goal:empty { display: none; }
.work-goal[data-danger="true"] { border-left-color: var(--red); background: #3b303d; }
.work-goal[data-danger="true"] strong { color: #ffbcc0; }

/* 职业卡同时承载说明与选择，避免先读完一整页才能找到按钮。 */
.overlay { background: rgba(9, 17, 24, .84); }
.modal { background: var(--panel-2); border-color: var(--line); border-radius: 14px; box-shadow: 0 16px 40px var(--shadow); }
.modal-title { color: var(--yellow); }
.modal-art { border-radius: 8px; box-shadow: none; animation: none; }
.modal-choices .btn { border-radius: 8px; }
.result-summary {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-dim);
  background: #263b4b;
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
}
.result-summary > strong, .result-summary > b { display: block; margin-bottom: 4px; color: var(--yellow); font-size: 12px; }
#modal-box[data-kind="industry"] { max-width: 460px; padding: 16px; }
#modal-box[data-kind="industry"] .modal-icon { font-size: 28px; }
#modal-box[data-kind="industry"] .modal-title { margin-block: 5px; font-size: 19px; }
#modal-box[data-kind="industry"] .modal-text { color: var(--ink-dim); font-size: 13px; }
#modal-box[data-kind="industry"] .modal-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.modal-choices .industry-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  min-height: 105px;
  padding: 10px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
  white-space: normal;
  line-height: 1.45;
}
.industry-card strong, .industry-card b { color: var(--yellow); font-size: 15px; font-weight: 800; }
.industry-card span, .industry-card small { display: block; margin-top: 5px; color: var(--ink-dim); font-size: 11px; font-weight: 400; }
.industry-card:hover { border-color: var(--teal); }
.mg-box.mg-app { background: var(--panel-2); border-color: var(--line); box-shadow: none; }
.mg-box.mg-app::before { background: var(--yellow); }
.mg-box.mg-app .mg-head { background: var(--panel); border-color: var(--line); }
#ach-pop { background: #354335; border-color: #829960; box-shadow: 0 6px 18px var(--shadow); }
.arcade-card-feature { background: #31454e; border-color: var(--teal); }
.icp a { color: var(--ink-faint); }

/* 小镇按钮仅留在首页；弹窗和小游戏也不允许被高 z-index 浮层压住。 */
body.game-active .town-return-control,
body.mg-open .town-return-control,
body:has(.overlay:not(.hidden)) .town-return-control { display: none; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  #screen-title .menu { max-width: 360px; }
  body.game-active .hud { margin-inline: 10px; padding-inline: 0; }
  body.game-active .hud-money { padding: 4px 6px; }
  body.game-active #scene { border-radius: 10px; }
  body.game-active .stats { min-height: 63px; grid-auto-rows: minmax(27px, auto); }
  body.game-active .stat { border-radius: 6px; padding: 4px 5px; }
  body.game-active .qbtn { border-radius: 7px; }
  body.game-active .panel { border-radius: 10px; }
  body.game-active .work-goal { margin-bottom: 6px; padding: 5px 7px; font-size: 11px; line-height: 1.35; }
  body.game-active .narr { margin-bottom: 6px; }
  body.game-active .op-top { padding: 3px 1px 5px; }
  body.game-active .op-card { border-radius: 8px; }
  body.game-active .op-card-ic { border-radius: 6px; }
  body.game-active .op-card-desc { min-height: 0; }
  body.game-active .op-card-tag { border-radius: 4px; }
  body.game-active .op-exec { border-radius: 8px; }
  body.game-active .op-forecast { display: flex; gap: 3px 7px; padding: 0; }
  body.game-active .op-forecast span { min-height: 16px; white-space: normal; overflow: visible; font-size: 10px; line-height: 1.35; }
  body.game-active .op-forecast .op-estimate { min-height: 0; }
  body.game-active .op-estimate-note { font-size: 9px; }
  body.game-active .op-deck { overflow: visible; }
  body.game-active .actions.op-desk { overflow: visible; }
}

@media (max-width: 600px) and (max-height: 740px) {
  #screen-title { padding: 14px 20px 58px; }
  .title-kicker { margin-bottom: 10px; }
  #title-canvas { width: 230px; margin-bottom: 10px; }
  .logo { font-size: 46px; }
  .subtitle { margin: 9px 0 14px; font-size: 12px; }
  .title-tip { margin-top: 12px; }
  body.game-active .work-goal { font-size: 11px; padding-block: 4px; }
  body.game-active .op-forecast { display: flex; }
  body.game-active #scene { max-height: min(18dvh, 132px); object-fit: contain; background: var(--panel-2); }
  body.game-active #screen-game.active { grid-template-rows: auto auto minmax(63px, auto) auto minmax(min-content, 1fr); }
  body.game-active .panel { min-height: min-content; overflow: visible; }
  body.game-active .actions.op-desk { flex: 1 0 auto; min-height: auto; }
  body.game-active .op-deck { height: auto; min-height: min-content; grid-template-rows: auto auto auto; }
  body.game-active .op-hand { height: auto; min-height: 118px; grid-auto-rows: minmax(56px, auto); }
  body.game-active .op-forecast .op-estimate { font-size: 11px; }
  body.game-active .op-estimate-note { font-size: 10px; }
  #modal-box[data-kind="industry"] { padding: 12px; }
  #modal-box[data-kind="industry"] .modal-choices { gap: 6px; margin-top: 9px; }
  .modal-choices .industry-card { min-height: 91px; padding: 8px; }
}

@media (max-width: 600px) and (max-height: 600px) {
  #screen-title { justify-content: flex-start; padding-top: 10px; }
  .title-kicker { margin-bottom: 7px; font-size: 11px; padding-bottom: 6px; }
  #title-canvas { width: 164px; margin-bottom: 8px; }
  .logo { font-size: 36px; gap: 2px; }
  .subtitle { margin: 7px 0 11px; font-size: 11px; }
  #screen-title .menu { gap: 6px; }
  #screen-title .menu #btn-new, #screen-title .menu #btn-continue { min-height: 45px; }
  .title-tip { min-height: 0; margin-top: 10px; font-size: 11px; }
  body.game-active #scene { max-height: 90px; }
  .overlay { padding: 12px; }
}

@media (max-width: 600px) and (min-height: 741px) {
  body.game-active .work-goal { font-size: 12px; line-height: 1.45; }
  body.game-active .work-goal > strong,
  body.game-active .work-goal > span { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
