:root {
  --text: #2b303b;
  --muted: #8b93a6;
  --accent: #ff4d58;
  --line: #edf0f5;
  --bg: #f5f6f8;
  --card: #ffffff;
  --shadow: 0 10px 24px rgba(28, 35, 52, 0.06);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.hero {
  min-height: 248px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(8, 15, 29, 0.95), rgba(17, 31, 60, 0.58), rgba(245, 246, 248, 0.98)),
    url("./icons/hero-bg.svg") center/cover no-repeat;
}
.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 12px;
}
.top-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 12px max(16px, calc((100vw - 1180px) / 2)) 10px;
  background: linear-gradient(180deg, rgba(8, 15, 29, .28), rgba(8, 15, 29, .18));
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.user-btn {
  border: 0;
  background: transparent;
  padding: 0;
}
.user-btn {
  width: 24px;
  height: 24px;
}
.user-btn img {
  width: 100%;
  height: 100%;
}
.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.logo {
  display: grid;
  justify-items: center;
  line-height: 1.05;
}
.logo span {
  color: #ff8a00;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
}
.logo small {
  color: #3ba4ff;
  font-size: 11px;
  font-weight: 700;
}
.user-btn {
  position: absolute;
  right: 0;
}
.search-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 24px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.search-tabs::-webkit-scrollbar {
  display: none;
}
.search-tabs a {
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.76);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  letter-spacing: .4px;
  text-shadow: 0 0 10px rgba(126, 199, 255, .12);
  padding: 0 0 12px;
  transition: color .18s ease, text-shadow .18s ease;
}
.search-tabs a:not(:last-child)::before {
  content: "";
  position: absolute;
  right: -14px;
  top: 4px;
  width: 1px;
  height: 14px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.22), transparent);
}
.search-tabs a.active {
  color: #fff;
  text-shadow: 0 0 12px rgba(126, 199, 255, .32);
}
.search-tabs a:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(126, 199, 255, .24);
}
.search-tabs a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7ee7ff, #ffffff, #7ee7ff);
  box-shadow: 0 0 12px rgba(126, 231, 255, .48);
  transform: translateX(-50%);
}
.notice {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 56px;
  padding: 0 14px;
  border-radius: 0;
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.18);
  margin-left: -10px;
  margin-right: -10px;
  padding-left: 24px;
  padding-right: 24px;
}
.notice img {
  width: 16px;
  height: 16px;
}
.notice-viewport {
  height: 20px;
  overflow: hidden;
}
.notice-track {
  display: grid;
  transition: transform .35s ease;
}
.notice-track span {
  height: 20px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.layout {
  width: min(1180px, calc(100% - 20px));
  margin: 0 auto;
}
.section-title img {
  width: 18px;
  height: 18px;
}
.content {
  min-width: 0;
}
.personal-panel {
  margin-top: -6px;
}
.panel-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.panel-tabs button {
  border: 0;
  color: #8f95a3;
  background: #eceeef;
  border-radius: 999px;
  padding: 8px 14px;
}
.panel-tabs .active {
  color: #fff;
  background: var(--accent);
}
.panel-tabs .edit-btn {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
}
.category-list {
  display: grid;
  gap: 16px;
  margin-top: 10px;
  padding-bottom: 34px;
}
.my-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.my-link-card {
  min-height: 64px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.category-section {
  scroll-margin-top: 130px;
}
.personal-panel {
  scroll-margin-top: 130px;
}
.section-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}
.site-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.site-grid > * {
  min-width: 0;
}
.site-card {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--card);
  border-radius: 6px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.site-card > div {
  min-width: 0;
  flex: 1;
  display: grid;
  align-content: center;
}
.site-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.site-card > img {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}
.site-card strong,
.site-card span {
  display: block;
}
.site-card strong {
  font-size: 14px;
  margin-bottom: 1px;
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.site-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.empty-state {
  min-height: 80px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 40;
}
.modal.open {
  display: block;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 24, .42);
}
.modal-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 18px 18px 22px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -14px 36px rgba(20, 27, 40, .12);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-head strong {
  font-size: 18px;
  letter-spacing: .2px;
}
.modal-head button {
  width: 18px;
  height: 18px;
  border: 0;
  padding: 0;
  background: transparent;
}
.modal-head img {
  width: 100%;
  height: 100%;
}
.modal-section + .modal-section {
  margin-top: 22px;
}
.modal-section h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-heading em {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-style: normal;
}
.custom-form {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 10px;
}
.custom-form input {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #fbfcfe;
  color: #2f3645;
}
.custom-form input:focus {
  outline: none;
  border-color: rgba(255, 77, 88, .45);
  box-shadow: 0 0 0 3px rgba(255, 77, 88, .1);
}
.custom-form button {
  border: 0;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 10px 18px rgba(255, 77, 88, .2);
}
.custom-form button:disabled {
  opacity: .72;
  cursor: wait;
}
.edit-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.edit-link-card {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 40px 12px 12px;
  border: 1px solid #edf1f6;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcfe, #f6f8fb);
}
.edit-link-card.just-added {
  animation: pop-in .28s ease both;
}
.edit-link-card img {
  width: 30px;
  height: 30px;
}
.edit-link-card strong,
.edit-link-card span {
  display: block;
}
.edit-link-card strong {
  font-size: 14px;
}
.edit-link-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.remove-link {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  color: #7e8798;
  background: #eef2f7;
  transition: .18s ease;
}
.remove-link:hover {
  color: #fff;
  background: var(--accent);
}
.edit-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 12px;
  border-radius: 12px;
  background: #f6f8fb;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  color: #fff;
  background: rgba(24, 29, 39, .92);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 860px) {
  .hero {
    min-height: 248px;
  }
  .hero-inner {
    width: calc(100% - 20px);
  }
  .content {
    margin-top: -4px;
  }
  .site-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 248px;
  }
  .logo span {
    font-size: 24px;
  }
  .search-tabs {
    gap: 22px;
    justify-content: flex-start;
  }
  .notice {
    margin-top: 56px;
  }
  .site-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .site-card {
    min-height: 76px;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }
  .site-card > img {
    width: 34px;
    height: 34px;
  }
  .site-card strong {
    font-size: 14px;
  }
  .site-card span {
    font-size: 12px;
    line-height: 1.35;
  }
  .my-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .edit-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .edit-link-card {
    min-height: 72px;
    align-items: flex-start;
    padding: 12px 34px 12px 12px;
  }
  .edit-link-card img {
    width: 28px;
    height: 28px;
  }
  .custom-form {
    grid-template-columns: 1fr;
  }
  .custom-form button {
    height: 46px;
  }
}
