:root {
  --primary-bg: #0b0d14;
  --card-bg: rgba(26, 29, 44, 0.8);
  --accent-blue: #00f2ff;
  --accent-red: #ff0055;
  --text-main: #ffffff;
  --text-dim: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Noto Sans SC", sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NFC 涟漪动画 */
.ripple-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  z-index: -1;
}

.ripple {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  opacity: 0;
  animation: ripple-anim 2.5s infinite ease-out;
}

.ripple:nth-child(2) {
  animation-delay: 0.8s;
}
.ripple:nth-child(3) {
  animation-delay: 1.6s;
}

@keyframes ripple-anim {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* 主容器 */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  z-index: 10;
}

/* Header */
header {
  margin-top: 40px;
  text-align: center;
  margin-bottom: 40px;
}

.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 10px var(--accent-blue));
}

.brand-title {
  font-family: "Orbitron", sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  background: linear-gradient(to right, #ffffff, var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* Main */
main {
  flex: 1;
}

.portal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.portal-item {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px 24px;
  backdrop-filter: blur(10px);
  transition:
    transform 0.2s,
    border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.portal-item.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}

.portal-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-blue);
}

.portal-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.portal-icon {
  font-size: 40px;
}

.portal-text h3 {
  font-size: 22px;
  margin-bottom: 4px;
}

.portal-text p {
  font-size: 13px;
  color: var(--text-dim);
}

.info-card {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  border-left: 4px solid var(--accent-blue);
}

.info-card h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid var(--glass-border);
}

.appid-tag {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.highlight {
  color: var(--accent-red);
  font-weight: bold;
  font-family: monospace;
}

.copyright {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-end;
}

.modal-content {
  width: 100%;
  background: #141724;
  border-top: 2px solid var(--accent-blue);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px;
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

.material-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 30px;
}

.material-card {
  background: #1e2235;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
}

.material-card.selected {
  border-color: var(--accent-blue);
}

.thumbnail-box {
  aspect-ratio: 16/9;
  background: #2d324d;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-icon {
  font-size: 20px;
  color: var(--accent-blue);
}

.duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 4px;
}

.material-title {
  font-size: 12px;
  padding: 8px;
  text-align: center;
}

.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-red), #ff4d8d);
  border: none;
  border-radius: 12px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
  cursor: pointer;
}

.primary-btn:active {
  transform: scale(0.98);
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--accent-blue);
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 1000;
  display: none;
  animation: fade-in 0.3s;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 用户状态栏样式 */
.user-status-bar {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
}

.login-btn {
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
  transition: transform 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-btn:active {
  transform: scale(0.95);
}

.user-info-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 25px;
  border: 1px solid var(--accent-blue);
  backdrop-filter: blur(5px);
}

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  object-fit: cover;
}

.nickname-txt {
  font-size: 0.9rem;
  color: var(--accent-blue);
  font-weight: bold;
}
