@font-face {
  font-family: "b";
  src: url(../fonts/Ubuntu-Regular.ttf) format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "title";
  src: url(../fonts/Pacifico-Regular.ttf) format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "ZCOOL KuaiLe";
  src: url(../fonts/ZCOOLKuaiLe-Regular-subset.woff2) format("woff2"),
       url(../fonts/ZCOOLKuaiLe-Regular.ttf) format("truetype");
  font-display: swap;
}

/* =====================================================
   基础
   ===================================================== */

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

html {
  scroll-behavior: smooth;
}

a,
a:hover,
a:link,
a:visited,
a:active,
a:focus {
  text-decoration: none;
  outline: none;
  border: none;
  color: inherit;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

button {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--bg);
  border-radius: 8px;
}

body {
  min-height: 100vh;
  width: 100%;
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: url("../svg/bg-pattern.svg");
  background-repeat: repeat;
  background-size: 260px 260px;
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

[data-theme="dark"] body {
  background-image: url("../svg/bg-pattern-dark.svg");
}

/* ===== 夜间模式细节优化 ===== */
/* 夜间版头像（HTML 里是内联样式，需 !important 覆盖） */
[data-theme="dark"] .logo,
[data-theme="dark"] .index-logo {
  background-image: url("../img/avatar-night.png") !important;
}

/* 卡片图标反色：深色描边图标在夜间变浅色，避免消失在深色底上 */
[data-theme="dark"] .projectItemRight img {
  filter: invert(0.92) hue-rotate(180deg);
}

/* 纸张噪点纹理 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: multiply;
}

[data-theme="dark"] body::before {
  opacity: 0.03;
  mix-blend-mode: screen;
}

/* =====================================================
   加载动画
   ===================================================== */

#zyyo-loading {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.45s ease;
}

#zyyo-loading-center {
  width: 54px;
  height: 54px;
  background: var(--accent);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  animation: loading-step 1.1s steps(2, end) infinite;
}

@keyframes loading-step {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-7px, 7px) rotate(-3deg); }
  50%  { transform: translate(0, 0) rotate(0deg); }
  75%  { transform: translate(7px, -7px) rotate(3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* =====================================================
   布局骨架
   ===================================================== */

.zyyo-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  position: relative;
}

.zyyo-left {
  width: 250px;
  height: 100vh;
  position: sticky;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 28px 16px 28px 16px;
  overflow-y: auto;
  scrollbar-width: none;
}

.zyyo-left::-webkit-scrollbar {
  display: none;
}

.zyyo-right {
  width: calc(100% - 250px);
  display: flex;
  flex-direction: column;
  padding: 40px 32px 24px;
  position: relative;
}

/* =====================================================
   左栏：头像 / 简介 / 标签 / 时间线
   ===================================================== */

.logo {
  flex-shrink: 0;
  width: 148px;
  height: 148px;
  margin: 8px auto 0;
  position: relative;
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  background-color: var(--paper);
  overflow: hidden;
}

.left-div {
  flex-shrink: 0;
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.left-des {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.left-des-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
}

.left-des-item svg {
  width: 17px;
  height: 17px;
  fill: var(--accent);
  flex-shrink: 0;
}

.left-tag {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.left-tag-item {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

#line {
  width: 100%;
  list-style: none;
  padding-left: 4px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: none;
}

#line::-webkit-scrollbar {
  display: none;
}

#line li {
  list-style: none;
  position: relative;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--muted);
  color: var(--ink);
}

#line li div:nth-child(2) {
  font-size: 14px;
}

#line li div:nth-child(3) {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.focus {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  position: absolute;
  left: -6px;
  top: 20px;
}

#line li:first-child .focus:first-child {
  background: var(--accent);
  animation: focus-pulse 1.8s ease infinite;
}

@keyframes focus-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.7); opacity: 0.6; }
}

/* =====================================================
   右栏头部
   ===================================================== */

.welcome {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 8px 0 18px;
  color: var(--ink);
  font-family: var(--font-body);
}

.gradientText {
  font-family: var(--font-hand);
  font-weight: 400;
  color: var(--accent);
  font-size: 1.08em;
  letter-spacing: 0;
}

.index-logo {
  flex-shrink: 0;
  width: 132px;
  height: 132px;
  margin: 8px 0 22px;
  position: relative;
  max-width: 200px;
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  background-color: var(--paper);
  overflow: hidden;
}

.description {
  font-size: 18px;
  margin-top: 10px;
  color: var(--ink);
  max-width: 42em;
}

.purpleText {
  color: var(--accent);
  font-weight: 700;
}

.textBackground {
  font-weight: 700;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  padding: 2px 7px;
  margin: 0 2px;
  font-size: 0.92em;
}

.iconContainer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.iconItem {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 13px;
  border-radius: 10px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  flex-shrink: 0;
}

.iconItem:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--press);
  color: var(--press-ink);
}

.iconItem svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.iconTip {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tanChiShe {
  width: min(82%, 720px);
  margin-top: 30px;
}

.tanChiShe img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(3px 3px 0 var(--ink));
}

/* =====================================================
   内容：标题 & 卡片
   ===================================================== */

.title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 25px;
  font-weight: 800;
  margin: 42px 0 20px;
  color: var(--ink);
  font-family: var(--font-display);
}

.title svg {
  width: 26px;
  height: 26px;
  fill: var(--accent);
  flex-shrink: 0;
}

.projectList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.projectItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 108px;
  padding: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.13s ease, box-shadow 0.13s ease, background 0.13s ease;
  color: var(--ink);
}

.projectItem:hover {
  transform: translate(-4px, -4px);
  box-shadow: 9px 9px 0 var(--ink);
  background: var(--press);
  color: var(--press-ink);
}

.projectItem.pressed {
  transform: translate(0, 0) scale(0.98);
  box-shadow: var(--shadow-sm);
}

.projectItemLeft {
  flex: 1;
  min-width: 0;
}

.projectItemLeft h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  margin: 0;
}

.projectItemLeft p {
  font-size: 13px;
  margin-top: 8px;
  color: inherit;
  opacity: 0.72;
}

.projectItemRight {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.projectItemRight img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.projectItem:hover .projectItemRight img {
  transform: rotate(-10deg) scale(1.08);
}

/* =====================================================
   二维码弹窗
   ===================================================== */

.tc {
  position: fixed;
  inset: 0;
  display: flex;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 18, 0.55);
  backdrop-filter: blur(4px);
  z-index: 99999;
}

.tc-main {
  width: min(80vw, 300px);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(20px) scale(0.92);
  transition: transform 0.2s ease;
}

.tc-img {
  width: 100%;
  display: block;
}

.tc.active {
  visibility: visible;
}

.tc-main.active {
  transform: translateY(0) scale(1);
}

/* =====================================================
   圆形音乐播放器
   ===================================================== */

.music-player-circle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 15px;
}

.music-disc {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  animation: rotate 22s linear infinite;
  animation-play-state: paused;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.music-disc.playing {
  animation-play-state: running;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.disc-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.disc-center {
  position: absolute;
  width: 13px;
  height: 13px;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.music-list {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  padding: 20px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.music-list.show {
  max-height: 440px;
  opacity: 1;
}

.music-list-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.music-list-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.music-list-items::-webkit-scrollbar {
  width: 6px;
}

.music-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  color: var(--ink);
}

.music-list-item:hover {
  transform: translateX(3px);
  background: var(--paper-2);
}

.music-list-item.active {
  background: var(--press);
  color: var(--press-ink);
}

.music-list-item-icon {
  font-weight: 700;
  font-size: 14px;
  opacity: 0.7;
}

.music-list-item-info {
  flex: 1;
  min-width: 0;
}

.music-list-item-name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-list-item-artist {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 2px;
}

.music-list-item-status {
  font-size: 15px;
}

/* =====================================================
   macOS 风格命令行终端
   ===================================================== */

.cmd-terminal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.cmd-terminal.active {
  opacity: 1;
  visibility: visible;
}

.cmd-window {
  width: min(92vw, 680px);
  height: min(76vh, 500px);
  background: #1e1e1c;
  border: 3px solid #0c0c0b;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 8px 0 #0c0c0b;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s ease;
}

.cmd-terminal.active .cmd-window {
  transform: scale(1) translateY(0);
}

.cmd-titlebar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #292927;
  border-bottom: 2px solid #0c0c0b;
  flex-shrink: 0;
}

.cmd-buttons {
  display: flex;
  gap: 8px;
}

.cmd-btn {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.cmd-btn-close { background: #ff5f57; }
.cmd-btn-minimize { background: #febc2e; }
.cmd-btn-maximize { background: #28c840; }

.cmd-title {
  flex: 1;
  text-align: center;
  color: #9b9688;
  font-size: 13px;
  font-weight: 600;
  margin-right: 46px;
}

.cmd-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
  font-family: "SF Mono", "Monaco", "Menlo", "Cascadia Code", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #d6d2c8;
}

.cmd-output {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 10px;
}

.cmd-output::-webkit-scrollbar {
  width: 6px;
}

.cmd-output::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
  border: none;
}

.cmd-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-prompt {
  color: #ff6a3d;
  font-weight: 700;
  flex-shrink: 0;
}

.cmd-input-line input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: inherit;
  caret-color: #ff6a3d;
  padding: 0;
  min-width: 0;
}

.cmd-cursor {
  width: 8px;
  height: 16px;
  background: #ff6a3d;
  animation: blink 1s step-end infinite;
  flex-shrink: 0;
}

@keyframes blink {
  50% { opacity: 0; }
}

.cmd-line {
  margin-bottom: 4px;
}

.cmd-line.cmd-echo { color: #8d887a; }
.cmd-line.cmd-input { color: #fff; }
.cmd-line.cmd-success { color: #3fb950; }
.cmd-line.cmd-error { color: #f85149; }
.cmd-line.cmd-info { color: #58a6ff; }
.cmd-line.cmd-warning { color: #d29922; }

.cmd-btn-form {
  padding: 6px 14px;
  background: #ff6a3d;
  border: none;
  border-radius: 6px;
  color: #141312;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.cmd-btn-form:hover {
  filter: brightness(1.08);
}

.cmd-btn-form-secondary {
  background: #292927;
  border: 1px solid #3d3c38;
  color: #d6d2c8;
}

.cmd-inline-input {
  margin: 4px 0;
}

.cmd-inline-input input {
  width: 100%;
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #58a6ff;
  color: #fff;
  font-family: inherit;
  font-size: inherit;
  outline: none;
  caret-color: #ff6a3d;
}

/* =====================================================
   底部备案
   ===================================================== */

.icp-footer {
  text-align: center;
  padding: 26px 20px 8px;
  margin-top: 40px;
}

.icp-item {
  margin: 9px 0;
  font-size: 13px;
  color: var(--muted);
}

.icp-main {
  color: var(--ink);
  font-weight: 600;
}

.icp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.icp-link:hover {
  color: var(--accent);
}

.icp-gov-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

/* =====================================================
   主题切换按钮
   ===================================================== */

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9998;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.theme-toggle:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* =====================================================
   响应式
   ===================================================== */

@media (max-width: 1120px) {
  .projectList {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .zyyo-main {
    flex-direction: column;
  }

  .zyyo-left {
    display: none;
  }

  .zyyo-right {
    width: 100%;
    padding: 28px 20px 20px;
  }

  .welcome {
    font-size: 11vw;
  }

  .description {
    font-size: 4vw;
  }

  .projectItem {
    min-height: 96px;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
  }
}

@media (min-width: 821px) {
  .index-logo {
    display: none;
  }
}

@media (max-width: 768px) {
  .music-player-circle {
    bottom: 18px;
    right: 18px;
  }

  .music-disc {
    width: 52px;
    height: 52px;
  }

  .music-list {
    width: 86vw;
    max-width: 330px;
  }

  .music-list.show {
    max-height: 70vh;
  }
}
