/*
 * 多模式上线样式
 * 保持 breakthrough.js 的现有行为，只把入口、弹窗和信息层级统一到
 * 升小满的纸面 + 酒红工作台语言。
 */

html body .breakthrough-rail {
  --multi-wine: #4b2118;
  --multi-wine-deep: #32140e;
  --multi-copper: #d7ac77;
  --multi-cream: #f0e0c3;
  position: relative;
  z-index: 4;
  display: grid;
  width: min(790px, 100%);
  min-height: 76px;
  grid-template-columns: 218px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  margin: -16px auto 0;
  padding: 8px 11px;
  overflow: visible;
  color: var(--multi-cream);
  border: 1px solid #2d150e;
  border-radius: 13px;
  background:
    radial-gradient(ellipse at 13% 0, rgba(167, 100, 60, .25), transparent 43%),
    linear-gradient(90deg, rgba(255, 255, 255, .04), transparent 18% 82%, rgba(0, 0, 0, .15)),
    url("/open/static/assets/paper-grain.svg") 0 0 / 220px 220px repeat,
    linear-gradient(180deg, #5d3023 0%, #4a2118 58%, #381510 100%);
  background-blend-mode: screen, normal, soft-light, normal;
  box-shadow:
    inset 0 0 0 2px rgba(232, 199, 151, .08),
    inset 0 1px 0 rgba(255, 217, 165, .1),
    0 11px 22px rgba(64, 34, 20, .23),
    0 2px 0 rgba(255, 245, 225, .3);
  isolation: isolate;
  animation: none;
}

html body .breakthrough-rail::before {
  position: absolute;
  inset: 5px;
  z-index: 0;
  display: block;
  content: "";
  pointer-events: none;
  background: transparent;
  border: 1px dashed rgba(226, 190, 140, .16);
  border-radius: 9px;
  mask-image: none;
}

html body .breakthrough-rail::after {
  position: absolute;
  top: -7px;
  right: 52px;
  width: 78px;
  height: 15px;
  content: "";
  pointer-events: none;
  background: rgba(198, 180, 140, .48);
  box-shadow: 0 1px 2px rgba(90, 75, 45, .12);
  transform: rotate(3deg);
}

html body .breakthrough-rail-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 7px 16px 7px 8px;
  border-right: 1px solid rgba(240, 220, 180, .2);
}

html body .breakthrough-rail-copy > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

html body .breakthrough-rail-copy small {
  display: block;
  color: #b99a70;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .05em;
}

html body .breakthrough-rail-copy b {
  color: #f2e2c4;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .05em;
  white-space: nowrap;
}

html body .breakthrough-signal {
  display: block;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid rgba(239, 217, 178, .27);
  border-radius: 50%;
}

html body .breakthrough-signal::before {
  top: 15px;
  left: 6px;
  width: 6px;
  height: 6px;
  background: #e8d5b5;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .05);
}

html body .breakthrough-signal i {
  top: 18px;
  left: 16px;
  width: 14px;
  color: #d8b884 !important;
}

html body .breakthrough-rail-actions {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

html body .breakthrough-rail-actions > button {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 8px;
  color: #ccb797;
  background: transparent !important;
  border: 0;
  border-radius: 0 !important;
}

html body .breakthrough-rail-actions > button + button::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 28px;
  content: "";
  background: rgba(237, 211, 170, .17);
  transform: translateY(-50%);
}

html body .breakthrough-rail-actions > button:hover {
  background: rgba(255, 232, 193, .06) !important;
}

html body .breakthrough-rail-actions > button > span:last-of-type {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

html body .breakthrough-rail-actions b {
  overflow: hidden;
  color: #decbaa;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body .breakthrough-rail-actions small {
  display: block;
  overflow: hidden;
  color: #9e8566;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body .breakthrough-rail-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: #d7ac77 !important;
  border: 1px solid rgba(214, 171, 117, .36);
  border-radius: 5px;
  background: rgba(68, 25, 16, .64) !important;
  transform: rotate(45deg);
}

html body .breakthrough-rail-icon svg {
  width: 13px;
  height: 13px;
  stroke-width: 1.7;
  transform: rotate(-45deg);
}

html body .breakthrough-due-badge,
html body .breakthrough-expansion-badge {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  min-width: 15px;
  height: 15px;
  place-items: center;
  padding: 0 4px;
  color: #f1dfbf !important;
  border: 1px solid rgba(226, 187, 128, .34);
  border-radius: 999px;
  background: #6b3422 !important;
  box-shadow: none;
  font-size: 8px !important;
}

html body .breakthrough-modal {
  z-index: 2200;
  padding: 22px;
  color: #29271f;
  background: transparent;
}

html body .breakthrough-scrim {
  background:
    radial-gradient(circle at 50% 36%, rgba(47, 34, 22, .12), rgba(29, 25, 20, .72)),
    rgba(31, 27, 22, .48);
  backdrop-filter: blur(6px) saturate(.88);
}

html body .breakthrough-dialog {
  display: grid;
  width: min(1060px, calc(100vw - 42px));
  height: min(790px, calc(100dvh - 52px));
  min-height: 540px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  color: #29271f;
  border: 1px solid rgba(91, 68, 42, .5);
  border-radius: 9px;
  background:
    url("/open/static/assets/paper-flecks.svg") 0 0 / 260px 260px repeat,
    url("/open/static/assets/paper-fiber.svg") 0 0 / 320px 320px repeat,
    url("/open/static/assets/paper-grain.svg") 0 0 / 220px 220px repeat,
    #eee6d7;
  background-blend-mode: multiply, soft-light, multiply, normal;
  box-shadow:
    0 34px 80px rgba(26, 18, 12, .36),
    0 8px 20px rgba(26, 18, 12, .22),
    inset 0 0 0 4px rgba(255, 250, 239, .22);
}

html body .breakthrough-head {
  position: relative;
  display: grid;
  min-height: 78px;
  grid-template-columns: 44px minmax(220px, 1fr) minmax(240px, 440px) 37px;
  align-items: center;
  gap: 22px;
  padding: 16px 22px 15px;
  border-bottom: 1px solid rgba(115, 94, 65, .2);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .45), transparent 46%),
    rgba(242, 235, 222, .82);
}

html body .breakthrough-head::after {
  position: absolute;
  right: 74px;
  bottom: -1px;
  width: 118px;
  height: 4px;
  content: "";
  background: var(--rust-deep, #7e351c);
  transform: rotate(-.8deg);
}

html body .breakthrough-mark {
  width: 44px;
  height: 44px;
  color: #f0dabb;
  border: 1px solid rgba(113, 79, 45, .5);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transform: rotate(-7deg);
}

html body .breakthrough-mark svg {
  width: 24px;
  height: 24px;
}

html body .breakthrough-head-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

html body .breakthrough-head-copy small {
  color: var(--rust-deep, #7e351c);
  font-family: var(--kai, "Kaiti SC", "KaiTi", serif);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
}

html body .breakthrough-head-copy h2 {
  margin: 0;
  color: #26261f;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: clamp(19px, 2vw, 27px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
}

html body .breakthrough-head-note {
  display: flex;
  max-width: 54ch;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  color: #746b59;
  font-family: var(--font, "Microsoft YaHei", sans-serif);
  font-size: 10px;
  line-height: 1.6;
  white-space: normal;
}

html body .breakthrough-head-note i {
  width: 6px;
  height: 6px;
  flex: none;
  background: #a85a39;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(168, 90, 57, .09);
}

html body .breakthrough-head .icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #756a57;
  border: 1px solid rgba(116, 94, 64, .24);
  border-radius: 50%;
  background: rgba(255, 252, 244, .35);
}

html body .breakthrough-layout {
  display: grid;
  width: 100%;
  min-height: 0;
  min-width: 0;
  grid-template-columns: 252px minmax(0, 1fr);
}

html body .breakthrough-switcher {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding: 20px 13px 21px;
  color: #d8c29e;
  border: 0;
  border-right: 1px solid #2d160f;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 12% 0, rgba(158, 91, 56, .19), transparent 42%),
    url("/open/static/assets/paper-grain.svg") 0 0 / 220px 220px repeat,
    linear-gradient(180deg, #572d21 0, #461f17 58%, #35140f 100%);
  background-blend-mode: screen, soft-light, normal;
}

html[data-skin] body .breakthrough-switcher {
  background:
    radial-gradient(ellipse at 12% 0, rgba(158, 91, 56, .19), transparent 42%),
    url("/open/static/assets/paper-grain.svg") 0 0 / 220px 220px repeat,
    linear-gradient(180deg, #572d21 0, #461f17 58%, #35140f 100%) !important;
  background-blend-mode: screen, soft-light, normal !important;
  border: 0 !important;
  border-right: 1px solid #2d160f !important;
  box-shadow: none !important;
}

html body .breakthrough-switcher::before {
  position: absolute;
  inset: 8px;
  z-index: 0;
  content: "";
  pointer-events: none;
  border: 1px dashed rgba(227, 191, 142, .14);
  border-radius: 6px;
}

html body .breakthrough-switcher > button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  color: #bca386;
  background: transparent !important;
  border: 1px solid transparent;
  border-radius: 4px;
}

html body .breakthrough-switcher > button:hover {
  color: #ead6b7;
  background: rgba(227, 189, 137, .055) !important;
}

html body .breakthrough-switcher > button.is-active,
html body .breakthrough-switcher > button[aria-selected="true"] {
  color: #f2dfc0;
  border-color: rgba(224, 185, 131, .17);
  background:
    linear-gradient(90deg, rgba(220, 173, 108, .14), transparent),
    rgba(74, 29, 19, .42) !important;
  box-shadow: inset 3px 0 0 #c88f4b;
}

html body .breakthrough-switcher > button > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

html body .breakthrough-switcher b {
  color: inherit;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 12px;
  font-weight: 600;
}

html body .breakthrough-switcher small {
  overflow: hidden;
  color: #8e765d;
  font-size: 8px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body .breakthrough-switcher > button.is-active small,
html body .breakthrough-switcher > button[aria-selected="true"] small {
  color: #b39a7c;
}

html body .breakthrough-switcher-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: #dfb57a !important;
  border: 1px solid rgba(215, 173, 118, .25);
  border-radius: 5px;
  background: rgba(68, 25, 16, .43) !important;
}

html body .breakthrough-switcher-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.65;
}

html body .breakthrough-switcher-divider {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 5px 4px;
  padding: 0 7px;
  color: #9e8160;
  font-size: 8px;
  letter-spacing: .1em;
}

html body .breakthrough-switcher-divider i {
  width: 100%;
  height: 1px;
  background: rgba(224, 192, 146, .17);
}

html body .breakthrough-switcher-note {
  position: relative;
  z-index: 1;
  margin: auto 8px 2px;
  padding-top: 13px;
  color: #8e765d;
  border-top: 1px solid rgba(224, 192, 146, .14);
  font-size: 8.5px;
  line-height: 1.65;
}

html body .breakthrough-stage {
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background:
    url("/open/static/assets/paper-grain.svg") 0 0 / 220px 220px repeat,
    rgba(245, 239, 227, .72);
  background-blend-mode: multiply, normal;
}

html body .breakthrough-panel {
  width: min(720px, 100%);
  min-width: 0;
  min-height: 100%;
  margin: 0 auto;
  padding: 28px 34px 25px;
  color: #696253;
}

html[data-skin] body .breakthrough-panel {
  color: #696253 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body .breakthrough-panel-head {
  margin-bottom: 18px;
}

html body .breakthrough-panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rust-deep, #7e351c);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
}

html body .breakthrough-panel-kicker::before {
  width: 18px;
  height: 1px;
  background: currentColor;
}

html body .breakthrough-panel-head h3 {
  margin: 7px 0;
  color: #24251e;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: clamp(24px, 2.3vw, 31px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
}

html body .breakthrough-panel-head p {
  max-width: 66ch;
  margin: 0;
  color: #696253;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 11px;
  line-height: 1.8;
}

html body .breakthrough-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

html body .breakthrough-field > span {
  color: #4e4a3e;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 10px;
  font-weight: 700;
}

html body .breakthrough-field textarea,
html body .breakthrough-field input,
html body .breakthrough-field select {
  color: #39372d;
  border: 1px solid rgba(109, 89, 62, .27);
  border-radius: 4px;
  background: rgba(252, 248, 239, .7);
  box-shadow: inset 0 1px 2px rgba(63, 47, 27, .04);
}

html body .breakthrough-field textarea {
  padding: 11px 12px;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 12px;
  line-height: 1.75;
}

html body .breakthrough-field textarea:focus,
html body .breakthrough-field input:focus,
html body .breakthrough-field select:focus {
  border-color: rgba(131, 74, 42, .58);
  box-shadow: 0 0 0 3px rgba(166, 99, 57, .09);
}

html[data-skin] body .breakthrough-field textarea,
html[data-skin] body .breakthrough-field input,
html[data-skin] body .breakthrough-field select,
html[data-skin] body .breakthrough-echo-form input {
  color: #39372d !important;
  border: 1px solid rgba(109, 89, 62, .27) !important;
  border-radius: 4px !important;
  background: rgba(252, 248, 239, .82) !important;
  box-shadow: inset 0 1px 2px rgba(63, 47, 27, .04) !important;
}

html body .breakthrough-field > small {
  color: #918671;
  font-size: 8px;
  line-height: 1.55;
}

html body .breakthrough-outcomes,
html body .breakthrough-futures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 17px;
  border-top: 1px solid rgba(102, 83, 55, .2);
  border-bottom: 1px solid rgba(102, 83, 55, .17);
}

html body .breakthrough-outcomes > span,
html body .breakthrough-futures > span {
  min-height: 64px;
  padding: 11px 14px;
  color: #4a473c;
  border-right: 1px solid rgba(102, 82, 54, .16);
  background: transparent;
}

html body .breakthrough-outcomes > span:first-child,
html body .breakthrough-futures > span:first-child {
  border-radius: 0;
}

html body .breakthrough-outcomes > span:last-child,
html body .breakthrough-futures > span:last-child {
  border-right: 0;
  border-radius: 0;
}

html body .breakthrough-outcomes b,
html body .breakthrough-futures b {
  color: #3e3d33;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 10px;
  font-weight: 700;
}

html body .breakthrough-outcomes small,
html body .breakthrough-futures small {
  color: #8a806c;
  font-size: 8px;
  line-height: 1.55;
}

html body .breakthrough-futures i {
  display: none;
}

html body .breakthrough-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(104, 84, 56, .18);
}

html body .breakthrough-panel-foot > span {
  color: #918671;
  font-size: 8px;
  line-height: 1.55;
}

html body .breakthrough-run,
html body .breakthrough-panel button[type="submit"] {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  color: #f3e4ca !important;
  border: 1px solid #321810 !important;
  border-radius: 4px !important;
  background: #4b2118 !important;
  box-shadow: inset 0 1px rgba(255, 231, 194, .1), 0 2px 5px rgba(66, 35, 21, .15) !important;
  font-family: var(--display, "Songti SC", "STSong", serif);
  font-size: 10px;
  font-weight: 700;
}

html body .breakthrough-run:hover,
html body .breakthrough-panel button[type="submit"]:hover {
  background: #5a291e !important;
}

html body .breakthrough-run svg {
  width: 12px;
  height: 12px;
}

html body .breakthrough-echo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .72fr);
  gap: 22px;
}

html body .breakthrough-echo-archive {
  padding-left: 20px;
  border-left: 1px solid rgba(104, 84, 56, .18);
}

html body .breakthrough-echo-archive > header {
  border-bottom: 1px solid rgba(104, 84, 56, .16);
}

html body .breakthrough-echo-card {
  background: rgba(250, 246, 237, .57);
  border: 1px solid rgba(104, 84, 56, .16);
  border-radius: 4px;
}

html body .breakthrough-echo-card.is-due {
  border-color: rgba(157, 82, 45, .4);
  background: rgba(241, 222, 194, .48);
}

@media (max-width: 900px) {
  html body .breakthrough-rail {
    width: 100%;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  html body .breakthrough-rail-copy {
    min-height: 53px;
    border-right: 0;
    border-bottom: 1px solid rgba(240, 220, 180, .18);
  }

  html body .breakthrough-rail-actions > button {
    min-height: 52px;
  }

  html body .breakthrough-dialog {
    width: calc(100vw - 24px);
    height: calc(100dvh - 28px);
  }

  html body .breakthrough-head {
    grid-template-columns: 44px minmax(220px, 1fr) 37px;
  }

  html body .breakthrough-head-note {
    display: none;
  }

  html body .breakthrough-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  html body .breakthrough-panel {
    padding: 23px 23px 20px;
  }

  html body .breakthrough-echo-grid {
    grid-template-columns: 1fr;
  }

  html body .breakthrough-echo-archive {
    padding-left: 0;
    border-top: 1px solid rgba(104, 84, 56, .18);
    border-left: 0;
  }
}

@media (max-width: 700px) {
  html body .breakthrough-rail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html body .breakthrough-rail-actions > button:nth-child(n + 3) {
    border-top: 1px solid rgba(237, 211, 170, .13);
  }

  html body .breakthrough-modal {
    padding: 0;
  }

  html body .breakthrough-dialog {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
  }

  html body .breakthrough-head {
    min-height: 65px;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 10px;
    padding: 10px 14px;
  }

  html body .breakthrough-head-copy h2 {
    font-size: 18px;
  }

  html body .breakthrough-layout {
    display: flex;
    flex-direction: column;
  }

  html body .breakthrough-switcher {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 9px;
    border-right: 0;
    border-bottom: 1px solid #2d160f;
  }

  html body .breakthrough-switcher::before,
  html body .breakthrough-switcher-divider,
  html body .breakthrough-switcher-note {
    display: none;
  }

  html body .breakthrough-switcher > button {
    min-width: 145px;
    min-height: 46px;
    flex: 0 0 145px;
  }

  html body .breakthrough-switcher small {
    display: none;
  }

  html body .breakthrough-panel {
    padding: 18px 15px 16px;
  }

  html body .breakthrough-panel-head h3 {
    font-size: 23px;
  }

  html body .breakthrough-outcomes,
  html body .breakthrough-futures {
    grid-template-columns: 1fr;
  }

  html body .breakthrough-outcomes > span,
  html body .breakthrough-futures > span {
    min-height: 50px;
    border-right: 0;
    border-bottom: 1px solid rgba(102, 82, 54, .13);
  }

  html body .breakthrough-outcomes > span:last-child,
  html body .breakthrough-futures > span:last-child {
    border-bottom: 0;
  }

  html body .breakthrough-panel-foot {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  html body .breakthrough-panel-foot > span {
    order: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .breakthrough-modal *,
  html body .breakthrough-rail * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
