@import url("./cycle-theme.css");

/* Story and doom dialogs live outside .app and need the same control styles. */
.card-track-dialog,
.card-track-item,
.card-track-face,
.card-track-empty,
.card-track-knowledge,
.card-track-progress-badge,
.card-track-side-badge,
.card-track-preview-badge,
.card-track-dialog :is(button, input, select, textarea) { border-radius: 0; }
.card-track-dialog, .card-track-face { box-shadow: none; }
.card-track-dialog, .card-track-item { background: var(--panel); }
.card-track-item { border-color: var(--line); }
.card-track-head h2 {
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--accent-strong);
}
.card-track-title { color: var(--accent-strong); font-weight: 600; }
.card-track-status, .card-track-counter-label, .card-track-knowledge-label,
.card-track-meta, .card-track-dialog button { font-weight: 600; }
.card-track-face, .card-track-empty { border-color: var(--line); background: var(--bg); }
.card-track-knowledge { border-color: var(--line); background: var(--accent-soft); }
.card-track-knowledge-value { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.card-track-side-badge { border-color: var(--line); background: var(--panel); color: var(--accent-strong); font-weight: 600; }
.card-track-progress-badge, .card-track-preview-badge { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; font-weight: 600; }
.card-track-dialog :is(input, select, textarea) { border-color: var(--line); background: var(--panel); color: var(--ink); font-weight: 500; }
.card-track-close, .card-track-progress button, .card-track-counter button, .card-track-retreat {
  border-color: var(--line);
  background: var(--panel);
  color: var(--accent-strong);
}
.card-track-close:hover, .card-track-progress button:hover, .card-track-counter button:hover, .card-track-retreat:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.card-track-advance { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
.card-track-advance:hover { border-color: var(--accent); background: var(--accent); }
.card-track-dialog :is(button, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

body {
  background: var(--bg);
  line-height: 1.6;
}

/* The darker accent keeps white button text legible in the gold cycle too. */
button {
  background: var(--accent-strong);
}

:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.app {
  padding: 40px clamp(20px, 4vw, 56px) 32px;
}

.app button,
.app a.secondary {
  border-radius: 0;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease;
}

/* 「战役简报」是链接，但要和前几个按钮长得完全一样：这里补齐按钮的基础几何
   （基础 button 规则在 index.html 的内联样式里，链接拿不到）。 */
.app a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
  cursor: pointer;
}

.app button.secondary,
.app a.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
}

.app button.secondary:hover,
.app a.secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.app :is(input:not([type="checkbox"]):not([type="range"]):not([type="file"]), textarea, select) {
  min-width: 0;
  border-radius: 0;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
}

.cycle-title {
  color: var(--accent-strong);
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .04em;
}

.cycle-title .cycle-symbol {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.campaign-save-status {
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.campaign-save-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.day-card {
  width: auto;
  min-width: 0;
  grid-template-columns: 72px auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 14px;
  background: var(--panel);
  box-shadow: none;
}

.day-card label {
  gap: 0;
  font-size: 12px;
  font-weight: 500;
}

.day-card #dayInput {
  width: 72px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 400;
  text-align: center;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.day-actions {
  grid-column: 2;
  grid-template-columns: repeat(2, max-content);
  align-content: center;
  align-items: center;
  gap: 8px;
}

.archive-actions {
  display: grid;
  /* 导出和导入略宽，战役简报略窄；整行与上方账号操作行同宽。 */
  grid-template-columns: 1.1fr 1.1fr 0.8fr;
  align-items: center;
  gap: 6px;
}

.app .archive-actions :is(button, a) {
  min-width: 0;
  padding-inline: 8px;
  white-space: nowrap;
}

.app .archive-actions :is(button, a) { width: 100%; }

.dashboard-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  border-block: 1px solid var(--line);
  margin-bottom: 36px;
  padding-block: 10px;
}

.record-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 30px;
}

.record-links .campaign-save-status {
  max-width: 100%;
  white-space: normal;
}

.app .record-card-link {
  min-height: 40px;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.record-card-link::after {
  content: "↗";
  margin-left: 8px;
  color: var(--gold);
}

/* 跳转行图标：字形是 assets/icons/<名称>.svg，由 .atopack 的 iconFiles 段随包安装
   （程序包不带这些提取自原 App 的素材，见 tools/packaging/package_common.py）。
   这里用 CSS 遮罩 + currentColor 上色，图标照旧跟随链接颜色与悬停色；没有字形时
   这一格自然为空，文字标签不受影响。
   每个字形按「等包围盒面积」缩放，尺寸由内联的 --nav-icon-w/h 给出，
   否则扁长的字形（如 argo 120x81）会比近方形的字形明显偏小。 */
.app .record-card-link > .nav-icon {
  width: var(--nav-icon-w, 16px);
  height: var(--nav-icon-h, 16px);
  flex: 0 0 auto;
  margin-right: 6px;
  background-color: currentColor;
  -webkit-mask-image: var(--icon-src);
  mask-image: var(--icon-src);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.app .record-card-link:hover {
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.title-cycle-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
}

.title-cycle-control select {
  min-width: 180px;
  min-height: 40px;
}

.grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
}

.grid > .stack {
  gap: 16px;
}

.app .panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 16px;
  background: var(--panel);
  box-shadow: none;
  overflow: visible;
}

.panel-head {
  min-height: 48px;
  padding: 0 0 14px;
  background: transparent;
  align-items: baseline;
}

.panel-head h2 {
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif;
  color: var(--accent-strong);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .05em;
}

.panel-body {
  padding: 16px 0 0;
}

.flow-head-tools {
  min-width: 0;
}

.progress {
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.progress-track {
  width: 100px;
  height: 3px;
  border-radius: 0;
  background: var(--line);
}

.flow-list {
  gap: 0;
}

.flow-step {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 24px 0;
  gap: 14px;
  background: transparent;
}

.flow-step:first-child {
  padding-top: 8px;
}

.flow-step.done {
  border-color: var(--line);
  background: transparent;
}

.flow-step.done .step-desc {
  color: #667867;
}

.flow-check {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 5px 0 0;
  padding: 4px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  background-clip: content-box;
}

.flow-check:checked {
  background-color: var(--accent);
}

.flow-check:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.step-title {
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
}

.step-index {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
}

.step-kind {
  font-size: 11px;
  font-weight: 500;
}

.step-desc {
  line-height: 1.8;
}

.step-actions {
  gap: 6px 10px;
}

.step-actions a,
.step-actions button.round-end-mark-button {
  border: 0;
  border-radius: 0;
  padding-inline: 4px;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
  font-weight: 600;
}

.step-actions a:hover,
.step-actions button.round-end-mark-button:hover {
  background: var(--accent-soft);
}

/* 注意：.exploration-removed-pile / .exploration-hidden / .exploration-builder 故意不在这份
   扁平化名单里。它们是探索区里的折叠入口，外观由 index.html 里那组统一的折叠卡片样式负责
   （同样的边框、圆角、底色与自定义三角）。这里如果一并清成透明无边框，就会盖掉那组规则
   —— 本表随 index.html 之后加载，且 `.app` 前缀的特异性更高。
   .exploration-faction-chip 同理移出：派系标签靠"细环 + 当前项加深"区分，环与底色都由
   下面那两条规则给。 */
.app :is(.step-track-reminder, .exploration-tools,
  .exploration-destruction,
  .exploration-destruction-card, .survey-constants,
  .survey-constant-card, .survey-hub-summary, .event-item, .second-screen-card,
  .empty, .field-note, .session-account) {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* 派系标签：方形细环、无底色；只有 AG 当前格所在的那个把环加深（其余两个只有
   一圈浅环）。 */
.app .exploration-faction-chip {
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.app .exploration-faction-chip.current {
  border: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 900;
}

.app :is(.exploration-tools, .exploration-destruction) {
  border-top: 1px solid var(--line);
  padding: 10px 0 0;
}

.app :is(.survey-constants, .structure-tech-tools) {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  padding: 0;
}

.survey-constants summary,
.app .structure-tech-tools > summary {
  padding: 9px 10px;
  color: var(--accent-strong);
  font-weight: 600;
}

.survey-constants[open] > summary,
.app .structure-tech-tools[open] > summary {
  border-bottom: 1px solid var(--line);
}

.survey-constants-body {
  padding: 10px;
  background: var(--bg);
}

.survey-constant-heading {
  color: var(--accent-strong);
}

.survey-constants-body > .survey-constant-group + .survey-constant-group {
  border-top: 1px solid var(--accent);
  margin-top: 8px;
  padding-top: 18px;
}

.survey-hub-summary-row {
  border-color: var(--line);
}

.survey-hub-summary-row.header,
.survey-hub-summary-row.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.app .survey-constant-tag {
  border-radius: 0;
}

.survey-constant-card {
  padding: 8px 0;
}

/* 提醒条统一按「结构科技」那条的规格：左侧 4px 竖条 + 一圈同色系的包边。
   （原来只有科技类带包边，其余是 2px 左条、四面没有边框，看着深浅不一。） */
.app .step-track-reminder {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  padding: 8px 12px;
}

.app .step-track-reminder.important {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  border-left-color: var(--danger);
  background: #f6ebe3;
}

.app .step-track-reminder.tech {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  border-left-color: var(--accent);
}

.app .step-track-reminder.terrain {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
}

.app .step-track-reminder.calamity {
  border: 1px solid #dcae9f;
  border-left: 4px solid #a52206;
  background: #f8ded8;
}

.app .step-track-reminder.story-progress {
  border: 1px solid #a6cbb6;
  border-left: 4px solid #216849;
  background: #dcefe3;
}

.app .step-track-reminder.calamity .step-track-tag {
  background: #a52206;
  color: #fff;
}

.app .step-track-reminder:is(.terrain, .calamity, .story-progress) .step-track-desc {
  color: var(--ink);
}

.app .step-track-reminder.battle-tech {
  border: 1px solid #8fa5cf;
  border-left: 4px solid #355a9a;
  background: #e0e9fa;
}

.app .step-track-reminder.structure-tech {
  border: 1px solid #7fb69f;
  border-left: 4px solid #216849;
  background: #dcefe3;
}

/* 地图上的「凝固时光」和「泰坦标记」同属移动步骤的结构科技提醒，但它们是两件事：
   泰坦那条保持绿色系，凝固时光改用蓝灰色，一眼能分清。 */
.app .step-track-reminder.structure-tech.map-frozen-time-reminder {
  border: 1px solid #a3b1c2;
  border-left: 4px solid #4f6076;
  background: #e9eef4;
  margin-top: 10px;
}

.app .step-track-reminder.map-frozen-time-reminder .step-track-tag {
  background: #4f6076;
  color: #fff;
}

/* 整条提醒的配色：跟着标签的类型走（R&R 紫、板块砖橙、回忆突破紫蓝、谈判绿、
   进展赭金），而不是只有标签本身变色。 */
.app .step-track-reminder.rr {
  border: 1px solid #b9a9d6;
  border-left: 4px solid #6c4fa1;
  background: #eee8f8;
}

.app .step-track-reminder.tile {
  border: 1px solid #dcae86;
  border-left: 4px solid #a2551d;
  background: #f8e9dc;
}

.app .step-track-reminder.exploration-card {
  border: 1px solid #b5b5b5;
  border-left: 4px solid #222;
  background: #f1f1f1;
  color: #111;
}

.app .step-track-reminder.exploration-card .step-track-desc {
  color: #222;
}

.app .step-track-reminder.milestone {
  border: 1px solid #a8b1dd;
  border-left: 4px solid #3f55a5;
  background: #e6e9f8;
}

.app .step-track-reminder.negotiation {
  --bg: #eef7f0;
  --panel: #f8fcf9;
  --muted: #486653;
  --line: #a4c9b0;
  --accent: #2f8056;
  --accent-strong: #216849;
  --accent-soft: #e8f5eb;
  border: 1px solid #7fb69f;
  border-left: 4px solid #216849;
  background: #dcefe3;
  padding: 8px 0;
}

.app .step-track-reminder.negotiation > :is(.step-track-title, .step-track-desc) {
  padding-inline: 12px;
}

.app .step-track-reminder.negotiation .step-track-title {
  color: var(--accent-strong);
}

.app .step-track-reminder.negotiation .step-track-title > .step-track-tag + span {
  color: #000;
}

.app .step-track-reminder.negotiation > summary {
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
}
.app .step-track-reminder.negotiation > summary::-webkit-details-marker { display: none; }
.app .step-track-reminder.negotiation > summary::before {
  content: "";
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  transition: transform 140ms ease;
}
.app .step-track-reminder.negotiation[open] > summary::before { transform: rotate(90deg); }

.app .step-track-reminder.advance {
  border: 1px solid #d8c48f;
  border-left: 4px solid #8a6a12;
  background: #f7f0dc;
}

/* 整条有底色的提醒，说明文字改用正文色，别在彩底上发灰。 */
.app .step-track-reminder:is(.rr, .tile, .milestone, .negotiation, .advance) .step-track-desc {
  color: var(--ink);
}

.app .step-track-reminder:is(.battle-tech, .structure-tech) .step-track-desc {
  color: var(--ink);
}

/* 提醒标签 / 日历图标共用一套实底白字配色。原先只有结构科技（绿）、战斗科技（蓝）、
   战斗（淡底红字）三种，且战斗与灾祸同为战斗事件却一个淡底一个红底、R&R 与板块又和
   「谈判」撞色。现在按类型一色一种，并给 R&R / 板块 / 谈判 / 进展 / 回忆突破各自
   单独的变体类（见 index.html 里的 tag.className）。
   顺序要求：两个"基准"类（battle-tech / structure-tech）必须排在各个变体前面 ——
   这些选择器特异性完全相同，后出现的赢。 */
.app :is(.date-track-icon, .step-track-tag).battle-tech {
  background: #355a9a;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).structure-tech {
  background: #216849;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).rr {
  background: #6c4fa1;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).tile {
  background: #a2551d;
  color: #fff;
}

.app .step-track-tag.exploration-card {
  background: #222;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).negotiation {
  background: #216849;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).advance {
  background: #8a6a12;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).milestone {
  background: #3f55a5;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).battle {
  background: #9d332c;
  color: #fff;
}

.app :is(.date-track-icon, .step-track-tag).important {
  background: var(--danger);
  color: #fff;
}

.date-track-list {
  max-height: 420px;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.date-track-item {
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 10px;
  background: transparent;
  font-weight: 500;
}

.date-track-item:is(.event, .noted) {
  border-color: var(--line);
  background: transparent;
}

/* C4 可以一直往后推，没有上限。时间表之外的续推日用虚线隔开，表示它不是印刷
   时间表里的一行（见 index.html 的 trackEntriesForRender）。 */
.date-track-item.beyond-track {
  border-top: 1px dashed var(--line);
}

.date-track-item:hover {
  background: var(--accent-soft);
}

.date-track-item.current,
.date-track-item.current.noted {
  border: 0;
  border-left: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding-left: 7px;
  background: var(--accent-soft);
  box-shadow: none;
}

.date-track-day {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 18px;
}

.date-track-icon {
  border-radius: 0;
  font-weight: 600;
}

.date-track-meta {
  font-size: 12px;
  font-weight: 500;
}

/* 今日流程顶部的扎根提醒：直接复用科技到期提醒条的样式（.structure-tech-due），
   只在已扎根后把整条压灰，避免处理完还一直抢眼。 */
.app .acclimation-reminder.applied .structure-tech-due-item {
  border-left-color: var(--line);
  background: var(--panel);
}

.app .acclimation-reminder.applied .structure-tech-due-item > span {
  color: var(--muted);
}

.app .acclimation-reminder .structure-tech-due-actions button:disabled {
  opacity: .55;
  cursor: default;
}

.app .structure-tech-tools {
  margin-top: 12px;
  width: 100%;
  min-width: 0;
}

/* 标题行里的文字与命运徽章装在一层 flex 里，summary 自己保持 list-item 时原生三角会被块级
   flex 挤到单独一行；这里跟折叠提醒一样改成 flex 行 + 自绘三角，三角、标题、徽章同排。 */
.app .structure-tech-tools > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.app .structure-tech-tools > summary::-webkit-details-marker { display: none; }
.app .structure-tech-tools > summary::before {
  content: "";
  flex: 0 0 auto;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  transition: transform 140ms ease;
}
.app .structure-tech-tools[open] > summary::before { transform: rotate(90deg); }

/* 谈判列表沿用「科技航行能力 · 使用与时间线」的折叠行与展开卡：
   这里只保留提醒条内部的定位，行本身的 padding / border / background
   全部交给下面通用的 grouped 规则，避免旧的谈判专用覆盖把展开卡压扁。 */
.app .step-track-reminder.negotiation > .structure-tech-tools {
  margin-top: 8px;
  border: 0;
  background: transparent;
}
.app .step-track-reminder.negotiation .structure-tech-actions {
  padding: 0 10px 4px;
  background: transparent;
}
.app .step-track-reminder.negotiation .structure-tech-actions > div {
  display: grid;
  gap: 0;
}
.app .step-track-reminder.negotiation .structure-tech-action-status:not(:empty) {
  grid-column: 1 / -1;
  padding: 8px 10px;
  background: #f3faf5;
}
/* 荒原商人的待选牌是一张临时卡，不是可折叠的能力行；给它和展开卡一致的外框。 */
.app .step-track-reminder.negotiation .structure-tech-negotiation-draw {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
}

.app .structure-tech-actions { min-width: 0; padding: 0 10px 8px; background: var(--bg); font-size: 13px; }
.app .structure-tech-action { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.app .structure-tech-action:first-child { border-top: 0; }
.app .structure-tech-action-title { flex: 0 1 auto; min-width: 0; text-align: left; }
.app .structure-tech-action-title strong { font-weight: inherit; }
.app .structure-tech-card-dialog { width: max-content; max-width: min(960px, 94vw); max-height: 90vh; margin: auto; padding: 16px; overflow: auto; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.app .structure-tech-card-dialog::backdrop { background: #0009; }
.app .structure-tech-card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.app .structure-tech-card-header h3 { margin: 0; font-size: 16px; }
.app .structure-tech-card-close { flex-shrink: 0; padding: 5px 10px; font: inherit; }
.app .structure-tech-card-images { display: flex; flex-wrap: wrap; gap: 12px; }
.app .structure-tech-card-images figure { flex: 0 1 420px; min-width: 0; max-width: 100%; margin: 0; }
.app .structure-tech-card-images figcaption { margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.app .structure-tech-card-images img { display: block; width: auto; height: auto; max-width: 100%; max-height: 72vh; object-fit: contain; }
/* The containers retain the form's logical groups without forcing new rows. */
.app :is(.structure-tech-action-mode, .structure-tech-action-fields) { display: contents; }
.app .structure-tech-action-choice { display: inline-flex; flex: 0 1 auto; flex-wrap: nowrap; align-items: center; gap: 4px; min-width: 0; max-width: 100%; margin: 0; }
.app .structure-tech-action-choice :is(select, input[type="text"], input[type="number"]) { width: auto; max-width: 18em; min-width: 0; min-height: 30px; padding: 4px; font: inherit; }
.app .structure-tech-action-choice input[type="checkbox"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; }
.app .structure-tech-action-choice input[type="number"] { width: 4.5em; }
.app .structure-tech-negotiation-cards { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.app .structure-tech-negotiation-card { display: flex; flex: 0 1 220px; flex-wrap: wrap; align-items: center; gap: 5px; cursor: pointer; }
.app .structure-tech-negotiation-card img { width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.app .exploration-pursuit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; margin: 8px 0; border-left: 3px solid var(--accent); background: var(--panel); font-size: 12px; }
.app .exploration-pursuit-count { display: inline-flex; align-items: center; gap: 6px; }
.app .exploration-pursuit-count img { width: 22px; height: 22px; object-fit: contain; }
.app .exploration-pursuit > span { flex: 1 1 240px; min-width: 0; }
.app .exploration-pursuit :is(select, button) { max-width: 100%; }
.app .exploration-pursuit details img { display: block; width: 240px; max-width: 100%; height: auto; }
.app .structure-tech-trade-lines { display: flex; flex: 1 0 100%; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.app .structure-tech-trade-hint { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 12px; }
.app .structure-tech-trade-line { display: flex; flex: 1 1 220px; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.app .structure-tech-trade-line > label:first-child { flex: 1 1 0; }
.app .structure-tech-trade-line select { flex: 1 1 0; width: 100%; max-width: 100%; min-width: 0; }
.app .structure-tech-trade-line input[type="number"] { width: 3.5em; }
.app :is(.structure-tech-action-preview, .structure-tech-action-status) { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.app .structure-tech-action-preview { flex: 1 0 max-content; min-width: 0; max-width: 100%; color: var(--muted); font-size: 12px; line-height: 1.5; }
.app .structure-tech-action-cost { color: var(--ink); font-weight: 700; }
.app .structure-tech-action-preview[data-wrap="true"] { flex-basis: 100%; order: 1; }
.app .structure-tech-action-status:not(:empty) { margin: 6px 0; }
.app .structure-tech-action-status:empty { display: none; }
.app .structure-tech-action-status[data-state="error"] { color: #a33627; }
.app .structure-tech-action-use { flex: 0 0 auto; min-height: 30px; margin-left: auto; padding: 5px 8px; font: inherit; }
.app .structure-tech-action-use:disabled { opacity: .55; cursor: default; }
/* Voyage abilities use compact disclosure rows; keep the console's typography,
   square controls and cycle/theme palette. Other shared panels stay unchanged. */
.app .structure-tech-actions[data-layout="grouped"] { padding: 0 10px 6px; container: tech-abilities / inline-size; }
.app .structure-tech-category-title { display: flex; align-items: center; gap: 7px; margin: 0; padding: 7px 0 2px; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; }
.app .structure-tech-category-title > span { font-weight: 400; }
.app .structure-tech-category + .structure-tech-category { margin-top: 3px; }
.app .structure-tech-entry { min-width: 0; border-bottom: 1px solid var(--line); }
.app .structure-tech-entry:last-child { border-bottom: 0; }
.app .structure-tech-entry > summary { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 5px 0; list-style: none; cursor: pointer; font-size: 12px; line-height: 1.6; }
.app .structure-tech-entry > summary::-webkit-details-marker { display: none; }
.app .structure-tech-entry > summary::before { content: ''; flex: 0 0 auto; border-top: 3px solid transparent; border-bottom: 3px solid transparent; border-left: 4px solid var(--accent); }
.app .structure-tech-entry[open] > summary::before { transform: rotate(90deg); }
.app .structure-tech-entry > summary:hover { background: var(--accent-soft); }
.app .structure-tech-entry-title { flex: 0 1 auto; min-width: 0; color: var(--accent); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .structure-tech-entry-meta { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.app .structure-tech-entry-state { flex: 0 1 auto; max-width: 40%; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.app .structure-tech-entry-state[data-state="ready"] { padding: 1px 6px; border: 1px solid var(--accent-strong); background: var(--accent-strong); color: #fff; font-weight: 700; }
.app .structure-tech-entry-state[data-state="ready"]::before { content: '✓'; margin-right: 4px; }
.app .structure-tech-entry[open] > summary,
.app .structure-tech-entry[open] > summary:hover { padding-right: 8px; background: var(--accent-strong); }
.app .structure-tech-entry[open] > summary :is(.structure-tech-entry-title, .structure-tech-entry-meta, .structure-tech-entry-state) { color: #fff; }
.app .structure-tech-entry[open] > summary::before { border-left-color: #fff; }
.app .structure-tech-entry[open] > summary .structure-tech-entry-state[data-state="ready"] { border-color: #fff; background: #fff; color: var(--accent-strong); }
.app .structure-tech-entry > .structure-tech-action { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(230px, 1fr); align-items: start; gap: 14px 22px; margin: 0 0 8px; padding: 12px 16px 14px; border: 1px solid var(--line); border-top: 0; border-left: 3px solid var(--accent); background: var(--panel); }
.app .structure-tech-action-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.app .structure-tech-action-source { min-width: 0; color: var(--muted); font-size: 11px; }
.app .structure-tech-action-source:has(select) { flex: 1 1 auto; max-width: 420px; }
.app .structure-tech-action-source-choice { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.app .structure-tech-action-source-choice select { flex: 1 1 auto; min-width: 0; width: 100%; max-width: 100%; min-height: 28px; padding: 4px 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; }
/* 泰坦强化的来源行：保留“来源：”，把下拉框换成并排的可用科技按钮。 */
.app .structure-tech-action-source:has(.structure-tech-source-toggle) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app .structure-tech-source-toggle { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.app .structure-tech-source-pick { min-height: 26px; padding: 2px 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; }
.app .structure-tech-source-pick[data-available="false"] { opacity: .55; }
.app .structure-tech-source-pick[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.app .structure-tech-source-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 招聘项目：效果在左，代价靠右，两个结果按钮固定在最右侧。 */
.app .structure-tech-entry > .structure-tech-action[data-group-id="voyage:recruitment"] { grid-template-columns: minmax(0, 1fr) auto; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-form { display: none; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-preview { grid-column: 1; grid-row: 2; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-use { display: none; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-timeline-note { grid-column: 1; grid-row: 3; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-facts { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; column-gap: 28px; row-gap: 6px; padding: 0; border-top: 0; background: transparent; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-facts > [data-kind="effect"] { flex: 1 1 320px; order: -1; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-facts > div { display: block; padding: 0; border-top: 0; }
.app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-facts dd { margin-top: 2px; text-align: left; }
.app .structure-tech-recruitment-note { flex: 1 1 100%; margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.app .structure-tech-recruitment-actions { grid-column: 2; grid-row: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; align-self: center; }
.app .structure-tech-recruitment-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.app .structure-tech-recruitment-choice { flex: 0 0 auto; min-height: 30px; padding: 4px 12px; border: 1px solid var(--accent); background: var(--panel); color: var(--accent-strong); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.app .structure-tech-recruitment-choice[data-result="success"] { background: var(--accent-strong); color: #fff; }
.app .structure-tech-recruitment-choice:disabled { opacity: .45; cursor: not-allowed; }
.app .structure-tech-recruitment-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app .structure-tech-entry .structure-tech-action-title { flex: 0 0 auto; min-height: 26px; padding: 2px 8px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent-strong); font: inherit; font-size: 11px; }
.app .structure-tech-entry .structure-tech-action-title::after { content: ' ↗'; }
.app .structure-tech-entry .structure-tech-action-title:hover { border-color: var(--accent); background: var(--panel); }
.app .structure-tech-entry .structure-tech-action-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 12px 14px; min-width: 0; grid-column: 1; grid-row: 2; }
.app .structure-tech-entry :is(.structure-tech-action-mode, .structure-tech-action-fields) { display: contents; }
.app .structure-tech-entry .structure-tech-action-form:has(.structure-tech-action-mode:empty):has(.structure-tech-action-fields:empty):not(:has(> label)):not(:has(.structure-tech-visual-choice)) { display: none; }
.app .structure-tech-entry :is(.structure-tech-action-mode, .structure-tech-action-fields):empty { display: none; }
.app .structure-tech-entry .structure-tech-action-choice { align-items: stretch; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; }
.app .structure-tech-entry .structure-tech-action-choice:has(input[type="checkbox"]) { flex-direction: row; align-items: center; grid-column: 1 / -1; }
.app .structure-tech-entry .structure-tech-action-choice:has(select:is([name="resultTitan"], [name="techSource"])) { grid-column: 1 / -1; }
.app .structure-tech-entry .structure-tech-action-choice :is(select, input:not([type="checkbox"])) { width: 100%; max-width: 100%; min-height: 34px; padding: 6px 8px; background: var(--panel); font-size: 12px; color: var(--ink); }
.app .structure-tech-entry .structure-tech-action-preview { grid-column: 2; grid-row: 2; order: 0; font-size: 12px; }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-preview { grid-column: 1; }
.app .structure-tech-entry .structure-tech-action-use { grid-column: 2; grid-row: 3; justify-self: end; margin: 0; min-width: 110px; min-height: 34px; padding: 6px 18px; font-size: 12px; }
.app .structure-tech-entry .structure-tech-action-timeline-note { grid-column: 1; grid-row: 3; align-self: center; color: var(--muted); font-size: 11px; }
.app .structure-tech-entry .structure-tech-trade-line { align-items: flex-end; }
.app .structure-tech-entry .structure-tech-trade-lines { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 14px; }
.app .structure-tech-entry .structure-tech-trade-hint { grid-column: 1 / -1; font-size: 11px; }
.app .structure-tech-entry .structure-tech-trade-line input[type="number"] { width: 4em; }
.app .structure-tech-action-facts { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 10px 14px 4px; border-top: 3px solid var(--accent); background: var(--accent-soft); }
.app .structure-tech-action-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; min-width: 0; padding: 7px 0; border-top: 1px solid var(--line); }
.app .structure-tech-action-facts dt { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: 11px; }
.app .structure-tech-action-facts dd { margin: 0; text-align: right; color: var(--accent-strong); font-size: 12px; font-weight: 600; line-height: 1.6; }
.app .structure-tech-action-facts > [data-kind="effect"] { display: block; order: -1; padding: 0 0 12px; border: 0; }
.app .structure-tech-action-facts > [data-kind="effect"] dt { color: var(--accent); }
.app .structure-tech-action-facts > [data-kind="effect"] dd { margin-top: 6px; text-align: left; font-size: 15px; line-height: 1.65; }
.app .structure-tech-action-feedback { margin: 8px 0 0; color: var(--accent-strong); font-size: 11px; }
/* Direct-use abilities keep compact content and the shared disclosure header. */
.app .structure-tech-entry[data-simple="true"] > .structure-tech-action { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 8px 12px; border-left-width: 1px; border-left-color: var(--line); }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-title,
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-use { background: var(--panel); color: var(--accent-strong); border: 1px solid var(--accent); }
.app .structure-tech-entry[data-simple="true"] :is(.structure-tech-action-title, .structure-tech-action-use):hover { background: var(--bg); }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-use { grid-row: 2; align-self: center; min-height: 30px; min-width: 90px; padding: 4px 10px; }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-timeline-note { grid-column: 1 / -1; }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-facts { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; padding: 0; border: 0; background: transparent; }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-facts > div { display: block; padding: 0; border: 0; }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-facts > [data-kind="effect"] { flex: 1 1 220px; }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-facts dd { margin-top: 4px; text-align: left; }
.app .structure-tech-entry[data-simple="true"] .structure-tech-action-facts > [data-kind="effect"] dd { font-size: 13px; }
/* 使用与时间线卡片只在 560px 以下改成单栏。带侧栏时这一块在 1280px 屏上约 750px，
   正好卡在原来的 760px 阈值下面，所以列表一直是单栏；降到 560px 后左右两栏仍放得下
   （操作列约 276px、时间线预览约 230px）。分组列表用同一个阈值，列表与展开卡片一起
   换栏，避免只换一半。 */
@container tech-abilities (max-width: 559.98px) {
  .app .structure-tech-entry > .structure-tech-action { grid-template-columns: minmax(0, 1fr) auto; }
  .app .structure-tech-entry .structure-tech-action-form { grid-column: 1 / -1; grid-row: auto; }
  .app .structure-tech-entry .structure-tech-action-preview { grid-column: 1 / -1; grid-row: auto; }
  .app .structure-tech-entry :is(.structure-tech-action-timeline-note, .structure-tech-action-use) { grid-row: auto; }
  .app .structure-tech-entry[data-simple="true"] .structure-tech-action-preview { grid-column: 1 / -1; }
  .app .structure-tech-entry[data-simple="true"] .structure-tech-action-timeline-note { grid-column: 1; grid-row: 3; }
  .app .structure-tech-entry[data-simple="true"] .structure-tech-action-use { grid-row: 3; }
  .app .structure-tech-action[data-group-id="voyage:recruitment"] .structure-tech-action-preview,
  .app .structure-tech-recruitment-actions { grid-column: 1 / -1; grid-row: auto; }
}
@container tech-abilities (max-width: 400px) {
  .app .structure-tech-entry .structure-tech-action-form { grid-template-columns: minmax(0, 1fr); }
}
/* Use the panel's available width, including when the console has a sidebar.
   The console's main column is only about 750px wide on a 1280px screen (about
   900px at 1440px), so the old 760px threshold narrowly missed it and the list
   stayed in one column. Two rows fit down to 560px; below that the ability rows
   and the 使用／时间线 card switch to one column together.
   Expanded forms span both columns to keep complex trade inputs readable. */
@container tech-abilities (min-width: 560px) {
  .app .structure-tech-category { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  .app .structure-tech-category-title,
  .app .structure-tech-entry[open] { grid-column: 1 / -1; }
  .app .structure-tech-entry:last-child { border-bottom: 1px solid var(--line); }
}
/* 谈判没有分类标题，但仍沿用时间线科技的两栏节奏：收起的能力并排，
   展开的能力横跨两栏。 */
@container tech-abilities (min-width: 560px) {
  .app .step-track-reminder.negotiation .structure-tech-actions > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    align-items: start;
  }
  .app .step-track-reminder.negotiation .structure-tech-actions > div > .structure-tech-entry[open],
  .app .step-track-reminder.negotiation .structure-tech-actions > div > .structure-tech-negotiation-draw { grid-column: 1 / -1; }
  .app .step-track-reminder.negotiation .structure-tech-actions > div > .structure-tech-entry:last-child { border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .app .structure-tech-entry-meta { display: none; }
  .app .structure-tech-entry-title { flex: 1 1 auto; }
  .app .structure-tech-entry > .structure-tech-action { padding: 10px; }
  .app .structure-tech-entry .structure-tech-action-choice { max-width: 100%; }
}
@media (pointer: coarse) {
  .app .structure-tech-entry > summary { min-height: 44px; }
}
.app .structure-save-reminder { margin: 8px 0; padding: 8px; font-size: 10px; line-height: 1.55; }
.app .structure-save-reminder .exploration-settle-actions button { min-width: calc(4em + 18px); }
.app .structure-save-reminder details { margin: 6px 0; }
.app .structure-save-reminder p { margin: 6px 0; }

.app .exploration-delay-tools {
  font-size: 10px;
  line-height: 1.35;
}

.app .exploration-delay-tools :is(button, select, input) {
  font-size: 10px;
  line-height: 1.35;
}

.app .structure-tech-due { display: grid; gap: 8px; margin-bottom: 16px; }
.app .structure-tech-due[hidden] { display: none; }
.app .structure-tech-due-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 12px; background: var(--accent-soft); font-size: 13px; }
.app .structure-tech-due-item.overdue { border-left-color: #a33627; }
.app .structure-tech-due-status { margin: 0; padding: 2px 2px 0; color: var(--accent-strong); font-size: 13px; overflow-wrap: anywhere; }
.app :is(.structure-tech-due-item, .date-track-tech-event) > span { min-width: 0; overflow-wrap: anywhere; }
.app :is(.structure-tech-due-item, .date-track-tech-event) button { flex-shrink: 0; padding: 6px 9px; font-size: 12px; }
.app .structure-tech-due-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; max-width: 100%; }
.app .structure-tech-due-actions > :is(button, a) { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 0; border-radius: 0; padding: 6px 9px; background: var(--accent-strong); color: #fff; font: inherit; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 140ms ease, color 140ms ease; }
.app .structure-tech-due-actions > :is(button, a):hover { background: var(--accent-strong); }

.app .date-track-tech-events { grid-column: 1 / -1; display: grid; gap: 6px; padding: 5px 0 3px; }
.app .date-track-tech-event { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-left: 2px solid var(--accent); padding-left: 8px; color: var(--accent-strong); font-size: 12px; }
.app .date-track-tech-event:is(.cooldown, .completed) { border-left-color: var(--line); color: var(--muted); }

@media (max-width: 600px) {
  .app :is(.structure-tech-due-item, .date-track-tech-event) { align-items: flex-start; flex-direction: column; }
  .app .structure-tech-action { gap: 7px 8px; }
  .app .structure-tech-action-title { flex-basis: 100%; }
  .app .structure-tech-action-choice { flex-wrap: wrap; }
  .app .structure-tech-action-choice :is(select, input[type="text"]) { max-width: 100%; }
  .app .structure-tech-trade-line .structure-tech-action-choice { flex-wrap: nowrap; }
  .app .structure-tech-action .structure-tech-action-preview { flex-basis: 100%; }
}

.app .second-screen-card {
  border-top: 1px solid var(--line);
  padding: 14px 0 0;
}

/* 「选择探索卡库」的折叠条与展开后内边距由 index.html 的统一折叠样式决定（各折叠区
   一致）。这里原先还把 .exploration-builder-body 的横向内边距清成 0，会让卡库比其它
   折叠区少缩进 14px，已随这次统一一并去掉。 */

.app .exploration-library label {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
}

/* 原先这里把派系标签的内边距压成 `2px 0`；底色一加上去就显得贴边，已去掉，
   让 index.html 的 `padding: 4px 8px` 生效。 */

.app .exploration-destruction-card {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.session-account {
  padding: 0;
}

.app #notesInput {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  background: var(--bg);
  line-height: 1.8;
}

.app #notesInput::placeholder {
  color: #777b70;
}

.app .ato-bgm-bar :is(button, select, .ato-bgm-import) {
  border-radius: 0;
}

/* Scanned card artwork keeps its own corners from assets/card-art.css. */
.app :is(.titan-x-step-track,
  .titan-x-step-track [data-titan-x-space], .dashboard-writer-notice) {
  border-radius: 0;
}

.app .app-updates {
  margin-top: 40px;
  padding-top: 20px;
  font-size: 12px;
}

.app .app-updates a {
  color: var(--accent);
}

.app .update-notice {
  border-radius: 0;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.app .update-status.update-error {
  color: var(--danger);
}

.auth-panel {
  border: 0;
  border-top: 3px solid var(--accent);
  border-radius: 0;
  padding: 32px;
}

.auth-panel h1 {
  color: var(--accent-strong);
  font-family: "Songti SC", SimSun, Georgia, serif;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 1040px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid > .stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 28px 0 0;
  }

  .date-track-list {
    max-height: 300px;
  }

  .flow-head-tools {
    width: auto;
  }
}

@media (max-width: 780px) {
  .app {
    padding-top: 28px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 20px;
  }

  .day-card {
    width: 100%;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
  }

  .day-card #dayInput {
    width: 72px;
    font-size: 40px;
  }

  .day-actions {
    grid-template-columns: auto auto;
    justify-content: end;
    align-content: center;
    align-items: center;
  }

  .day-actions button {
    font-size: 12px;
    padding-inline: 10px;
  }

  .dashboard-navigation {
    margin-bottom: 28px;
  }
}

@media (max-width: 620px) {
  .cycle-title {
    font-size: clamp(24px, 6vw, 32px);
    gap: 10px;
  }

  .cycle-title .cycle-symbol {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .app .panel {
    padding: 16px;
  }

  .app .survey-constant-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid > .stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .record-links {
    gap: 4px 20px;
  }

  .app .record-links .record-card-link {
    font-size: 12px;
    padding-inline: 0;
  }

  .app .record-links .record-card-link > .nav-icon {
    /* 14/16，随窄屏字号一起收一点 */
    width: calc(var(--nav-icon-w, 16px) * 0.875);
    height: calc(var(--nav-icon-h, 16px) * 0.875);
    margin-right: 4px;
  }

  .dashboard-navigation .title-cycle-control {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .title-cycle-control select {
    flex: 1;
    max-width: 260px;
  }

  .panel-head {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
  }

  .flow-head-tools {
    max-width: 100%;
  }

  .progress-track {
    width: 72px;
  }

  .flow-step {
    gap: 10px;
    padding-block: 20px;
  }

  .step-actions {
    width: 100%;
    margin-top: 4px;
  }

  .app .step-action-button,
  .step-actions a {
    min-height: 36px;
  }

  .step-title {
    font-size: 16px;
  }

  .second-screen-scale {
    grid-template-columns: auto minmax(0, 1fr) 44px;
  }

  .second-screen-scale.with-rotation {
    grid-template-columns: auto minmax(0, 1fr) 44px auto auto;
  }

  .app-credit {
    text-align: left;
  }
}

@media (max-width: 360px) {
  .day-card {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 8px;
  }

  .day-card #dayInput {
    width: 60px;
    font-size: 36px;
  }

  .day-actions button {
    font-size: 11px;
    padding-inline: 8px;
    white-space: nowrap;
  }

  .app .archive-actions button {
    padding-inline: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app button,
  .progress-fill {
    transition: none;
  }
}

.app .map-titan-reminder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 20px;
  align-items: center;
  margin-top: 10px;
  padding: 12px 14px;
}
.map-titan-reminder > .step-track-title { grid-column: 1; grid-row: 1; }
/* 说明文字跨满整行，直到提醒条最右侧；只有标题行要给右上角按钮让位。 */
.map-titan-reminder > .step-track-desc { grid-column: 1 / -1; }
.app .map-titan-reminder .map-titan-award {
  font-weight: 700;
  color: #174e35;
  margin-top: 7px;
}
/* 泰坦标记提醒固定使用绿色系，不跟随循环主题色（C2 红、C3 紫、C4 金、C5 深蓝）。
   按钮尺寸沿用 .step-action-button，横排在提醒条右上角；窄屏才落到说明下方。 */
.map-titan-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  max-width: min(440px, 46vw);
}
.app .map-titan-actions button {
  width: auto;
  white-space: nowrap;
  border: 1px solid #75a58a;
  background: #f4faf6;
  color: #216849;
}
.app .map-titan-actions button:hover { border-color: #216849; background: #e1efe6; color: #174e35; }
.app .map-titan-actions button[data-map-titan-result="success"] { border-color: #216849; background: #216849; color: #fff; }
.app .map-titan-actions button[data-map-titan-result="success"]:hover { border-color: #174e35; background: #174e35; color: #fff; }
.app .map-titan-actions button:disabled { opacity: .55; cursor: default; }
@media (max-width: 600px) {
  .app .map-titan-reminder { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .map-titan-actions { grid-column: 1; grid-row: auto; justify-self: start; justify-content: flex-start; max-width: none; margin-top: 6px; }
}
