:root {
  color-scheme: dark;
  font-family: "SF Pro Display", "Segoe UI", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  background: #0b1220;
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.is-lightbox-open {
  overflow: hidden;
}


.app-root {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 100vh;
  background: url("assets/wallpaper.png") center / cover no-repeat fixed;
}

.app-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 30, 0.65);
  backdrop-filter: blur(12px);
  z-index: 0;
}

.app-root > * {
  position: relative;
  z-index: 1;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(2rem, 6vw, 4rem);
  backdrop-filter: blur(10px);
}

.dock {
  width: clamp(72px, 8vw, 92px);
  padding: clamp(1.5rem, 5vh, 2.5rem) 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  background: rgba(11, 18, 35, 0.78);
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(14px);
  transition: width 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.dock-user-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.dock-user {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 24px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dock-user:hover {
  border-color: rgba(94, 234, 212, 0.35);
  transform: translateY(-2px);
}

.dock-avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.65), rgba(16, 185, 129, 0.65));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #f8fafc;
}

.dock-user-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.dock-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc;
}

.dock-user-role {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.18);
  color: #5eead4;
}

.dock-nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  align-items: center;
}

.dock-button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 0.5rem;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: #cbd5f5;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dock-button:hover,
.dock-button.is-active {
  background: rgba(59, 130, 246, 0.18);
  color: #f8fafc;
  transform: translateY(-2px);
}

.dock-icon {
  font-size: 1.4rem;
}

.dock-label {
  font-size: 0.75rem;
  font-weight: 600;
}

body.is-dock-collapsed .dock {
  width: 0;
  padding: 0;
  opacity: 0;
  border-right: none;
  pointer-events: none;
}


.app-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.header-info {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}

.clock-time {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f8fafc;
  text-shadow: 0 10px 30px rgba(8, 11, 22, 0.6);
}

.clock-meta {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  letter-spacing: 0.08em;
  color: #cbd5f5;
}

.header-actions {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover,
.icon-button[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(96, 165, 250, 0.45);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 6vh, 3.25rem);
  position: relative;
  padding-bottom: 6.5rem;
}

.home-screen {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(0.5rem, 3vh, 2rem) 0;
}

.home-inner {
  width: min(1180px, 100%);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vh, 2.5rem);
  align-items: center;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(360px, 0.9fr);
  gap: clamp(1.5rem, 3vw, 2.25rem);
  align-items: start;
  justify-content: center;
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
  width: 100%;
  max-width: 900px;
}

@media (max-width: 960px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .calendar-panel {
    order: 2;
  }
}

.search-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 24px 60px rgba(7, 11, 23, 0.45);
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.search-engine-select {
  position: relative;
}

.search-engine-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.search-engine-button:hover,
.search-engine-button[aria-expanded="true"] {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(96, 165, 250, 0.45);
  color: #f8fafc;
}

.search-engine-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.search-engine-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 18px 40px rgba(8, 11, 22, 0.45);
  z-index: 20;
}

.search-engine-menu[hidden] {
  display: none;
}

.search-engine-menu button {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #cbd5f5;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.search-engine-menu button:hover,
.search-engine-menu button[aria-selected="true"] {
  background: rgba(59, 130, 246, 0.18);
  color: #f8fafc;
}

#search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #f8fafc;
  font-size: clamp(1rem, 3vw, 1.2rem);
  outline: none;
}

#search-input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.search-submit {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(14, 165, 233, 0.85));
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(14, 165, 233, 0.35);
}

.search-submit svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.shortcut-toolbar {
  background: rgba(15, 23, 42, 0.78);
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: clamp(1.5rem, 4vw, 2rem);
  box-shadow: 0 28px 60px rgba(7, 11, 23, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.shortcut-list {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shortcut-item {
  list-style: none;
}

.shortcut-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #f8fafc;
  padding: 0.55rem 0.4rem;
  border-radius: 18px;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.shortcut-link:hover {
  transform: translateY(-4px);
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.14);
}

.shortcut-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shortcut-icon img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(7, 11, 23, 0.4));
}

.shortcut-icon--text {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: #f8fafc;
}

.shortcut-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: #e2e8f0;
}

.shortcut-empty {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.7);
}

.shortcut-hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.75);
}

.calendar-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 24px 60px rgba(7, 11, 23, 0.45);
  padding: 1rem 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  width: 100%;
  max-width: 430px;
  justify-self: end;
}

.calendar-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calendar-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.calendar-month-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
}

.calendar-today {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.calendar-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.calendar-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #cbd5f5;
  font-size: 0.95rem;
}

.calendar-select select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  padding: 0.5rem 0.75rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.calendar-weekday {
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
}

.calendar-day {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 0.65rem 0;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.calendar-day:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.35);
}

.calendar-day.is-empty {
  visibility: hidden;
}

.calendar-day.is-today {
  border-color: rgba(52, 211, 153, 0.65);
  color: #34d399;
}

.calendar-day.is-selected {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(96, 165, 250, 0.6);
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.25);
}

.calendar-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.75rem;
  color: #cbd5f5;
  font-size: 0.95rem;
}

body.is-dock-collapsed .shortcut-toolbar {
  display: none;
}

body.is-dock-collapsed .calendar-panel {
  display: none;
}

.shortcut-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 24, 0.78);
  backdrop-filter: blur(8px);
  z-index: 1200;
}

.shortcut-dialog {
  position: relative;
  width: min(360px, 92vw);
  padding: 2.25rem 2.5rem 2rem;
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 60px rgba(7, 11, 23, 0.55);
}

.shortcut-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
}

.shortcut-close:hover {
  color: #f8fafc;
}

.shortcut-dialog h2 {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  color: #f8fafc;
}

.shortcut-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.shortcut-field span {
  font-size: 0.9rem;
  color: #cbd5f5;
}

.shortcut-field input {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font: inherit;
}

.shortcut-field input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.shortcut-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.shortcut-modal[hidden] {
  display: none;
}

.site-footer {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  width: min(1040px, 92%);
  padding: 0.9rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(7, 11, 23, 0.35);
  backdrop-filter: blur(8px);
  z-index: 900;
}

.site-footer__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.5rem;
  color: #cbd5f5;
}

.site-footer__stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.site-footer__stat strong {
  color: #f8fafc;
  font-weight: 600;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: #60a5fa;
}
.app-shell,
.resume-section,
.community-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resume-section {
  padding: 3rem clamp(1.5rem, 5vw, 6rem);
  gap: 2rem;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.2), transparent 60%),
    rgba(15, 23, 42, 0.9);
}

.resume-header,
.community-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.resume-header h1,
.community-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: #f8fafc;
}

.resume-header p,
.community-header p {
  margin: 0.35rem 0 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

.resume-content {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.resume-card {
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resume-card h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #f1f5f9;
}

.resume-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.resume-card p {
  margin: 0;
  color: #cbd5f5;
  line-height: 1.6;
}

.resume-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resume-tags li {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.25);
  color: #dbeafe;
  font-size: 0.85rem;
}

.resume-project header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.resume-project h3 {
  margin: 0;
  font-size: 1rem;
  color: #f8fafc;
}

.resume-project span {
  font-size: 0.85rem;
  color: #94a3b8;
}

.community-section {
  padding: 3rem clamp(1.5rem, 5vw, 6rem);
  gap: 2rem;
  background: radial-gradient(circle at bottom, rgba(236, 72, 153, 0.22), transparent 60%),
    rgba(15, 23, 42, 0.92);
}

.community-placeholder {
  padding: 2rem;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  color: #cbd5f5;
  font-size: 1rem;
  line-height: 1.6;
  background: rgba(15, 23, 42, 0.65);
}

.verification-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.verification-dialog {
  width: min(360px, 90%);
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  padding: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.verification-dialog h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
  text-align: center;
}

.verification-dialog input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
}

.verification-dialog input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.verification-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
}

.auth-dialog {
  width: min(420px, 92%);
  background: rgba(15, 23, 42, 0.95);
  border-radius: 20px;
  padding: 2.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.55);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.auth-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5f5;
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.auth-close:hover {
  transform: none;
  box-shadow: none;
  background: rgba(148, 163, 184, 0.35);
}

.auth-dialog h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #f8fafc;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #cbd5f5;
  font-size: 0.95rem;
}

.auth-field input {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.code-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.code-input-group input {
  flex: 1;
}

.code-input-group .ghost-button {
  white-space: nowrap;
}

.auth-hint {
  margin: 0;
  color: #94a3b8;
  font-size: 0.85rem;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.auth-links .link-button {
  font-size: 0.9rem;
}

.barrage {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff7f7;
  font-size: 0.95rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 18px 40px rgba(239, 68, 68, 0.25);
  z-index: 120;
}

.barrage.show {
  animation: barrage-fly 2s ease-out forwards;
}

.barrage.fade-out {
  opacity: 0;
}

@keyframes barrage-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
}

.top-bar {
  flex-shrink: 0;
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-panel .ghost-button {
  padding: 0.4rem 0.85rem;
}

.auth-user-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

.auth-panel.is-auth .auth-user-label {
  color: #e2e8f0;
}

.auth-label-prefix {
  margin-right: 0.25rem;
}

.auth-username {
  font-weight: 600;
  color: #f8fafc;
}

.auth-user-label.has-role .auth-username {
  margin-right: 0.35rem;
}

.auth-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  background: linear-gradient(135deg, #facc15, #f97316);
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.35);
}

.top-bar-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.link-button {
  background: none;
  color: #60a5fa;
  padding: 0;
  box-shadow: none;
}

.link-button:hover {
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.top-bar {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-bar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #f8fafc;
}

.status {
  min-width: 12rem;
  text-align: right;
  font-size: 0.9rem;
}

.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 320px;
  background: rgba(15, 23, 42, 0.65);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: 640px;
  flex: none;
}

.sidebar-resizer {
  width: 6px;
  cursor: col-resize;
  background: rgba(148, 163, 184, 0.1);
  transition: background 0.2s ease;
  flex: none;
  align-self: stretch;
  min-height: 100%;
}

.sidebar-resizer:hover,
body.resizing .sidebar-resizer {
  background: rgba(96, 165, 250, 0.35);
}

body.resizing {
  cursor: col-resize;
}

.tree-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.tree-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.root-path {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  word-break: break-all;
}

.tree {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.25rem 1rem 0.75rem;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
}

.tree-root {
  padding-left: 0;
}

.tree-node {
  margin: 0.2rem 0;
}

.tree-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  position: relative;
}

.tree-node.selected > .tree-row {
  background: rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.tree-toggle {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}

.tree-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #f8fafc;
}

.tree-leaf-placeholder {
  width: 1.2rem;
  height: 1.2rem;
}

.tree-label {
  background: transparent;
  border: none;
  text-align: left;
  color: #e2e8f0;
  font-size: 0.95rem;
  padding: 0.35rem 0.2rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-label.directory::before {
  content: "📁";
}

.tree-label.file::before {
  content: "📄";
}

.tree-label:hover {
  color: #93c5fd;
}

.tree-menu-button {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
}

.tree-menu-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tree-menu-button:disabled:hover {
  background: transparent;
  color: #94a3b8;
}

.tree-menu-button:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #f8fafc;
}

.context-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0.5rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.45);
  padding: 0.4rem 0;
  min-width: 160px;
  z-index: 20;
}

.context-menu button {
  width: 100%;
  background: transparent;
  color: #cbd5f5;
  padding: 0.45rem 1rem;
  text-align: left;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.context-menu button:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #f8fafc;
}

.context-menu button:disabled {
  opacity: 0.4;
}

.dock-menu {
  position: fixed;
  min-width: 180px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.45);
  padding: 0.25rem 0;
  z-index: 1100;
}

.dock-menu[hidden] {
  display: none;
}

.dock-menu button {
  width: 100%;
  border: none;
  background: transparent;
  color: #e2e8f0;
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.dock-menu button:hover {
  background: rgba(59, 130, 246, 0.22);
}

.dock-menu__check {
  width: 1.25rem;
  text-align: center;
  color: #34d399;
}

.dock-menu button[aria-checked="false"] .dock-menu__check {
  visibility: hidden;
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.85));
  padding: 1.5rem 2rem;
  gap: 1rem;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.25);
  color: #bfdbfe;
  font-size: 0.85rem;
  width: fit-content;
}

.upload-progress-bar {
  position: relative;
  width: 160px;
  height: 6px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.2);
  overflow: hidden;
}

.upload-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #a855f7);
  transition: width 0.15s ease;
}

.upload-progress-text {
  min-width: 80px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-info {
  font-size: 0.95rem;
  color: #94a3b8;
}

.panel-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.panel-actions-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.panel-actions-group[hidden] {
  display: none !important;
}

.panel-actions button:disabled {
  background: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
  box-shadow: none;
}

.primary-button {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.28);
}

.primary-button:hover {
  box-shadow: 0 22px 50px rgba(37, 99, 235, 0.35);
}

.ghost-button,
.panel-actions button:nth-of-type(3) {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  box-shadow: none;
}

.ghost-button:hover,
.panel-actions button:nth-of-type(3):hover {
  background: rgba(148, 163, 184, 0.22);
  box-shadow: none;
  transform: none;
}

.empty-state {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  text-align: left;
  color: #94a3b8;
  background: transparent;
}

.empty-state p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #94a3b8;
}

.article-workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 1rem 1.25rem;
}

.article-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-toolbar h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #f8fafc;
}

.article-toolbar p {
  margin: 0.25rem 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.article-toolbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.article-content {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 1.5rem;
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1rem;
}

.article-sidebar h3 {
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
}

.article-column-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-column-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-column-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.article-column-delete {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.75rem;
}

.article-column-delete:hover {
  background: rgba(248, 113, 113, 0.2);
}

.article-column-button {
  flex: 1;
  text-align: left;
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.article-column-button:hover {
  background: rgba(59, 130, 246, 0.35);
}

.article-column-button.is-active {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(37, 99, 235, 0.35);
}

.article-column-children {
  margin-left: 1rem;
  padding-left: 0.75rem;
  border-left: 1px dashed rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.article-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.article-list-container {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.article-list-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
}

.article-list-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.article-filter select {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  color: #e2e8f0;
}

.article-filter-mine {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.article-list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.article-list-item:hover {
  background: rgba(37, 99, 235, 0.32);
}

.article-list-item.is-active {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(30, 64, 175, 0.35);
}

.article-list-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
}

.article-list-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.article-empty {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.article-preview {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-preview h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #f8fafc;
}

.article-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.article-content-display {
  line-height: 1.7;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-content-display h1,
.article-content-display h2,
.article-content-display h3,
.article-content-display h4,
.article-content-display h5,
.article-content-display h6 {
  color: #f8fafc;
  margin: 0.75rem 0 0.5rem;
}

.article-content-display pre {
  background: rgba(15, 23, 42, 0.75);
  border-radius: 8px;
  padding: 0.75rem;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.article-content-display code {
  background: rgba(30, 41, 59, 0.75);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
}

.article-content-display blockquote {
  border-left: 4px solid rgba(94, 234, 212, 0.4);
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: #cbd5f5;
  background: rgba(30, 41, 59, 0.35);
  border-radius: 0 8px 8px 0;
}

.article-content-display blockquote p {
  margin: 0.35rem 0;
}

.article-content-display table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  border-radius: 8px;
  overflow: hidden;
}

.article-content-display thead {
  background: rgba(148, 163, 184, 0.1);
}

.article-content-display th,
.article-content-display td {
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.article-content-display tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.08);
}

.article-preview-actions {
  display: flex;
  gap: 0.75rem;
}

.article-preview-actions .destructive {
  color: #fca5a5;
}

.article-editor {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1.25rem;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
}

.article-editor-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.article-field input,
.article-field textarea {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.article-field textarea {
  resize: vertical;
  min-height: 12rem;
}

.article-preview-pane {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-preview-pane h3 {
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
}

.article-live-preview {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  min-height: 12rem;
  overflow-y: auto;
}

.article-live-preview p {
  margin: 0.5rem 0;
}

.article-live-preview pre {
  background: rgba(30, 41, 59, 0.75);
  padding: 0.5rem;
  border-radius: 6px;
  overflow-x: auto;
}

.article-live-preview code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
}

.editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.editor-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #f8fafc;
}

.editor-path {
  margin: 0.35rem 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.editor-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editor-buttons .primary-button {
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.25);
}

.editor-buttons .ghost-button.disabled-action {
  pointer-events: none;
  opacity: 0.45;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.editor-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.editor-body textarea {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1.25rem 1.5rem;
  color: #e2e8f0;
  font-size: 1rem;
  line-height: 1.6;
  resize: none;
  min-height: 300px;
}

.editor-body textarea:focus {
  outline: none;
}

.editor-body textarea[hidden] {
  display: none;
}

.viewer-container {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  overflow: auto;
}

.viewer-container[hidden] {
  display: none;
}

.comments-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comments-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
}

.comments-header p {
  margin: 0.35rem 0 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(30, 41, 59, 0.55);
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  flex-wrap: wrap;
}

.comment-meta-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.comment-meta-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.comment-author {
  margin: 0;
  font-weight: 600;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.comment-time {
  font-size: 0.85rem;
  color: #94a3b8;
}

.comment-meta-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: #cbd5f5;
  padding: 0.25rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.comment-meta-button:focus-visible {
  outline: 2px solid rgba(148, 163, 184, 0.45);
  outline-offset: 2px;
}

.comment-meta-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.comment-delete-button {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

.comment-delete-button:hover:not(:disabled),
.comment-delete-button:focus-visible:not(:disabled) {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border-left: 3px solid rgba(96, 165, 250, 0.55);
}

.comment-content {
  margin: 0;
  color: #cbd5f5;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.comment-images img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.comment-images img:hover,
.comment-images img:focus-visible {
  transform: scale(1.03);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
  border-color: rgba(96, 165, 250, 0.5);
}

.comment-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.comment-login-hint {
  margin: 0;
  color: #cbd5f5;
  font-size: 0.9rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 1rem;
}

.comment-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  max-height: 320px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  line-height: 1.6;
}

.comment-field textarea:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.comment-preview-item {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.7);
}

.comment-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 0.75rem;
  line-height: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.comment-preview-remove:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(248, 113, 113, 0.6);
}

.comment-form.is-disabled textarea {
  cursor: not-allowed;
  opacity: 0.6;
}

.comment-form.is-disabled button {
  cursor: not-allowed;
}

.comment-form.is-disabled .comment-actions .ghost-button {
  background: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
}

.comment-form.is-disabled .primary-button {
  background: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
  box-shadow: none;
}

.comment-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(10, 13, 23, 0.85);
  backdrop-filter: blur(6px);
  z-index: 1000;
}


.comment-lightbox-content {
  position: relative;
  max-width: min(960px, 90vw);
  max-height: min(90vh, 720px);
  width: min(960px, 90vw);
  height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.65);
}

.comment-lightbox.is-fullscreen {
  padding: 0;
}

.comment-lightbox.is-fullscreen .comment-lightbox-content {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

.comment-lightbox-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.comment-lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(8, 15, 31, 0.7);
}

.comment-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.12s ease-out;
  transform-origin: center center;
  cursor: zoom-in;
}

.comment-lightbox-stage.is-zoomed img {
  cursor: grab;
}

.comment-lightbox-stage.is-zooming img {
  cursor: grabbing;
}

.comment-lightbox-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.comment-lightbox-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.comment-lightbox-action:hover,
.comment-lightbox-action:focus-visible {
  background: rgba(59, 130, 246, 0.35);
  transform: scale(1.05);
  outline: none;
}

.comment-lightbox-close:hover,
.comment-lightbox-close:focus-visible {
  background: rgba(59, 130, 246, 0.35);
  transform: scale(1.05);
  outline: none;
}

.comment-lightbox-caption {
  margin: 0;
  font-size: 0.9rem;
  color: #cbd5f5;
  text-align: center;
  line-height: 1.5;
}

#image-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
  align-self: center;
}

#pdf-preview {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
  align-self: stretch;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(37, 99, 235, 0.92);
  color: #fff;
  padding: 0.9rem 1.4rem;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.35);
  transition: opacity 0.3s ease;
  z-index: 30;
}

@media (max-width: 1024px) {
  .workspace {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 40vh;
  }

  .main-panel {
    padding: 1rem;
  }

  .article-content {
    grid-template-columns: 1fr;
  }

  .article-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .connection {
    width: 100%;
    flex-wrap: wrap;
  }

  .connection input {
    flex: 1;
    min-width: 0;
  }

  .panel-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
