:root {
  --color-primary: #4b2e83; /* 深紫色主色调 */
  --color-secondary: #9f7aea; /* 淡紫色次色 */
  --color-accent: #805ad5; /* 强调色 */
  --color-text: #2d2a32;
  --color-text-light: #88889c;
  --color-bg: #fdfcfe;
  --color-white: #ffffff;
  --color-header-bg: linear-gradient(135deg, #4b2e83 0%, #6b46c1 100%);
  --color-footer-bg: linear-gradient(135deg, #6b46c1 0%, #4b2e83 100%);
  --color-link: #9f7aea;
  --color-link-hover: #805ad5;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.12);

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.2;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  color: var(--color-secondary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p {
  margin-bottom: var(--space-sm);
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
  transform: translateY(-1px);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

main {
  flex: 1;
  padding: var(--space-lg) 0;
}

header {
  background: var(--color-header-bg);
  color: var(--color-white);
  padding: 2.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

#particles-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
header h1,
header p {
  position: relative;
  z-index: 1;
}

header h1 {
  color: #FFFFFF !important;
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

footer {
  background: var(--color-footer-bg);
  color: var(--color-white);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: var(--space-xl);
  position: relative;
}

footer p {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* 卡片网格布局 */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.prompt-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.prompt-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.prompt-image {
  overflow: hidden;
}

.prompt-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}
.prompt-image-large img{
	height: auto !important;
}
.prompt-link:hover .prompt-image img {
  transform: scale(1.03);
}

.prompt-content {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.prompt-content h2 {
  font-size: 1.25rem;
}

.description {
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  flex: 1;
}

/* 详情页样式 */
.prompt-detail {
  max-width: 900px;
  margin: 0 auto;
}

.breadcrumb {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.breadcrumb a {
  color: var(--color-secondary);
}

.prompt-article {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.prompt-meta {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: var(--space-md) 0;
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.featured-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.prompt-section {
  margin: var(--space-lg) 0;
  position: relative;
}

.prompt-section h2 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: var(--space-xs);
}

.prompt-text {
  color: var(--color-text-light);
  background-color: rgba(0, 0, 0, 0.03);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere; /* 确保长英文也会换行 */
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin-top: var(--space-sm);
  position: relative;
  max-height: 8rem;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.prompt-text.expanded {
  max-height: none;
}


.description-section {
	margin: var(--space-lg) 0;
	position: relative;
}

.description-section h2 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: var(--space-xs);
}

.description-text {
  color: var(--color-text-light);
  background-color: rgba(0, 0, 0, 0.03);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin-top: var(--space-sm);
  position: relative;
}

.btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem; /* 更紧凑的间距（你原来是0.5rem） */
}

/* 复制按钮图标样式 - 贴合紫色主题风格 */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  color: var(--color-secondary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.copy-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: transform var(--transition-fast);
}

.copy-btn:hover {
  background-color: rgba(159, 122, 234, 0.1); /* 淡紫 hover 背景 */
  color: var(--color-accent);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.copy-btn:active svg {
  transform: scale(0.9);
}

/* 复制成功状态 */
.copy-success {
  background-color: rgba(46, 204, 113, 0.15) !important;
  color: #2ecc71 !important;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.4);
}

/* 复制失败状态 */
.copy-error {
  background-color: rgba(231, 76, 60, 0.15) !important;
  color: #e74c3c !important;
  box-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}


/* 复用 copy-btn 样式即可，不需新增 toggle-btn 样式 */

.toggle-btn .arrow-icon {
  transition: transform 0.3s ease;
}

/* 展开状态，箭头旋转 */
.prompt-text.expanded + .prompt-actions .toggle-btn .arrow-icon {
  transform: rotate(180deg);
}

/* 节头部布局 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.prompt-actions {
  margin-top: var(--space-lg);
  text-align: center;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  margin: var(--space-lg) 0;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.page-link {
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
  transition: all var(--transition-fast);
  min-width: 40px;
  text-align: center;
}

.page-link:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--color-secondary);
}

.page-link.active {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
  font-weight: 500;
}

.page-dots {
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
}

/* 无结果提示 */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-lg);
  color: var(--color-text-light);
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background-color: var(--color-secondary);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
}

.btn:hover {
  color: var(--color-white);
  background-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  :root {
    --space-md: 1rem;
    --space-lg: 1.5rem;
  }

  header {
    padding: 2rem 1rem;
  }

  header h1 {
    font-size: 2.2rem;
  }

  header p {
    font-size: 1rem;
  }

  footer {
    padding: 1.5rem 1rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .prompt-meta {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .page-link {
    padding: var(--space-xs) 0.75rem;
    min-width: 36px;
  }
}
/* 认证表单样式 */
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-links a {
    color: var(--color-secondary);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input {
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* 增强版导航栏样式 */
.main-nav {
    display: flex;
    justify-content: flex-end; /* 新增：确保内容靠右 */
    align-items: center;
    gap: 1.5rem;
    margin-left: auto; /* 这个会让整个导航栏靠右 */
}

.user-greeting span {
    color: var(--color-link-hover);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav-icon {
    width: 16px;
    height: 16px;
}

.nav-link:hover {
    color: var(--color-link-hover);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-link-hover);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.logout {
    color: var(--color-link) !important;
}

.logout:hover {
    color: var(--color-link-hover) !important;
}

.logout::after {
    background-color: var(--color-link-hover);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .user-greeting {
        display: none;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: 0.5rem;
    }
    
    .highlight span {
        display: inline;
    }
}

/* 上传者信息样式 */
.prompt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #666;
}

.prompt-meta .uploader {
    margin-right: 1rem;
}

.prompt-meta .uploader a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s;
}

.prompt-meta .uploader a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .prompt-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 用户个人页面样式 */
.user-profile-header {
    margin-bottom: 2rem;
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.user-profile-header h1 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.user-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.user-stats svg {
    width: 16px;
    height: 16px;
}

/* 提示词卡片调整 */
.prompt-card .prompt-meta {
    margin: 0.5rem 0;
    font-size: 0.8rem;
    color: #666;
}