:root {
  --primary-color: #6b7a88;
  --secondary-color: #a5b4c2;
  --accent-color: #8d9ca8;
  --background-color: #f8f9fa;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e2e8f0;
  --white: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-soft: 0 2px 4px rgba(0, 0, 0, 0.03);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Noto Serif SC', serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  padding-top: 70px;
}

h1, h2, h3, h4 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-weight: 500;
}

p {
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

a:hover {
  color: var(--accent-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--white);
  box-shadow: var(--shadow-soft);
  z-index: 1000;
}

.navbar {
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  list-style: none;
}

.nav-item {
  margin-left: 2rem;
}

.nav-link {
  color: var(--text-color);
  font-weight: 400;
}

.nav-link:hover {
  color: var(--accent-color);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  padding: 4rem 0;
  text-align: center;
  margin-bottom: 3rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Content Sections */
.content-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.section-group h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.section-group ul {
  list-style: none;
}

.section-group li {
  margin-bottom: 0.5rem;
}

.section-group a {
  color: var(--text-color);
  padding: 0.5rem 0;
  display: block;
  border-radius: 4px;
  transition: var(--transition);
}

.section-group a:hover {
  background-color: rgba(171, 194, 217, 0.1);
  padding-left: 0.75rem;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.post-card {
  background-color: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.post-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.post-card h3, .post-card h4 {
  margin-bottom: 0.75rem;
}

.post-card h3 a, .post-card h4 a {
  color: var(--primary-color);
}

.post-card h3 a:hover, .post-card h4 a:hover {
  color: var(--accent-color);
}

.post-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 1rem;
}

/* Forms */
.auth-container {
  max-width: 500px;
  margin: 3rem auto;
  padding: 2rem;
}

.auth-form {
  background-color: var(--white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-weight: 400;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(165, 180, 194, 0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  text-align: center;
}

.btn:hover {
  background-color: var(--accent-color);
}

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

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

.btn-liked {
  background-color: var(--accent-color);
}

.btn-success {
  background-color: #4ade80;
}

.btn-success:hover {
  background-color: #22c55e;
}

.btn-danger {
  background-color: #f87171;
}

.btn-danger:hover {
  background-color: #ef4444;
}

.btn-info {
  background-color: #60a5fa;
}

.btn-info:hover {
  background-color: #3b82f6;
}

.btn-secondary {
  background-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: var(--accent-color);
}

/* Post Detail */
.post-detail {
  background-color: var(--white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.post-detail h1 {
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.post-content {
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

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

#like-btn {
  margin-right: 0.5rem;
}

#likes-count {
  font-weight: 500;
}

/* Comments Section */
.comments-section {
  background-color: var(--white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.comment-form {
  margin-bottom: 2rem;
}

.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
  min-height: 100px;
}

.comments-list {
  margin-top: 2rem;
}

.comment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-date {
  color: var(--text-light);
  font-size: 0.9rem;
}

.comment-content {
  line-height: 1.6;
}

/* Admin Section */
.admin-section {
  margin-bottom: 3rem;
}

.admin-section h3 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.post-item {
  background-color: var(--white);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}

.post-actions {
  margin-top: 1rem;
}

.post-actions .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Sub Sections */
.sub-sections {
  margin: 2rem 0;
}

.sub-section {
  background-color: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.sub-section h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Flash Messages */
.flash-messages {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 20px;
}

.flash-message {
  padding: 0.75rem;
  background-color: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  color: #1e40af;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding: 0 20px;
  color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    flex-direction: column;
  }
  
  .nav-item {
    margin: 0.5rem 0;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}