/* ============================================================
   StoryShare — "Literary Garden" Design System
   A story-sharing space that feels like reading in a sunlit garden.
   Organic, refined, typography-forward.
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --color-forest: #2d6a4f;
  --color-forest-dark: #1b4332;
  --color-sage: #52b788;
  --color-moss: #95d5b2;
  --color-mist: #d8f3dc;
  --color-cream: #faf7f2;
  --color-warm-white: #fffdf9;
  --color-amber: #c08552;
  --color-amber-hover: #a06d3e;
  --color-blush: #e8a598;
  --color-blush-hover: #d9897a;
  --color-ink: #1a1f1c;
  --color-ink-light: #3a4540;
  --color-stone: #78776d;
  --color-border: #e0dcd5;
  --color-border-light: #ede9e2;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(26, 31, 28, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 31, 28, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 31, 28, 0.1);
  --shadow-glow: 0 0 0 3px rgba(45, 106, 79, 0.12);

  --transition-fast: 180ms ease;
  --transition-smooth: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-cream);
  color: var(--color-ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* Subtle paper-grain texture via CSS */
  background-image:
    radial-gradient(circle at 20% 50%, rgba(45, 106, 79, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(82, 183, 136, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(149, 213, 178, 0.05) 0%, transparent 50%);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Full-page main content (replaces .container for main) */
.main-content {
  padding: 28px 32px 48px 40px;
  min-height: 100vh;
  flex: 1;
  margin-left: 0;
  transition: margin-left var(--transition-smooth);
}

/* Sidebar push: 侧边栏打开时内容区和固定元素同步右移 */
.sidebar:hover ~ .main-content,
.sidebar.open ~ .main-content {
  margin-left: 240px;
}

.sidebar:hover ~ .fab-publish,
.sidebar.open ~ .fab-publish {
  right: 28px;
}  /* FAB 不需要移动，它在右侧 */

.sidebar:hover ~ #musicPlayer,
.sidebar.open ~ #musicPlayer {
  left: 264px;
}

.sidebar:hover ~ #floatingCollapseBtn,
.sidebar.open ~ #floatingCollapseBtn {
  left: 264px;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

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

a:hover {
  color: var(--color-forest-dark);
}

/* ---- Navbar ---- */
.navbar {
  background: rgba(255, 253, 249, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--color-border-light);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-forest);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--color-forest-dark);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-tabs {
  display: flex;
  gap: 2px;
  background: var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 3px;
}

.nav-tab {
  padding: 7px 18px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-stone);
  background: transparent;
  transition: all var(--transition-smooth);
  position: relative;
}

.nav-tab:hover {
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.6);
}

.nav-tab.active {
  background: white;
  color: var(--color-forest);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-forest);
  white-space: nowrap;
  font-family: var(--font-display);
  font-style: italic;
}

.btn-logout-nav {
  background: transparent;
  color: var(--color-stone);
  border: 1px solid var(--color-border);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-logout-nav:hover {
  color: var(--color-blush);
  border-color: var(--color-blush);
  background: rgba(232, 165, 152, 0.06);
}

/* ---- Hamburger ---- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 110;
  border-radius: var(--radius-sm);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-forest);
  border-radius: 2px;
  transition: all var(--transition-smooth);
  transform-origin: center;
}

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

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

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

/* ---- Buttons ---- */
.btn {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-smooth);
  background: var(--color-border-light);
  color: var(--color-ink);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.04);
  opacity: 0;
  transition: opacity var(--transition-fast);
  border-radius: inherit;
}

.btn:hover::after {
  opacity: 1;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-glow);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-forest);
  color: white;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.25);
}

.btn-primary:hover {
  background: var(--color-forest-dark);
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-warning {
  background: var(--color-amber);
  color: white;
  box-shadow: 0 2px 8px rgba(192, 133, 82, 0.25);
}

.btn-warning:hover {
  background: var(--color-amber-hover);
  box-shadow: 0 4px 14px rgba(192, 133, 82, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--color-blush);
  color: white;
  box-shadow: 0 2px 8px rgba(232, 165, 152, 0.25);
}

.btn-danger:hover {
  background: var(--color-blush-hover);
  box-shadow: 0 4px 14px rgba(232, 165, 152, 0.35);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 15px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
}

/* ---- Main Content ---- */
main.container,
.main-content {
  flex: 1;
  padding-top: 36px;
  padding-bottom: 48px;
}

/* ---- Publish Section ---- */
.publish-section {
  background: var(--color-warm-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
}

.publish-section h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-forest);
  margin-bottom: 20px;
  font-style: italic;
}

.form-group {
  margin-bottom: 14px;
}

.form-select,
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 11px 15px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-ink);
  background: var(--color-cream);
  transition: all var(--transition-fast);
}

.form-select:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-ink);
  background: var(--color-cream);
  resize: vertical;
  line-height: 1.7;
  transition: all var(--transition-fast);
}

textarea:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

/* ---- Board / Cards ---- */
.board {
  background: var(--color-warm-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-smooth);
}

.board-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-forest);
  padding-bottom: 14px;
  border-bottom: 2px solid var(--color-mist);
  position: relative;
}

.board-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--color-forest);
  border-radius: 2px;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.board-header .board-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.board-header .board-title::after {
  display: none;
}

/* ---- Profile ---- */
.profile-block {
  margin-bottom: 24px;
}

.profile-block h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--color-ink);
  font-family: var(--font-display);
}

.profile-block form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-block .btn {
  align-self: flex-start;
}

@media (min-width: 769px) {
  .profile-block form {
    max-width: 460px;
  }
}

.profile-divider {
  margin: 24px 0;
  border: none;
  border-top: 1px solid var(--color-border-light);
}

/* ---- Post List ---- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-item {
  padding: 18px 20px;
  background: var(--color-cream);
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-moss);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.post-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-forest), var(--color-sage));
  opacity: 0;
  transition: opacity var(--transition-smooth);
  border-radius: 0 2px 2px 0;
}

.post-item:hover {
  border-left-color: var(--color-forest);
  box-shadow: 0 6px 24px rgba(26, 31, 28, 0.1);
  transform: translateX(3px);
  background: white;
}

.post-item:hover::before {
  opacity: 1;
}

.post-content {
  font-size: 0.98rem;
  line-height: 1.75;
  margin-bottom: 10px;
  word-break: break-word;
  color: var(--color-ink);
  font-family: var(--font-body);
}

.post-content.collapsed {
  max-height: 5.25em;
  overflow: hidden;
  position: relative;
}

.post-content.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5em;
  background: linear-gradient(to bottom, transparent, var(--color-cream));
  pointer-events: none;
}

.post-item:hover .post-content.collapsed::after {
  background: linear-gradient(to bottom, transparent, white);
}

.post-content.expandable {
  cursor: pointer;
  user-select: none;
}

.post-expand-btn {
  display: inline-block;
  background: none;
  border: none;
  color: var(--color-forest);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.post-expand-btn:hover {
  background: rgba(45, 106, 79, 0.08);
  color: var(--color-forest-dark);
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-stone);
}

.post-author {
  font-weight: 600;
  color: var(--color-forest);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
}

.post-date {
  color: var(--color-stone);
}

.post-actions {
  display: flex;
  gap: 8px;
}

.post-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.post-action-btn:hover {
  background: rgba(45, 106, 79, 0.06);
}

.post-action-btn-edit {
  color: var(--color-forest);
}

.post-action-btn-delete {
  color: var(--color-blush);
}

.post-action-btn-delete:hover {
  background: rgba(232, 165, 152, 0.1);
}

.empty-message {
  text-align: center;
  color: var(--color-stone);
  padding: 36px 20px;
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 20px 0;
}

.pagination button {
  padding: 8px 16px;
  border: 1.5px solid var(--color-border);
  background: var(--color-warm-white);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-ink);
  transition: all var(--transition-smooth);
}

.pagination button:hover:not(:disabled) {
  background: var(--color-forest);
  color: white;
  border-color: var(--color-forest);
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.2);
  transform: translateY(-1px);
}

.pagination button.active {
  background: var(--color-forest);
  color: white;
  border-color: var(--color-forest);
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.2);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.85rem;
  color: var(--color-stone);
  font-weight: 500;
}

/* ---- Admin Tools ---- */
.admin-tools {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-section {
  margin-bottom: 24px;
}

/* ---- User Table ---- */
.loading-text {
  text-align: center;
  color: var(--color-stone);
  padding: 32px 20px;
  font-style: italic;
}

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

.user-table th,
.user-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.user-table th {
  background: var(--color-cream);
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--color-forest);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-table tr {
  transition: background var(--transition-fast);
}

.user-table tr:hover {
  background: var(--color-mist);
}

.user-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.user-badge-admin {
  background: #fef3e2;
  color: #b45309;
}

.user-badge-user {
  background: var(--color-mist);
  color: var(--color-forest-dark);
}

.delete-user-btn {
  background: none;
  border: none;
  color: var(--color-blush);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.delete-user-btn:hover {
  background: rgba(232, 165, 152, 0.12);
  color: var(--color-blush-hover);
}

.delete-user-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Modal ---- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 31, 28, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
  animation: modalFadeIn var(--transition-smooth) both;
}

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

.modal-content {
  background: var(--color-warm-white);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 90%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-light);
  animation: modalSlideUp var(--transition-spring) both;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-forest);
  margin-bottom: 24px;
  text-align: center;
}

.modal-content input {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-ink);
  background: var(--color-cream);
  transition: all var(--transition-fast);
}

.modal-content input:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

.close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.6rem;
  font-weight: 300;
  cursor: pointer;
  color: var(--color-stone);
  line-height: 1;
  transition: all var(--transition-fast);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close:hover {
  color: var(--color-ink);
  background: var(--color-border-light);
}

.modal-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--color-stone);
}

.modal-footer a {
  color: var(--color-forest);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.modal-footer a:hover {
  color: var(--color-forest-dark);
  text-decoration: underline;
}

.modal-lg {
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--color-stone);
  font-size: 0.82rem;
  margin-top: auto;
  border-top: 1px solid var(--color-border-light);
}

.footer p {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.01em;
}

/* ---- Announcement Board ---- */
.announcement-board {
  background: var(--color-warm-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.announcement-board::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-forest), var(--color-sage), var(--color-moss));
}

.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.announcement-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-forest);
}

.announcement-admin {
  display: flex;
  gap: 8px;
  align-items: center;
}

.theme-input {
  padding: 7px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-ink);
  background: var(--color-cream);
  width: 200px;
  transition: all var(--transition-fast);
}

.theme-input:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

.announcement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.announcement-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-mist), #e0f0e6);
  color: var(--color-forest-dark);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  animation: fadeInUp var(--transition-smooth) both;
  cursor: default;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 4px rgba(45, 106, 79, 0.06);
}

.announcement-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(45, 106, 79, 0.12);
}

.announcement-theme {
  font-family: var(--font-display);
  font-style: italic;
}

.announcement-date {
  font-size: 0.72rem;
  color: var(--color-stone);
  font-family: var(--font-body);
  font-style: normal;
}

.announcement-delete-btn {
  background: none;
  border: none;
  color: var(--color-stone);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  transition: color var(--transition-fast);
}

.announcement-delete-btn:hover {
  color: var(--color-blush);
}

/* ---- Filter Bar ---- */
.filter-bar {
  background: var(--color-warm-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-stone);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-display);
}

.filter-select,
.filter-input {
  padding: 8px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-ink);
  background: var(--color-cream);
  min-width: 130px;
  transition: all var(--transition-fast);
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

.filter-input[type="date"] {
  min-width: 140px;
}

.filter-input[placeholder] {
  min-width: 120px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 0;
}

/* ---- Post Theme Tag ---- */
.post-theme-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-mist), #e0f0e6);
  color: var(--color-forest-dark);
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  font-style: italic;
  vertical-align: middle;
  transition: all var(--transition-fast);
}

/* ---- User Table Scrollable ---- */
#userManageContent {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Staggered Entrance Animation ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-content {
  animation: fadeInUp var(--transition-smooth) both;
}

.post-item:nth-child(1) { animation-delay: 0ms; }
.post-item:nth-child(2) { animation-delay: 60ms; }
.post-item:nth-child(3) { animation-delay: 120ms; }
.post-item:nth-child(4) { animation-delay: 180ms; }
.post-item:nth-child(5) { animation-delay: 240ms; }
.post-item:nth-child(6) { animation-delay: 300ms; }
.post-item:nth-child(7) { animation-delay: 360ms; }
.post-item:nth-child(8) { animation-delay: 420ms; }

.post-item {
  animation: fadeInUp var(--transition-smooth) both;
}

/* ---- Album Grid ---- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.album-card {
  background: var(--color-cream);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
}

.album-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-moss);
}

.album-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-forest);
  margin-bottom: 8px;
  font-style: italic;
}

.album-card-desc {
  font-size: 0.85rem;
  color: var(--color-stone);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.album-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--color-stone);
}

.album-card-author {
  font-weight: 600;
  color: var(--color-amber);
  font-family: var(--font-display);
  font-style: italic;
}

.album-card-count {
  background: var(--color-mist);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-forest-dark);
}

.album-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 6px;
}

.album-badge-public {
  background: var(--color-mist);
  color: var(--color-forest-dark);
}

.album-badge-private {
  background: #fef3e2;
  color: #b45309;
}

.album-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.album-card-actions .btn {
  font-size: 0.72rem;
  padding: 3px 10px;
}

.album-card-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 0.72rem;
  font-family: var(--font-body);
  color: var(--color-stone);
  padding: 3px 10px;
  border-radius: 12px;
  transition: all var(--transition-fast);
  margin-right: 6px;
}

.album-card-comment-btn:hover {
  color: var(--color-forest);
  border-color: var(--color-sage);
  background: var(--color-mist);
}

/* ---- Album Layout (main + sidebar) ---- */
.album-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

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

.album-main .board-title {
  margin-bottom: 20px;
}

/* ---- Album Sidebar ---- */
.album-sidebar {
  flex-shrink: 0;
  width: 280px;
  position: sticky;
  top: 24px;
}

.album-sidebar-card {
  background: var(--color-warm-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.album-sidebar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-forest), var(--color-sage), var(--color-moss));
}

.album-sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-mist);
  color: var(--color-forest);
  margin-bottom: 14px;
}

.album-sidebar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-forest);
  margin-bottom: 4px;
}

.album-sidebar-desc {
  font-size: 0.8rem;
  color: var(--color-stone);
  margin-bottom: 18px;
  line-height: 1.5;
}

.album-sidebar-card .form-group {
  margin-bottom: 12px;
}

.album-sidebar-card .form-input,
.album-sidebar-card .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-ink);
  background: var(--color-cream);
  transition: all var(--transition-fast);
}

.album-sidebar-card .form-input:focus,
.album-sidebar-card .form-textarea:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

.album-sidebar-card .btn-block {
  width: 100%;
}

/* ---- Album Public Toggle ---- */
.album-public-toggle {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 12px;
  position: relative;
  transition: background var(--transition-fast);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-label input:checked + .toggle-switch {
  background: var(--color-forest);
}

.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-text {
  font-size: 0.88rem;
  color: var(--color-ink);
  font-weight: 500;
}

/* ---- Album Detail ---- */
.album-detail-info {
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.album-detail-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-forest);
  font-style: italic;
}

.album-detail-desc {
  font-size: 0.9rem;
  color: var(--color-stone);
  margin-top: 6px;
}

.album-detail-meta {
  font-size: 0.82rem;
  color: var(--color-stone);
  margin-top: 8px;
}

.album-detail-actions {
  display: flex;
  gap: 6px;
}

/* ---- Album Entry Form ---- */
.album-entry-form {
  background: var(--color-cream);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.album-entry-form textarea {
  width: 100%;
  margin-bottom: 10px;
}

/* ---- Album Entry List ---- */
.album-entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.album-entry-item {
  padding: 14px 16px;
  background: var(--color-cream);
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-sage);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all var(--transition-smooth);
}

.album-entry-item:hover {
  background: white;
  box-shadow: var(--shadow-sm);
}

.album-entry-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-forest-dark);
  line-height: 1.4;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.album-entry-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-ink);
  margin-bottom: 8px;
}

.album-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--color-stone);
}

.album-entry-actions {
  display: flex;
  gap: 6px;
}

.album-entry-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: var(--color-stone);
  padding: 2px 10px;
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.album-entry-comment-btn:hover {
  color: var(--color-forest);
  border-color: var(--color-sage);
  background: var(--color-mist);
}

.album-entry-edit-btn,
.album-entry-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.album-entry-edit-btn {
  color: var(--color-forest);
}

.album-entry-edit-btn:hover {
  background: rgba(45, 106, 79, 0.08);
}

.album-entry-delete-btn {
  color: var(--color-blush);
}

.album-entry-delete-btn:hover {
  background: rgba(232, 165, 152, 0.1);
}

/* ---- Admin Album List ---- */
.admin-album-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-album-item {
  background: var(--color-cream);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.admin-album-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-moss);
}

.admin-album-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.admin-album-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-forest);
  font-style: italic;
}

.admin-album-author {
  font-size: 0.85rem;
  color: var(--color-amber);
  font-weight: 600;
}

.admin-album-meta {
  font-size: 0.8rem;
  color: var(--color-stone);
}

.admin-album-entries {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-light);
}

.admin-album-entry {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--color-ink);
  border-bottom: 1px dashed var(--color-border-light);
}

.admin-album-entry:last-child {
  border-bottom: none;
}

.admin-album-entry-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-forest-dark);
  margin-bottom: 4px;
}

.admin-album-entry-date {
  font-size: 0.72rem;
  color: var(--color-stone);
}

/* ---- Comment Panel ---- */
.comment-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 31, 28, 0.3);
  z-index: 250;
  transition: opacity var(--transition-smooth);
}

.comment-overlay.show {
  display: block;
}

.comment-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--color-warm-white);
  box-shadow: var(--shadow-lg);
  z-index: 260;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-smooth);
  border-left: 1px solid var(--color-border-light);
}

.comment-panel.show {
  right: 0;
}

.comment-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.comment-panel-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-forest);
  font-style: italic;
}

.comment-panel-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-stone);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}

.comment-panel-close:hover {
  color: var(--color-ink);
  background: var(--color-border-light);
}

.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  padding: 12px 14px;
  background: var(--color-cream);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.comment-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-forest);
  font-family: var(--font-display);
  font-style: italic;
}

.comment-date {
  font-size: 0.72rem;
  color: var(--color-stone);
}

.comment-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-ink);
}

.comment-delete-btn {
  background: none;
  border: none;
  color: var(--color-stone);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 4px;
  transition: color var(--transition-fast);
  line-height: 1;
}

.comment-delete-btn:hover {
  color: var(--color-blush);
}

.comment-pagination {
  padding: 8px 20px;
  margin-top: 0;
  border-top: 1px solid var(--color-border-light);
}

.comment-form-wrapper {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  resize: none;
}

.comment-form .btn {
  align-self: flex-end;
}

/* ---- Floating Collapse Button ---- */
.floating-collapse-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  z-index: 270;
  transition: left var(--transition-smooth), all var(--transition-smooth);
  padding: 10px 18px;
  background: var(--color-forest);
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.35);
  transition: all var(--transition-smooth);
  animation: fadeInUp var(--transition-smooth) both;
}

.floating-collapse-btn:hover {
  background: var(--color-forest-dark);
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.45);
  transform: translateY(-2px);
}

.floating-collapse-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ---- Post Comment Indicator ---- */
.post-comment-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--color-forest);
  cursor: pointer;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  background: none;
  border: none;
  font-family: var(--font-body);
}

.post-comment-indicator:hover {
  background: rgba(45, 106, 79, 0.08);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .container {
    padding: 0 14px;
  }

  /* --- Mobile Navbar --- */
  .navbar {
    padding: 10px 0;
  }

  .navbar .container {
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
  }

  .hamburger {
    display: flex;
    order: -1;
  }

  .nav-left {
    flex: 1;
    min-width: 0;
  }

  .logo {
    font-size: 1.3rem;
  }

  .nav-tabs {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 253, 249, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 60px 24px;
    z-index: 105;
    border-radius: 0;
    animation: fadeInUp 200ms ease both;
  }

  .nav-tabs.open {
    display: flex;
  }

  .nav-tab {
    font-size: 1.1rem;
    padding: 14px 28px;
    width: 100%;
    max-width: 280px;
    text-align: center;
    border-radius: var(--radius-md);
  }

  .nav-right {
    gap: 6px;
  }

  .user-info {
    gap: 6px;
  }

  .user-name {
    font-size: 0.82rem;
  }

  .btn-logout-nav {
    font-size: 0.72rem;
    padding: 3px 10px;
  }

  /* --- Mobile Main --- */
  main.container {
    padding-top: 20px;
    padding-bottom: 36px;
  }

  .board {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .board-title {
    font-size: 1.25rem;
  }

  .publish-section {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .publish-section h2 {
    font-size: 1.1rem;
  }

  /* --- Mobile Filter --- */
  .filter-bar {
    padding: 14px;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-item {
    flex-direction: column;
    gap: 3px;
  }

  .filter-select,
  .filter-input,
  .filter-input[type="date"] {
    min-width: auto;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .btn {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  /* --- Mobile Posts --- */
  .post-list {
    gap: 10px;
  }

  .post-item {
    padding: 14px 14px;
    border-left-width: 3px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }

  .post-content {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .post-actions {
    align-self: flex-end;
  }

  .post-action-btn {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  /* --- Mobile Announcements --- */
  .announcement-board {
    padding: 16px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
  }

  .announcement-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .announcement-title {
    font-size: 1.05rem;
  }

  .announcement-admin {
    flex-direction: column;
    gap: 8px;
  }

  .theme-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.88rem;
  }

  .announcement-list {
    gap: 6px;
  }

  .announcement-item {
    font-size: 0.8rem;
    padding: 4px 12px;
  }

  /* --- Mobile Modals --- */
  .modal-content {
    width: 92%;
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }

  .modal-content h2 {
    font-size: 1.25rem;
  }

  /* --- Mobile Forms --- */
  .form-select,
  input[type="text"],
  input[type="password"],
  textarea {
    padding: 11px 13px;
    font-size: 0.92rem;
  }

  textarea {
    min-height: 100px;
  }

  /* --- Mobile Board Header --- */
  .board-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .board-header .board-title {
    text-align: center;
  }

  /* --- Mobile Pagination --- */
  .pagination {
    gap: 4px;
    margin-top: 24px;
  }

  .pagination button {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  /* --- Mobile Profile --- */
  .profile-block h3 {
    font-size: 1rem;
  }

  /* --- Mobile User Table --- */
  .user-table {
    font-size: 0.78rem;
  }

  .user-table th,
  .user-table td {
    padding: 8px 6px;
  }

  .user-table thead {
    display: none;
  }

  .user-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    padding: 12px 0;
    border-bottom: 2px solid var(--color-mist);
  }

  .user-table tbody td {
    padding: 4px 6px;
    border-bottom: none;
  }

  .user-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--color-forest);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
  }

  /* --- Mobile Album Layout --- */
  .album-layout {
    flex-direction: column;
  }

  .album-sidebar {
    width: 100%;
    position: static;
    order: -1;
  }

  /* --- Mobile Album Grid --- */
  .album-grid {
    grid-template-columns: 1fr;
  }

  .album-card {
    padding: 14px;
  }

  /* --- Mobile Album Detail --- */
  .album-detail-name {
    font-size: 1.2rem;
  }

  .album-detail-actions {
    flex-direction: column;
    gap: 4px;
  }

  .album-entry-title {
    font-size: 1.05rem;
  }

  /* --- Mobile Comment Panel --- */
  .comment-panel {
    right: -100%;
    width: 100%;
    max-width: 100%;
  }

  .floating-collapse-btn {
    right: auto;
    left: 12px;
    bottom: 16px;
  }

  /* --- Mobile Admin Albums --- */
  .admin-album-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* --- Admin tools --- */
  .admin-tools {
    flex-direction: column;
  }

  .admin-tools .btn {
    width: 100%;
  }
}

/* --- Small Mobile --- */
@media (max-width: 400px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 10px;
  }

  .logo {
    font-size: 1.15rem;
  }

  .nav-tab {
    font-size: 1rem;
    padding: 12px 20px;
  }

  .board {
    padding: 14px 10px;
  }

  .publish-section {
    padding: 14px 10px;
  }

  .post-item {
    padding: 12px 10px;
  }

  .post-content {
    font-size: 0.9rem;
  }

  .board-title {
    font-size: 1.15rem;
  }

  .btn {
    font-size: 0.82rem;
  }

  .btn-sm {
    font-size: 0.76rem;
    padding: 5px 10px;
  }

  .modal-content {
    padding: 18px 14px;
    width: 96%;
  }

  .filter-bar {
    padding: 10px;
  }

  .announcement-board {
    padding: 12px 10px;
  }

  .user-table tbody tr {
    grid-template-columns: 1fr 1fr;
    font-size: 0.74rem;
  }
}

/* ---- Reduced Motion ---- */
/* ---- Music Player (NetEase iframe) ---- */
.music-player {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 280;
  transition: left var(--transition-smooth);
}

.music-toggle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-light);
  background: var(--color-warm-white);
  color: #ec4141;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-smooth);
  z-index: 2;
  position: relative;
}

.music-toggle-btn:hover {
  background: #ec4141;
  color: white;
  border-color: #ec4141;
  box-shadow: 0 4px 16px rgba(236, 65, 65, 0.35);
  transform: translateY(-2px);
}

.music-toggle-btn:active {
  transform: translateY(0) scale(0.95);
}

.music-panel {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 340px;
  background: var(--color-warm-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: musicPanelIn var(--transition-smooth) both;
}

.music-panel.show {
  display: flex;
}

@keyframes musicPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.music-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
  background: linear-gradient(135deg, #fef5f5, var(--color-warm-white));
}

.music-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  font-style: italic;
  color: #ec4141;
}

.music-panel-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--color-stone);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: all var(--transition-fast);
}

.music-panel-close:hover {
  color: var(--color-ink);
  background: var(--color-border-light);
}

.music-config {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.music-config-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.music-type-select {
  padding: 8px 10px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--color-ink);
  background: var(--color-cream);
  cursor: pointer;
  flex-shrink: 0;
}

.music-type-select:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
}

.music-id-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--color-ink);
  background: var(--color-cream);
}

.music-id-input:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

.music-config-hint {
  font-size: 0.7rem;
  color: var(--color-stone);
  margin-top: 6px;
  line-height: 1.5;
}

.music-config-hint a {
  color: var(--color-forest);
}

.music-config-hint b {
  color: #ec4141;
}

.music-iframe-wrapper {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-iframe-wrapper iframe {
  display: block;
  width: 100%;
  border: none;
}

/* Mobile */
@media (max-width: 768px) {
  .music-player {
    bottom: 16px;
    left: 12px;
  }

  .music-toggle-btn {
    width: 42px;
    height: 42px;
  }

  .music-panel {
    width: calc(100vw - 24px);
    max-width: 340px;
    bottom: 54px;
  }
}

@media (max-width: 400px) {
  .music-player {
    bottom: 12px;
    left: 8px;
  }

  .music-toggle-btn {
    width: 38px;
    height: 38px;
  }

  .music-panel {
    width: calc(100vw - 16px);
    bottom: 48px;
    left: -4px;
  }
}

/* ============================================================
   Sidebar Navigation
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 150;
  display: flex;
}

.sidebar-trigger {
  width: 5vw;
  min-width: 20px;
  max-width: 80px;
  height: 100vh;
  flex-shrink: 0;
  cursor: pointer;
  z-index: 2;
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(to right, rgba(45, 106, 79, 0.03), transparent);
}

.sidebar-inner {
  width: 240px;
  height: 100%;
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  transform: translateX(-100%);
  transition: transform var(--transition-smooth);
  overflow-y: auto;
  box-shadow: 2px 0 24px rgba(26, 31, 28, 0.08);
}

.sidebar:hover .sidebar-inner,
.sidebar.open .sidebar-inner {
  transform: translateX(0);
}

.sidebar-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 16px;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-forest);
  text-decoration: none;
  letter-spacing: -0.02em;
  cursor: pointer;
  user-select: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav .nav-tab {
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-stone);
  background: transparent;
  text-align: left;
  transition: all var(--transition-smooth);
  width: 100%;
}

.sidebar-nav .nav-tab:hover {
  color: var(--color-forest);
  background: var(--color-mist);
}

.sidebar-nav .nav-tab.active {
  background: var(--color-forest);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.25);
}

.sidebar-nav .nav-tab-admin {
  /* admin tabs share the same styles */
}

.sidebar-user {
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-username {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  color: var(--color-forest);
  cursor: pointer;
  font-size: 1rem;
  transition: color var(--transition-fast);
}

.sidebar-username:hover {
  color: var(--color-forest-dark);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 31, 28, 0.35);
  z-index: 140;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
  display: block;
}

/* ============================================================
   Mobile Topbar (always visible logo on mobile)
   ============================================================ */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 145;
  padding: 12px 16px;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border-light);
  text-align: center;
}

.mobile-topbar-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-forest);
  text-decoration: none;
  letter-spacing: -0.02em;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-topbar {
    display: block;
  }
}

/* Layout mode: topbar fallback */
body.layout-topbar .sidebar { display: none; }
body.layout-topbar .sidebar-overlay { display: none; }
body.layout-topbar .main-content { margin-left: 0; padding: 28px 24px 48px; }
body.layout-topbar .fab-publish { display: none; }

/* ============================================================
   FAB Publish Button
   ============================================================ */
.fab-publish {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 130;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-forest);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.4);
  transition: all var(--transition-spring);
}

.fab-publish:hover {
  background: var(--color-forest-dark);
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 28px rgba(45, 106, 79, 0.5);
}

.fab-publish:active {
  transform: scale(0.95);
}

.fab-publish svg {
  width: 24px;
  height: 24px;
}

/* ============================================================
   Personal Center Modal
   ============================================================ */
.nav-layout-options {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.nav-layout-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.nav-layout-option:hover {
  border-color: var(--color-sage);
  background: var(--color-mist);
}

.nav-layout-option input[type="radio"] {
  accent-color: var(--color-forest);
}

.nav-layout-option input:checked + span {
  color: var(--color-forest);
  font-weight: 600;
}

/* ============================================================
   Update Notification Modal
   ============================================================ */
.update-content {
  margin-bottom: 20px;
}

.update-info-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-ink);
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--color-mist);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-forest);
}

.update-features-list {
  list-style: none;
  padding: 0;
}

.update-features-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 0.92rem;
  color: var(--color-stone);
  line-height: 1.5;
}

.update-features-list li::before {
  content: '✦';
  position: absolute;
  left: 2px;
  color: var(--color-forest);
  font-weight: bold;
  font-size: 0.75rem;
  top: 10px;
}

/* ============================================================
   Theme Management Admin
   ============================================================ */
.theme-admin-input {
  padding: 8px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-ink);
  background: var(--color-cream);
  width: 260px;
  transition: all var(--transition-fast);
}

.theme-admin-input:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-glow);
  background: white;
}

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.theme-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-cream);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.theme-list-item:hover {
  background: white;
  box-shadow: var(--shadow-sm);
}

.theme-list-item span {
  font-size: 0.92rem;
  color: var(--color-ink);
  font-weight: 500;
}

/* ============================================================
   Responsive: Mobile Sidebar
   ============================================================ */
@media (max-width: 768px) {
  .sidebar-trigger {
    display: none;
  }

  .sidebar:not(.open) .sidebar-inner {
    transform: translateX(-100%);
  }

  .sidebar.open .sidebar-inner {
    transform: translateX(0);
  }

  /* Mobile: sidebar overlays, don't push content */
  .sidebar:hover ~ .main-content,
  .sidebar.open ~ .main-content {
    margin-left: 0;
  }

  .sidebar:hover ~ #musicPlayer,
  .sidebar.open ~ #musicPlayer {
    left: 24px;
  }

  .sidebar:hover ~ #floatingCollapseBtn,
  .sidebar.open ~ #floatingCollapseBtn {
    left: 24px;
  }

  .main-content {
    padding: 60px 14px 60px 14px;  /* top padding for mobile topbar */
  }

  .fab-publish {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  .fab-publish svg {
    width: 22px;
    height: 22px;
  }

  .sidebar-inner {
    width: 100%;
    max-width: 280px;
  }
}

/* ============================================================
   Responsive: Mobile Publish Modal
   ============================================================ */
@media (max-width: 768px) {
  #publishModal .modal-content,
  #profileModal .modal-content,
  #updateModal .modal-content {
    width: 92vw;
    margin: 20px auto;
    padding: 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
