:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-highlight: #ffffff;
  --card: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.4);
  --text: #1c1c1e;
  --muted: #6b6f76;
  --primary: #1f6feb;
  --primary-ink: #ffffff;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --radius-lg: 26px;
  --radius-md: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #ffffff, var(--bg) 60%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px 80px;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.blob-one {
  background: #cde7ff;
  top: -120px;
  left: -120px;
}

.blob-two {
  background: #fbe2d8;
  bottom: -160px;
  right: -140px;
}

.shell {
  width: min(1280px, 100%);
  display: grid;
  gap: 36px;
  position: relative;
  z-index: 1;
}

.login-view .shell {
  min-height: calc(100vh - 120px);
  gap: 20px;
}

.login-view #loginPanel {
  align-self: center;
  margin-top: -236px;
}

.login-view .topbar {
  justify-content: center;
  text-align: center;
}

.login-view .topbar div {
  display: grid;
  justify-items: center;
  gap: 6px;
}

body.login-view {
  align-items: center;
  padding-top: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 600;
}

.card {
  padding: clamp(28px, 4vw, 42px);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  animation: floatIn 0.8s var(--ease) both;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.card-head h2 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  margin-bottom: 8px;
}

.card-head p {
  color: var(--muted);
}

.login-card {
  max-width: 1080px;
  margin: 0 auto;
}

.login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.login-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 111, 235, 0.12);
  color: #1f6feb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 320px);
  align-items: start;
}

.login-form {
  align-content: start;
}

.login-aside {
  display: grid;
  gap: 16px;
  align-content: start;
}

.glass-panel {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.panel-title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 13px;
  color: var(--muted);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-value {
  color: var(--text);
  font-weight: 600;
}

.tip-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.tip-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(31, 111, 235, 0.12);
  color: #1f6feb;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.tip-text {
  font-size: 13px;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

input {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  transition: border 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus {
  outline: none;
  border-color: rgba(31, 111, 235, 0.4);
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.15);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease), color 0.2s var(--ease);
}

.primary-button {
  color: var(--primary-ink);
  background: linear-gradient(135deg, #2f7cf6, #1f6feb);
  box-shadow: 0 12px 24px rgba(31, 111, 235, 0.25);
}

.primary-button:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 14px 26px rgba(31, 111, 235, 0.3);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button svg,
.ghost-button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.toolbar {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
  margin-bottom: 24px;
}

.toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.toolbar-inline label {
  min-width: 120px;
  flex: 1 1 140px;
}

.toolbar-inline label span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar-inline input {
  height: 40px;
  padding: 10px 12px;
  font-size: 13px;
}

.toolbar-inline .toolbar-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.toolbar-inline .primary-button {
  padding: 10px 16px;
  font-size: 13px;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.table-wrap {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.workspace {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 24px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.ghost-small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border 0.2s var(--ease),
    background 0.2s var(--ease);
}

.category-button:hover {
  transform: translateY(-1px);
}

.category-button.active {
  border-color: rgba(31, 111, 235, 0.35);
  background: rgba(31, 111, 235, 0.12);
  color: #1f6feb;
}

.category-count {
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
}

.workspace-main {
  display: grid;
  gap: 16px;
}

.cards-wrap {
  position: relative;
  padding: 6px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.link-card {
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 12px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-meta {
  display: grid;
  gap: 2px;
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
}

.card-desc {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.4;
}

.card-url {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.2s var(--ease), opacity 0.2s var(--ease);
}

.link-card:hover .card-url {
  max-height: 44px;
  opacity: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding-top: 10px;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.open-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.open-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(15, 23, 42, 0.1);
}

.category-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row-actions .icon-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border 0.2s var(--ease), color 0.2s var(--ease);
}

.link:hover {
  color: #1f6feb;
  border-color: rgba(31, 111, 235, 0.35);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
 td {
  text-align: left;
  padding: 14px 12px;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

tr {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  transition: background 0.2s var(--ease);
}

tr:hover {
  background: rgba(255, 255, 255, 0.7);
}

.row-enter {
  animation: rowIn 0.35s var(--ease) both;
}

.actions-col {
  width: 140px;
}

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

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.95);
}

.icon-button.danger {
  color: #d64545;
}

.helper {
  color: var(--muted);
  font-size: 13px;
}

.chip {
  padding: 8px 14px;
  background: rgba(31, 111, 235, 0.1);
  color: #1f6feb;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  text-align: center;
}

.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(31, 111, 235, 0.1);
  color: #1f6feb;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 12px 18px;
  background: rgba(28, 28, 30, 0.85);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s var(--ease);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  body {
    padding: 32px 16px 60px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .toolbar-inline {
    grid-template-columns: 1fr;
  }

  .toolbar-inline .toolbar-actions {
    justify-self: start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .actions-col {
    width: auto;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .toast {
    right: 16px;
    left: 16px;
    text-align: center;
  }
}

@media (max-width: 1100px) {
  .toolbar-inline .toolbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}
