/* === Reset & Base === */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

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

:root {
  --bg-primary: #05050A;
  --bg-secondary: #0A0A12;
  --bg-tertiary: #14141F;
  --accent-cyan: #00F0FF;
  --accent-purple: #7000FF;
  --accent-green: #00FF88;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0B0;
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 12px;
}

body {
  font-family: 'Sora', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  background-image: radial-gradient(circle at 50% -20%, rgba(112, 0, 255, 0.15), transparent 70%);
  background-attachment: fixed;
}

/* === Views === */
.view {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* === Loading === */
#loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Auth View === */
.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
}

.auth-container h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-size: 1rem;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.divider {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 32px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.divider-text span {
  padding: 0 16px;
}

.otp-login-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.otp-login-form input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}

.otp-login-form input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 4px rgba(112, 0, 255, 0.1);
}

.otp-login-form .btn {
  width: 100%;
}

.otp-qr-container {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.otp-secret-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  word-break: break-all;
}

.otp-secret-text code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  font-size: 0.85rem;
}

/* 사설 운영 — 신규 등록 UI 임시 비공개 (cutoff: 2027-01-01 KST, index.html 인라인 스크립트와 함께 제거) */
html.hide-registration .divider,
html.hide-registration .register-section {
  display: none;
}

.register-section {
  text-align: left;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.3s ease;
}

.register-section[open] {
  background: rgba(255, 255, 255, 0.05);
}

.register-section summary {
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 0;
  user-select: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.register-section summary:hover {
  color: var(--text-primary);
}

.form-group {
  margin-top: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 4px rgba(112, 0, 255, 0.1);
}

.register-section .btn {
  margin-top: 24px;
  width: 100%;
}

.error {
  margin-top: 20px;
  padding: 14px;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.2);
  border-radius: var(--radius);
  color: #ff6e6e;
  font-size: 0.9rem;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
  background: var(--glass-bg);
  color: var(--text-primary);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--accent-purple);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(112, 0, 255, 0.3);
}

.btn-primary:hover {
  background: #8533ff;
  box-shadow: 0 6px 16px rgba(112, 0, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 20px;
}

.btn-download {
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.2);
  background: rgba(0, 240, 255, 0.05);
}

.btn-download:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.btn-source {
  color: var(--accent-green);
  border-color: rgba(0, 255, 136, 0.2);
  background: rgba(0, 255, 136, 0.05);
}

.btn-source:hover {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
}

/* === Header === */
header {
  height: 70px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  background: rgba(5, 5, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-center {
  text-align: center;
  position: relative;
}

.refresh-toast {
  position: absolute;
  top: calc(100% - 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid var(--glass-border);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 110;
}

.refresh-toast.hidden {
  display: none;
}

.refresh-toast.fade-out {
  opacity: 0;
}

.header-center h1,
.header-center h2 {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.brand-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

button.brand-link h1 {
  margin: 0;
}

@media (hover: hover) {
  button.brand-link:hover {
    opacity: 0.75;
  }
}

button.brand-link:active {
  opacity: 0.5;
}

button.brand-link:focus-visible {
  outline: 2px solid var(--accent-cyan, #00bfff);
  outline-offset: 4px;
  border-radius: 4px;
}

.cat-chip {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 4px;
  border-radius: 8px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.badge-expert {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: padding-box;
  -webkit-text-fill-color: #fff;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75em;
  vertical-align: middle;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

#username-display {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* === Main Content === */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* === Search & Filters === */
.search-container {
  margin-bottom: 32px;
}

.search-bar {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  padding: 16px 24px;
  padding-right: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(112, 0, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

.file-count {
  position: absolute;
  right: 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Filters */
.filters-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.filter-chip.active {
  background: rgba(112, 0, 255, 0.15);
  border-color: var(--accent-purple);
  color: var(--accent-cyan);
}

.sort-area {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.sort-chip {
  padding: 4px 12px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-chip:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sort-chip.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Search History */
#search-history {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0f0f18;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-top: 8px;
  z-index: 50;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-item {
  padding: 12px 24px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* === File List === */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.file-item:hover {
  border-color: rgba(112, 0, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.meta-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-order {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #a78bfa;
}

.file-actions {
  display: flex;
  gap: 8px;
  margin-left: 16px;
  flex-shrink: 0;
}

.file-actions .btn-small {
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.2s;
}

.file-item:hover .file-actions .btn-small {
  opacity: 1;
  transform: translateX(0);
}

/* === Tabs === */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text-primary);
}

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

/* === Project Grid === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.project-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.project-card.expanded {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.04);
}

.project-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
}

.project-card-files {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px;
  background: rgba(0, 240, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius);
}

.project-card-files .file-item {
  padding: 12px 16px;
  border-radius: 8px;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-cyan);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.page-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-state .hint {
  font-size: 0.9rem;
  margin-top: 12px;
  opacity: 0.7;
}

/* === Tooltip === */
.tooltip {
  position: fixed;
  width: 400px;
  padding: 20px;
  background: #1a1a24;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  pointer-events: none;
  z-index: 1000;
  backdrop-filter: blur(20px);
}

/* === Markdown Body (Updated for Dark Theme) === */
.markdown-body {
  color: var(--text-secondary);
  line-height: 1.8;
  padding: 24px 0;
  font-size: 1.05rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.5px;
}

.markdown-body h1 {
  font-size: 2.2rem;
  margin: 32px 0 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

.markdown-body h2 {
  font-size: 1.8rem;
  margin: 40px 0 20px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
}

.markdown-body a {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-cyan);
  transition: all 0.2s;
}

.markdown-body a:hover {
  background: rgba(0, 240, 255, 0.1);
  border-bottom-style: solid;
}

.markdown-body code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', monospace;
  color: #ff9d00;
}

.markdown-body pre {
  position: relative;
  background: #11111a;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.9rem;
}

/* === Code Copy Button === */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  z-index: 2;
  font-family: inherit;
  line-height: 1.4;
}

.markdown-body pre:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.code-copy-btn.copied {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent-purple);
  padding-left: 20px;
  background: rgba(112, 0, 255, 0.05);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  font-style: italic;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 2em;
  margin: 16px 0;
}

.markdown-body li {
  margin: 6px 0;
  line-height: 1.7;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin: 4px 0;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 40px 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border: 1px solid var(--glass-border);
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  text-align: left;
  color: var(--accent-cyan);
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
}

.markdown-body td {
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
}

.markdown-body tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* === Mermaid === */
.markdown-body .mermaid {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  text-align: center;
  overflow-x: auto;
}


/* === Back to Top === */
.btn-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--accent-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-top:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.btn-top.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* === TOC Panel === */
.toc-panel {
  position: fixed;
  top: 70px;
  right: 0;
  width: 280px;
  max-height: calc(100vh - 70px);
  background: rgba(10, 10, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  z-index: 150;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toc-panel.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

.toc-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.toc-close:hover {
  color: var(--text-primary);
}

.toc-list {
  padding: 12px 0;
}

.toc-item {
  display: block;
  padding: 8px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  border-left: 2px solid transparent;
}

.toc-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border-left-color: var(--accent-cyan);
}

.toc-item.active {
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
}

.toc-item.toc-h3 {
  padding-left: 36px;
  font-size: 0.8rem;
}

#btn-toc.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* === Footer === */
.app-footer {
  text-align: center;
  padding: 24px 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  opacity: 0.5;
}

/* === Responsive === */
@media (max-width: 640px) {
  .code-copy-btn {
    opacity: 1;
  }

  header {
    height: auto;
    padding: 16px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .header-left, .header-center, .header-right {
    justify-content: center;
  }

  .header-right {
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
  }

  .file-item {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .file-actions {
    margin-left: 0;
    margin-top: 12px;
    width: 100%;
    justify-content: flex-end;
  }

  .file-actions .btn-small {
    opacity: 1;
    transform: none;
  }
  
  .pagination {
    flex-direction: column;
    gap: 12px;
  }
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

