/* === Vintage Blog Theme - 深蓝书卷复古风格 === */

:root {
  --bg-page: #1a1a2e;
  --bg-sidebar: #16213e;
  --bg-paper: #eaddc4;
  --bg-paper-dark: #d4c4a8;
  --text-main: #2c1810;
  --text-light: #5c3d2e;
  --text-muted: #8b7a5a;
  --text-on-dark: #c4b8a0;
  --accent: #b8860b;
  --accent-hover: #d4a017;
  --border: #b8a070;
  --border-light: #d0c0a0;
  --shadow: rgba(22, 33, 62, 0.2);
  --font-serif: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}


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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-serif);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.8;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(184, 134, 11, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(22, 33, 62, 0.4) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* === Layout === */

.wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 280px;
  min-height: 100vh;
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 2rem 1.5rem;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  border-right: 2px solid rgba(184, 160, 112, 0.3);
  box-shadow: 3px 0 15px var(--shadow);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(184, 160, 112, 0.3);
  position: relative;
}

.sidebar-logo .logo-icon {
  display: block;
  margin: 0 auto 0.8rem;
  width: 48px;
  height: 48px;
  opacity: 0.85;
}

.sidebar-logo a {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.1em;
  display: block;
}

.sidebar-logo .subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  letter-spacing: 0.15em;
}

.sidebar-logo .logo-ornament {
  display: block;
  margin: 0.8rem auto 0;
  width: 120px;
  height: 10px;
  opacity: 0.3;
}

.sidebar-nav {
  margin-bottom: 2rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.5rem 0.8rem;
  color: var(--text-on-dark);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 0.95rem;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(184, 134, 11, 0.12);
  border-left-color: var(--accent);
  color: #eaddc4;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(184, 160, 112, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-section h3::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--accent);
  opacity: 0.4;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16v2H4zm0 5h16v2H4zm0 5h10v2H4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16v2H4zm0 5h16v2H4zm0 5h10v2H4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.sidebar-section a,
.sidebar-section .tag-item {
  display: block;
  padding: 0.3rem 0.8rem;
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  opacity: 0.8;
}

.sidebar-section a:hover {
  opacity: 1;
  color: var(--accent);
}

.sidebar-section .count {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 3rem;
}

/* === Content Layout (article + right sidebar) === */

.content-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.content-main {
  flex: 1;
  min-width: 0;
}

.content-side {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 3rem;
}

.side-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.2rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 1px 3px var(--shadow);
  position: relative;
  overflow: hidden;
}

.side-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--accent) 50%, transparent 95%);
  opacity: 0.35;
}

.side-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(139, 119, 80, 0.01) 3px, rgba(139, 119, 80, 0.01) 6px);
  pointer-events: none;
}

.side-card > * {
  position: relative;
  z-index: 1;
}

.side-card h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

/* side search */

.side-search {
  display: flex;
  gap: 0;
}

.side-search input {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-right: none;
  background: rgba(255,255,255,0.4);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  min-width: 0;
}

.side-search input:focus {
  background: rgba(255,255,255,0.7);
  border-color: var(--accent);
}

.side-search button {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.side-search button:hover {
  background: var(--accent-hover);
}

/* side list */

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.side-list li:first-child {
  padding-top: 0;
}

.side-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.side-list a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color 0.2s;
}

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

.side-list .side-count,
.side-list .side-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* side tags */

.side-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.side-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.2s;
}

.side-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .content-layout {
    flex-direction: column;
  }

  .content-side {
    width: 100%;
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .content-side .side-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .content-side {
    grid-template-columns: 1fr;
  }
}

/* === Paper Card === */

.paper-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2.5rem 3rem;
  margin-bottom: 2rem;
  box-shadow:
    0 1px 3px var(--shadow),
    inset 0 0 60px rgba(139, 105, 20, 0.05);
  position: relative;
}

.paper-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 2%, var(--accent) 15%, var(--accent-hover) 50%, var(--accent) 85%, transparent 98%);
  opacity: 0.5;
  z-index: 3;
}

.paper-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 119, 80, 0.015) 2px, rgba(139, 119, 80, 0.015) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(139, 119, 80, 0.008) 3px, rgba(139, 119, 80, 0.008) 6px);
  pointer-events: none;
  z-index: 1;
  border-radius: 2px;
}

/* === Decorative Flourish === */

.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.5rem 0;
  color: var(--border);
  font-size: 0.7rem;
  opacity: 0.5;
}

.flourish::before,
.flourish::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.flourish svg {
  width: 48px;
  height: 12px;
  fill: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
}

/* === Article List === */

.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}



.article-item {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border-light);
}

.article-item:first-child {
  padding-top: 0;
}

.article-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.article-meta span {
  margin-right: 1rem;
}

.article-meta .category {
  display: inline-block;
  padding: 0.1rem 0.7rem;
  background: transparent;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.05em;
  position: relative;
}

.article-meta .category:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.article-title {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.article-title::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--accent);
  opacity: 0.35;
  flex-shrink: 0;
  margin-top: 0.2rem;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm6 3h8v2h-8V9z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm6 3h8v2h-8V9z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.article-title a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s;
}

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

.article-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-footer .views {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.article-footer .views svg {
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
  opacity: 0.6;
}

/* === Single Article === */

.page-header {
  text-align: center;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.page-header .header-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  display: block;
  opacity: 0.4;
}

.page-header h1 {
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

.page-header .header-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-style: italic;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.post-header h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.2rem;
}

.post-meta svg {
  width: 13px;
  height: 13px;
  fill: var(--text-muted);
  opacity: 0.5;
  vertical-align: -2px;
  margin-right: 0.2rem;
}

.post-cover {
  margin: -2.5rem calc(-3rem) 2rem;
  width: calc(100% + 6rem);
  overflow: hidden;
}

.post-cover img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-main);
  max-width: 50rem;
}

.post-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.post-content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.8rem;
  color: var(--text-light);
}

.post-content p {
  margin-bottom: 1rem;
  text-indent: 2em;
}

.post-content p:first-of-type {
  text-indent: 0;
}

.post-content p:first-of-type::first-letter {
  font-size: 3.2em;
  font-weight: bold;
  float: left;
  line-height: 0.85;
  margin: 0.1em 0.15em 0.05em 0;
  color: var(--accent);
  font-family: 'Georgia', serif;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: rgba(139, 105, 20, 0.06);
  color: var(--text-light);
  font-style: italic;
}

.post-content blockquote p {
  text-indent: 0;
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  margin: 1rem 0;
  padding-left: 2em;
}

.post-content li {
  margin-bottom: 0.3rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px var(--shadow);
}

.post-content pre {
  margin: 1.5rem 0;
  padding: 1.2rem 1.5rem;
  background: #1a0f0a;
  color: #d4c4a8;
  border-radius: 2px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid rgba(184, 160, 112, 0.2);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15rem 0.4rem;
  background: rgba(139, 105, 20, 0.1);
  border-radius: 2px;
}

.post-content pre code {
  background: none;
  padding: 0;
  border: none;
}

.post-content hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid var(--border-light);
}

.post-content .read-more {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.post-content .read-more:hover {
  text-decoration: underline;
}

/* === Post Navigation === */

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.post-navigation a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  max-width: 45%;
}

.post-navigation a:hover {
  text-decoration: underline;
}

.post-navigation .next {
  text-align: right;
}

.post-navigation .nav-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

/* === Reading Stats === */

.reading-stats {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(139, 105, 20, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 2px;
}

.reading-stats h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stats-bar {
  display: flex;
  align-items: flex-end;
  height: 60px;
  gap: 3px;
}

.stats-bar .bar-item {
  flex: 1;
  background: var(--accent);
  opacity: 0.4;
  border-radius: 1px 1px 0 0;
  transition: opacity 0.2s;
  min-height: 2px;
  position: relative;
}

.stats-bar .bar-item:hover {
  opacity: 0.8;
}

.stats-bar .bar-item .bar-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 2px;
  white-space: nowrap;
  z-index: 5;
}

.stats-bar .bar-item:hover .bar-tooltip {
  display: block;
}

/* === Pagination === */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  background: var(--bg-paper);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Flash Messages === */

.flash-messages {
  margin-bottom: 1.5rem;
}

.flash-message {
  padding: 0.8rem 1.2rem;
  margin-bottom: 0.5rem;
  border-radius: 2px;
  font-size: 0.9rem;
  border-left: 3px solid;
}

.flash-message.success {
  background: rgba(76, 175, 80, 0.1);
  border-color: #4caf50;
  color: #2e7d32;
}

.flash-message.error {
  background: rgba(244, 67, 54, 0.1);
  border-color: #f44336;
  color: #c62828;
}

/* === Content Footer === */

.content-footer {
  text-align: center;
  padding: 0.5rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-left: calc(100% - 260px);
  max-width: 260px;
}

.content-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .content-footer {
    margin-left: 0;
    max-width: none;
  }
}

/* === Footer === */

.footer {
  display: none;
}

/* === Responsive === */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    padding: 1rem;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .paper-card {
    padding: 1.5rem;
  }

  .post-header h1 {
    font-size: 1.5rem;
  }

  .post-cover {
    margin: -1.5rem -1.5rem 1rem;
  }
}

/* === Admin Charts === */

.admin-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .admin-charts {
    grid-template-columns: 1fr;
  }
}

/* === Admin Styles === */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-header h1 {
  font-size: 1.5rem;
}

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

.stat-card {
  background: rgba(139, 105, 20, 0.06);
  border: 1px solid var(--border-light);
  padding: 1.2rem;
  text-align: center;
  border-radius: 2px;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--bg-paper);
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 2px;
}

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

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

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

.btn-danger {
  background: #c62828;
  color: #fff;
  border-color: #c62828;
}

.btn-danger:hover {
  background: #e53935;
}

.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
}

/* === Admin Table === */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.admin-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: normal;
}

.admin-table tr:hover {
  background: rgba(139, 105, 20, 0.04);
}

.admin-table .actions {
  display: flex;
  gap: 0.5rem;
}

/* === Cover Upload === */

.cover-upload {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 0.3rem;
}

.cover-preview {
  width: 200px;
  height: 120px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  background-color: rgba(0,0,0,0.05);
  position: relative;
  flex-shrink: 0;
}

.cover-preview-remove {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  font-size: 1rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.cover-preview-remove:hover {
  background: rgba(198, 40, 40, 0.8);
}

.cover-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.2rem;
}

.cover-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === Admin Form === */

.admin-form label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.3rem;
  margin-top: 1rem;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-main);
  border-radius: 2px;
  transition: border-color 0.2s;
}

.admin-form input[type="text"]:focus,
.admin-form input[type="password"]:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.8);
}

.admin-form textarea {
  min-height: 400px;
  line-height: 1.7;
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

.admin-form .form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.8rem;
}

/* === Music Player === */

.sidebar-player {
  margin-top: auto;
}

.player-info {
  font-size: 0.8rem;
  color: var(--text-on-dark);
  opacity: 0.8;
  margin-bottom: 0.5rem;
  padding: 0 0.3rem;
  height: 1.3rem;
  overflow: hidden;
  position: relative;
}

.player-info-wrap {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 8s linear infinite;
  animation-play-state: paused;
}

.player-info-wrap.marquee-active {
  animation-play-state: running;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  20% { transform: translateX(0); }
  80% { transform: translateX(calc(-100% + 240px)); }
  100% { transform: translateX(calc(-100% + 240px)); }
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.player-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(184, 160, 112, 0.25);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 6px;
}

.player-btn svg {
  width: 100%;
  height: 100%;
  fill: var(--text-on-dark);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.player-btn:hover {
  border-color: var(--accent);
  background: rgba(184, 134, 11, 0.12);
}

.player-btn:hover svg {
  opacity: 1;
  fill: var(--accent);
}

.player-btn-play {
  width: 38px;
  height: 38px;
  padding: 8px;
}

.player-btn-play svg {
  opacity: 0.9;
}

.player-progress {
  padding: 0 0.3rem;
  margin-bottom: 0.2rem;
}

.player-seek {
  width: 100%;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(184, 160, 112, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.player-seek::-webkit-slider-thumb:hover {
  opacity: 1;
}

.player-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0 0.3rem;
}

/* === Login Page === */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
}

.login-box {
  background: var(--bg-paper);
  padding: 3rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.login-box .btn {
  width: 100%;
  margin-top: 1rem;
}

.login-box .form-help {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .admin-table .actions {
    flex-direction: column;
  }
}
