/* ===================================
   W.A.S.T.E. Journal - 共享样式
   =================================== */

:root {
  --color-paper: #f9f9f9;
  --color-charcoal: #333;
  --color-charcoal-light: #555;
  --color-accent-gold: #c5a02f;
  --color-science-red: #d12f2f;
  --color-gray-300: #e0e0e0;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", "Noto Serif SC", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--color-paper);
  font-family: var(--font-sans);
  color: var(--color-charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.chinese-serif { font-family: var(--font-serif); }

/* ===================================
   Top Bar（顶部快速导航）
   =================================== */
.top-bar {
  background: white;
  border-bottom: 1px solid var(--color-gray-300);
  padding: 0.5rem 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-charcoal-light);
  position: relative;
  z-index: 100;
}

.top-bar-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
}

.top-bar a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.top-bar a:hover { color: var(--color-science-red); }

/* ===================================
   Header（Logo + 副标题）
   =================================== */
header {
  background: white;
  border-bottom: 4px solid var(--color-charcoal);
  padding: 2rem 0;
  position: relative;
  z-index: 99;
}

.header-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-title {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--color-charcoal);
}

.logo-subtitle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem 0;
  height: 3.5rem;
}

.logo-subtitle span {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-charcoal);
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  padding: 0.5rem 1.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-science-red);
  color: white;
}

.btn-primary:hover { background: #b52525; }

.btn-outline {
  border: 1px solid var(--color-charcoal);
  background: transparent;
  color: var(--color-charcoal);
}

.btn-outline:hover {
  background: var(--color-charcoal);
  color: white;
}

/* ===================================
   Navigation（导航栏）
   =================================== */
nav {
  background: white;
  border-bottom: 1px solid var(--color-gray-300);
  position: sticky;
  top: 0;
  z-index: 98;
}

.nav-content {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.nav-item {
  border-right: 1px solid var(--color-gray-300);
  padding: 0.75rem 1.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-charcoal-light);
  transition: color 0.2s;
  cursor: pointer;
}

.nav-item:last-child { border-right: none; }
.nav-item:hover { color: var(--color-science-red); }
.nav-item.active { color: var(--color-science-red); }

/* ===================================
   Sticky Scroll Bar（滚动时出现的黑色顶部栏）
   =================================== */
.sticky-bar {
  position: fixed;
  top: -60px;
  left: 0;
  width: 100%;
  background: #000000 !important;
  color: white;
  padding: 0.75rem 0;
  z-index: 1000;
  transition: top 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.sticky-bar.visible {
  top: 0;
}

.sticky-bar-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent !important;
}

.sticky-bar-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: white;
  text-decoration: none;
}

.sticky-bar-nav {
  display: flex;
  gap: 1.5rem;
  background-color: rgba(0,0,0,0) !important;
}

.sticky-bar-nav a {
  color: #aaa !important;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
  background: transparent !important;
  padding: 0.5rem 0.75rem;
}

.sticky-bar-nav a:hover { 
  color: #ffffff !important;
  background: rgba(255,255,255,0.1) !important;
}

/* ===================================
   Sidebar（侧边栏）
   =================================== */
.sidebar-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  background: var(--color-charcoal);
  color: white;
  border: none;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.sidebar-toggle:hover {
  background: var(--color-science-red);
  transform: scale(1.05);
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  transition: all 0.3s;
}

.sidebar-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: var(--color-charcoal);
  color: white;
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(0,0,0,0.3);
}

.sidebar.active {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

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

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: white;
  margin-bottom: 0.5rem;
}

.sidebar-tagline {
  font-size: 0.75rem;
  color: #aaa;
  font-style: italic;
}

.sidebar-nav {
  padding: 1.5rem;
  display: block !important;
}

.sidebar-nav ul {
  list-style: none;
  display: block !important;
}

.sidebar-nav li {
  margin-bottom: 0.5rem;
  display: block !important;
}

.sidebar-nav a {
  display: block;
  padding: 0.75rem 1rem;
  color: #aaa;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.05);
  border-left-color: var(--color-accent-gold);
}

.sidebar-nav a.active {
  color: white;
  border-left-color: var(--color-accent-gold);
  background: rgba(197, 160, 47, 0.1);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 2rem;
}

.sidebar-footer p {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.8;
}

/* ===================================
   Main Content
   =================================== */
main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ===================================
   Footer
   =================================== */
footer {
  background: var(--color-charcoal);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 0.75rem;
  margin-bottom: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.5rem;
}

.footer-section p, .footer-section a {
  font-size: 0.875rem;
  color: #aaa;
  line-height: 2;
  text-decoration: none;
}

.footer-section a:hover { color: white; }

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
  .logo-title { font-size: 2.5rem; }
  .logo-subtitle { height: 2.5rem; }
  .logo-subtitle span { font-size: 0.55rem; }
  .header-content { flex-direction: column; text-align: center; }
  .header-actions { justify-content: center; }
  
  /* 手机端隐藏导航栏 */
  nav { display: none; }
  
  /* 手机端隐藏 sticky-bar（太挤了） */
  .sticky-bar { display: none; }
  
  /* 手机端显示侧边栏按钮（左下角） */
  .sidebar-toggle { 
    display: flex;
    top: auto;
    bottom: 1rem;
    left: 1rem;
  }
  
  /* 确保侧边栏正常显示 */
  .sidebar {
    width: 280px;
  }
  
  .sidebar-nav {
    padding: 1rem;
  }
  
  .sidebar-nav a {
    font-size: 0.9rem;
    padding: 0.875rem 1rem;
  }
}

@media (min-width: 769px) {
  /* 桌面端隐藏侧边栏按钮 */
  .sidebar-toggle { display: none; }
}
