:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f4f2;
  --line: #d8dee6;
  --text: #14201c;
  --muted: #617069;
  --green: #146b59;
  --blue: #315f9f;
  --danger: #9a3d2f;
  --shadow: 0 18px 46px rgba(31, 45, 61, 0.12);
  --radius: 8px;
  --font-sans: "Inter", "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(245, 247, 249, 0.96)),
    linear-gradient(135deg, #eef5f2 0%, #f7f8fb 52%, #eef3fb 100%);
  font-family: var(--font-sans);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  background: #0f5949;
}

.ghost-button {
  color: var(--text);
  background: rgba(20, 32, 28, 0.08);
}

.ghost-button:hover {
  background: rgba(20, 32, 28, 0.12);
}

.clip-shell {
  width: min(1060px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 32px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.topbar,
.editor-panel,
.message-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 18px;
}

.home-link {
  align-self: center;
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.key-panel {
  display: grid;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.key-row {
  display: flex;
  gap: 10px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(49, 95, 159, 0.16);
  border-color: rgba(49, 95, 159, 0.42);
}

#keyInput {
  max-width: 148px;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.expiry-text {
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.editor-panel {
  min-height: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 14px;
}

textarea {
  min-height: 360px;
  padding: 18px;
  resize: vertical;
  line-height: 1.7;
  font-size: 16px;
}

.action-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.message-panel {
  margin-top: 20vh;
  padding: 28px;
}

.message-panel h1,
.message-panel p {
  margin: 0 0 14px;
}

.message-panel a {
  color: var(--green);
  font-weight: 800;
}

@media (max-width: 760px) {
  .clip-shell {
    width: min(100% - 20px, 560px);
    padding: 10px 0 16px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .key-row,
  .action-bar,
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #keyInput {
    max-width: none;
  }

  .expiry-text {
    text-align: left;
  }

  .editor-panel {
    grid-template-rows: minmax(52vh, 1fr) auto;
  }
}
