/* =========================================
   1. Variables (CSS 变量)
   ========================================= */
:root {
  /* Colors */
  --bg: #000;
  --card: rgba(0, 0, 0, 0.33);
  --cardhover: rgba(0, 0, 0, 0.66);
  --text: #ccc;
  --a: #ba9a99;
  --light: rgba(128, 128, 128, 0.75);

  /* Shadows */
  --shadow: rgba(128, 128, 128, 0.5) 0px 0px 8px 0px;
  --light-shadow: rgba(128, 128, 128, 0.75) 0 0 25px 0px;

  /* Cursors */
  --cursor-default: url(https://cdn.dabinqwq.top/img/cursor/default_dark.png);
  --cursor-pointer: url(https://cdn.dabinqwq.top/img/cursor/pointer_dark.png);
  --cursor-text: url(https://cdn.dabinqwq.top/img/cursor/text_dark.png);
  --cursor-move: url(https://cdn.dabinqwq.top/img/cursor/move_dark.png);
  --cursor-zoom-in: url(https://cdn.dabinqwq.top/img/cursor/zoom-in_dark.png);
}

/* =========================================
   2. Fonts & Icons (字体与图标)
   ========================================= */
@font-face {
  font-family: 'icomoon';
  src: url('data:application/font-ttf;base64,AAEAAAALAIAAAwAwT1MvMg8SB3QAAAC8AAAAYGNtYXDT/9MTAAABHAAAAGxnYXNwAAAAEAAAAYgAAAAIZ2x5ZoSqlwIAAAGQAAACaGhlYWQuRJvfAAAD+AAAADZoaGVhB8IDyQAABDAAAAAkaG10eBYAAAAAAARUAAAAIGxvY2EBwAD6AAAEdAAAABJtYXhwAA4AZgAABIgAAAAgbmFtZZlKCfsAAASoAAABhnBvc3QAAwAAAAAGMAAAACAAAwOaAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADqsAPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAUAAAABAAEAADAAAAAQAg6QDpB+lF6rD//f//AAAAAAAg6QDpB+lF6rD//f//AAH/4xcEFv4WwRVXAAMAAQAAAAAAAAAAAAAAAAAAAAAAAQAB//8ADwABAA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AAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

[class^="icon-"],
[class*=" icon-"] {
  font-family: 'icomoon' !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-home:before {
  content: "\e900";
}

.icon-quill:before {
  content: "\e907";
}

.icon-envelop:before {
  content: "\e945";
}

.icon-github:before {
  content: "\eab0";
}

/* =========================================
   3. Global Reset & Base Styles (全局重置)
   ========================================= */
* {
  box-sizing: border-box;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  /* Layout */
  display: flex;
  flex-direction: column;
  margin: 0;

  /* Scrolling: Default allows scroll (Mobile) */
  overflow-x: hidden;
  overflow-y: auto;

  /* Typography & Visuals */
  color: var(--text);
  background: var(--bg);
  text-shadow: var(--shadow);

  /* Cursors */
  cursor: var(--cursor-default), auto !important;
}

/* Cursor Overrides */
div,
footer,
input[type=radio i],
label,
.enable-highlight pre>code::-webkit-scrollbar-thumb {
  cursor: var(--cursor-default), auto !important;
}

a,
button,
.emoji,
a:hover,
input[type=checkbox],
label:where(.svelte-ddsc3z) {
  cursor: var(--cursor-pointer), auto !important;
}

input,
textarea,
.post-content,
.comment-content {
  cursor: var(--cursor-text), auto !important;
}

#max-img-box #max-img {
  cursor: var(--cursor-move), auto !important;
}

.post-page article .post-content img:not(.logo) {
  cursor: var(--cursor-zoom-in), auto !important;
}

/* =========================================
   4. Layout Structure (核心布局)
   ========================================= */
#parallax-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.parallax-layer {
  position: absolute;
  top: -2.5% !important;
  left: -2.5% !important;
  width: 105%;
  height: 105%;
  will-change: transform;
}

.parallax-layer>div {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

#bg-layer-div {
  background-image: url("https://cdn.dabinqwq.top/img/background/elainatransbg.webp");
  background-color: #1a1a1a;
  filter: brightness(0.4);
}

.fg-image {
  background-image: url("https://cdn.dabinqwq.top/img/background/elainatrans.webp");
  filter: brightness(0.8);
}

.center-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  /* Mobile padding */
  width: 100%;
}

.container {
  /* Default Mobile: 90% width, Single Column */
  width: 90%;
  max-width: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
  padding: 0;
  justify-items: center;
  /* Center items horizontally */
}

/* =========================================
   5. Components (组件)
   ========================================= */

/* --- Avatar / Profile Section --- */
.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center content */
  text-align: center;
  gap: 16px;
  width: 100%;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  transform: translateZ(0);
  transition: box-shadow .3s;
}

.avatar:hover {
  box-shadow: var(--light-shadow);
}

.name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
}

.subtitle {
  color: var(--text);
  white-space: pre-wrap;
  transition: height 0.3s ease-out;
  will-change: height;
}

/* --- Links & Social --- */
.link {
  color: var(--a);
  text-decoration: none;
  padding: 0 .15em;
  border-bottom: 1px dashed rgba(255, 255, 255, .35);
  transition: border-color .3s, opacity .3s;
}

.link:hover {
  border-bottom-color: var(--light);
  opacity: .8;
}

.social {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .06);
  background-color: var(--card);
  color: #fff;
  text-decoration: none;
  outline: none;
  box-shadow: var(--shadow);
  transform: translateZ(0);
  transition: box-shadow .3s, background-color .3s;
}

.icon-btn:hover {
  background-color: var(--cardhover);
  box-shadow: var(--light-shadow);
}

.icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* --- Code Card --- */
.code-card {
  padding: 1.25rem 1.25rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, .06);
  background-color: var(--card);
  color: #e5e7eb;
  box-shadow: var(--shadow);
  opacity: 0.75;
  transition: box-shadow .3s, background-color .3s, opacity .3s;
  width: 100%;
}

.code-card:hover {
  background-color: var(--cardhover);
  opacity: 1;
  -webkit-backdrop-filter: blur(2.5px);
  backdrop-filter: blur(2.5px);
}

.dots {
  display: flex;
  gap: 8px;
  padding: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.d-red {
  background: #ff5f56;
}

.d-yellow {
  background: #ffbd2e;
}

.d-green {
  background: #27c93f;
}

pre {
  margin: 0;
  padding: 8px 32px;
  overflow: auto;
  line-height: 1.42;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: bold;
}

code span {
  letter-spacing: 0.16em;
}

/* --- Footer --- */
.footer {
  /* Default Mobile: Relative positioning */
  position: relative;
  width: 100%;
  margin-top: auto;
  padding: 20px 0;

  text-align: center;
  color: var(--text);
  font-size: 13px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.footer .dot {
  opacity: .7;
  margin: 0 .25em;
}

.footer .footer-link {
  color: var(--a);
  text-decoration: none;
  padding: 0 .15em;
  border-bottom: 1px dashed rgba(255, 255, 255, .35);
  transition: border-color .3s, opacity .3s;
}

.footer .footer-link:hover {
  border-bottom-color: var(--light);
  opacity: .8;
}

/* =========================================
   6. Animation & Utilities (动画与工具类)
   ========================================= */
/* Animations Keyframes */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink-anim {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes floatAnim {
  0% {
    transform: translate(-32px, -32px);
    opacity: 1;
    animation-timing-function: cubic-bezier(0, 0, 0, 1);
  }

  10% {
    transform: translate(-32px, -64px);
    opacity: 1;
    animation-timing-function: cubic-bezier(1, 0.5, 1, 25);
  }

  90% {
    transform: translate(-32px, 96px);
    opacity: 0;
    animation-timing-function: cubic-bezier(1, 1, 1, 100);
  }

  100% {
    transform: translate(-32px, 224px);
    opacity: 0;
  }
}

/* Animation Classes */
.page-enter {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp .8s ease-out .05s forwards;
}

[data-anim] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}

[data-anim].show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  visibility: hidden;
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.delay-1 {
  animation-delay: .12s;
}

.delay-2 {
  animation-delay: .18s;
}

.delay-3 {
  animation-delay: .24s;
}

.delay-4 {
  animation-delay: .30s;
}

.floating-image {
  position: fixed;
  width: 64px;
  height: 64px;
  pointer-events: none;
  opacity: 1;
  animation: floatAnim 3s forwards;
  z-index: 10000000;
}

/* Syntax Highlighting Colors */
.json-key {
  color: #9CDCFE;
}

.json-string {
  color: #CE9178;
}

.json-number {
  color: #B5CEA8;
}

/* Typing Effect */
.typing-cursor::after {
  content: '_';
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: bold;
  display: inline-block;
  vertical-align: bottom;
  animation: blink-anim 1s step-end infinite;
  color: var(--text);
  width: 0;
}

.typing-cursor.typing::after {
  animation: none;
  opacity: 1;
}

/* =========================================
   7. Media Queries (响应式设计)
   ========================================= */

/* --- PC Layout Override (Min-width 992px) --- */
@media (min-width: 992px) {
  body {
    overflow: hidden;
    /* Lock scroll on PC */
  }

  .center-wrapper {
    padding: 0;
  }

  .container {
    width: 80%;
    max-width: 1200px;
    grid-template-columns: calc(40% - 32px) calc(60% - 32px);
    align-items: center;
  }

  .footer {
    position: fixed;
    bottom: 0;
    padding: 12px 0;
    margin-top: 0;
  }
}

/* --- Tablet / Mobile Tweaks (Existing optimizations) --- */
@media (max-width: 680px) {
  .name {
    font-size: 20px;
  }

  .subtitle {
    font-size: 14px;
  }

  .social {
    gap: 12px;
  }

  .icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .icon {
    width: 24px;
    height: 24px;
  }

  .code-card {
    padding: 14px;
  }

  pre {
    font-size: 13px;
    word-break: break-word;
    white-space: pre-wrap;
  }
}

@media (max-width: 420px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
    gap: 22px;
  }

  .footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .name {
    font-size: 18px;
  }

  .subtitle {
    font-size: 13px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .icon {
    width: 22px;
    height: 22px;
  }
}