/* ========================================
   个人博客网站 — 像素风复古设计
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* 俐方体11号 (Cubic-11) 像素中文字体 */
@font-face {
  font-family: 'Cubic-11';
  src: url('https://cdn.jsdelivr.net/gh/nicennnnnnnlee/Cubic-11@main/Cubic-11.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/gh/nicennnnnnnlee/Cubic-11@main/Cubic-11.woff') format('woff'),
       url('https://cdn.jsdelivr.net/gh/nicennnnnnnlee/Cubic-11@main/Cubic-11.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* CSS 变量定义 */
:root {
  --bg: #F0EDE3;
  --black: #000000;
  --blue: #4169E1;
  --white: #FFFFFF;
  --nav-bg: #2A2A2A;
  --border: 2px solid var(--black);
  --gray: #888888;
  --light-gray: #cccccc;
  --success: #28a745;
  --error: #dc3545;
  --pixel-font: 'Cubic-11', 'Press Start 2P', monospace;
  --body-font: 'Cubic-11', 'Courier New', Courier, monospace;
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 16px 16px;
  font-family: var(--body-font);
  color: var(--black);
  line-height: 1.7;
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--black);
  text-decoration: none;
  transition: color 0.1s ease;
}

a:hover {
  color: var(--blue);
}

/* ========== 顶部菜单栏 ========== */
.navbar {
  background: var(--nav-bg);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.navbar-logo {
  color: var(--white);
  font-family: var(--pixel-font);
  font-size: 14px;
  padding: 16px 0;
}

.navbar-links {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
}

.navbar-links li {
  display: flex;
  align-items: center;
}

.navbar-links a {
  color: var(--white);
  font-family: var(--pixel-font);
  font-size: 11px;
  padding: 16px 14px;
  display: block;
  text-transform: uppercase;
  transition: all 0.1s ease;
}

.navbar-links a:hover,
.navbar-links a.active {
  background: var(--blue);
  color: var(--white);
}

.menu-toggle {
  display: none;
  background: none;
  border: var(--border);
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ========== 用户菜单 ========== */
.user-menu {
  position: relative;
}

.user-name {
  color: var(--white);
  font-family: var(--pixel-font);
  font-size: 9px;
  padding: 16px 12px;
  display: block;
  cursor: pointer;
  transition: all 0.1s ease;
}

.user-name:hover {
  background: var(--blue);
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  min-width: 200px;
  border: var(--border);
  box-shadow: 4px 4px 0 var(--black);
  z-index: 1001;
}

.user-menu:hover .user-dropdown {
  display: block;
}

.user-dropdown a {
  display: block;
  padding: 10px 16px;
  color: var(--black);
  font-family: var(--body-font);
  font-size: 12px;
  border-bottom: 1px solid var(--light-gray);
  transition: all 0.1s ease;
}

.user-dropdown a:hover {
  background: var(--blue);
  color: var(--white);
}

.user-dropdown a:last-child {
  border-bottom: none;
}

/* ========== 页面布局 ========== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

.content-card {
  background: var(--white);
  border: var(--border);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 4px 4px 0 var(--black);
}

.section-title {
  font-family: var(--pixel-font);
  font-size: 16px;
  color: var(--black);
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 16px;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--black);
}

/* ========== 首页 Hero ========== */
.hero {
  text-align: center;
  padding: 40px 24px;
  background: #1A0808;
  border: var(--border);
  margin-bottom: 24px;
  box-shadow: 4px 4px 0 var(--black);
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
}

.hero.hero-clicked {
  background: var(--white);
}

.hero::after {
  content: "★ PERSONAL BLOG ★";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 0 12px;
  font-family: var(--pixel-font);
  font-size: 8px;
  color: var(--black);
  white-space: nowrap;
}

.hero h1 {
  font-family: var(--pixel-font);
  font-size: 24px;
  margin-bottom: 16px;
  line-height: 1.6;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

.hero-title span {
  display: block;
}

.hero-title .line1 { color: #E8D5C4; }
.hero-title .line2 { color: #C4956A; }
.hero-title .line3 { color: #E8D5C4; }

.hero.hero-clicked .hero-title .line1 { color: var(--black); }
.hero.hero-clicked .hero-title .line2 { color: var(--blue); }
.hero.hero-clicked .hero-title .line3 { color: var(--black); }

.hero p {
  font-family: var(--body-font);
  font-size: 14px;
  color: var(--gray);
}

/* 像素画 */
.pixel-art-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pixel-art {
  display: grid;
  grid-template-columns: repeat(16, 6px);
  grid-template-rows: repeat(16, 6px);
  gap: 0;
  border: 2px solid var(--white);
  padding: 4px;
  background: rgba(255,255,255,0.1);
  image-rendering: pixelated;
}

.hero.hero-clicked .pixel-art {
  border: var(--border);
  background: var(--bg);
}

.pixel-art .px {
  width: 6px;
  height: 6px;
}

.px-dark  { background: var(--black); }
.px-blue  { background: var(--blue); }
.px-white { background: var(--white); }
.px-skin  { background: #FFD5A5; }
.px-red   { background: #E74C3C; }

.pixel-art-label {
  font-family: var(--pixel-font);
  font-size: 7px;
  color: var(--white);
  text-align: center;
}

.hero.hero-clicked .pixel-art-label {
  color: var(--black);
}

/* Hero 按钮 */
.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-pixel {
  font-family: var(--pixel-font);
  font-size: 10px;
  padding: 14px 24px;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.1s ease;
  box-shadow: 4px 4px 0 rgba(255,255,255,0.3);
  text-align: center;
  min-width: 180px;
  text-decoration: none;
  display: inline-block;
}

.hero.hero-clicked .btn-pixel {
  border: var(--border);
  background: var(--white);
  color: var(--black);
  box-shadow: 4px 4px 0 var(--black);
}

.btn-pixel:hover {
  background: var(--blue);
  color: var(--white);
  box-shadow: 2px 2px 0 var(--black);
  transform: translate(2px, 2px);
}

.btn-pixel:active {
  box-shadow: 0 0 0 var(--black);
  transform: translate(4px, 4px);
}

/* ========== 动态卡片 ========== */
.post-card {
  background: var(--white);
  border: var(--border);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 4px 4px 0 var(--black);
  transition: all 0.1s ease;
}

.post-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--black);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--light-gray);
}

.post-avatar {
  width: 40px;
  height: 40px;
  border: var(--border);
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pixel-font);
  font-size: 14px;
}

.post-user {
  font-family: var(--pixel-font);
  font-size: 12px;
  color: var(--black);
}

.post-time {
  font-family: var(--body-font);
  font-size: 14px;
  color: var(--gray);
}

.post-content {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.post-images img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border: var(--border);
  cursor: pointer;
  transition: all 0.1s ease;
  image-rendering: auto;
}

.post-images img:hover {
  transform: scale(1.05);
}

.post-actions {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--light-gray);
}

.post-action-btn {
  background: none;
  border: var(--border);
  color: var(--black);
  font-family: var(--pixel-font);
  font-size: 8px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0 var(--black);
}

.post-action-btn:hover {
  background: var(--blue);
  color: var(--white);
  box-shadow: 1px 1px 0 var(--black);
  transform: translate(1px, 1px);
}

/* ========== 按钮系统 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  font-family: var(--pixel-font);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.1s ease;
  border: var(--border);
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--black);
  text-align: center;
}

.btn:hover {
  box-shadow: 2px 2px 0 var(--black);
  transform: translate(2px, 2px);
}

.btn:active {
  box-shadow: 0 0 0 var(--black);
  transform: translate(4px, 4px);
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-primary:hover {
  background: #3358d4;
}

.btn-secondary {
  background: var(--white);
  color: var(--black);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-danger {
  background: var(--error);
  color: var(--white);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 11px;
  box-shadow: 2px 2px 0 var(--black);
}

.btn-sm:hover {
  box-shadow: 1px 1px 0 var(--black);
  transform: translate(1px, 1px);
}

/* ========== 发布区 ========== */
.post-form {
  background: var(--white);
  border: var(--border);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 4px 4px 0 var(--black);
}

.post-form textarea {
  width: 100%;
  min-height: 100px;
  border: var(--border);
  padding: 12px;
  font-family: var(--body-font);
  font-size: 14px;
  resize: vertical;
  background: var(--bg);
}

.post-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(65, 105, 225, 0.3);
}

.post-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.image-upload-area {
  border: 2px dashed var(--black);
  padding: 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.1s ease;
  margin-top: 12px;
}

.image-upload-area:hover {
  background: rgba(65, 105, 225, 0.1);
  border-color: var(--blue);
}

.image-upload-area .icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.image-upload-area p {
  font-family: var(--pixel-font);
  font-size: 8px;
  color: var(--gray);
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.image-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: var(--border);
}

/* ========== 文件上传 ========== */
.upload-zone {
  border: 2px dashed var(--black);
  padding: 40px;
  text-align: center;
  background: var(--white);
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 4px 4px 0 var(--black);
}

.upload-zone:hover {
  background: rgba(65, 105, 225, 0.1);
  border-color: var(--blue);
}

.upload-zone .upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-zone .upload-title {
  font-family: var(--pixel-font);
  font-size: 12px;
  margin-bottom: 8px;
}

.upload-zone .upload-hint {
  font-family: var(--body-font);
  font-size: 12px;
  color: var(--gray);
}

.upload-progress {
  height: 8px;
  background: var(--bg);
  border: var(--border);
  margin-top: 16px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--blue);
  transition: width 0.3s ease;
  width: 0%;
}

.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--white);
  border: var(--border);
  margin-bottom: 8px;
  box-shadow: 2px 2px 0 var(--black);
}

.file-item .file-name {
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--blue);
}

.file-item .file-size {
  font-size: 12px;
  color: var(--gray);
}

/* 文件卡片网格 */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.file-card {
  border: var(--border);
  background: var(--white);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--black);
  transition: all 0.1s ease;
}

.file-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--black);
}

.file-preview {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: var(--border);
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.file-preview img:hover {
  transform: scale(1.05);
}

.file-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.file-icon {
  font-size: 48px;
  color: var(--gray);
}

.file-info {
  padding: 12px;
}

.file-name {
  font-family: var(--body-font);
  font-size: 12px;
  color: var(--blue);
  display: block;
  margin-bottom: 8px;
  word-break: break-all;
  text-decoration: none;
}

.file-name:hover {
  text-decoration: underline;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--gray);
  font-family: var(--pixel-font);
}

/* ========== 音乐播放器 ========== */
.music-section {
  margin-bottom: 32px;
}

.music-player {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  border: var(--border);
  padding: 20px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--black);
}

.vinyl-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.vinyl-record {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--black);
  border: 3px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  animation: spin 3s linear infinite;
}

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

.vinyl-record::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid var(--black);
  position: absolute;
}

.vinyl-record::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  position: absolute;
  z-index: 1;
}

.vinyl-groove {
  position: absolute;
  border-radius: 50%;
  border: 1px solid #333;
}

.vinyl-groove:nth-child(1) { width: 90px; height: 90px; }
.vinyl-groove:nth-child(2) { width: 70px; height: 70px; }
.vinyl-groove:nth-child(3) { width: 50px; height: 50px; }

.track-info { text-align: center; }

.track-name {
  font-family: var(--pixel-font);
  font-size: 9px;
  margin-bottom: 4px;
}

.track-artist {
  font-family: var(--body-font);
  font-size: 12px;
  color: #555;
}

.track-status {
  font-family: var(--pixel-font);
  font-size: 7px;
  color: var(--blue);
  margin-top: 4px;
  animation: blink 1s step-end infinite;
}

.playlist-box {
  border: var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.tab-input { display: none; }

.tab-labels {
  display: flex;
  border-bottom: var(--border);
}

.tab-label {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-family: var(--pixel-font);
  font-size: 8px;
  cursor: pointer;
  background: var(--white);
  border-right: 1px solid var(--black);
  transition: all 0.1s ease;
  user-select: none;
}

.tab-label:last-child { border-right: none; }

.tab-label:hover {
  background: var(--blue);
  color: var(--white);
}

#tab-playlist:checked ~ .tab-labels .tab-label[for="tab-playlist"],
#tab-lyrics:checked ~ .tab-labels .tab-label[for="tab-lyrics"] {
  background: var(--black);
  color: var(--white);
}

.tab-content {
  display: none;
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

#tab-playlist:checked ~ .tab-content-playlist { display: block; }
#tab-lyrics:checked ~ .tab-content-lyrics { display: block; }

.song-list { list-style: none; }

.song-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed rgba(0,0,0,0.15);
  font-family: var(--body-font);
  font-size: 13px;
  transition: background 0.1s ease;
}

.song-item:hover { background: rgba(65,105,225,0.1); }
.song-item.active { background: rgba(65,105,225,0.2); font-weight: bold; }

.song-check {
  width: 14px;
  height: 14px;
  border: 2px solid var(--black);
  background: var(--white);
  flex-shrink: 0;
  position: relative;
}

.song-item.active .song-check::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
}

.song-num {
  font-family: var(--pixel-font);
  font-size: 8px;
  color: #888;
  width: 20px;
  flex-shrink: 0;
}

.song-title { flex: 1; }

.song-duration {
  font-family: var(--pixel-font);
  font-size: 7px;
  color: #888;
}

.lyrics-text {
  font-family: var(--body-font);
  font-size: 12px;
  line-height: 2;
  color: #555;
  text-align: center;
}

.lyrics-text .highlight {
  color: var(--blue);
  font-weight: bold;
}

.player-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: var(--border);
  background: var(--white);
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
}

.ctrl-btn:hover {
  background: var(--blue);
  color: var(--white);
}

.ctrl-btn.play-btn {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

/* ========== 相册 ========== */
.gallery-section {
  margin-bottom: 32px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-card {
  border: var(--border);
  background: var(--white);
  overflow: hidden;
  transition: transform 0.1s ease;
  box-shadow: 4px 4px 0 var(--black);
}

.gallery-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--black);
}

.gallery-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  border-bottom: var(--border);
}

.gallery-card figcaption {
  padding: 10px;
  font-family: var(--pixel-font);
  font-size: 8px;
  text-align: center;
  color: #555;
}

/* ========== 弹出卡片 ========== */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 16px 16px;
  overflow-y: auto;
}

.popup-overlay.active {
  display: flex;
}

.popup-card {
  background: var(--bg);
  border: var(--border);
  max-width: 800px;
  width: 100%;
  position: relative;
  box-shadow: 8px 8px 0 var(--black);
  animation: popupIn 0.2s ease;
}

@keyframes popupIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  font-family: var(--pixel-font);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0 var(--black);
}

.popup-close:hover {
  background: var(--error);
  color: var(--white);
}

.popup-content {
  padding: 24px;
}

.popup-content .content-card {
  box-shadow: none;
  border: none;
  margin: 0;
  padding: 0;
}

.popup-content .section-title {
  margin-top: 0;
}

/* ========== 课程空间 ========== */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--black);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-dot {
  position: absolute;
  left: -30px;
  top: 4px;
  width: 16px;
  height: 16px;
  background: var(--blue);
  border: var(--border);
}

.timeline-card {
  background: var(--white);
  border: var(--border);
  padding: 16px 20px;
  box-shadow: 4px 4px 0 var(--black);
}

.timeline-date {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 4px 12px;
  font-family: var(--pixel-font);
  font-size: 8px;
  margin-bottom: 8px;
}

.timeline-title {
  font-family: var(--pixel-font);
  font-size: 14px;
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 15px;
  color: var(--gray);
}

/* ========== 思维导图分支样式 ========== */
.branches-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px dashed var(--light-gray);
}

.branch-item {
  position: relative;
  margin-left: 32px;
  margin-bottom: 16px;
  padding-left: 24px;
}

.branch-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  width: 24px;
  height: 2px;
  background: var(--blue);
}

.branch-item::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--blue);
}

.branch-card {
  background: var(--bg);
  border: 2px solid var(--blue);
  padding: 12px 16px;
  box-shadow: 3px 3px 0 var(--blue);
  position: relative;
}

.branch-card::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 20px;
  width: 12px;
  height: 12px;
  background: var(--blue);
  border: 2px solid var(--black);
  border-radius: 50%;
}

.branch-date {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  padding: 3px 10px;
  font-family: var(--pixel-font);
  font-size: 7px;
  margin-bottom: 6px;
}

.branch-title {
  font-family: var(--pixel-font);
  font-size: 11px;
  margin-bottom: 6px;
  color: var(--blue);
}

.branch-desc {
  font-size: 13px;
  color: var(--gray);
}

/* ========== 表单样式 ========== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-family: var(--pixel-font);
  font-size: 11px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: var(--border);
  font-family: var(--body-font);
  font-size: 16px;
  background: var(--bg);
  transition: all 0.1s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(65, 105, 225, 0.3);
}

/* ========== 后台管理 ========== */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.admin-sidebar {
  width: 220px;
  background: var(--nav-bg);
  padding: 16px 0;
  flex-shrink: 0;
  border-right: var(--border);
}

.admin-sidebar-item {
  padding: 16px 20px;
  cursor: pointer;
  font-family: var(--pixel-font);
  font-size: 14px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.1s ease;
  text-transform: uppercase;
}

.admin-sidebar-item:hover {
  background: var(--blue);
}

.admin-sidebar-item.active {
  background: var(--blue);
  border-left: 4px solid var(--white);
}

.admin-content {
  flex: 1;
  padding: 24px;
  background: var(--bg);
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: var(--border);
  box-shadow: 4px 4px 0 var(--black);
}

.data-table th {
  background: var(--black);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--pixel-font);
  font-size: 8px;
  text-transform: uppercase;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--light-gray);
  font-size: 13px;
}

.data-table tr:hover {
  background: rgba(65, 105, 225, 0.1);
}

/* ========== 消息提示 ========== */
.alert {
  padding: 12px 16px;
  border: var(--border);
  margin-bottom: 16px;
  font-size: 13px;
  font-family: var(--body-font);
}

.alert-success {
  background: #d4edda;
  border-color: var(--success);
}

.alert-error {
  background: #f8d7da;
  border-color: var(--error);
}

/* ========== 注册/登录弹窗 ========== */
#loginModal,
#registerModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.auth-container {
  max-width: 400px;
  width: 90%;
  margin: 0;
}

.auth-header {
  background: var(--black);
  color: var(--white);
  text-align: center;
  padding: 20px;
  border: var(--border);
}

.auth-header h2 {
  font-family: var(--pixel-font);
  font-size: 14px;
}

.auth-body {
  background: var(--white);
  padding: 24px;
  border: var(--border);
  border-top: none;
  box-shadow: 6px 6px 0 var(--black);
}

/* ========== 统计卡片 ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: var(--border);
  padding: 20px;
  text-align: center;
  box-shadow: 4px 4px 0 var(--black);
}

.stat-card .stat-number {
  font-family: var(--pixel-font);
  font-size: 28px;
  color: var(--blue);
}

.stat-card .stat-label {
  font-family: var(--pixel-font);
  font-size: 8px;
  color: var(--gray);
  margin-top: 8px;
  text-transform: uppercase;
}

/* ========== 页脚 ========== */
.footer {
  text-align: center;
  padding: 24px;
  border: var(--border);
  background: var(--white);
  margin-top: 40px;
  box-shadow: 4px 4px 0 var(--black);
}

.footer p {
  font-family: var(--pixel-font);
  font-size: 8px;
  color: var(--gray);
  line-height: 2;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .navbar-links {
    display: none;
    flex-wrap: wrap;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-bottom: var(--border);
    padding: 4px;
    gap: 4px;
  }

  .navbar-links.open {
    display: flex;
  }

  .navbar-links li {
    flex: 1;
    min-width: 0;
  }

  .navbar-links a {
    padding: 10px 8px;
    text-align: center;
    font-size: 8px;
    display: block;
    border: 1px solid #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 24px 16px;
  }

  .hero h1 {
    font-size: 16px;
  }

  .pixel-art {
    grid-template-columns: repeat(16, 4px);
    grid-template-rows: repeat(16, 4px);
  }

  .pixel-art .px {
    width: 4px;
    height: 4px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-pixel {
    min-width: 100%;
    font-size: 9px;
  }

  .post-card {
    padding: 16px;
  }

  .music-player {
    grid-template-columns: 1fr;
  }

  .vinyl-side {
    flex-direction: row;
    gap: 16px;
    justify-content: center;
  }

  .vinyl-record {
    width: 80px;
    height: 80px;
  }

  .vinyl-record::before {
    width: 28px;
    height: 28px;
  }

  .vinyl-groove:nth-child(1) { width: 60px; height: 60px; }
  .vinyl-groove:nth-child(2) { width: 46px; height: 46px; }
  .vinyl-groove:nth-child(3) { width: 34px; height: 34px; }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    width: 60px;
  }

  .admin-sidebar-item span {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px 8px;
  }

  .hero {
    padding: 24px 16px;
  }

  .hero h1 {
    font-size: 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========== 动画 ========== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.blink {
  animation: blink 1s step-end infinite;
}

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

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