:root {
  --paper-cream: #faf8f3;
  --paper-aged: #f5f1e8;
  --ink-black: #1a1614;
  --ink-gray: #4a4542;
  --accent-burnt: #c85a3e;
  --accent-gold: #d4a574;
  --border-subtle: #e8e3d8;
  --shadow-soft: rgba(26, 22, 20, 0.08);
}

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

body {
  font-family: 'Crimson Text', Georgia, serif;
  background: var(--paper-cream);
  color: var(--ink-black);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Masthead - Editorial Header */
.masthead {
  background: var(--paper-aged);
  border-bottom: 1px solid var(--ink-black);
  padding: 0.75rem 3rem 0.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px var(--shadow-soft);
}

.masthead-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.publication-info {
  flex: 1;
}

.publication-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink-black);
  margin: 0;
  line-height: 1;
}

.publication-title a {
  color: inherit;
  text-decoration: none;
}

.publication-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-gray);
  margin-top: 0.2rem;
}

.masthead-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.current-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--ink-gray);
  letter-spacing: 0.05em;
}

.btn-admin {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-family: 'Crimson Text', serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-gray);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-admin:hover {
  color: var(--ink-black);
  border-color: var(--ink-black);
  text-decoration: none;
}



/* Layout */
.layout {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  padding: 2rem 3rem;
  min-height: calc(100vh - 180px);
  align-items: start;
}

/* Sidebar - Archive */
.sidebar {
  background: var(--paper-aged);
  border: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem 1.5rem;
  position: sticky;
  top: 95px;
  box-shadow: 0 2px 12px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 115px);
}

.sidebar-header {
  border-bottom: 2px solid var(--ink-black);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-black);
}

.sidebar-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-gray);
  margin-top: 0.25rem;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  flex-shrink: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.archive-list::-webkit-scrollbar {
  width: 4px;
}

.archive-list::-webkit-scrollbar-track {
  background: transparent;
}

.archive-list::-webkit-scrollbar-thumb {
  background: rgba(200, 180, 150, 0.35);
  border-radius: 4px;
}

.archive-list.disabled {
  opacity: 0.45;
  pointer-events: none;
  position: relative;
  user-select: none;
}

.archive-list.disabled .report-item {
  cursor: not-allowed;
}

.report-item {
  background: var(--paper-cream);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.report-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-burnt);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.report-item:hover {
  background: #fff;
  border-color: var(--accent-gold);
  transform: translateX(4px);
}

.report-item:hover::before {
  transform: scaleY(1);
}

.report-item.active {
  background: #fff;
  border-color: var(--accent-burnt);
  box-shadow: 0 2px 8px var(--shadow-soft);
}

.report-item.active::before {
  transform: scaleY(1);
}

.report-date {
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-black);
  display: block;
}

.report-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-gray);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* Subscribe Section */
.subscribe-section {
  margin-top: 1.5rem;
}

.subscribe-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-subtle) 20%, var(--border-subtle) 80%, transparent);
  margin-bottom: 1.25rem;
}

.subscribe-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: 0.375rem;
}

.subscribe-desc {
  font-size: 0.8rem;
  color: var(--ink-gray);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
}

.subscribe-input {
  flex: 1;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-subtle);
  background: var(--paper-cream);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--ink-black);
  outline: none;
  transition: border-color 0.2s ease;
}

.subscribe-input::placeholder {
  color: #bbb;
}

.subscribe-input:focus {
  border-color: var(--accent-burnt);
}

.subscribe-btn {
  padding: 0.625rem 1rem;
  background: var(--accent-burnt);
  color: #fff;
  border: none;
  font-family: 'Crimson Text', serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.subscribe-btn:hover {
  background: #b04d32;
}

.subscribe-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.subscribe-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-gray);
  margin-top: 0.75rem;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Loading Skeleton */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-item {
  height: 80px;
  background: linear-gradient(90deg, var(--paper-cream) 25%, var(--paper-aged) 50%, var(--paper-cream) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: 1px solid var(--border-subtle);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Main Content */
.content {
  background: #fff;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px var(--shadow-soft);
  position: relative;
  min-height: calc(100vh - 200px);
  margin: 0;
  padding: 2rem;
}

/* Empty State */
.content-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  text-align: center;
  min-height: 600px;
}

.empty-illustration {
  color: var(--accent-gold);
  margin-bottom: 2rem;
  opacity: 0.6;
}

.empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: 0.75rem;
}

.empty-text {
  font-size: 1rem;
  color: var(--ink-gray);
  max-width: 400px;
}




/* Report Header */
.report-header {
  display: flex;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--ink-black);
  margin-bottom: 2rem;
}

.report-date-badge {
  background: var(--accent-burnt);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  box-shadow: 0 2px 8px rgba(200, 90, 62, 0.3);
}

.badge-day {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.badge-month {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.report-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.report-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink-black);
  margin-bottom: 0.5rem;
}

.report-stats {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--ink-gray);
}

/* View Tabs */
.view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.5rem;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  top: 1px;
}

.tab:hover {
  color: var(--ink-black);
  background: var(--paper-cream);
}

.tab.active {
  color: var(--accent-burnt);
  border-bottom-color: var(--accent-burnt);
}

.tab-icon {
  font-size: 1.125rem;
}

/* View Container */
.view-container {
  position: relative;
  min-height: calc(100vh - 380px);
}

.view-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-panel.active {
  display: block;
}

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

.report-preview {
  border: 1px solid var(--border-subtle);
  background: var(--paper-cream);
  overflow: hidden;
  border-radius: 4px;
  container-type: inline-size;
}

.image-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.report-image {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 16px var(--shadow-soft);
}

.image-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-gray);
  margin-top: 1rem;
  font-style: italic;
}

.btn-download {
  background: var(--accent-burnt);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(200, 90, 62, 0.3);
}

.btn-download:hover {
  background: #b04d32;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(200, 90, 62, 0.4);
}

.btn-download:active {
  transform: translateY(0);
}

.raw-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--ink-black);
  padding: 4rem 1.5rem 1.5rem;
  background: var(--paper-cream);
  border: 1px solid var(--border-subtle);
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.raw-text-wrapper {
  position: relative;
}

.btn-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(250, 248, 243, 0.9);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 1rem;
  font-family: 'Crimson Text', serif;
  font-size: 0.85rem;
  color: var(--ink-gray);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.btn-copy:hover {
  background: var(--accent-burnt);
  color: #fff;
  border-color: var(--accent-burnt);
}

.btn-copy.copied {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}



/* Status Toast */
.status-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink-black);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 4px;
  font-family: 'Crimson Text', serif;
  font-size: 0.875rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.status-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 260px 1fr;
    padding: 2rem 1.5rem;
  }

  .masthead {
    padding: 0.5rem 2rem 0.4rem;
  }

  .publication-title {
    font-size: 1.75rem;
  }

  .subscribe-form {
    flex-wrap: nowrap;
  }

  .subscribe-input {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .archive-list {
    max-height: 250px;
  }

  .masthead-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .masthead-meta {
    width: 100%;
    justify-content: space-between;
  }

  .publication-title {
    font-size: 1.75rem;
  }

  .report-header {
    flex-direction: column;
    gap: 1rem;
  }
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--ink-brown, #5a4a3a);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 0.85;
  visibility: visible;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.back-to-top:active {
  transform: translateY(-1px);
}
