:root {
  --primary-color: #6a11cb;
  --secondary-color: #2575fc;
  --text-color: #333;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius-md: 12px;
  --radius-lg: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, 'Microsoft YaHei', sans-serif;
}

/* body {
  background-color: #eef2f5;
  修改背景色以区分模拟容器
  color: var(--text-color);
  line-height: 1.6;
  padding-bottom: 60px;
  padding-top: 20px;
  增加顶部间距用于展示模拟容器
} */

/* 模拟嵌入环境的容器 */
.simulation-wrapper {
  max-width: 940px;
  margin: 0 auto;
  background-color: var(--bg-color);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* 防止溢出 */
}

.container {
  width: 100%;
  /* 自适应父容器 */
  margin: 0 auto;
  padding: 0 20px;
}
.container .tp-center{
	
	text-align:center;
}

/* Header */
header {
/*   background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  padding: 20px 0;
  text-align: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-md); */
}

header h1 {

  padding:20px 0;
  text-align:center;
  color:#333;
  letter-spacing:0.20rem;
  font-size: 1.8rem;
  font-weight: 600;
}

header p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Toolbar / Navigation */
.toolbar {
  position: sticky;
  top: 10px;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 10px 10px;
  margin: 0 0 20px 0;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  background-color: #f0f5ff;
  color: var(--secondary-color);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.btn:hover {
  background-color: var(--secondary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(37, 117, 252, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.1em;
}

.btn-primary {
  background-color: #3f487b;
  color: white;
}

.btn-primary:hover {
  background-color: #293262;
}

.page-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f5ff;
  padding: 4px 12px;
  border-radius: 20px;
}

.page-input {
  width: 50px;
  border: none;
  background: transparent;
  text-align: right;
  font-size: 1rem;
  font-weight: bold;
  color: var(--secondary-color);
}

.page-input:focus {
  outline: none;
}

.page-total {
  color: #666;
  font-size: 0.9rem;
}

/* Main Content */
.content-area {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.page-title {
  font-size: 1.4rem;
  color: var(--text-color);
  font-weight: 600;
}

.page-badge {
/*   background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white; */
  display:inline-block;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: bold;
}

.image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 400px;
  transition: all 0.3s ease;
}

.page-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  transition: opacity 0.3s ease;
  opacity: 0;
  /* Hidden by default for fade-in */
}

.page-image.loaded {
  opacity: 1;
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #888;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--secondary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  color: #e74c3c;
  background-color: #fff5f5;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #feb2b2;
}

/* Catalog Drawer */
.catalog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.catalog-overlay.active {
  opacity: 1;
  visibility: visible;
}

.catalog-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100%;
  background-color: white;
  z-index: 9999;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  max-width: 90vw;
}

.catalog-drawer.active {
  right: 0;
}

.catalog-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f9fa;
}

.catalog-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 5px;
}

.catalog-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.catalog-group {
  margin-bottom: 20px;
}

.catalog-group-title {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.catalog-item {
  background-color: #f8f9fa;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.catalog-item:hover {
  background-color: #f0f5ff;
  color: var(--secondary-color);
  border-color: #d0e1fd;
}

/* Footer */
footer {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-top: auto;
  padding: 20px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--primary-color);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
  z-index: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-group {
    justify-content: space-between;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-badge {
    align-self: flex-start;
  }

  .catalog-drawer {
    width: 85%;
  }
}
