:root {
  color: #1d2c2d;
  background: #f4f6f2;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(100% - 32px, 980px); margin: 0 auto; padding: 22px 0 54px; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 46px; }
.brand { color: #163d3d; font-size: 18px; font-weight: 800; text-decoration: none; }
.connection-state, .release-status { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 4px; color: #637477; background: #e3e9e6; font-size: 12px; font-weight: 700; }
.connection-state.is-connected, .release-status-ready { color: #17603c; background: #d9ecd9; }
.connection-state.is-error, .release-status-error { color: #8b3430; background: #f6dcd8; }
.release-status-loading { color: #225b67; background: #dcecef; }

.page-intro { margin: 34px 0 22px; }
.eyebrow { margin: 0 0 7px; color: #52777a; font-size: 12px; font-weight: 800; letter-spacing: 0; }
h1, h2, h4, p { margin-top: 0; }
h1 { margin-bottom: 9px; color: #173d3d; font-size: 28px; line-height: 1.2; }
.page-intro p:not(.eyebrow) { max-width: 620px; margin-bottom: 0; color: #56696c; font-size: 14px; line-height: 1.65; }

.update-card, .ready-card, .progress-panel, .advanced-panel { border: 1px solid #d5ded9; background: #fff; }
.update-card { padding: 26px; }
.card-heading, .progress-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-heading h2 { margin: 0; color: #263d3f; font-size: 21px; }
.release-version { margin: 16px 0 0; color: #405759; font-size: 14px; font-weight: 700; }
.release-notes { margin: 12px 0 0; padding-left: 19px; color: #56696c; font-size: 14px; line-height: 1.65; }
.primary-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button { min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 4px; font-weight: 800; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: #fff; background: #126e6b; }
.button-primary:hover:not(:disabled) { background: #0d5856; }
.button-secondary { color: #155e61; border-color: #8cacaa; background: #fff; }
.button-secondary:hover:not(:disabled) { background: #edf5f1; }
.button-danger { color: #fff; background: #b74742; }
.button-danger:hover:not(:disabled) { background: #973935; }
.text-button { padding: 5px 3px; color: #497176; border: 0; background: transparent; font-size: 13px; font-weight: 700; }
.text-button:hover:not(:disabled) { color: #155e61; text-decoration: underline; }
.helper-text { margin: 14px 0 0; color: #67777a; font-size: 13px; line-height: 1.55; }

.ready-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 20px 26px; }
.summary-label { margin-bottom: 6px; color: #6a7a7c; font-size: 12px; font-weight: 800; }
.summary-name { margin-bottom: 6px; color: #263d3f; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.summary-meta { margin-bottom: 0; color: #6a7a7c; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }

.progress-panel { margin-top: 16px; padding: 20px 26px; }
.progress-heading { align-items: center; }
.progress-heading h2 { margin: 0; font-size: 15px; }
.progress-heading span { color: #54676a; font-size: 13px; font-weight: 700; }
.progress-track { height: 9px; margin-top: 16px; overflow: hidden; background: #e2e9e5; }
.progress-bar { width: 0; height: 100%; background: #1a8b82; transition: width .12s linear; }

.advanced-panel { margin-top: 16px; color: #4d6063; }
.advanced-panel > summary, .operation-log > summary { padding: 16px 22px; cursor: pointer; color: #426368; font-size: 13px; font-weight: 800; }
.advanced-content { display: grid; gap: 24px; padding: 4px 22px 24px; border-top: 1px solid #e0e6e3; }
.advanced-content h2 { margin-bottom: 10px; color: #354b4e; font-size: 15px; }
.advanced-content > section .helper-text { margin-top: -3px; margin-bottom: 12px; }
.file-picker { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 13px; color: #155e61; border: 1px dashed #78a5a0; border-radius: 4px; background: #f5faf8; font-size: 13px; font-weight: 800; cursor: pointer; }
.file-picker-danger { color: #963b36; border-color: #cc8a82; background: #fff6f3; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker.is-dragging { border-color: #126e6b; background: #dcefe8; }
.recovery-summary { margin: 12px 0; color: #6a7a7c; font-size: 13px; white-space: pre-wrap; }
.recovery-panel { border: 1px solid #ead3ce; }
.recovery-panel > summary { padding: 13px 14px; cursor: pointer; color: #93423b; background: #fff8f6; font-size: 13px; font-weight: 800; }
.recovery-content { padding: 2px 14px 16px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-size: 13px; }
.check-row input { width: 16px; height: 16px; accent-color: #126e6b; }
.confirmation { display: grid; gap: 7px; max-width: 300px; margin-bottom: 14px; font-size: 13px; }
.confirmation input { height: 38px; padding: 7px 9px; border: 1px solid #b9c6c8; border-radius: 4px; }
.operation-log { border-top: 1px solid #e0e6e3; }
.operation-log > summary { padding-left: 0; }
.log-output { max-height: 280px; margin: 10px 0 0; padding: 14px; overflow: auto; color: #d9e7e3; background: #162425; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

@media (max-width: 680px) {
  .app-shell { width: min(100% - 24px, 980px); padding-top: 12px; }
  .page-intro { margin: 26px 0 18px; }
  h1 { font-size: 25px; }
  .update-card, .progress-panel { padding: 21px; }
  .ready-card { align-items: stretch; flex-direction: column; padding: 20px 21px; }
  .ready-card .button { width: 100%; }
  .primary-actions { align-items: stretch; flex-direction: column; }
  .primary-actions .button { width: 100%; }
  .primary-actions .text-button { align-self: flex-start; }
}
