:root {
  --ink: #151515;
  --muted: #525252;
  --line: #121212;
  --panel: #ffffff;
  --blue: #2474f3;
  --red: #b42318;
  --soft: #f2f3f5;
  --shadow: 0 18px 42px rgba(20, 24, 32, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.lock-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: #fff;
}

.lock-panel {
  width: min(390px, 100%);
  padding: 28px;
  border: 6px solid var(--line);
  border-radius: 42px;
  background: var(--panel);
}

.lock-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: #141c26;
  font-size: 24px;
  font-weight: 800;
}

.lock-panel h1 {
  margin: 22px 0 16px;
  font-size: 28px;
  letter-spacing: 0;
}

.unlock-form {
  display: grid;
  gap: 10px;
}

.unlock-form input,
.unlock-form button {
  height: 48px;
  border-radius: 12px;
}

.unlock-form input {
  border: 1px solid #ccd2dc;
  padding: 0 14px;
  outline: none;
}

.unlock-form button {
  border: 0;
  color: #fff;
  background: #141c26;
  font-weight: 800;
}

#unlockError {
  display: block;
  min-height: 20px;
  margin-top: 10px;
  color: var(--red);
}

.app-shell {
  min-height: 100vh;
}

.workspace {
  width: min(100%, 1250px);
  margin: 0 auto;
  padding: 24px 70px 60px;
}

.top-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 154px;
  padding: 0 44px;
  border: 7px solid var(--line);
  border-radius: 78px;
  color: #202020;
  background: #fff;
}

.top-pill input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #202020;
  background: transparent;
  font-size: 26px;
  font-weight: 800;
  outline: none;
}

.top-pill input::placeholder {
  color: #202020;
  opacity: 1;
}

.top-pill input:focus {
  border: 0;
  box-shadow: none;
}

.top-pill input::-webkit-search-cancel-button {
  display: none;
}

.pill-action {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.pill-action:focus-visible {
  outline: 4px solid rgba(36, 116, 243, 0.22);
}

.top-pill.has-query .pill-corners {
  display: none;
}

.top-pill.has-query .pill-action::before,
.top-pill.has-query .pill-action::after {
  position: absolute;
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: #101010;
  content: "";
}

.top-pill.has-query .pill-action::before {
  transform: rotate(45deg);
}

.top-pill.has-query .pill-action::after {
  transform: rotate(-45deg);
}

.pill-corners {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
}

.pill-corners::before,
.pill-corners::after {
  position: absolute;
  inset: 8px;
  content: "";
  border: 5px solid #101010;
  border-radius: 8px;
}

.pill-corners::before {
  clip-path: polygon(0 0, 42% 0, 42% 16%, 16% 16%, 16% 42%, 0 42%, 0 0, 58% 0, 100% 0, 100% 42%, 84% 42%, 84% 16%, 58% 16%);
}

.pill-corners::after {
  clip-path: polygon(0 58%, 16% 58%, 16% 84%, 42% 84%, 42% 100%, 0 100%, 0 58%, 58% 84%, 84% 84%, 84% 58%, 100% 58%, 100% 100%, 58% 100%);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 154px));
  justify-content: space-between;
  gap: 72px 54px;
  margin-top: 86px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 140px;
  display: grid;
  place-items: center;
  color: #555;
  font-size: 24px;
}

.entry-app,
.add-app {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  user-select: none;
  cursor: pointer;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

.add-app {
  align-self: start;
}

.entry-app:focus-visible .entry-icon,
.entry-app:hover .entry-icon,
.add-app:focus-visible .add-icon,
.add-app:hover .add-icon {
  box-shadow: 0 0 0 4px rgba(36, 116, 243, 0.16);
  transform: translateY(-2px);
}

.entry-app.dragging {
  opacity: 0.22;
  transform: scale(0.95);
}

.entry-app.drag-source {
  pointer-events: none;
}

.entry-app.drag-over .entry-icon {
  box-shadow: 0 0 0 5px rgba(36, 116, 243, 0.26);
}

.drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.96;
  transform-origin: left top;
  transition: none;
}

.drag-ghost .entry-icon {
  box-shadow: 0 18px 36px rgba(20, 24, 32, 0.24);
}

.drag-ghost .edit-chip {
  display: none;
}

.entry-icon {
  position: relative;
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  overflow: hidden;
  border-radius: 26px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.add-icon {
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  border-radius: 26px;
  color: #bfc0c2;
  background: #ededee;
  font-size: 78px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.entry-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-icon span {
  display: block;
  max-width: 100%;
  padding: 0 8px;
  overflow: hidden;
  font-size: 31px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-name {
  width: 100%;
  min-height: 36px;
  overflow: hidden;
  color: #3d3d3d;
  font-size: 26px;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-chip {
  position: absolute;
  right: 5px;
  top: 5px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(16, 16, 16, 0.14);
  border-radius: 999px;
  color: #141414;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  font-size: 16px;
  line-height: 1;
}

.edit-chip:focus-visible {
  outline: 3px solid rgba(36, 116, 243, 0.34);
}

.is-dragging,
.is-dragging * {
  cursor: grabbing !important;
}

.entry-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.entry-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.entry-dialog form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.dialog-head h2 {
  margin: 0;
  font-size: 20px;
}

.ghost-icon {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #eef2f6;
  font-size: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 700;
}

label span {
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d5dbe6;
  border-radius: 9px;
  outline: none;
  background: #fff;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 116, 243, 0.14);
}

input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 10px 12px;
}

.primary-btn,
.secondary-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: var(--blue);
}

.secondary-btn {
  border-color: #d5dbe6;
  background: #fff;
}

@media (max-width: 900px) {
  .workspace {
    padding: 20px 30px 44px;
  }

  .top-pill {
    min-height: 108px;
    padding: 0 30px;
    border-width: 6px;
    border-radius: 58px;
  }

  .cards-grid {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    gap: 42px 24px;
    margin-top: 52px;
  }

  .entry-icon {
    width: 82px;
    height: 82px;
    border-radius: 20px;
  }

  .entry-icon span {
    font-size: 24px;
  }

  .entry-name {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .workspace {
    padding: 16px 18px 36px;
  }

  .top-pill {
    min-height: 74px;
    padding: 0 20px;
    border-width: 4px;
    border-radius: 40px;
  }

  .top-pill input {
    font-size: 18px;
  }

  .pill-action {
    width: 36px;
    height: 36px;
  }

  .top-pill.has-query .pill-action::before,
  .top-pill.has-query .pill-action::after {
    width: 24px;
    height: 4px;
  }

  .pill-corners {
    width: 36px;
    height: 36px;
  }

  .pill-corners::before,
  .pill-corners::after {
    inset: 6px;
    border-width: 3px;
    border-radius: 6px;
  }

  .cards-grid {
    grid-template-columns: repeat(3, minmax(78px, 1fr));
    gap: 34px 18px;
    margin-top: 40px;
  }

  .entry-app,
  .add-app {
    gap: 10px;
  }

  .entry-icon,
  .add-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .add-icon {
    font-size: 52px;
  }

  .entry-icon span {
    font-size: 21px;
  }

  .entry-name {
    min-height: 24px;
    font-size: 15px;
  }

  .edit-chip {
    right: 4px;
    top: 4px;
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .lock-panel {
    border-width: 4px;
    border-radius: 30px;
    padding: 22px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
