:root {
  color-scheme: light;
  --ink: #182033;
  --muted: #7b8498;
  --line: #e8ebf1;
  --purple: #6253e7;
  --purple-dark: #5142d4;
  --surface: #ffffff;
  --bg: #f5f6fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.shell {
  width: min(100% - 40px, 820px);
  margin: 0 auto;
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 32, 51, .07);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--purple);
  color: white;
  font-family: "Manrope", sans-serif;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 5px 12px #6253e733;
}

.topbar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #687185;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #45bb88;
  box-shadow: 0 0 0 3px #45bb881f;
}

.intro {
  padding: 55px 0 30px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8c91a5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.intro h1, h2 {
  margin: 0;
  font-family: "Manrope", "Microsoft YaHei", sans-serif;
  letter-spacing: -.6px;
}

.intro h1 { font-size: clamp(28px, 5vw, 38px); }
.intro > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.panel {
  background: var(--surface);
  border: 1px solid rgba(24, 32, 51, .06);
  border-radius: 16px;
  box-shadow: 0 8px 28px #2734510a, 0 1px 3px #2734510a;
}

.login-panel { width: min(100%, 410px); margin: 0 auto; padding: 28px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; }
.panel-heading h2, .library-heading h2 { font-size: 19px; }
.heading-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--purple);
  font-size: 20px;
}

label:not(.drop-zone) { display: block; margin: 16px 0 7px; color: #4b5366; font-size: 12px; font-weight: 600; }
input:not([type="file"]) {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid #e3e6ee;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:not([type="file"]):focus { border-color: #9288f1; box-shadow: 0 0 0 3px #6253e71a; }

.button {
  min-height: 45px;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s, transform .15s;
}
.button-primary { background: var(--purple); color: white; }
.button-primary:hover:not(:disabled) { background: var(--purple-dark); transform: translateY(-1px); }
.button-primary:disabled { cursor: not-allowed; opacity: .46; }
.button-full { width: 100%; margin-top: 21px; }
.button-full span { padding-left: 5px; font-size: 17px; }

.message { min-height: 0; margin: 10px 0 0; font-size: 12px; }
.message:empty { display: none; }
.is-error { color: #c44545; }
.is-success { color: #21825a; }

.admin-panel { padding-bottom: 42px; }
.upload-panel { padding: 27px; }
.upload-panel .panel-heading { margin-bottom: 19px; }
.upload-icon { color: #3ca77b; }

.drop-zone {
  position: relative;
  display: flex;
  min-height: 155px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px dashed #cdd1df;
  border-radius: 11px;
  background: #fafaff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone:hover { border-color: #8b81ed; background: #f7f6ff; }
.drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 10px;
  background: #eeecff;
  color: var(--purple);
  font-size: 20px;
}
.drop-zone strong { max-width: 90%; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.drop-hint { color: #989eb0; font-size: 11px; }
.upload-panel .button-full { margin-top: 15px; }

.progress-wrap { margin-top: 15px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.progress-copy span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 4px; overflow: hidden; border-radius: 4px; background: #eceaf8; }
.progress-bar { width: 35%; height: 100%; border-radius: inherit; background: var(--purple); animation: indeterminate 1.2s ease-in-out infinite alternate; }
@keyframes indeterminate { from { transform: translateX(-20%); } to { transform: translateX(220%); } }

.library-section { margin-top: 37px; }
.library-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.library-heading .eyebrow { margin-bottom: 5px; }
.count-badge { padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: #727b8f; font-size: 11px; }
.software-list { display: grid; gap: 9px; }
.software-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(24, 32, 51, .06);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 3px 12px #27345108;
}
.file-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: #f0efff;
  color: var(--purple);
  font-size: 19px;
}
.software-info { min-width: 0; flex: 1; }
.software-name { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.software-meta { display: block; margin-top: 4px; color: #969daf; font-size: 10px; }
.link-row { display: flex; min-width: 0; align-items: center; gap: 8px; margin-top: 8px; }
.software-link { overflow: hidden; color: #6557da; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.copy-button, .delete-button { flex: 0 0 auto; border: 0; background: none; color: #777f92; font-size: 10px; }
.copy-button { padding: 4px 0 4px 4px; }
.copy-button:hover { color: var(--purple); }
.copy-fallback { position: fixed; left: -10000px; top: 0; }
.delete-button { width: 27px; height: 27px; border-radius: 7px; font-size: 19px; }
.delete-button:hover { background: #fff0f0; color: #c44545; }

.empty-state { padding: 35px 18px; border: 1px dashed #d8dbe5; border-radius: 12px; color: #8991a3; text-align: center; }
.empty-state > span { display: block; margin-bottom: 8px; color: #aaa4ec; font-size: 25px; }
.empty-state strong { color: #555e72; font-size: 13px; }
.empty-state p { margin: 6px 0 0; font-size: 11px; }

footer { padding: 0 0 30px; color: #a0a5b2; font-size: 10px; text-align: center; }
footer span { padding: 0 5px; }

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 820px); }
  .topbar { height: 68px; }
  .intro { padding: 39px 0 24px; }
  .login-panel, .upload-panel { padding: 21px; }
  .software-card { gap: 10px; padding: 12px; }
  .file-icon { width: 34px; height: 34px; }
  .software-link { font-size: 10px; }
}
