/* ===== 基础重置 ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== 全局背景 ===== */
body {
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
  color: #333;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8f9ff 0%, #f9f9fa 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  top: -30%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(58, 134, 255, 0.1) 0%,
    rgba(131, 56, 236, 0.05) 70%,
    transparent 100%
  );
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

body > header,
body > main > *,
body > footer {
  position: relative;
  z-index: 1;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== 顶部导航栏 ===== */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  color: #3a86ff;
  font-size: 32px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  position: relative;
  transition: color 0.3s;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(to right, #3a86ff, #8338ec);
  transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: #3a86ff;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
}

.login-btn {
  background: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 134, 255, 0.4);
}

/* ===== 页头用户信息（已登录时） ===== */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 24px;
  transition: background 0.3s;
}

.user-info:hover {
  background: rgba(58, 134, 255, 0.08);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 页脚 ===== */
.app-footer {
  background: #fff;
  padding: 30px 0;
  margin-top: 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer-org {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.footer-icp {
  font-size: 13px;
  color: #9ca3af;
}

/* ===== 卡片样式 ===== */
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  word-break: break-all;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* ===== 区块通用样式 ===== */
.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-tag {
  display: inline-block;
  color: #3a86ff;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 14px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: #212529;
}

.section-subtitle {
  font-size: 16px;
  color: #6c757d;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== 装饰背景图：左侧渐变笔触 ===== */
.page-asset-brush {
  position: fixed;
  top: 0;
  left: 0;
  height: auto;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* ===== 装饰背景图：宇航员（右下方） ===== */
.page-asset-astronaut {
  position: fixed;
  right: 0;
  height: auto;
  z-index: 0;
  pointer-events: none;
  opacity: 0.95;
  animation: astronautFloat 4s ease-in-out infinite;
}

@keyframes astronautFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
}

/* ===== Modal/Toast 样式 ===== */
.ed-modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.ed-modal-mask.ed-modal-mask-show {
  opacity: 1;
  pointer-events: auto;
}

.ed-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.1);
  width: 400px;
  max-width: 90%;
  max-height: 85vh;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.ed-modal-container.ed-modal-container-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.ed-modal-container .ed-modal-content {
  text-align: center;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ed-modal-container .ed-modal-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  padding: 16px;
  flex-shrink: 0;
}

.ed-modal-container .ed-modal-text {
  font-size: 15px;
  color: #666;
  margin-bottom: 20px;
  padding: 0 16px;
  line-height: 1.5;
  word-break: break-word;
  flex: 1;
  overflow-y: auto;
  text-align: center;
  min-height: 0;
}

/* 协议弹窗内容较长，改为左对齐 + 滚动 */
#ruleModal .ed-modal-text {
  text-align: left;
}

/* 协议弹窗：加宽、限高 */
#ruleModal {
  width: 800px;
  max-height: 50vh;
}

.ed-modal-container .ed-modal-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.ed-modal-container .ed-modal-buttons.ed-modal-buttons-center {
  grid-template-columns: 1fr;
}

.ed-modal-container .ed-modal-buttons .ed-modal-button {
  padding: 12px 0;
  font-size: 16px;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  position: relative;
}

.ed-modal-container .ed-modal-buttons .ed-modal-button:active {
  opacity: 0.7;
}

.ed-modal-container .ed-modal-buttons .ed-modal-button-cancel::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 1px;
  background-color: #e5e5e5;
}

.ed-modal-container .ed-modal-buttons .ed-modal-button-confirm {
  font-weight: bold;
}

.ed-toast-container {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 9999;
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(20px);
}

.ed-toast-container.ed-toast-show {
  opacity: 1;
  transform: translateY(0);
}

.ed-toast-container.ed-toast-top {
  top: 20%;
}
.ed-toast-container.ed-toast-bottom {
  bottom: 20%;
}
.ed-toast-container.ed-toast-center {
  top: 50%;
  transform: translateY(calc(-50% + 20px));
}
.ed-toast-container.ed-toast-center.ed-toast-show {
  transform: translateY(-50%);
}

.ed-toast-container .ed-toast-content {
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  max-width: 80%;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ed-toast-container .ed-toast-content .ed-toast-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.ed-toast-container .ed-toast-content .ed-toast-icon-success {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.ed-toast-container .ed-toast-content .ed-toast-icon-error {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
}

.ed-toast-container .ed-toast-content .ed-toast-icon-loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z'/%3E%3C/svg%3E");
  animation: toastLoading 1s linear infinite;
}

@keyframes toastLoading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ed-toast-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
}
