:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 350;
  color: #172235;
  background: #dce5ef;
  --ink: #172235;
  --muted: #57677d;
  --blue: #176bd1;
  --line: rgba(255, 255, 255, .48);
  --ease-fluent: cubic-bezier(.1, .9, .2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: linear-gradient(135deg, #d9e4ef, #cbd8e9 52%, #e7eaf1);
}

body::before, body::after {
  position: fixed;
  inset: -2%;
  z-index: -1;
  pointer-events: none;
  content: "";
}

body::before {
  background: url("/login_image.JPG") center 54% / cover no-repeat;
  filter: saturate(.78);
  transform: scale(1.025);
  animation: wallpaper-drift 32s ease-in-out infinite alternate;
}

body::after {
  background:
    linear-gradient(135deg, rgba(230, 239, 250, .30), rgba(26, 43, 66, .12)),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .25), transparent 62%);
}

button, input, select { font: inherit; font-weight: 350; }

.shell {
  width: min(100% - 40px, 720px);
  margin: 0 auto;
  padding: clamp(54px, 10vh, 100px) 0 36px;
}

.hero {
  margin: 0 0 30px;
  animation: fluent-enter .72s var(--ease-fluent) both;
}

.hero-tools { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.language-switch {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 12px;
  background: rgba(244, 248, 255, .42);
  box-shadow: 0 4px 14px rgba(24, 42, 68, .08), inset 0 1px 0 rgba(255, 255, 255, .5);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

button.language-option {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3e5068;
  box-shadow: none;
  font-size: .78rem;
}

button.language-option::after { display: none; }
button.language-option:hover { transform: none; background: rgba(255, 255, 255, .36); box-shadow: none; }
button.language-option[aria-pressed="true"] { background: rgba(255, 255, 255, .78); color: #172235; box-shadow: 0 1px 4px rgba(24, 42, 68, .1); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 15px;
  color: rgba(25, 42, 64, .76);
  font-size: .72rem;
  font-weight: 350;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31a978;
  content: "";
  box-shadow: 0 0 0 4px rgba(49, 169, 120, .16);
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 620px;
  margin-bottom: 10px;
  color: #14243a;
  font-size: clamp(2.8rem, 8vw, 4.7rem);
  font-weight: 300;
  letter-spacing: -.065em;
  line-height: 1.02;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.65rem;
  font-weight: 350;
  letter-spacing: -.045em;
}

.hero p, .muted {
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 300;
  line-height: 1.55;
}

.hero p { max-width: 470px; margin-bottom: 0; }

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(25px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(247, 250, 255, .58);
  box-shadow: 0 26px 75px rgba(24, 42, 68, .18), 0 2px 8px rgba(24, 42, 68, .08), inset 0 1px 0 rgba(255, 255, 255, .6);
  backdrop-filter: blur(27px) saturate(155%);
  -webkit-backdrop-filter: blur(27px) saturate(155%);
  animation: fluent-enter .78s .08s var(--ease-fluent) both;
  transition: transform .35s var(--ease-fluent), box-shadow .35s var(--ease-fluent), border-color .35s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .68);
  box-shadow: 0 32px 85px rgba(24, 42, 68, .20), 0 3px 10px rgba(24, 42, 68, .08), inset 0 1px 0 rgba(255, 255, 255, .7);
}

#login-panel {
  background: rgba(244, 248, 255, .48);
  box-shadow: 0 30px 85px rgba(18, 37, 63, .23), 0 2px 8px rgba(18, 37, 63, .1), inset 0 1px 0 rgba(255, 255, 255, .68);
}

#login-panel::before {
  position: absolute;
  inset: -2px;
  z-index: 0;
  background: url("/login_image.JPG") center 59% / cover no-repeat;
  content: "";
  animation: image-settle 1.1s var(--ease-fluent) both;
}

#login-panel::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(239, 246, 255, .82), rgba(227, 237, 249, .66));
  content: "";
  backdrop-filter: blur(17px) saturate(140%);
  -webkit-backdrop-filter: blur(17px) saturate(140%);
}

#login-panel > * { position: relative; z-index: 1; }
#login-panel h2 { color: #172235; }
#login-panel .muted { color: #4f6077; }
#login-panel label { color: #28384c; }

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.card-heading p { max-width: 500px; margin-bottom: 0; }
form { display: grid; gap: 12px; }

label {
  margin-top: 4px;
  color: #34445a;
  font-size: .88rem;
  font-weight: 350;
}

input, select {
  width: 100%;
  min-height: 51px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, .63);
  color: var(--ink);
  font-size: .96rem;
  box-shadow: inset 0 1px 2px rgba(32, 51, 76, .045), 0 1px 0 rgba(255, 255, 255, .34);
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease, transform .22s var(--ease-fluent);
}

input:hover, select:hover { background: rgba(255, 255, 255, .76); }
input:focus, select:focus { border-color: rgba(23, 107, 209, .62); background: rgba(255, 255, 255, .86); box-shadow: 0 0 0 4px rgba(23, 107, 209, .12); }
input[type="file"] { padding: 8px; color: #53647a; }

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 9px;
  background: rgba(255, 255, 255, .65);
  color: #27384d;
  font: inherit;
  font-weight: 350;
  cursor: pointer;
  transition: background .18s ease, transform .18s var(--ease-fluent);
}

input[type="file"]::file-selector-button:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .92); }
.hint { margin: -3px 0 5px; color: #64758b; font-size: .82rem; font-weight: 300; }
.language-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0 14px; }
.language-grid > div { display: grid; gap: 8px; }

button, .download-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 51px;
  overflow: hidden;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 12px;
  background: linear-gradient(180deg, #2e83df, #176bd1);
  color: #fff;
  font-size: .96rem;
  font-weight: 350;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(25, 92, 169, .2), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .22s var(--ease-fluent), box-shadow .22s ease, filter .22s ease;
}

button::after, .download-link::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .18) 48%, transparent 72%);
  content: "";
  transform: translateX(-110%);
  transition: transform .55s var(--ease-fluent);
}

button:hover::after, .download-link:hover::after { transform: translateX(110%); }
button:hover, .download-link:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 8px 20px rgba(25, 92, 169, .24), inset 0 1px 0 rgba(255, 255, 255, .25); }
button:active, .download-link:active { transform: scale(.985); }
button:disabled { cursor: wait; opacity: .6; transform: none; }
button.secondary { min-height: 38px; padding: 0 13px; border-color: rgba(255, 255, 255, .65); background: rgba(255, 255, 255, .52); color: #33465e; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); font-size: .82rem; }
button.secondary:hover { background: rgba(255, 255, 255, .82); box-shadow: 0 3px 10px rgba(26, 48, 76, .08); }

.progress-wrap { margin-top: 24px; animation: fluent-enter .38s var(--ease-fluent) both; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: #52647a; font-size: .84rem; font-weight: 300; }
progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .65); accent-color: var(--blue); }
progress::-webkit-progress-bar { border-radius: 20px; background: rgba(255, 255, 255, .65); }
progress::-webkit-progress-value { border-radius: 20px; background: linear-gradient(90deg, #49a1ef, #176bd1); transition: width .3s var(--ease-fluent); }
progress::-moz-progress-bar { border-radius: 20px; background: linear-gradient(90deg, #49a1ef, #176bd1); }

.message {
  margin: 18px 0 0;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 12px;
  background: rgba(242, 248, 255, .62);
  color: #365270;
  font-size: .9rem;
  font-weight: 300;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
  animation: fluent-enter .3s var(--ease-fluent) both;
}

.message.error { border-color: rgba(194, 63, 60, .16); background: rgba(255, 239, 239, .76); color: #9c3331; }
.download-link { width: 100%; margin-top: 16px; animation: fluent-enter .35s var(--ease-fluent) both; }
footer { padding: 20px 4px 0; color: rgba(35, 51, 71, .68); font-size: .78rem; font-weight: 300; line-height: 1.55; }

button:focus-visible, .download-link:focus-visible { outline: 3px solid rgba(23, 107, 209, .35); outline-offset: 3px; }
[hidden] { display: none !important; }

@keyframes fluent-enter {
  from { opacity: 0; transform: translateY(13px) scale(.985); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes wallpaper-drift {
  from { transform: scale(1.025) translate3d(0, 0, 0); }
  to { transform: scale(1.07) translate3d(-.5%, -.4%, 0); }
}

@keyframes image-settle {
  from { transform: scale(1.055); }
  to { transform: scale(1); }
}

@media (max-width: 540px) {
  .shell { width: min(100% - 28px, 720px); padding-top: 42px; }
  .language-grid { grid-template-columns: 1fr; }
  .card-heading { align-items: center; }
  .card { border-radius: 21px; }
}

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