/* ===== CSS Variables ===== */
:root,
[data-theme="light"] {
  --design-width: 52;
  --page-max-width: 520px;
  --page-bg: #ffffff;
  --card-bg: rgba(244, 245, 254, 0.7019607843137254);
  --card-border: rgba(0, 0, 0, 0.06);
  --text-primary: #333333;
  --text-secondary: #666680;
  --text-muted: #ffffff;
  --nav-title: #ffffff;
  --lang-bg: rgba(255, 255, 255, 0.2);
  --lang-text: #ffffff;
  --lang-border: rgba(0, 0, 0, 0.08);
  --theme-toggle-bg: #f0f0f5;
  --theme-toggle-active: #ffffff;
  --social-link-bg: #ffffff;
  --social-link-hover: #f0f0f8;
  --brand-tab-bg: rgba(120, 111, 235, 0.2);
  --brand-tab-active-bg: linear-gradient(0deg, #7683d9 0%, #d8a0fe 100%);
  --brand-tab-border: rgba(0, 0, 0, 0.06);
  --link-item-bg: #f8f8fc;
  --link-thumb-bg: #e8e8f0;
  --link-thumb-border: rgba(0, 0, 0, 0.08);
  --access-bg: #ffffff;
  --access-text: #ffffff;
  --access-hover: #6a5ad8;
  --hero-overlay: transparent;
  --content-bg: linear-gradient(90deg, #9facf8 0%, #d5d0fb 100%);
  --footer-text: #ffffff;
  --shadow-card: 0 0.139rem 0.832rem rgba(0, 0, 0, 0.06);
  --icon-share: url("../static/share.png");
  --icon-link: url("../static/link.png");
  --icon-copy: url("../static/copy.png");
  --theme-toggle-width: 12.48rem;
  --theme-toggle-btn-size: 2.6rem;
}

[data-theme="dark"] {
  --page-bg: #1f1b32;
  --card-bg: #2f2c3f;
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #b0b0c8;
  --text-muted: #707088;
  --nav-title: #ffffff;
  --lang-bg: rgba(255, 255, 255, 0.2);
  --lang-text: #ffffff;
  --lang-border: rgba(255, 255, 255, 0.1);
  --theme-toggle-bg: #201c33;
  --theme-toggle-active: #ffffff;
  --social-link-bg: #2f2c3f;
  --social-link-hover: rgba(255, 255, 255, 0.1);
  --brand-tab-bg: rgba(120, 111, 235, 0.2);
  --brand-tab-active-bg: linear-gradient(0deg, #7683d9 0%, #d8a0fe 100%);
  --brand-tab-border: rgba(0, 0, 0, 0.06);
  --link-item-bg: rgba(255, 255, 255, 0.06);
  --link-thumb-bg: rgba(255, 255, 255, 0.08);
  --link-thumb-border: rgba(255, 255, 255, 0.12);
  --access-bg: #7c6cf0;
  --access-text: #ffffff;
  --access-hover: #9585f5;
  --hero-overlay: linear-gradient(180deg, transparent 40%, rgba(10, 10, 18, 0.6) 75%, #1f1b32 100%);
  --content-bg: #1f1b32;
  --footer-text: #606078;
  --shadow-card: 0 0.277rem 1.387rem rgba(0, 0, 0, 0.4);
  --icon-share: url("../static/share-white.png");
  --icon-link: url("../static/link-white.png");
  --icon-copy: url("../static/copy-white.png");
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: min(calc(100vw / var(--design-width)), 10px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.04rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--page-bg);
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ===== Page Layout ===== */
.page-wrapper {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  background: var(--page-bg);
}

.page {
  width: 100%;
  max-width: var(--page-max-width);
  background: var(--content-bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0.555rem 2.773rem rgba(0, 0, 0, 0.12);
  padding-bottom: var(env(safe-area-inset-bottom) + 1.555rem);
}

[data-theme="dark"] .page {
  box-shadow: 0 0.555rem 2.773rem rgba(0, 0, 0, 0.5);
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 0.832rem;
  padding: 1.109rem 1.387rem;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.nav__title {
  font-size: 2.357rem;
  font-weight: 700;
  color: var(--nav-title);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  text-shadow: 0 0.069rem 0.277rem rgba(0, 0, 0, 0.4);
}

.nav__lang {
  display: inline-flex;
  align-items: center;
  padding: 0.416rem 0.971rem;
  height: 2.08rem;
  font-size: 0.901rem;
  font-weight: 500;
  color: var(--lang-text);
  background: var(--lang-bg);
  border: 0.069rem solid var(--lang-border);
  border-radius: 1.109rem;
  white-space: nowrap;
}

.theme-toggle {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  width: var(--theme-toggle-width);
  height: calc(var(--theme-toggle-btn-size) + 0.173rem);
  padding: 0.087rem;
  border-radius: 2.357rem;
  background-color: rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  flex-shrink: 0;
}

[data-theme="dark"] .theme-toggle {
  background-color: #201c33;
}

.theme-toggle__btn {
  position: absolute;
  top: 0.087rem;
  left: 0.087rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--theme-toggle-btn-size);
  height: var(--theme-toggle-btn-size);
  border-radius: 50%;
  background: var(--theme-toggle-active);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  flex-shrink: 0;
  transition: left 0.3s ease, background 0.3s, opacity 0.2s;
}
.theme-toggle__btn img{
  width: 1.6rem;
  height: 1.6rem;
}
[data-theme="light"] .theme-toggle__btn {
  left: 0.087rem;
  background: rgba(255, 255, 255,1);
  backdrop-filter: blur(0.555rem);
}

[data-theme="dark"] .theme-toggle__btn {
  left: calc(var(--theme-toggle-width) - var(--theme-toggle-btn-size) - 0.173rem);
  background: #2f2c3f;
  backdrop-filter: blur(0.555rem);
}

.theme-toggle__btn:active {
  opacity: 0.85;
}

.theme-toggle__icon--light {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--dark {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--light {
  display: block;
}

.theme-toggle__label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.525rem;
  color: var(--lang-text);
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  z-index: 1;
  transition: left 0.3s ease, right 0.3s ease;
}

[data-theme="light"] .theme-toggle__label {
  left: calc(var(--theme-toggle-btn-size) + 0.416rem);
  right: 0.416rem;
}

[data-theme="dark"] .theme-toggle__label {
  left: 0.416rem;
  right: calc(var(--theme-toggle-btn-size) + 0.416rem);
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  width: 100%;
}

.hero__bg {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 108%;
  overflow: hidden;
}

.hero__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  pointer-events: none;
}

.hero__logos {
  position: absolute;
  left: 0;
  right: 0;
  top: 21%;
  padding: 0 1.941rem;
  z-index: 2;
  overflow: hidden;
}

.hero-logos-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
}

.hero-logos-swiper:not(.hero-logos-swiper--scrollable) .swiper-wrapper {
  justify-content: center;
}

.hero__logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  max-width: 11.787rem;
  margin: 0 auto;
  width: 100%;
  transition: transform 0.2s;
}

.hero__logo-item:hover {
  transform: scale(1.04);
}

.hero__logo-item img {
  width: 75%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0.277rem 0.832rem rgba(0, 0, 0, 0.3));
}

.hero__logo-item--center img {
  width: 65%;
}

/* ===== Content Area ===== */
.content {
  padding: 0 1.387rem 2.219rem;
  margin-top: -12.16rem;
  position: relative;
  z-index: 5;
}

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border: 0.069rem solid var(--card-border);
  border-radius: 1.109rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.109rem;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Bio Card */
.card--bio {
  display: flex;
  align-items: center;
  gap: 1.109rem;
  padding: 1.664rem 1.387rem;
}

.bio__text {
  flex: 1;
  font-size: 1.941rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.bio__edit {
  flex-shrink: 0;
  padding: 0.277rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.bio__edit img{
  width: 1.387rem;
}
.bio__edit:hover {
  opacity: 1;
}

/* Social Card */
.card--social {
  padding: 1.387rem 1.109rem 1.664rem;
}

.card__header {
  display: flex;
  align-items: center;
  gap: 0.832rem;
  margin-bottom: 1.387rem;
  padding: 0 0.277rem;
}

.card--social .card__header-icon[src*="share"] {
  display: none;
}

.card--social .card__header::before {
  content: "";
  display: block;
  width: 1.664rem;
  height: 1.664rem;
  background-image: var(--icon-share);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.card--links .card__header-icon[src*="link"] {
  display: none;
}

.card--links .card__header::before {
  content: "";
  display: block;
  width: 1.664rem;
  height: 1.664rem;
  background-image: var(--icon-link);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.card__title {
  font-size: 2.08rem;
  font-weight: bold;
  color: var(--text-primary);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.109rem;
  padding: 1.109rem 1.387rem;
  margin-bottom: 1.555rem;
  background: var(--social-link-bg);
  border-radius: 6932.64rem;
  transition: background 0.2s;
}

[data-theme="dark"] .social-link {
  border: 0.069rem solid rgba(244, 245, 254, 0.7019607843137254);
}

.social-link:last-of-type {
  margin-bottom: 0;
}

.social-link:hover {
  background: var(--social-link-hover);
}

.social-link__icon {
  flex-shrink: 0;
  width: 2.08rem;
  height: 2.08rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-link__text {
  font-size: 1.941rem;
  color: #786feb;
}

[data-theme="dark"] .social-link__text {
  color: #ffffff;
}

.social__hint {
  margin-top: 1.387rem;
  text-align: center;
  font-size: 1.525rem;
  color: var(--text-secondary);
}

/* Links Card */
.card--links {
  padding: 1.387rem 1.109rem 1.664rem;
}

/* Brand Tabs */
.brand-tabs-viewport--scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.brand-tabs-viewport--scroll::-webkit-scrollbar {
  display: none;
}

.brand-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.693rem;
  margin-bottom: 1.387rem;
  margin-top: 2.773rem;
}

.brand-tabs--scroll {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
}

.brand-tabs--scroll .brand-tab {
  flex: 0 0 31%;
  min-width: 9.024rem;
}

.brand-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.416rem;
  height: 5.547rem;
  background: var(--brand-tab-bg);
  border: 0.069rem solid var(--brand-tab-border);
  border-radius: 2.773rem;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.brand-tab:hover {
  background: var(--brand-tab-active-bg);
}

.brand-tab:hover span {
  color: #ffffff;
}

.brand-tab--active {
  background: var(--brand-tab-active-bg);
  border-color: var(--access-bg);
  box-shadow: 0 0 0 0.069rem var(--access-bg);
}

.brand-tab__logo {
  height: 3.467rem;
  width: auto;
  object-fit: contain;
  position: absolute;
  top: -1.733rem;
  left: 50%;
  transform: translateX(-50%);
}

.brand-tab span {
  font-size: 1.664rem;
  font-weight: 600;
  color: #786feb;
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin-top: 1.733rem;
}

[data-theme="dark"] .brand-tab span {
  color: #ffffff;
}

.brand-tab--active span {
  color: #ffffff;
}

/* Link Items */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.832rem;
}

.link-list__empty,
.link-list__loading {
  text-align: center;
  font-size: 1.387rem;
  color: var(--text-secondary);
  padding: 2.08rem 0.693rem;
}

.link-item {
  display: flex;
  gap: 0.971rem;
  padding: 1.109rem;
  background: var(--link-item-bg);
  border-radius: 1.941rem;
  align-items: flex-start;
}

.link-item__thumb {
  width: 5.408rem;
  height: 5.408rem;
  border-radius: 0.693rem;
  overflow: hidden;
  flex-shrink: 0;
}

.link-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-item__thumb--placeholder {
  background: var(--link-thumb-bg);
  border: 0.069rem dashed var(--link-thumb-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-item__thumb--placeholder::after {
  content: "图片";
  font-size: 0.832rem;
  color: var(--text-muted);
}

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

.link-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.693rem;
  margin-bottom: 0.555rem;
}

.link-item__name {
  font-size: 2.08rem;
  font-weight: 600;
  color: var(--text-primary);
}

.link-item__url-row {
  display: flex;
  align-items: center;
  gap: 0.555rem;
  min-width: 0;
}

.link-item__copy {
  flex-shrink: 0;
  width: 1.387rem;
  height: 1.387rem;
  background-image: var(--icon-copy);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.link-item__copy:hover {
  opacity: 1;
}

.link-item__url {
  font-size: 1.525rem;
  color: #999999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.link-item__access {
  display: inline-flex;
  align-items: center;
  gap: 0.555rem;
  padding: 0.693rem 1.387rem;
  background: linear-gradient(0deg, #7683d9 0%, #d8a0fe 100%);
  color: #ffffff;
  border-radius: 9999px;
  font-size: 0.971rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}

.link-item__access:hover {
  background: var(--access-hover);
}

.link-item__access img {
  filter: brightness(10);
  width: 1.387rem;
}

/* ===== Footer ===== */
.footer {
  padding: 1.387rem 0.555rem 1.555rem;
  text-align: center;
  font-size: 1.701rem;
}

.footer p {
  font-size: 1.901rem;
  line-height: 1.6;
  color: var(--footer-text);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 2.219rem;
  left: 50%;
  transform: translateX(-50%) translateY(5.547rem);
  padding: 0.832rem 1.664rem;
  background: rgba(30, 30, 50, 0.92);
  color: #fff;
  border-radius: 1.664rem;
  font-size: 0.971rem;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 100;
  white-space: nowrap;
}

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