
/* 全局样式设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 设置字体和背景 */
body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: linear-gradient(135deg, #0D47A1 70%, #607D8B 25%, #FF9800 5%);
  color: #FFFFFF;
  overflow-x: hidden;
  transition: background 0.5s ease;
}

/* 容器布局 */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(13, 71, 161, 0.9);
  display: flex;
  justify-content: space-between;
  padding: 15px 30px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.navbar li {
  position: relative;
}

.navbar a {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar a:hover {
  color: #FF9800;
}

.dropdown {
  display: none;
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 0;
  top: 35px;
  left: 0;
  backdrop-filter: blur(10px);
}

.navbar li:hover .dropdown {
  display: block;
}

.dropdown a {
  display: block;
  padding: 10px 20px;
  color: #FFFFFF;
  transition: background 0.3s ease;
}

.dropdown a:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 主标题样式 */
header {
  width: 100%;
  padding: 100px 0 50px 0;
  text-align: center;
  background: rgba(13, 71, 161, 0.8);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

header p {
  font-size: 1.2rem;
  color: #FF9800;
}

/* 文章内容样式 */
article {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 40px;
  margin: 20px 0;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

article h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #FFFFFF;
  border-bottom: 2px solid #FF9800;
  padding-bottom: 10px;
}

article p {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #FFFFFF;
}

article pre {
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 20px;
}

article code {
  color: #FFEB3B;
  font-family: 'Courier New', Courier, monospace;
}

article img {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  margin: 10px;
  transition: transform 0.3s ease;
}

article img:hover {
  transform: scale(1.05);
}

/* 提示语样式 */
.notification {
  background: rgba(255, 152, 0, 0.8);
  color: #FFFFFF;
  padding: 15px 30px;
  border-radius: 10px;
  text-align: center;
  font-size: 1.2rem;
  margin: 20px 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* 代码块样式 */
pre code {
  position: relative;
  display: block;
  padding: 15px;
  background: #263238;
  color: #ECEFF1;
  border-radius: 10px;
  overflow: visible;
}

pre code::before {
  content: 'CSS3 示例代码';
  position: absolute;
  top: -25px;
  left: 0;
  background: #FF9800;
  color: #FFFFFF;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar ul {
    flex-direction: column;
    background: rgba(13, 71, 161, 0.95);
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    display: none;
  }

  .navbar ul.active {
    display: flex;
  }

  .navbar .menu-toggle {
    display: block;
    cursor: pointer;
    color: #FFFFFF;
    font-size: 1.5rem;
  }
}

@media (max-width: 500px) {
  header h1 {
    font-size: 2rem;
  }

  article {
    padding: 20px;
  }

  .notification {
    font-size: 1rem;
    padding: 10px 20px;
  }
}

/* 微交互效果 */
.card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.slide-up {
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 1s forwards;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: #FF9800;
  color: #FFFFFF;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
  text-decoration: none;
  font-size: 1rem;
}

.btn:hover {
  background: #4CAF50;
}

/* 装饰性元素样式 */
.decorative-line {
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #FF9800, #4CAF50);
  margin: 10px auto 30px auto;
  border-radius: 2px;
}

.footer {
  width: 100%;
  padding: 20px 0;
  background: rgba(13, 71, 161, 0.9);
  text-align: center;
  color: #FFFFFF;
  position: relative;
  bottom: 0;
}

.footer a {
  color: #FF9800;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #4CAF50;
}

/* 图片悬浮动画 */
.image-hover:hover {
  transform: rotate(5deg) scale(1.05);
  transition: transform 0.3s ease;
}

