/* Minecraft 字体 */
@font-face {
  font-family: 'Minecraft';
  src: url('../fonts/mc.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #fdfbf7;
  --card: #f7f3ea;
  --border: #e0d6c2;
  --text: #2d1f0e;
  --muted: #8c7b6a;
  --primary: #f97316;
  --accent: #e85d04;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  /* 导航栏 */
  --nav-bg: rgba(255, 255, 255, .82);
  --nav-border: rgba(0, 0, 0, .08);
  --nav-text: #666;
  --nav-text-dim: #999;
  --nav-text-bright: #222;
  --nav-hover-bg: rgba(0, 0, 0, .04);
  --nav-hover-text: #333;
  --nav-active-bg: rgba(249, 115, 22, .1);
  --nav-active-color: #f97316;
  --brand-color: #f97316;
}

html.dark {
  --bg: #121217;
  --card: #1a1a1f;
  --border: #2a2a30;
  --text: #e0e0e0;
  --muted: #888;
  --primary: #f59e0b;
  --accent: #f97316;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --nav-bg: rgba(26, 26, 31, .82);
  --nav-border: rgba(255, 255, 255, .06);
  --nav-text: #aaa;
  --nav-text-dim: #666;
  --nav-text-bright: #fff;
  --nav-hover-bg: rgba(255, 255, 255, .05);
  --nav-hover-text: #fff;
  --nav-active-bg: rgba(245, 158, 11, .08);
  --nav-active-color: #f59e0b;
  --brand-color: #f59e0b;
}

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

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  transition: background .3s, color .3s;
}

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

/* ---- 顶部栏 ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  transition: background .3s, border-color .3s;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.header-logo svg {
  width: 100%;
  height: 100%;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.header-name {
  font-family: 'Minecraft', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 400;
  font-size: 17px;
  color: var(--brand-color);
  letter-spacing: 1px;
  image-rendering: pixelated;
  text-decoration: none;
}

.header-name a {
  color: inherit;
  text-decoration: none;
}

.header-slogan {
  font-size: 11px;
  color: var(--nav-text-dim);
  margin-top: 1px;
}

/* 导航菜单 */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  margin: 0 24px;
}

.nav-link {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 4px;
  transition: .15s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--nav-hover-text);
  background: var(--nav-hover-bg);
}

.nav-link.active {
  color: var(--nav-active-color);
  background: var(--nav-active-bg);
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--nav-active-color);
  border-radius: 1px;
}

/* 右侧 */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.online-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--nav-text);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, .5);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

.online-text {
  color: var(--nav-text-bright);
}

.online-count {
  font-family: monospace;
  font-size: 13px;
  color: var(--nav-text-bright);
  font-weight: 600;
}

/* 主题切换按钮 */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-text);
  padding: 4px;
  border-radius: 4px;
  transition: .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--nav-hover-text);
  background: var(--nav-hover-bg);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* 主内容 */
.main {
  padding-top: 80px;
  padding-bottom: 80px;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* 告示牌 */
.billboard {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 2px;
  margin-bottom: 64px;
  overflow: hidden;
  position: relative;
  transform: rotate(-.5deg);
}

.billboard::before,
.billboard::after {
  content: '';
  display: block;
  height: 8px;
  background: rgba(146, 64, 14, .15);
}

.billboard-inner {
  padding: 40px 48px;
}

.billboard h1 {
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
}

.billboard p {
  color: var(--muted);
  font-size: 18px;
  margin-top: 20px;
  max-width: 420px;
  line-height: 1.6;
}

.billboard-tags {
  position: absolute;
  right: 24px;
  top: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.tag {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 2px;
}

.tag-primary {
  background: rgba(249, 115, 22, .1);
  color: var(--primary);
  border: 1.5px solid currentColor;
}

.tag-secondary {
  background: rgba(0, 0, 0, .05);
  color: var(--text);
}

/* 数据网格 */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.metric {
  background: var(--card);
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.metric:first-child { border-left: 1px solid var(--border); }
.metric:nth-child(3) { border-left: 1px solid var(--border); }

.metric-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 28px;
  font-weight: 900;
  font-family: monospace;
}

.metric-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.metric-bar {
  margin-top: 8px;
  height: 3px;
  background: rgba(0, 0, 0, .05);
  border-radius: 2px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .5s;
}

/* 区块 */
.section {
  margin-bottom: 64px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-dot {
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: var(--primary);
}

.section h2 {
  font-size: 20px;
  font-weight: 700;
}

.section-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 12px;
}

/* 玩家网格 */
.players-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.player-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 16px 12px;
  text-align: center;
  transition: border-color .2s;
}

.player-card:hover {
  border-color: rgba(249, 115, 22, .4);
}

.player-avatar {
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #fde68a, #fdba74);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #7c2d12;
}

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

.player-mode {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* 空状态 */
.empty {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 48px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--muted);
  opacity: .3;
  margin: 0 auto;
}

.empty-icon svg {
  width: 100%;
  height: 100%;
}

.empty-text {
  color: var(--muted);
  font-size: 16px;
  margin-top: 8px;
}

.empty-sub {
  font-size: 12px;
  margin-top: 4px;
  opacity: .6;
  color: var(--muted);
}

/* 详情网格 */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 24px;
}

.detail-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.detail-card p {
  color: var(--muted);
  line-height: 1.7;
}

.badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.badge {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
}

.badge-green {
  background: #d1fae5;
  color: #065f46;
}

.badge-amber {
  background: #fef3c7;
  color: #92400e;
}

.badge-gray {
  background: rgba(0, 0, 0, .05);
  color: var(--muted);
}

.info-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 18px 20px;
}

.info-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.info-value {
  font-size: 15px;
  font-weight: 700;
  word-break: break-all;
}

/* 插件网格 */
.plugins-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.plugin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 18px;
  transition: border-color .2s;
}

.plugin-card:hover {
  border-color: rgba(249, 115, 22, .3);
}

.plugin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.plugin-name {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 600;
  white-space: nowrap;
}

.plugin-badge-link {
  background: rgba(249, 115, 22, .1);
  color: var(--primary);
  text-decoration: none;
}

.plugin-badge-link:hover {
  background: rgba(249, 115, 22, .2);
}

.plugin-badge-off {
  background: #fee2e2;
  color: #991b1b;
}

.plugin-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plugin-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}

.plugin-size {
  font-size: 10px;
  color: rgba(0, 0, 0, .25);
  margin-top: 6px;
}

/* 展开按钮 */
.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: .2s;
  margin-top: 16px;
}

.expand-btn:hover {
  color: var(--primary);
  border-color: rgba(249, 115, 22, .3);
}

/* 连接地址 */
.connect-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.connect-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.connect-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.connect-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.connect-addr {
  font-size: 18px;
  font-weight: 700;
  font-family: monospace;
}

/* 底部 */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.footer small {
  font-size: 11px;
  opacity: .6;
  display: block;
  margin-top: 4px;
}

/* 响应式 */
@media (max-width: 900px) {
  .header-nav { display: none; }
}

@media (min-width: 480px) {
  .players-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 640px) {
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .metric:nth-child(3) { border-left: none; }
  .players-grid { grid-template-columns: repeat(4, 1fr); }
  .plugins-grid { grid-template-columns: repeat(2, 1fr); }
  .connect-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .detail-grid { grid-template-columns: 3fr 2fr; }
}

@media (min-width: 1024px) {
  .players-grid { grid-template-columns: repeat(6, 1fr); }
  .plugins-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .03); }
::-webkit-scrollbar-thumb { background: rgba(249, 115, 22, .3); border-radius: 3px; }
