:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --line: #d2dae2;
  --text: #202830;
  --muted: #627080;
  --accent: #167a6b;
  --accent-strong: #0f5f55;
  --danger: #b23b3b;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

button,
input { font: inherit; }

.update-shell {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(36px, env(safe-area-inset-bottom));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1,
h2,
p { margin: 0; }

h1 { font-size: 24px; line-height: 1.35; }
h2 { font-size: 16px; }

.page-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

a { color: var(--accent-strong); }

.update-tool {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input[type="password"],
input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--text);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.package-meta {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(100px, 1fr) minmax(100px, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.package-meta div { min-width: 0; padding: 12px 8px; }
.package-meta dt { color: var(--muted); font-size: 12px; }
.package-meta dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; }

button {
  min-height: 44px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--accent-strong); }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.update-status { margin-top: 24px; }

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.progress-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  background: #dfe5ea;
  border-radius: 4px;
}

#progressFill {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

#statusMessage {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

#statusMessage[data-state="error"],
#statusMessage[data-state="failed"] { color: var(--danger); }

@media (max-width: 560px) {
  .update-shell { width: min(100% - 24px, 680px); }
  .page-header { align-items: baseline; }
  .package-meta { grid-template-columns: 1fr 1fr; }
  .package-meta div:first-child { grid-column: 1 / -1; }
}
