* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; color: #222; background: #f6f8fa; }
.site-header { background: #2c3e50; color: #fff; }
.nav { max-width: 980px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; }
.nav-left { font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
.nav-links a { color: #dfe6ec; text-decoration: none; font-size: 14px; }
.btn-home { background: #409eff; color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 4px; font-size: 14px; font-weight: 500; transition: background 0.3s; }
.btn-home:hover { background: #337ecc; }
.nav-toggle { display: none; flex-direction: column; cursor: pointer; padding: 4px; }
.nav-toggle span { width: 20px; height: 2px; background: #fff; margin: 2px 0; transition: 0.3s; }
.container { max-width: 980px; margin: 24px auto; padding: 0 16px; }
.breadcrumb { color: #667; font-size: 13px; margin-bottom: 12px; }
.page-title { font-size: 22px; font-weight: 600; color: #1f2d3d; text-align: center; margin: 16px 0 20px; }
.card { background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.04); padding: 18px; margin-bottom: 20px; }
.card h2 { font-size: 18px; border-left: 3px solid #409eff; padding-left: 8px; color: #273444; }
.btn { background: #409eff; color: #fff; border: 0; padding: 10px 14px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 500; transition: background 0.3s; }
.btn:hover { background: #337ecc; }
.btn-copy { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; padding: 4px 8px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.btn-copy:hover { background: #e0f2fe; }

/* 搜索区域样式 */
.search-section { margin-top: 12px; }
.input-group { display: flex; gap: 12px; align-items: end; margin-bottom: 16px; }
.input-group label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.input-group input { flex: 1; padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 14px; }
.input-group button { flex: 0 0 auto; }
.search-tips { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 12px; margin-top: 12px; }
.search-tips p { margin: 0 0 8px 0; font-size: 13px; color: #2c3e50; }
.search-tips ul { margin: 8px 0; padding-left: 20px; }
.search-tips li { margin: 4px 0; font-size: 12px; color: #5e6d82; line-height: 1.4; }

/* 结果区域样式 */
.result-content { margin-top: 12px; }
.dream-result { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.dream-keyword { font-size: 16px; font-weight: 600; color: #2c3e50; margin-bottom: 8px; }
.dream-meaning { font-size: 14px; color: #5e6d82; line-height: 1.6; margin-bottom: 12px; }
.dream-details { background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 12px; }
.dream-details h4 { font-size: 14px; color: #2c3e50; margin: 0 0 8px 0; }
.dream-details ul { margin: 8px 0; padding-left: 20px; }
.dream-details li { font-size: 13px; color: #5e6d82; margin: 4px 0; line-height: 1.4; }

/* 热门梦境样式 */
.hot-dreams { margin-top: 12px; }

/* 分类标签样式 */
.category-tabs { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-bottom: 16px; 
  padding-bottom: 12px; 
  border-bottom: 1px solid #e2e8f0; 
}
.category-tab { 
  background: #f8fafc; 
  color: #5e6d82; 
  border: 1px solid #e2e8f0; 
  padding: 8px 16px; 
  border-radius: 20px; 
  font-size: 13px; 
  cursor: pointer; 
  transition: all 0.3s; 
  white-space: nowrap;
}
.category-tab:hover { 
  background: #e2e8f0; 
  color: #2c3e50; 
}
.category-tab.active { 
  background: #409eff; 
  color: #fff; 
  border-color: #409eff; 
}

/* 梦境分类内容样式 */
.dream-categories { margin-top: 16px; }
.category-title { 
  font-size: 16px; 
  color: #2c3e50; 
  margin: 0 0 12px 0; 
  padding-bottom: 8px; 
  border-bottom: 2px solid #409eff; 
}
.dream-tags { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-bottom: 16px; 
}
.dream-tag { 
  background: #f0f9ff; 
  color: #0369a1; 
  border: 1px solid #bae6fd; 
  padding: 6px 12px; 
  border-radius: 16px; 
  font-size: 13px; 
  cursor: pointer; 
  transition: all 0.3s; 
}
.dream-tag:hover { 
  background: #e0f2fe; 
  transform: translateY(-1px); 
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.2); 
}

/* 查看全部和收起按钮样式 */
.show-all-btn, .collapse-btn { 
  text-align: center; 
  margin-top: 12px; 
}
.btn-outline { 
  background: transparent; 
  color: #409eff; 
  border: 1px solid #409eff; 
  padding: 8px 16px; 
  border-radius: 20px; 
  font-size: 13px; 
  cursor: pointer; 
  transition: all 0.3s; 
}
.btn-outline:hover { 
  background: #409eff; 
  color: #fff; 
}

/* 帮助内容样式 */
.help-content { margin-top: 12px; }
.help-content h3 { color: #2c3e50; font-size: 16px; margin: 16px 0 8px 0; border-left: 3px solid #409eff; padding-left: 8px; }
.help-content ul { margin: 8px 0; padding-left: 20px; }
.help-content li { margin: 6px 0; line-height: 1.5; font-size: 14px; }
.help-content p { margin: 8px 0; line-height: 1.6; font-size: 14px; color: #5e6d82; }
.example { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 12px; margin: 12px 0; }
.example p { margin: 6px 0; font-size: 13px; color: #5e6d82; }
.example code { background: #e2e8f0; padding: 2px 6px; border-radius: 3px; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; }
.desc { color: #5e6d82; font-size: 14px; }

/* 版权信息样式 */
.site-footer { background: #2c3e50; color: #fff; text-align: center; padding: 20px 0; margin-top: 40px; }
.footer-content p { margin: 0; font-size: 14px; color: #dfe6ec; }

/* 移动端适配 */
@media (max-width: 768px) {
  .nav-right { flex-direction: column; gap: 8px; }
  .nav-links { display: none; }
  .btn-home { align-self: flex-end; }
  .nav-toggle { display: flex; }
  .page-title { font-size: 18px; }
  .card { padding: 16px; }
  .container { padding: 0 12px; }
  .input-group { flex-direction: row; gap: 8px; align-items: end; }
  .input-group label { margin-bottom: 0; flex: 0 0 auto; }
  .input-group input { flex: 1; }
  .input-group button { flex: 0 0 auto; }
  .category-tabs { gap: 6px; }
  .category-tab { padding: 6px 12px; font-size: 12px; }
  .dream-tags { gap: 6px; }
  .dream-tag { padding: 5px 10px; font-size: 12px; }
  .dream-result { padding: 12px; }
  .dream-keyword { font-size: 15px; }
  .dream-meaning { font-size: 13px; }
  .dream-details { padding: 10px; }
  .dream-details h4 { font-size: 13px; }
  .dream-details li { font-size: 12px; }
}

/* iPhone 13/14/15 优化 (390px-413px) */
@media (min-width: 390px) and (max-width: 413px) {
  .input-group { flex-direction: row; gap: 6px; align-items: end; }
  .input-group label { margin-bottom: 0; flex: 0 0 auto; font-size: 12px; }
  .input-group input { flex: 1; font-size: 13px; }
  .input-group button { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }
  .category-tabs { gap: 5px; }
  .category-tab { padding: 5px 10px; font-size: 11px; }
  .dream-tags { gap: 5px; }
  .dream-tag { padding: 4px 8px; font-size: 11px; }
  .dream-result { padding: 10px; }
  .dream-keyword { font-size: 14px; }
  .dream-meaning { font-size: 12px; }
}

/* iPhone 6s Plus 优化 (414px-429px) */
@media (min-width: 414px) and (max-width: 429px) {
  .input-group { flex-direction: row; gap: 8px; align-items: end; }
  .input-group label { margin-bottom: 0; flex: 0 0 auto; font-size: 13px; }
  .input-group input { flex: 1; font-size: 14px; }
  .input-group button { flex: 0 0 auto; padding: 9px 13px; font-size: 14px; }
  .category-tabs { gap: 6px; }
  .category-tab { padding: 6px 12px; font-size: 12px; }
  .dream-tags { gap: 6px; }
  .dream-tag { padding: 5px 10px; font-size: 12px; }
  .dream-result { padding: 12px; }
  .dream-keyword { font-size: 15px; }
  .dream-meaning { font-size: 13px; }
}

@media (max-width: 480px) {
  .page-title { font-size: 16px; }
  .card h2 { font-size: 16px; }
  .btn { padding: 8px 12px; font-size: 14px; }
  .input-group { flex-direction: row; gap: 6px; align-items: end; }
  .input-group label { margin-bottom: 0; flex: 0 0 auto; font-size: 12px; }
  .input-group input { flex: 1; font-size: 13px; }
  .input-group button { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }
  .category-tabs { gap: 5px; }
  .category-tab { padding: 5px 10px; font-size: 11px; }
  .dream-tags { gap: 5px; }
  .dream-tag { padding: 4px 8px; font-size: 11px; }
  .dream-result { padding: 10px; }
  .dream-keyword { font-size: 14px; }
  .dream-meaning { font-size: 12px; }
  .dream-details { padding: 8px; }
  .dream-details h4 { font-size: 12px; }
  .dream-details li { font-size: 11px; }
  .help-content h3 { font-size: 15px; }
  .help-content li { font-size: 13px; }
  .help-content p { font-size: 13px; }
}

/* 通用移动端优化 - 确保所有手机都显示汉堡菜单 */
@media (max-width: 768px) {
  .nav-toggle { display: flex !important; }
  .nav-links { 
    position: fixed; 
    top: 50px; 
    left: -100%; 
    width: 100%; 
    height: calc(100vh - 50px); 
    background: #2c3e50; 
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: center; 
    padding-top: 20px; 
    transition: left 0.3s; 
  }
  .nav-links.active { left: 0; }
  .nav-links a { font-size: 14px; padding: 12px 20px; }
}
