:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f3f3;
  color: #242424;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: #f3f3f3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.58)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(0, 0, 0, 0.018) 39px 40px),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(0, 0, 0, 0.018) 39px 40px);
}

.app-window {
  width: min(100%, 500px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px) saturate(130%);
}

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(250, 250, 250, 0.78);
}

.app-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.header-text {
  min-width: 0;
}

h1 {
  min-width: 0;
  margin: 0;
  color: #1f1f1f;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

.notice {
  margin: 4px 0 0;
  color: #616161;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0;
}

.app-content {
  padding: 28px 24px 24px;
}

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #424242;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #8a8886;
  border-bottom-color: #605e5c;
  border-radius: 4px;
  outline: none;
  background: #fff;
  color: #242424;
  font: inherit;
  font-size: 15px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder {
  color: #707070;
}

input:focus {
  border-color: #0f6cbd;
  border-bottom-color: #0f6cbd;
  box-shadow: inset 0 -2px #0f6cbd;
}

button {
  width: 100%;
  height: 40px;
  border: 1px solid #0f6cbd;
  border-radius: 4px;
  background: #0f6cbd;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

button:hover {
  border-color: #115ea3;
  background: #115ea3;
}

button:focus-visible {
  outline: 2px solid #242424;
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px);
}

#message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #c50f1f;
  font-size: 14px;
  text-align: center;
}

.result-panel {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

#result {
  display: grid;
  place-items: center;
  padding: 16px 12px;
  overflow-wrap: anywhere;
  border: 1px solid #b4d6f2;
  border-radius: 4px;
  background: #eff6fc;
  color: #0c3b5e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  user-select: all;
}

.copy-button {
  width: 72px;
  height: auto;
  min-height: 42px;
  padding: 0 14px;
  border-color: #d1d1d1;
  background: #fff;
  color: #242424;
}

.copy-button:hover {
  border-color: #c7c7c7;
  background: #f5f5f5;
}

.copy-button:active {
  background: #ebebeb;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  min-width: 96px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(32, 32, 32, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

@media (max-width: 520px) {
  body {
    padding: 16px;
  }

  main {
    width: 100%;
  }

  h1 {
    font-size: 18px;
  }

  .app-header,
  .app-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .result-panel {
    grid-template-columns: 1fr;
  }

  .copy-button {
    width: 100%;
    min-height: 40px;
  }
}
