:root {
  --bg: #b37c46;
  --accent: #fff4ec;
  --accent-700: #f89655;
  --accent-500: #ffd9b3;
  --accent-900: #f07123;
  --text: #22252a;
  --muted: #6b6f76;
  --max-width: 1000px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  background: var(--accent);
  overflow: hidden
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0;
  padding: 0
}

.content>.container {
  max-width: none;
  width: calc(100% - 6px)
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--accent-900);
  padding: 0;
  display: flex;
  align-items: center;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12)
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 30px;
  margin-left: 4px;
  margin-top: 4px;
  margin-bottom: 4px;
  margin-right: 4px;
  background: #ffd9b3;
  border-radius: 15px;
  overflow: hidden;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 1rem;
  width: 100%
}

.site-title {
  font-weight: 700;
  color: #fff;
  padding-left: 1.5rem;
  font-style: italic;
  font-size: 1.4rem
}



.layout {
  display: flex;
  margin-top: 64px;
  background: var(--accent);
  min-height: calc(100vh - 64px)
}

.sidebar {
  top: 64px;
  left: 0;
  bottom: 0;
  width: 200px;
  padding: 1.25rem 1rem;
  background: var(--accent-700)
}

.sidebar .logo {
  display: block;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  margin-bottom: 1rem
}

.sidebar .nav {
  display: flex;
  flex-direction: column;
  align-items: center
}

.sidebar .nav a {
  display: block;
  width: 100%;
  padding: .6rem 0;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  text-align: center;
  border-radius: 6px;
  transition: background .18s ease, color .12s ease, transform .12s ease;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
  touch-action: manipulation;
  font-size: 1.1rem;
  font-weight: 600
}

.sidebar .nav a:hover,
.sidebar .nav a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.sidebar .nav a:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: none;
}

.sidebar .nav a:focus {
  outline: none
}

.sidebar .nav a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.12);
  outline-offset: 2px
}

.sidebar .nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700
}

.container>.card.placeholder {
  background: #fff3e6;
  border: 1px solid var(--accent-700);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.placeholder h1 {
  margin: 0 0 6px;
  font-size: 26px;
  color: var(--accent-900);
}

.placeholder .muted {
  color: var(--muted);
  font-size: 14px;
}

.mc-wrapper {
  margin-top: 16px;
}

.scroll-panel {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 6px;
}

.card.game-server,
.card.app-server,
.card.qian-workshop,
.card.project-card {
  background: var(--accent-500);
  border: 1px solid var(--accent-700);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}

.game-server>h3,
.app-server>h3,
.qian-workshop>h3,
.project-card>h4 {
  margin: 0 0 10px;
  font-size: 20px;
  color: var(--accent-900);
}

.container>.card.placeholder {
  width: 100%;
  height: calc(100vh - 64px - 68px);
  box-sizing: border-box;

  background: #faebdd;
  border: 1px solid var(--accent-700);
  border-radius: 16px;

  padding: 24px 28px;
  margin: 0;

  overflow: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.main-content {
  padding: 30px;
  box-sizing: border-box;
}

.card.project-card {
  padding-left: 30px;
}

.card.mc-server,
.card.app-details,
.card.qian-details {
  background: #faece2;
  border: 1px solid var(--accent-700);
  border-radius: 12px;
  padding: 14px 16px 14px 28px;
  margin-top: 10px;
  color: var(--text);
}

.mc-status {
  color: #1d8a3f;
  font-weight: bold;
}

.mc-status.offline {
  color: #b4864a;
}

.app-status {
  color: var(--accent-900);
  font-weight: bold;
}

code.mc-ip {
  background: var(--accent-500);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
  color: var(--text);
}

.copy-ip,
.btn.app-btn {
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent-900);
  background: #f5d1d1;
  color: var(--accent-900);
  cursor: pointer;
  font-size: 14px;
  display: inline-block;
  transition: all 0.15s ease;
}

.copy-ip:hover,
.btn.app-btn:hover {
  background: var(--accent-900);
  color: #fff;
}

.btn.app-btn {
  float: right;
}

.card.app-details::after {
  content: "";
  display: block;
  clear: both;
}

.scroll-panel::-webkit-scrollbar {
  width: 8px;
}

.scroll-panel::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-panel::-webkit-scrollbar-thumb {
  background: var(--accent-700);
  border-radius: 4px;
}

.scroll-panel {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-700) transparent;
}

.card.tool-app {
  background: var(--accent-500);
  border: 1px solid var(--accent-700);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.card.tool-app h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: var(--accent-900);
}

.card.tool-app .card.tools {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  border: none;
  box-shadow: none;
}

.card.tool-app .tool-list {
  max-height: 152px;
  min-height: 152px;
  height: 152px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(248, 113, 35, 0.35);
  border-radius: 10px;
  padding: 6px 8px;
  background: #faece2;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-700) transparent;
}

.card.tool-app .tool-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text);
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.card.tool-app .tool-item:last-child {
  border-bottom: none;
}

.card.tool-app .tool-item:hover {
  background: rgba(248, 150, 85, 0.12);
}

.card.tool-app .tool-item a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 500;
}

.card.tool-app .tool-item a:hover {
  text-decoration: underline;
}

.card.tool-app .tool-list::-webkit-scrollbar {
  width: 8px;
}

.card.tool-app .tool-list::-webkit-scrollbar-thumb {
  background: var(--accent-700);
  border-radius: 4px;
}

.card.tool-app .tool-list::-webkit-scrollbar-track {
  background: transparent;
}

.card.placeholder .scroll-panel {
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  max-height: none;
  height: auto;
  overflow: visible;
}

/* 固定资源中心标题（只固定两行字） */
.card.placeholder {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resource-header {
  flex-shrink: 0;
  padding: 24px 28px 12px;
  background: #faebdd;
}

.card.placeholder .scroll-panel {
  flex: 1;
  overflow-y: auto;
  padding: 0 28px 24px;
}
/* ===== BGM 控件（不影响原有样式）===== */

.header-inner {
  display: flex;
  align-items: center;
}

.site-title {
  white-space: nowrap;
  margin-right: 10px;
}

#volumeRange {
  width: 60px;
  margin-left: 10px;
}

.music-toggle {
  margin-left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;

  background: rgba(224, 122, 58, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: #fff;

  font-size: 15px;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: background 0.2s ease, border-color 0.2s ease;
}

.music-toggle:hover {
  background: rgba(224, 122, 58, 0.45);
  border-color: #fff;
}

.music-toggle.playing {
  background: #fff;
  border-color: #e07a3a;
  color: #e07a3a;
}

.header-inner {
  display: flex;
  align-items: center;
}

/* 标题固定 */
.site-title {
  white-space: nowrap;
}

/* 音乐按钮和滑块间距 */
.music-toggle {
  margin-left: 10px;
}

#volumeRange {
  -webkit-appearance: none;
  appearance: none;

  width: 90px;
  height: 4px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.35);
  outline: none;
  cursor: pointer;
  margin-left: 8px;
  flex-shrink: 0;
  border: none;

  /* 防止浏览器用蓝色 accent */
  accent-color: transparent;
}

/* Chrome / Edge / Safari 轨道 */
#volumeRange::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
}

/* Chrome / Edge / Safari 滑块 */
#volumeRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;

  width: 12px;
  height: 12px;
  border-radius: 50%;

  background: #ffffff;
  border: none;
  margin-top: -4px; /* 4px 轨道居中 */
  box-shadow: none;
}

/* Firefox 轨道 */
#volumeRange::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
}

/* Firefox 滑块 */
#volumeRange::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: none;
}

#volumeRange:focus {
  outline: none;
  box-shadow: none;
}

#volumeRange:hover {
  background: rgba(255, 255, 255, 0.55);
}

#volumeRange:hover::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.55);
}

#volumeRange:hover::-moz-range-track {
  background: rgba(255, 255, 255, 0.55);
}

.header-search {
  margin-left: auto;
}

.header-inner {
  display: flex;
  align-items: center;
}

.header-spacer {
  flex: 1;}
/* ===== 待补项 / 禁用态 ===== */
.card.tool-app .tool-item.is-disabled {
  color: var(--muted);
  opacity: .55;
  cursor: not-allowed;
  border-bottom-style: dashed;
}

.card.tool-app .tool-item.is-disabled:hover {
  background: transparent;
}

/* ===== 首页快捷入口 ===== */
.card.placeholder .home-links {
  margin-top: 22px;
  display: grid;
  gap: 8px;
  max-width: 460px;
}

.hero-gifs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 18px 0 4px;
}

.hero-gifs img {
  max-width: min(300px, 40vw);
  height: auto;
  border: 2px solid #6b588d;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .hero-gifs img { max-width: 100%; }
  .card.placeholder .home-links { max-width: 100%; }
}

/* ===== 留言板 ===== */
.msg-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 22px;
}

.msg-form input,
.msg-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #fffdfa;
  font: inherit;
  color: var(--text);
}

.msg-form textarea {
  min-height: 96px;
  resize: vertical;
}

.msg-form input:focus,
.msg-form textarea:focus {
  outline: none;
  border-color: var(--accent-700);
  box-shadow: 0 0 0 3px rgba(248, 150, 85, 0.15);
}

.msg-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.msg-actions button {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent-700);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.msg-actions button:hover { background: var(--accent-900); }

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.msg-item {
  padding: 12px 14px;
  border-radius: 8px;
  background: #faece2;
}

.msg-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.msg-item p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

/* ===== 顶栏：水纹 + 一条游过的鱼 ===== */
.site-header {
  overflow: hidden;
}

.header-inner {
  position: relative;
  z-index: 2;
}

.header-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 12px;
  opacity: 0.45;
  pointer-events: none;
}

.header-wave svg {
  width: 100%;
  height: 100%;
  display: block;
}

.header-fish {
  position: absolute;
  bottom: 5px;
  left: -70px;
  opacity: 0.45;
  pointer-events: none;
  animation: swimAcross 54s linear infinite;
  z-index: 1;
}

@keyframes swimAcross {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 140px)); }
}

.header-fish svg {
  display: block;
  animation: fishBob 5.5s ease-in-out infinite;
}

@keyframes fishBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2.5px); }
}

@media (prefers-reduced-motion: reduce) {
  .header-fish, .header-fish svg { animation: none; opacity: 0.12; }
}

/* ===== 首页自我介绍 ===== */
.home-intro {
  margin: 20px 0 6px;
  line-height: 1.9;
  color: var(--text);
}

.home-intro p { margin: 0 0 6px; }

.hero-gifs figure {
  margin: 0;
  text-align: center;
}

.hero-gifs figcaption {
  font-size: 0.8rem;
  margin-top: 6px;
}

.hero-gifs img {
  background: #fff;
}

/* ===== 手机适配 ===== */
@media (max-width: 768px) {
  .site-header {
    height: 56px;
  }

  .site-title {
    font-size: 1.05rem;
    padding-left: 12px;
    margin-right: 6px;
  }

  .header-inner {
    padding-right: 0.5rem;
  }

  #volumeRange {
    width: 56px;
    margin-left: 6px;
  }

  .music-toggle {
    margin-left: 6px;
    width: 28px;
    height: 28px;
  }

  .layout {
    flex-direction: column;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
  }

  .sidebar {
    position: sticky;
    top: 56px;
    z-index: 5;
    width: auto;
    padding: 6px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }

  .sidebar .nav {
    flex-direction: row;
    justify-content: space-between;
    gap: 4px;
  }

  .sidebar .nav a {
    flex: 1;
    padding: 0.5rem 0;
    font-size: 0.95rem;
  }

  .main-content {
    padding: 12px 10px;
    margin: 0;
    width: auto;
  }

  .content > .container {
    width: 100%;
  }

  .card.placeholder {
    padding: 14px 12px;
  }

  .hero-gifs {
    gap: 10px;
  }

  .hero-gifs img {
    max-width: calc(50% - 6px);
  }

  .card.placeholder .home-links {
    max-width: 100%;
  }

  .msg-head {
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 480px) {
  /* 窄屏放不下音量条，先藏起来，音乐开关还能点 */
  #volumeRange {
    display: none;
  }

  .site-title {
    font-size: 0.98rem;
    padding-left: 10px;
  }
}

@media (max-width: 420px) {
  .site-title {
    font-size: 0.9rem;
  }

  .hero-gifs {
    gap: 8px;
    justify-content: space-between;
  }

  .hero-gifs img {
    max-width: calc(50% - 4px);
  }

  .home-intro {
    margin-top: 14px;
    line-height: 1.8;
  }
}

/* ===== 手机适配 · 二次修正 ===== */
@media (max-width: 768px) {
  .header-inner {
    gap: 8px;
  }

  .site-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-gifs {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .hero-gifs figure {
    flex: 1 1 0;
    min-width: 0;
  }

  .hero-gifs img {
    width: 100%;
    max-width: 100%;
    object-fit: contain;
  }
}

/* 窄屏：标题占左，控制件靠右，别挤在一起 */
@media (max-width: 768px) {
  .header-inner {
    justify-content: flex-start;
  }

  .site-title {
    margin-right: auto;
    flex: 0 1 auto;
    max-width: calc(100% - 96px);
  }

  .music-toggle {
    flex: 0 0 auto;
    margin-left: 8px;
  }

  .header-spacer {
    display: none;
  }
}

/* ===== 首页形象 ===== */
.home-portrait {
  justify-content: center;
  margin: 26px 0 8px;
}

.home-portrait img {
  max-width: 300px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(224, 150, 90, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .home-portrait img {
    max-width: 62%;
  }
}

/* 潜工坊卡片 */
.btn.qian-btn {
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent-900);
  background: #f5d1d1;
  color: var(--accent-900);
  cursor: pointer;
  font-size: 14px;
  display: inline-block;
  text-decoration: none;
  transition: all 0.15s ease;
  float: right;
}
.btn.qian-btn:hover {
  background: var(--accent-900);
  color: #fff;
}
.card.qian-details::after {
  content: "";
  display: block;
  clear: both;
}
.qian-status { color: #2f7a3f; font-weight: 600; }
