/* 性能优化：定义通用变量和基础样式 */
:root {
  --primary-color: #000;
  --bg-alpha: rgba(255,255,255,0.13);
  --bg-alpha-light: rgba(255,255,255,0.10);
  --text-shadow: 1px 1px 2px white, -1px -1px 2px white, 1px -1px 2px white, -1px 1px 2px white;
  --border-radius: 14px;
  --transition-fast: 0.2s;
  --transition-medium: 0.3s;
  --box-shadow: 0 2px 12px 0 rgba(0,0,0,0.07);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
  background: url('bg-container.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--primary-color);
  text-shadow: var(--text-shadow);
  /* 性能优化：启用硬件加速 */
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 20px 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
}

/* 性能优化：使用CSS变量减少重复 */
.time {
  font-size: 2.2rem;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--primary-color);
  text-shadow: var(--text-shadow);
}

.date {
  font-size: 1.1rem;
  margin-top: 4px;
  opacity: 0.8;
  color: var(--primary-color);
  text-shadow: var(--text-shadow);
}

.version {
  font-size: 0.8rem;
  margin-top: 4px;
  opacity: 0.6;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--primary-color);
  text-shadow: var(--text-shadow);
}

.status-row {
  display: flex;
  gap: 18px;
  margin-bottom: 32px;
  justify-content: flex-start;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

/* 性能优化：状态卡片样式 */
.status-card {
  background: var(--bg-alpha-light);
  border-radius: var(--border-radius);
  padding: 18px 28px;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--box-shadow);
  box-sizing: border-box;
  /* 性能优化：启用硬件加速 */
  will-change: transform;
  backface-visibility: hidden;
}

.status-card .icon {
  font-size: 1.6rem;
  margin-right: 8px;
}

.status-card .label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-color);
  text-shadow: var(--text-shadow);
}

.status-card .value {
  font-size: 1.1rem;
  margin-left: 8px;
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: var(--text-shadow);
}

/* 性能优化：管理链接样式 */
.admin-link {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  text-shadow: var(--text-shadow);
  transition: opacity var(--transition-fast);
}

.admin-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* 合并抽屉效果样式 */
.nav-groups-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 38px;
}

.group-titles {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.group-title {
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--primary-color);
  text-shadow: var(--text-shadow);
  padding: 20px 15px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  user-select: none;
  position: relative;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.2);
  flex: 1;
  min-width: 0;
  text-align: center;
  height: 70px;
  box-sizing: border-box;
}

.group-title:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.15) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border-color: rgba(255,255,255,0.3);
}

.group-title.active {
  background: linear-gradient(135deg, rgba(65, 65, 239, 0.6) 0%, rgba(65, 65, 239, 0.4) 100%);
  color: white;
  text-shadow: none;
  border-color: rgba(65, 65, 239, 0.3);
}

.group-title .arrow {
  display: none;
}

.shared-card-list {
  flex-wrap: wrap;
  margin: 18px;
  flex: 1;
  min-height: 200px;
  transition: opacity var(--transition-medium);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.shared-card-list.hidden {
  opacity: 0;
  pointer-events: none;
}

.shared-card-list.visible {
  opacity: 1;
}

/* 性能优化：导航卡片样式 */
.nav-card {
  background: var(--bg-alpha);
  border-radius: var(--border-radius);
  padding: 18px 22px;
  width: 200px;
  height: 70px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--primary-color);
  box-shadow: var(--box-shadow);
  transition: background var(--transition-fast), transform var(--transition-fast);
  font-size: 1.08rem;
  font-weight: 500;
  overflow: hidden;
  position: relative;
  text-shadow: var(--text-shadow);
  /* 性能优化：启用硬件加速 */
  will-change: transform, background;
  backface-visibility: hidden;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  transition: all 0.5s ease;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: pulse-color 2s infinite;
}

.status-indicator::before {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.8);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.8;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.4;
  transition: opacity 0.3s ease;
  animation: pulse-shadow 3s infinite alternate;
}

.nav-card:hover .status-indicator::after {
  opacity: 0.7;
}

.status-indicator.online {
  background-color: #4CAF50;
  box-shadow: 0 0 4px #4CAF50;
}

.status-indicator.online::before {
  box-shadow: 0 0 4px 1px rgba(76, 175, 80, 0.9);
}

.status-indicator.online::after {
  box-shadow: 0 0 10px 3px rgba(76, 175, 80, 0.7);
}

.status-indicator.offline {
  background-color: #F44336;
  box-shadow: 0 0 4px #F44336;
}

.status-indicator.offline::before {
  box-shadow: 0 0 4px 1px rgba(244, 67, 54, 0.9);
}

.status-indicator.offline::after {
  box-shadow: 0 0 10px 3px rgba(244, 67, 54, 0.7);
}

.status-indicator.checking {
  background-color: #FFC107;
  box-shadow: 0 0 4px #FFC107;
}

.status-indicator.checking::before {
  box-shadow: 0 0 4px 1px rgba(255, 193, 7, 0.9);
}

.status-indicator.checking::after {
  box-shadow: 0 0 10px 3px rgba(255, 193, 7, 0.7);
}

@keyframes pulse-color {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pulse-shadow {
  0% {
    opacity: 0.3;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.3;
    transform: scale(0.9);
  }
}

/* 电脑端状态行滑动动画 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 电脑端状态行滑动动画 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-card:hover {
  background: #fff;
  color: #5b6ee1;
  transform: translateY(-3px) scale(1.04);
  text-shadow: none;
}

.nav-card img {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  margin-right: 14px;
}

.nav-card span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: calc(100% - 46px);
}

/* 折叠面板样式美化 */
.collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  padding: 0.9em 1.2em 0.9em 0.8em;
  margin-bottom: 6极;
  border-radius: 14px;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.08) 100%);
  box-shadow: 0 4px 18px 0 rgba(60,40,120,0.10), 0 1.5px 6px 0 rgba(0,0,0,0.08);
  color: #000;
  position: relative;
  transition: background 0.3s, box-shadow 0.3s, color 0.3s;
  z-index: 1;
  text-shadow: 1px 1px 2px white, -1px -1px 2px white, 1px -1px 2px white, -1px 1px 2px white;
}
.collapsible-header:hover,
.collapsible-header.active {
  background: linear-gradient(90deg, #e1a16b 0%, #e16ba0 100%);
  color: #fff;
  box-shadow: 0 6px 24px 0 rgba(225,107,160,0.13), 0 2px 8px 0 rgba(0,0,0,0.10);
  text-shadow: none;
}
.collapsible-header .arrow {
  margin-left: 12px;
  font-size: 1.1em;
  transition: transform 0.45s cubic-bezier(.68,-0.55,.27,1.55), color 0.3s;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12));
}
.collapsible-header .arrow.open {
  transform: rotate(180deg) scale(1.15);
  color: #e1a16b;
}
.collapsible-header.active .arrow {
  color: #e1a16b;
}

.collapsible-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(.68,-0.55,.27,1.55), opacity 0.4s;
  will-change: max-height, opacity;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}
.collapsible-content.open {
  opacity: 1;
  max-height: 1000px; /* 足够大即可 */
  margin-bottom: 18px;
}

/* 保证收起时不占空间 */
.collapsible-content:not(.open) {
  margin-bottom: 0;
}

/* 兼容原有卡片布局 */
.card-list {
  transition: none;
}

/* 汉堡菜单 - 所有设备都显示 */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

/* 电脑端汉堡菜单悬停效果 */
@media (min-width: 769px) {
  .mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
  }
}

.mobile-menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: #333;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* 移动端侧边菜单 */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 999;
  transition: right 0.3s ease;
  padding: 80px 20px 20px;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.mobile-sidebar.active {
  right: 0;
}

.mobile-sidebar .status-card {
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 15px;
}

/* 适配移动端分组标题 */
@media (max-width: 768px) {
  /* 移动端汉堡菜单位置调整 */
  .mobile-menu-toggle {
    top: 15px;
    right: 15px;
  }
  
  .header {
    margin-top: 60px;
  }
  
  .collapsible-header {
    font-size: 1.01rem;
    padding: 0.7em 0.8em 0.7em 0.7em;
    margin-bottom: 4px;
  }
  
  .container { 
    padding: 15px; 
  }
  
  .status-row {
    flex-direction: column; 
    gap: 12px;
    display: none;
  }
  
  .card-list { 
    flex-direction: row; 
    flex-wrap: wrap;
    gap: 10px; 
    justify-content: space-between;
  }
  
  .nav-card { 
    width: calc(50% - 10px);
    height: 40px;
    padding: 10px 10px;
    font-size: 0.95rem;
  }
  
  .nav-card img {
    width: 36px;
    height: 36px;
    margin-right: 12px;
  }
  
  .status-card {
    width: 100%;
    padding: 15px 20px;
    min-width: auto;
    gap: 10px;
    box-sizing: border-box;
    font-size: 0.95rem;
  }
  
  .status-card .icon {
    font-size: 1.3rem;
    margin-right: 8px;
  }
  
  .status-card .label {
    font-size: 1rem;
  }
  
  .status-card .value {
    font-size: 1rem;
    margin-left: 8px;
  }
  
  /* 移动端合并抽屉适配 */
  .nav-groups-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .group-titles {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 10px 15px;
  }
  
  .group-title {
    padding: 12px 16px;
    font-size: 0.95rem;
    min-width: 80px;
    text-align: center;
    flex-direction: column;
    gap: 4px;
    height: auto;
    min-height: 60px;
  }
  
  .group-title:hover {
    transform: translateY(-1px);
  }
  
  .group-title .arrow {
    margin-top: 2px;
    font-size: 0.9rem;
  }
  
  .shared-card-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 10px 15px;
  }
  
  /* 移动端时间显示优化 */
  .time {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }
  
  .date {
    font-size: 1rem;
  }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  .mobile-menu-toggle {
    top: 15px;
    right: 15px;
    width: 28px;
    height: 20px;
  }
  
  .header {
    margin-top: 50px;
  }
  
  .time {
    font-size: 1.6rem;
  }
  
  .date {
    font-size: 0.9rem;
  }
  
  .nav-card {
    height: 60px;
    padding: 12px 15px;
    font-size: 0.95rem;
  }
  
  .nav-card img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
  }
  
  .group-title {
    padding: 10px 12px;
    font-size: 0.9rem;
    min-width: 70px;
  }
  
  .status-card {
    padding: 12px 15px;
  }
}
