* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20242a;
  background: #eef3f7;
  overflow-x: hidden;
}

.shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

.panel {
  width: min(900px, 100%);
  padding: 28px;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(31, 47, 70, 0.12);
}

h1 {
  margin: 0;
  font-size: 24px;
}

.header {
  margin-bottom: 22px;
}

.header p {
  margin: 8px 0 0;
  color: #667085;
}

form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.5fr) auto;
  gap: 16px;
  align-items: end;
}

#account-field {
  grid-column: 1;
  transform-origin: top left;
}

#login-password-field {
  grid-column: 2;
}

#login-submit {
  grid-column: 3;
}

#password-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.password-top-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 16px;
  align-items: end;
}

.email-slot {
  min-height: 74px;
}

.email-slot #account-field {
  width: 100%;
}

#password-submit {
  min-width: 160px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #c8d3df;
  border-radius: 6px;
  font: inherit;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 64px;
}

.password-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  width: auto;
  min-width: 44px;
  height: 30px;
  padding: 0 8px;
  transform: translateY(-50%);
  border-radius: 5px;
  color: #124071;
  background: #e8f3ff;
  font-size: 13px;
}

.email-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
}

.email-field input {
  border-radius: 6px 0 0 6px;
}

select {
  height: 44px;
  padding: 0 10px;
  border: 1px solid #c8d3df;
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #f8fbfd;
  font: inherit;
  font-weight: 700;
}

button {
  height: 44px;
  min-width: 144px;
  max-width: 100%;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: #1677ff;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

input:disabled,
select:disabled {
  color: #667085;
  background: #f1f5f9;
  cursor: not-allowed;
}

.secondary {
  min-width: 72px;
  height: 36px;
  color: #124071;
  background: #e8f3ff;
}

.locked-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  background: #f8fbfd;
}

#locked-email {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #0f5dcc;
  font-size: 18px;
}

.lock-rule {
  margin: 6px 0 0;
  color: #667085;
  font-size: 13px;
}

.query-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  color: #5c3b00;
  background: #fff7d6;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.16);
}

.query-tip strong {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: #d97706;
  font-size: 14px;
}

.query-tip span {
  font-size: 16px;
  font-weight: 800;
}

#query-button {
  width: 100%;
  margin-top: 12px;
}

.password-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  background: #f8fbfd;
}

.password-content {
  max-height: 0;
  opacity: 0;
  transition: max-height 860ms cubic-bezier(.45,0,.2,1), opacity 640ms ease;
}

#password-toggle {
  width: 100%;
  height: auto;
  min-height: 24px;
  padding: 0;
  color: #124071;
  background: transparent;
  text-align: left;
}

#password-toggle::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  transition: transform 360ms cubic-bezier(.45,0,.2,1);
}

.password-open #password-toggle::before {
  transform: rotate(90deg);
}

.status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  color: #124071;
  background: #e8f3ff;
  overflow-wrap: anywhere;
}

pre {
  min-height: 96px;
  margin: 18px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: 6px;
  background: #111820;
  color: #cfe6ff;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  background: #f8fbfd;
}

h2 {
  margin: 4px 0 0;
  font-size: 16px;
}

.empty {
  padding: 12px;
  border-radius: 6px;
  background: #fff;
  overflow-wrap: anywhere;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.label,
.meta,
.empty {
  color: #6b7280;
  font-size: 13px;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.code {
  width: fit-content;
  margin-top: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #0f5dcc;
  background: #e6f1ff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
}

.copy-code {
  min-width: 72px;
  height: 36px;
  border-radius: 6px;
}

.login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 0 18px;
  border-radius: 6px;
  color: #fff;
  background: #111820;
  font-weight: 800;
  text-decoration: none;
}

.usage-notice {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: stretch;
  padding: 14px 16px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  background: #fbfdff;
}

.notice-copy strong {
  display: block;
  color: #16395c;
  font-size: 15px;
  font-weight: 800;
}

.notice-copy p {
  max-width: 620px;
  margin: 4px 0 0;
  color: #5f6b7a;
  line-height: 1.5;
}

.admin-contact {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid #d7e0e8;
}

.contact-title {
  color: #16395c;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d7e0e8;
  border-radius: 6px;
  color: #143a63;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.contact-item svg {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  fill: currentColor;
  flex: 0 0 auto;
}

.contact-item span {
  white-space: nowrap;
}

.contact-item.telegram {
  color: #1677b8;
}

.contact-item.wechat {
  color: #11803b;
}

@media (max-width: 820px) {
  .shell {
    padding: 16px 10px 28px;
    overflow-x: hidden;
  }

  .panel {
    width: 100%;
    padding: 22px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .header p {
    font-size: 15px;
    line-height: 1.55;
  }

  form,
  #password-form {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    min-width: 0;
  }

  #account-field,
  #login-password-field,
  #login-submit {
    grid-column: auto;
    min-width: 0;
  }

  .email-field {
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0;
  }

  .email-field input,
  select {
    border: 1px solid #c8d3df;
    border-radius: 6px;
  }

  input,
  select,
  button {
    min-width: 0;
    width: 100%;
  }

  .password-top-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .email-slot {
    min-height: 0;
  }

  .locked-row,
  .query-tip {
    align-items: flex-start;
  }

  .locked-row {
    flex-direction: column;
  }

  .query-tip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .query-tip strong {
    width: fit-content;
  }

  .query-tip span {
    font-size: 15px;
    line-height: 1.55;
  }

  .message-head,
  .meta {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .usage-notice,
  .contact-list {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .admin-contact {
    padding-left: 0;
    padding-top: 12px;
    border-left: 0;
    border-top: 1px solid #d7e0e8;
  }

  .contact-item {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 12px 8px 24px;
  }

  .panel {
    padding: 18px;
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(31, 47, 70, 0.1);
  }

  h1 {
    font-size: 22px;
  }

  .header {
    margin-bottom: 18px;
  }

  .password-box,
  .message,
  .usage-notice {
    padding: 12px;
  }

  .code {
    width: 100%;
    font-size: 30px;
    text-align: center;
  }

  .contact-title,
  .notice-copy strong {
    text-align: center;
    white-space: normal;
  }

  .notice-copy p {
    text-align: left;
  }
}
