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

:root {
  --bg: #aee6ee;
  --shape-top: #f5b8c8;
  --shape-bottom: #f0d9a8;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #888888;
  --text-light: #aaaaaa;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.1);
  --radius-card: 28px;
  --radius-pill: 999px;
  --max-width: 480px;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-bg__shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.page-bg__shape--top {
  top: -80px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: var(--shape-top);
  opacity: 0.7;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-radius: 0;
}

.page-bg__shape--bottom {
  bottom: -100px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: var(--shape-bottom);
  opacity: 0.65;
}

.page {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 0 48px;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  padding: 4px 4px 12px;
}

.top-bar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.top-bar__btn:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #555;
}

.top-bar__btn svg {
  width: 20px;
  height: 20px;
}

.top-bar__right {
  display: flex;
  gap: 4px;
}

.top-bar__btn.is-favorited {
  color: #f5a623;
}

/* QR float (desktop) */
.qr-float {
  display: none;
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.qr-float img {
  width: 120px;
  height: 120px;
  display: block;
}

.qr-float p {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .qr-float {
    display: block;
  }
}

/* Profile */
.profile {
  text-align: center;
  padding: 8px 0 24px;
}

.profile__avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.profile__name {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.profile__bio {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 12px;
}

.profile__url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: background 0.2s;
}

.profile__url:hover {
  background: rgba(255, 255, 255, 0.85);
}

.profile__url svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.profile__social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.profile__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s, background 0.2s;
}

.profile__social a:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.85);
}

.profile__social svg {
  width: 20px;
  height: 20px;
}

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.35);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.search-overlay.is-open {
  display: flex;
}

.search-box {
  width: 90%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--bg);
  box-shadow: 0 0 0 3px rgba(174, 230, 238, 0.5);
}

.search-results {
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.search-results__item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s;
}

.search-results__item:hover {
  background: #f5f5f5;
}

.search-results__empty {
  padding: 12px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

/* Sections */
.section {
  margin-top: 8px;
}

.section + .section {
  margin-top: 20px;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  user-select: none;
}

.section__header--clickable {
  cursor: pointer;
}

.section__arrow {
  width: 16px;
  height: 16px;
  color: #aaa;
  transition: transform 0.25s ease;
}

.section.is-collapsed .section__arrow {
  transform: rotate(-90deg);
}

.section__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.section.is-collapsed .section__links {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

/* Link cards */
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.link-card:active {
  transform: translateY(0);
}

.link-card.is-hidden {
  display: none;
}

.link-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}

.link-card__icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.link-card__icon--custom {
  background: #eee;
  padding: 0;
  overflow: hidden;
}

.link-card__icon--custom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.link-card__body {
  flex: 1;
  min-width: 0;
}

.link-card__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.link-card__subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.link-card__arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #ccc;
}

.link-card__arrow svg {
  width: 18px;
  height: 18px;
}

.link-card--btn {
  width: 100%;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

/* 分割线模块 */
.module-divider-wrap {
  width: 100%;
}

.module-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  margin: 0 auto;
}

.module-divider--short {
  width: 40%;
}

.module-divider--medium {
  width: 72%;
}

.module-divider--long {
  width: 100%;
}

.module-divider--clickable {
  cursor: pointer;
  user-select: none;
}

.module-divider__line {
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.18);
}

.module-divider--dashed .module-divider__line {
  height: 0;
  background: none;
  border-top: 1px dashed rgba(0, 0, 0, 0.22);
}

.module-divider__line--full {
  flex: none;
  width: 100%;
}

.module-divider__label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  padding: 0;
}

.module-divider__chevron {
  width: 14px;
  height: 14px;
  color: #999;
  transition: transform 0.25s ease;
}

.module-divider-wrap.is-collapsed .module-divider__chevron {
  transform: rotate(-90deg);
}

.module-divider-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-divider-wrap.is-collapsed .module-divider-group {
  display: none;
}

body.has-modal {
  overflow: hidden;
}

/* 二维码 / 文本复制弹窗 */
.module-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.module-modal.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.module-modal__box {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.module-modal__box--qr {
  padding: 28px 24px 20px;
  text-align: center;
}

.module-modal__box--qr img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.module-modal__box--qr p {
  margin: 16px 0 0;
  font-size: 14px;
  color: #666;
}

.module-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #999;
  cursor: pointer;
}

.module-modal__box--copy {
  padding: 20px 20px 0;
}

.module-modal__box--copy h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}

.module-modal__content {
  max-height: 240px;
  overflow-y: auto;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-break: break-all;
}

.module-modal__actions {
  display: flex;
  border-top: 1px solid #eee;
  margin-top: 16px;
}

.module-modal__actions button {
  flex: 1;
  padding: 14px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

.module-modal__actions button:last-child {
  color: #e53935;
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 300;
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 14px;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.admin-entry {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  color: #888;
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-entry:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  color: #7c3aed;
}

/* 在浏览器中打开提示 */
.browser-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  text-align: right;
  padding: 16px 24px;
}

.browser-hint.is-visible {
  display: block;
}

.browser-hint__arrow {
  width: 60px;
  height: 60px;
  margin-left: auto;
  margin-bottom: 12px;
  border-top: 3px dashed #fff;
  border-right: 3px dashed #fff;
  border-radius: 0 12px 0 0;
}

.browser-hint p {
  font-size: 16px;
  line-height: 1.6;
}

/* 初始弹窗 */
.initial-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.initial-popup.is-visible {
  display: flex;
}

.initial-popup__box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  max-width: 320px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
}

.initial-popup__close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.initial-popup__box img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

.initial-popup__box #initial-popup-content {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  padding-top: 8px;
}
