:root {
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #17231f;
  background: #f2f5f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100dvh; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #67d6ac; outline-offset: 4px; }

.topbar {
  width: min(1120px, calc(100% - 48px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #17231f; text-decoration: none; font-size: 17px; }
.brand svg { width: 30px; height: 30px; fill: #248364; }
.brand strong { font-weight: 650; }
.local-badge { display: flex; align-items: center; gap: 8px; color: #52615c; font-size: 14px; }
.local-badge > span { width: 7px; height: 7px; border-radius: 50%; background: #248364; }

main { width: min(1120px, calc(100% - 48px)); margin: 24px auto 0; }
.hero {
  min-height: 236px;
  padding: 40px 44px;
  border-radius: 22px;
  background: #172b25;
  color: #f0f7f4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  box-shadow: 0 18px 50px rgb(23 43 37 / 10%);
}
.environment { margin: 0 0 30px; color: #b8cbc3; font-size: 14px; letter-spacing: .04em; }
.status-line { display: flex; align-items: center; gap: 14px; }
.status-dot { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: #d6a75c; box-shadow: 0 0 0 6px rgb(214 167 92 / 12%); }
.status-dot.active { background: #65d6a9; box-shadow: 0 0 0 6px rgb(101 214 169 / 12%); }
.status-dot.inactive { background: #ef9a83; box-shadow: 0 0 0 6px rgb(239 154 131 / 12%); }
.status-dot.loading { animation: breathe 1.4s ease-in-out infinite; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.25; letter-spacing: -.035em; font-weight: 650; }
.status-description { margin: 14px 0 0 26px; color: #c3d3cc; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.refresh-button {
  min-width: 132px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #a4e6c9;
  color: #15362b;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease-out, background 160ms ease-out;
}
.refresh-button:hover { background: #b8efd6; transform: translateY(-2px); }
.refresh-button:active { transform: translateY(0); }
.refresh-button:disabled { cursor: wait; opacity: .75; transform: none; }
.refresh-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refresh-button.is-loading svg { animation: spin .9s linear infinite; }
.error-message { margin: 16px 0 0; padding: 14px 18px; border-radius: 10px; background: #f8e5df; color: #8b3324; font-size: 14px; }

.dashboard-grid { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .9fr); gap: 24px; align-items: start; }
.panel { border: 1px solid #dfe6e3; border-radius: 18px; background: #f9fbfa; }
.releases-panel { padding: 28px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-label { margin: 0 0 7px; color: #6b7b75; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 11px; letter-spacing: .14em; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.count-label { color: #6a7873; font-size: 13px; }
.release-header { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(110px, .8fr) 64px; gap: 12px; margin-top: 28px; padding: 0 16px 10px; border-bottom: 1px solid #e3e9e6; color: #73817c; font-size: 12px; }
.release-list { margin: 0; padding: 0; list-style: none; }
.release-list li { min-height: 70px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(110px, .8fr) 64px; gap: 12px; align-items: center; border-bottom: 1px solid #e7ecea; }
.release-list li:last-child { border-bottom: 0; }
.release-list code { color: #243d34; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.release-list time { color: #62716b; font-size: 13px; }
.release-state { justify-self: start; padding: 4px 8px; border-radius: 6px; background: #e9eeeb; color: #5c6b65; font-size: 12px; white-space: nowrap; }
.release-state.current { background: #dff3e9; color: #176345; }
.release-list .release-skeleton { display: block; padding-top: 24px; color: #6b7b75; font-size: 14px; }

.details-panel { padding: 28px; }
.details-panel dl { margin: 24px 0 0; }
.details-panel dl > div { padding: 14px 0; border-bottom: 1px solid #e4eae7; }
.details-panel dt { margin-bottom: 6px; color: #71807a; font-size: 12px; }
.details-panel dd { margin: 0; color: #2b3b35; font-size: 14px; overflow-wrap: anywhere; }
.readonly-note { margin: 24px 0 0; display: flex; gap: 10px; color: #62716b; font-size: 13px; line-height: 1.7; }
.readonly-note svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; fill: none; stroke: #43806a; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
footer { width: min(1120px, calc(100% - 48px)); margin: 30px auto 40px; color: #6b7974; font-size: 12px; text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .45; } }

@media (max-width: 800px) {
  .hero { padding: 32px; align-items: flex-start; flex-direction: column; }
  .environment { margin-bottom: 24px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .topbar, main, footer { width: calc(100% - 32px); }
  .topbar { min-height: 76px; }
  .brand { font-size: 15px; }
  .local-badge { font-size: 12px; }
  main { margin-top: 12px; }
  .hero { min-height: 250px; padding: 26px 22px; border-radius: 18px; gap: 26px; }
  .status-line { align-items: flex-start; }
  .status-dot { margin-top: 9px; }
  .status-description { margin-left: 0; }
  .refresh-button { width: 100%; }
  .releases-panel, .details-panel { padding: 22px 18px; }
  .release-header { display: none; }
  .release-list li { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 18px 4px; }
  .release-list code { grid-column: 1 / -1; }
  .release-list time { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.commits-panel { margin-top: 24px; padding: 28px; }
.section-description { margin: 10px 0 0; color: #687872; font-size: 14px; line-height: 1.7; }
.action-error { margin: 16px 0 0; padding: 12px 14px; border-radius: 8px; background: #f8e5df; color: #8b3324; font-size: 13px; }
.commit-list { margin: 20px 0 0; padding: 0; list-style: none; }
.commit-list li { min-height: 72px; padding: 14px 0; display: grid; grid-template-columns: minmax(0, 1fr) 110px 104px; align-items: center; gap: 16px; border-top: 1px solid #e4eae7; }
.commit-info { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.commit-info a { color: #213b31; font-size: 15px; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-info a:hover { text-decoration: underline; text-underline-offset: 3px; }
.commit-info span { color: #6a7b74; font-size: 12px; }
.build-status { color: #64746e; font-size: 12px; overflow-wrap: anywhere; }
.commit-action, .secondary-button, .danger-button { min-height: 44px; padding: 0 14px; border: 1px solid #cad8d2; border-radius: 9px; background: #f5f8f6; color: #29463b; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; transition: background 160ms ease-out, transform 160ms ease-out; }
.commit-action:hover, .secondary-button:hover { background: #e9f1ed; }
.commit-action:active, .secondary-button:active, .danger-button:active { transform: scale(.98); }
.commit-action.primary { border-color: #28785c; background: #28785c; color: #f0f8f4; }
.commit-action.primary:hover { background: #20694f; }
.commit-action:disabled { cursor: default; opacity: .58; }
.commit-action:focus-visible, .secondary-button:focus-visible, .danger-button:focus-visible { outline: 3px solid #67d6ac; outline-offset: 3px; }
.commit-placeholder { display: block !important; color: #6b7b75; font-size: 14px; }
.deploy-dialog { width: min(460px, calc(100% - 32px)); padding: 28px; border: 1px solid #dfe6e3; border-radius: 18px; background: #f9fbfa; color: #17231f; box-shadow: 0 24px 80px rgb(16 36 29 / 24%); }
.deploy-dialog::backdrop { background: rgb(13 28 23 / 55%); }
.deploy-dialog p { color: #53665e; font-size: 14px; line-height: 1.75; }
.deploy-dialog code { display: block; color: #52675e; font-size: 12px; overflow-wrap: anywhere; }
.dialog-actions { margin-top: 26px; display: flex; justify-content: flex-end; gap: 12px; }
.danger-button { border-color: #a44f3e; background: #a44f3e; color: #fff7f3; }
.danger-button:hover { background: #8f4132; }

@media (max-width: 600px) {
  .commits-panel { padding: 22px 18px; }
  .commit-list li { grid-template-columns: 1fr auto; gap: 10px 12px; }
  .commit-info { grid-column: 1 / -1; }
  .commit-info a { white-space: normal; line-height: 1.6; }
  .build-status { align-self: center; }
}

.topbar-actions { display: flex; align-items: center; gap: 16px; }
.game-picker { display: flex; align-items: center; gap: 8px; color: #52615c; font-size: 13px; }
.game-picker select { min-height: 44px; padding: 0 32px 0 12px; border: 1px solid #cad8d2; border-radius: 9px; background: #f9fbfa; color: #243d34; font: inherit; cursor: pointer; }
.text-button { min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: #52615c; font: inherit; font-size: 13px; cursor: pointer; }
.text-button:hover { color: #176345; }

.login-page { display: grid; place-items: center; padding: 32px 16px; }
.login-shell { width: min(420px, 100%); }
.login-panel { margin-top: 32px; padding: 36px; border: 1px solid #dfe6e3; border-radius: 18px; background: #f9fbfa; box-shadow: 0 18px 50px rgb(23 43 37 / 8%); }
.login-panel h1 { font-size: 30px; }
.login-description { margin: 16px 0 28px; color: #53665e; font-size: 15px; line-height: 1.7; }
.login-panel form { display: grid; gap: 12px; }
.login-panel label { color: #354a42; font-size: 14px; font-weight: 600; }
.login-panel input { min-height: 48px; padding: 0 14px; border: 1px solid #bdcec6; border-radius: 10px; background: #fcfefd; color: #17231f; font: inherit; font-size: 16px; }
.login-panel input:focus { border-color: #43806a; outline: 3px solid #c4ebda; }
.login-button { min-height: 48px; margin-top: 8px; border: 0; border-radius: 10px; background: #28785c; color: #f0f8f4; font: inherit; font-weight: 650; cursor: pointer; transition: background 160ms ease-out, transform 160ms ease-out; }
.login-button:hover { background: #20694f; }
.login-button:active { transform: scale(.98); }
.login-button:disabled { cursor: wait; opacity: .65; }
.login-footnote { margin-top: 20px; color: #62716b; font-size: 12px; text-align: center; }

@media (max-width: 650px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 12px 0; }
  .topbar-actions { width: 100%; justify-content: space-between; gap: 8px; }
  .game-picker { flex: 1; }
  .game-picker select { max-width: 170px; }
  .login-panel { padding: 28px 22px; }
}
