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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ===== Top Bar ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 200;
}

.topbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #666;
}

.topbar-user a {
  color: #999;
  text-decoration: none;
  font-size: 12px;
}

.topbar-user a:hover {
  color: #e74c3c;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 48px;
  left: 0;
  bottom: 0;
  width: 180px;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  padding: 12px 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  margin: 2px 8px;
  border-radius: 6px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: #f5f5f5;
  color: #333;
}

.sidebar-link.active {
  background: #e8f4fd;
  color: #1890ff;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ===== Main Content ===== */
#content {
  margin-left: 180px;
  margin-top: 48px;
  padding: 24px;
  height: calc(100vh - 48px);
  overflow: hidden;
}

/* Login: full page, no topbar/sidebar offset */
body.login-active #content {
  margin-left: 0;
  margin-top: 0;
  padding: 0;
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
}

.login-card {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 360px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #1a1a1a;
}

.login-card .brand-subtitle {
  font-size: 12px;
  color: #999;
  margin-bottom: 28px;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; }

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

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

.btn-secondary {
  background: #fff;
  color: #555;
  border-color: #d9d9d9;
}

.btn-secondary:hover { border-color: #1890ff; color: #1890ff; }

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ===== Cards ===== */
.card {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #e8e8e8;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

/* ===== Note List ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: #666;
  transition: border-color 0.2s, color 0.2s;
}

.btn-icon:hover { border-color: #1890ff; color: #1890ff; }

.folder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.folder-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s;
}

.folder-card:hover { border-color: #1890ff; }
.folder-card .folder-emoji { font-size: 16px; }
.folder-card .folder-name { color: #333; }

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.note-grid-card {
  cursor: pointer;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.note-grid-card h4 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-grid-card p {
  font-size: 12px;
  color: #666;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.note-grid-card .meta {
  margin-top: 8px;
  font-size: 11px;
  color: #aaa;
}

.breadcrumb a {
  color: #1890ff;
  cursor: pointer;
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .active { color: #333; }

.note-item { cursor: pointer; }

.note-item h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}

.note-item p {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-item .meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
}

/* ===== Editor ===== */
.editor-container {
  background: #fff;
  border-radius: 6px;
  padding: 20px;
  border: 1px solid #e8e8e8;
}

.editor-container input {
  width: 100%;
  font-size: 18px;
  font-weight: 500;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 0;
  margin-bottom: 12px;
}

.editor-container input:focus { outline: none; }

.editor-container textarea {
  width: 100%;
  min-height: 400px;
  border: none;
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
}

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

.editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ===== Calendar ===== */
.calendar {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e8e8e8;
}

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

.calendar-header h3 { font-size: 15px; font-weight: 500; }

.calendar-header button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 8px;
  color: #1890ff;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-grid .weekday {
  text-align: center;
  font-size: 11px;
  color: #999;
  padding: 6px 0;
}

.calendar-grid .day {
  text-align: center;
  padding: 8px 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  position: relative;
}

.calendar-grid .day:hover { background: #e8f4fd; }
.calendar-grid .day.today { color: #1890ff; font-weight: 600; }
.calendar-grid .day.selected { background: #1890ff; color: #fff; }
.calendar-grid .day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1890ff;
}
.calendar-grid .day.selected.has-event::after { background: #fff; }

.event-list { margin-top: 12px; }

.event-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
}

.event-time {
  color: #1890ff;
  font-size: 13px;
  min-width: 50px;
  margin-right: 12px;
}

.event-info { flex: 1; }
.event-info h4 { font-size: 13px; margin-bottom: 2px; }
.event-info p { font-size: 12px; color: #999; }

/* Schedule Form */
.schedule-form .form-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.schedule-form .form-row label {
  min-width: 56px;
  font-size: 13px;
  color: #555;
}

.schedule-form .form-row input,
.schedule-form .form-row select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
}

/* ===== Books ===== */
.book-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.book-info { flex: 1; min-width: 0; overflow: hidden; }

/* Book Cover */
.book-cover {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.book-cover.cover-sm {
  width: 40px;
  height: 56px;
  margin-right: 12px;
}

.book-cover.cover-lg {
  width: 90px;
  height: 125px;
  margin: 0 auto 8px;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover .cover-title {
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  padding: 4px;
  line-height: 1.3;
  word-break: break-all;
}

.book-cover.cover-lg .cover-title {
  font-size: 13px;
  padding: 8px;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.breadcrumb-item {
  color: #1890ff;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.breadcrumb-item:hover { background: #e8f4fd; }
.breadcrumb-item.active { color: #333; cursor: default; }
.breadcrumb-item.active:hover { background: none; }
.breadcrumb-sep { color: #ccc; margin: 0 2px; }

/* Folder items */
.folder-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.folder-item .folder-icon { font-size: 24px; margin-right: 12px; }
.folder-cover-icon { font-size: 40px; margin-bottom: 8px; }
.folder-info { flex: 1; }
.folder-info h3 { font-size: 14px; margin: 0; }

/* Grid view */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.grid-book-item {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.grid-book-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.grid-book-title {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.folders-section {
  margin-bottom: 12px;
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 2px;
}

/* Drag & Drop */
.dragging {
  opacity: 0.4;
}

.drag-over {
  border-color: #1890ff !important;
  box-shadow: 0 0 0 2px rgba(24,144,255,0.2) !important;
  background: #e8f4fd !important;
}

.drop-delete-zone {
  position: fixed;
  bottom: 0;
  left: 180px;
  right: 0;
  height: 56px;
  background: #ff4d4f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
  transition: background 0.2s;
}

.drop-delete-zone.active {
  background: #cf1322;
}

.chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 12px;
}
.book-info h3 { font-size: 14px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-info p { font-size: 12px; color: #999; }

/* Reader */
.reader-container {
  background: #fff;
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.8;
  flex: 1;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
}

.reader-container h1 { font-size: 24px; margin: 20px 0 10px; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
.reader-container h2 { font-size: 20px; margin: 16px 0 8px; }
.reader-container h3 { font-size: 16px; margin: 12px 0 6px; }
.reader-container p { margin: 10px 0; font-size: 14px; }
.reader-container code { background: #f5f5f5; padding: 2px 4px; border-radius: 3px; font-size: 13px; color: #d4380d; }
.reader-container pre { background: #282c34; color: #abb2bf; padding: 14px; border-radius: 4px; overflow-x: auto; margin: 12px 0; }
.reader-container pre code { background: none; color: inherit; padding: 0; }
.reader-container blockquote { border-left: 3px solid #1890ff; padding: 8px 16px; margin: 12px 0; background: #f6f8fa; color: #555; }
.reader-container ul, .reader-container ol { padding-left: 20px; margin: 8px 0; }
.reader-container li { margin: 2px 0; }
.reader-container img { max-width: 100%; height: auto; display: block; margin: 8px 0; }
.reader-container svg { max-width: 100%; height: auto; display: block; margin: 8px 0; }
.reader-container table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.reader-container th { border: 1px solid #ddd; padding: 8px 10px; background: #f5f5f5; text-align: left; font-weight: 500; }
.reader-container td { border: 1px solid #ddd; padding: 8px 10px; }
.reader-container table tr:hover td { background: #fafafa; }

/* ===== Stats / Monitor ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  border: 1px solid #e8e8e8;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #1890ff;
}

.stat-card .stat-label {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.chart-container {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #e8e8e8;
}

.chart-container h3 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  color: #333;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
}

.bar-chart .bar {
  flex: 1;
  background: #1890ff;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  position: relative;
  transition: background 0.2s;
}

.bar-chart .bar:hover { background: #40a9ff; }

.bar-chart .bar:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th, .data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.data-table th {
  background: #fafafa;
  color: #666;
  font-weight: 500;
  font-size: 12px;
}

.data-table tr:hover td { background: #fafafa; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 60px;
  right: 24px;
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 13px;
  z-index: 9999;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h3 { margin-bottom: 16px; font-size: 15px; }

/* ===== Empty ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state p { font-size: 13px; }

/* ===== Badges ===== */
.users-table-wrap { overflow-x: auto; }

.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

.badge-admin { background: #fff7e6; color: #d46b08; }
.badge-user { background: #f0f0f0; color: #666; }

/* ===== FAB Button ===== */
.fab-btn {
  position: fixed;
  right: 24px;
  bottom: 40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #4A90D9;
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(74, 144, 217, 0.4);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.15s;
}
.fab-btn:hover { transform: scale(1.1); }

/* Icon-only button */
.btn.icon-only { padding: 4px 6px; line-height: 1; }

/* ===== Reader Topbar (auto-hide) ===== */
.reader-topbar {
  position: sticky;
  top: 0;
  height: 44px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 150;
  flex-shrink: 0;
}
.reader-topbar.bar-hidden { opacity: 0.3; }
.reader-topbar-left, .reader-topbar-right { display: flex; align-items: center; gap: 8px; }
.reader-topbar-center { font-size: 14px; font-weight: 500; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: center; }
.reader-icon-btn { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 4px; color: #555; display: flex; align-items: center; }
.reader-icon-btn:hover { background: #f0f0f0; }
.reader-icon-btn.reader-icon-lg { padding: 4px; }

/* ===== Reader Side Panels (TOC/Settings) ===== */
.reader-side-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: rgba(30, 30, 30, 0.92);
  backdrop-filter: blur(12px);
  color: #fff;
  z-index: 160;
  display: flex;
  flex-direction: column;
  animation: slideInLeft 0.2s ease;
}
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.side-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 14px; font-weight: 500; }
.side-panel-close { cursor: pointer; font-size: 20px; color: #aaa; padding: 0 4px; }
.side-panel-close:hover { color: #fff; }
.side-panel-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.side-panel-item { padding: 10px 16px; cursor: pointer; font-size: 13px; color: #ddd; border-radius: 4px; margin: 0 8px; }
.side-panel-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Settings inside side panel */
.side-panel-body.settings-body { padding: 16px; }
.side-panel-body .settings-group { margin: 14px 0; display: flex; align-items: center; justify-content: space-between; }
.side-panel-body .settings-group label { font-size: 13px; color: #ccc; font-weight: 500; }
.side-panel-body .settings-group select { padding: 4px 8px; border: 1px solid #555; border-radius: 4px; font-size: 13px; background: #333; color: #fff; }
.font-size-slider { display: flex; align-items: center; gap: 8px; }
.font-size-slider input[type="range"] { width: 100px; }
.font-size-slider span { font-size: 12px; color: #ccc; min-width: 36px; }
.side-panel-body .bg-options { display: flex; gap: 10px; }
.side-panel-body .bg-opt { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #666; cursor: pointer; }
.side-panel-body .bg-opt.active { border-color: #4A90D9; box-shadow: 0 0 0 2px rgba(74,144,217,0.4); }

/* Paginate mode */
.reader-container.paginate-mode { overflow: hidden; height: calc(100vh - 110px); column-fill: auto; }

.pdf-viewer { padding: 16px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; overflow-y: auto; }
.pdf-viewer.pdf-flip-mode { padding: 0; gap: 0; justify-content: center; }
.pdf-viewer.pdf-dual-scroll { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.pdf-viewer.pdf-dual-scroll .pdf-page-canvas { max-width: 48%; }
.pdf-flip-container { display: flex; gap: 4px; align-items: center; justify-content: center; height: 100%; }
.pdf-page-canvas { display: block; max-width: 100%; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.pdf-page-info { font-size: 12px; color: #666; }
.page-mode-group { display: flex; gap: 2px; background: #f0f0f0; border-radius: 4px; padding: 2px; }
.page-mode-group .reader-icon-btn { padding: 4px 6px; border-radius: 3px; }
.page-mode-group .reader-icon-btn.active { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.side-panel-item.active { background: rgba(74,144,217,0.3); color: #fff; }

.note-linked-layout { display: flex; flex: 1; overflow: hidden; }
.note-linked-reader { flex: 1; overflow-y: auto; border-right: 1px solid #e8e8e8; }
.note-linked-editor { flex: 1; display: flex; flex-direction: column; background: #fff; }
.note-linked-toolbar { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.note-linked-content { flex: 1; padding: 16px 20px; overflow-y: auto; outline: none; font-size: 14px; line-height: 1.8; }
.note-linked-content:empty::before { content: attr(placeholder); color: #ccc; }

/* ===== Three-Column Layout ===== */
.three-col-layout {
  display: flex;
  height: calc(100vh - 48px);
  margin: -24px;
  overflow: hidden;
}

.middle-panel {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid #e8e8e8;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.middle-panel-header {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #fff;
}

.middle-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.middle-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.note-mode-tabs {
  display: flex;
  gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: #fff;
}
.note-mode-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tab-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  vertical-align: middle;
}
.note-mode-tab:hover { color: #333; }
.note-mode-tab.active {
  color: #1890ff;
  border-bottom-color: #1890ff;
  font-weight: 500;
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8f9fa;
  position: relative;
  padding: 24px;
}
#books-main-panel { padding: 0; overflow: hidden; }

/* ===== Note List (Middle Panel) ===== */
.note-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.1s;
}

.note-list-item:hover { background: #f8f9fa; }
.note-list-item.active { background: #e8f4fd; border-left: 3px solid #1890ff; }

.note-list-title {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.note-list-preview {
  font-size: 12px;
  color: #999;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.note-list-meta {
  font-size: 11px;
  color: #bbb;
}

/* Note Folder Chips */
.note-folder-chips {
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #f0f0f0;
}

.note-folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f5f5f5;
  border-radius: 12px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}

.note-folder-chip:hover { background: #e8f4fd; color: #1890ff; }
.note-folder-chip.active { background: #e8f4fd; color: #1890ff; font-weight: 500; }

/* Main Panel Editor */
.main-editor-wrap {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-editor-header {
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-editor-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  border: none;
  outline: none;
  color: #1a1a1a;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
  position: relative;
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tool-sep {
  width: 1px;
  height: 20px;
  background: #e8e8e8;
  margin: 0 6px;
  flex-shrink: 0;
}
.tool-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.15s, color 0.15s;
}
.tool-icon:hover { background: #e8f4fd; color: #1890ff; }
.tool-icon:active { background: #d0e8fa; }
.tool-icon svg { flex-shrink: 0; }

/* Sub-toolbar (table tools) */
.sub-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafbfc;
  position: relative;
}

/* Color Picker Dropdown */
.color-picker-dropdown {
  position: absolute;
  top: 100%;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 500;
  margin-top: 4px;
}
.cp-row {
  display: flex;
  gap: 4px;
}
.cp-dot {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.08);
  transition: border-color 0.15s, transform 0.1s;
}
.cp-dot:hover { border-color: #1890ff; transform: scale(1.2); }
.cp-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
  border: 1px dashed #ccc;
}

.main-editor-body {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  position: relative;
}

.editor-block {
  position: relative;
  margin-bottom: 4px;
  padding-left: 24px;
}
.editor-block:hover .eb-del-btn { opacity: 1; }
.editor-block:hover .drag-handle { opacity: 1; }
.eb-del-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f5222d;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

/* Drag Handle */
.drag-handle {
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
  color: #bbb;
  border-radius: 3px;
}
.drag-handle:hover { color: #666; background: #f0f0f0; }
.drag-handle:active { cursor: grabbing; }

/* Drag Indicator */
.drag-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #999;
  border-radius: 1px;
  display: none;
  z-index: 100;
  pointer-events: none;
}
.eb-drag-src {
  opacity: 0.3;
}
.eb-drag-ghost {
  opacity: 0.6;
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 4px 8px;
  max-width: 320px;
  max-height: 80px;
  overflow: hidden;
  pointer-events: none;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-size: 12px;
}
.eb-text {
  outline: none;
  font-size: 14px;
  line-height: 1.8;
  min-height: 24px;
  color: #333;
  padding: 2px 0;
}
.eb-text[placeholder]:empty:before {
  content: attr(placeholder);
  color: #ccc;
  pointer-events: none;
}
.eb-heading-1 { font-size: 22px; font-weight: 700; outline: none; min-height: 30px; }
.eb-heading-2 { font-size: 18px; font-weight: 600; outline: none; min-height: 26px; }
.eb-heading-3 { font-size: 15px; font-weight: 600; outline: none; min-height: 22px; }


.eb-tbl { border-collapse: collapse; font-size: 13px; display: inline-table; }
.eb-tbl td { border: 1px solid #e8e8e8; padding: 6px 8px; min-width: 60px; min-height: 28px; outline: none; }
.eb-tbl th { border: 1px solid #e8e8e8; padding: 4px 6px; background: #f7f8fa; font-weight: normal; font-size: 11px; color: #999; cursor: pointer; user-select: none; position: relative; overflow: visible; }
.eb-tbl .eb-tbl-corner { width: 28px; min-width: 28px; background: #eef0f3; cursor: grab; }
.eb-tbl .eb-tbl-col-hdr { text-align: center; min-width: 60px; }
.eb-tbl .eb-tbl-col-hdr .col-resize {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: col-resize;
  z-index: 2;
}
.eb-tbl .eb-tbl-col-hdr .col-resize:hover { background: #1890ff; }
.eb-tbl .eb-tbl-row-hdr { text-align: center; width: 28px; position: relative; }
.eb-tbl .eb-tbl-row-hdr .row-resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 4px;
  cursor: row-resize;
  z-index: 2;
}
.eb-tbl .eb-tbl-row-hdr .row-resize:hover { background: #1890ff; }
.eb-tbl th:hover { background: #e3e8ee; }
.eb-tbl th.sel { background: #d6e4ff; color: #1890ff; }
.eb-tbl td.sel { background: #e6f4ff; }

.tbl-col-del, .tbl-col-add, .tbl-row-del, .tbl-row-add {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  z-index: 5;
  user-select: none;
}
.tbl-col-del {
  top: -22px; left: 50%; transform: translateX(-50%);
  background: #fff0f0; border: 1px solid #ffccc7;
}
.tbl-col-del:hover { background: #ff4d4f; color: #fff; }
.tbl-col-add {
  top: 50%; right: -22px; transform: translateY(-50%);
  background: #f0fff0; border: 1px solid #b7eb8f; font-weight: bold; font-size: 14px; color: #52c41a;
}
.tbl-col-add:hover { background: #52c41a; color: #fff; }
.tbl-row-del {
  left: -22px; top: 50%; transform: translateY(-50%);
  background: #fff0f0; border: 1px solid #ffccc7;
}
.tbl-row-del:hover { background: #ff4d4f; color: #fff; }
.tbl-row-add {
  bottom: -22px; left: 50%; transform: translateX(-50%);
  background: #f0fff0; border: 1px solid #b7eb8f; font-weight: bold; font-size: 14px; color: #52c41a;
}
.tbl-row-add:hover { background: #52c41a; color: #fff; }

.eb-todo-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.eb-todo-item input[type="checkbox"] { width: 16px; height: 16px; }
.eb-todo-item span { flex: 1; outline: none; font-size: 14px; }

.eb-list-item { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; }
.eb-list-num { color: #999; font-size: 13px; min-width: 18px; }
.eb-list-item span { flex: 1; outline: none; font-size: 14px; }

.eb-audio { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.eb-audio audio { height: 32px; }
.eb-audio-block { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.eb-audio-label { font-size: 13px; color: #666; }
.eb-mindmap-block { padding: 8px 0; }
.eb-mm-wrap { position: relative; display: inline-block; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid #e8e8e8; }
.eb-mm-wrap:hover { border-color: #bbb; }
.mm-selected .eb-mm-wrap { border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.15); }
.eb-mm-canvas { display: block; }
.eb-mm-ctrl { position: absolute; width: 24px; height: 24px; background: rgba(0,0,0,0.55); color: #fff; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; opacity: 0; transition: opacity 0.15s; z-index: 2; }
.mm-selected .eb-mm-ctrl, .eb-mm-wrap:hover .eb-mm-ctrl { opacity: 1; }
.eb-mm-ctrl:hover { background: rgba(0,0,0,0.8); }
.eb-mm-edit { top: 6px; right: 6px; }

.mm-editor-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #fff; z-index: 1000; display: flex; flex-direction: column; }
.mm-editor-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid #e8e8e8; background: #fafbfc; }
.mm-editor-header span { font-size: 14px; font-weight: 500; }
.mm-editor-header button { padding: 4px 16px; background: #1890ff; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.mm-editor-header button:hover { background: #096dd9; }
#mm-editor-canvas { flex: 1; cursor: grab; }

/* Formula Block */
.eb-formula-block {
  padding: 12px 0;
}
.eb-formula-preview {
  min-height: 32px;
  padding: 8px 0;
  overflow-x: auto;
  cursor: pointer;
}
.eb-formula-input {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #e8e8e8;
  border-top: none;
  border-radius: 0 0 6px 6px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  resize: vertical;
  outline: none;
  color: #333;
  background: #fff;
}
.eb-formula-input:focus { border-color: #1890ff; }

/* Code Block */
.eb-code-block { padding: 8px 0; }
.eb-code-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.eb-code-lang { font-size: 12px; padding: 2px 6px; border: 1px solid #e1e4e8; border-radius: 4px; background: #f6f8fa; outline: none; }
.eb-code-lang:focus { border-color: #1890ff; }
.eb-code-pre { background: #1e1e1e; color: #d4d4d4; border-radius: 6px; padding: 12px 16px; overflow-x: auto; margin: 0; font-size: 13px; line-height: 1.5; cursor: pointer; }
.eb-code-pre code { font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace; background: none; padding: 0; }
.eb-code-input { width: 100%; min-height: 80px; font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace; font-size: 13px; line-height: 1.5; border: 1px solid #e1e4e8; border-radius: 4px; padding: 8px 12px; resize: vertical; margin-top: 4px; tab-size: 2; background: #fafbfc; }
.eb-code-input:focus { border-color: #1890ff; outline: none; }
.eb-placeholder { color: #bbb; font-size: 13px; font-style: italic; cursor: pointer; }

/* Image Selection */
.eb-image-wrap { display: inline-block; position: relative; }
.eb-image-wrap img { max-width: 100%; border-radius: 4px; cursor: pointer; display: block; }
.eb-image-wrap img.selected { outline: 2px solid #1890ff; outline-offset: 2px; border-radius: 4px; }
.eb-image-wrap .eb-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.15s;
}
.eb-image-wrap .eb-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #1890ff;
  border-bottom: 2px solid #1890ff;
}
.eb-image-wrap:has(img.selected) .eb-resize-handle,
.eb-image-wrap:hover .eb-resize-handle { opacity: 1; }
.eb-image-block { padding: 8px 0; }
.eb-img-ctrl {
  position: absolute;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.eb-image-wrap:hover .eb-img-ctrl,
.eb-image-wrap:has(img.selected) .eb-img-ctrl { opacity: 1; }
.eb-img-ctrl:hover { background: rgba(0,0,0,0.8); }
.eb-img-del { top: 4px; left: 4px; }
.eb-img-rotate { top: 4px; right: 4px; }

/* Disabled image toolbar buttons */
.tool-img-only:disabled,
.tool-tbl-only:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Folder Item in middle panel */
.folder-tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
  color: #333;
  border-bottom: 1px solid #f8f8f8;
}
.folder-tree-item:hover { background: #f0f7ff; }
.folder-tree-item.selected { background: #e8f4fd; border-left: 3px solid #1890ff; }
.folder-tree-item.selected .folder-tree-name { color: #1890ff; font-weight: 500; }
.folder-tree-name[contenteditable="true"] {
  outline: none;
  background: #fff;
  border: 1px solid #1890ff;
  border-radius: 3px;
  padding: 0 4px;
  min-width: 60px;
}
.folder-tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-icon { font-size: 14px; flex-shrink: 0; }
.folder-tree-loading { padding: 6px 12px; font-size: 12px; color: #bbb; }

/* Middle panel drag */
.mid-drag-ghost {
  position: fixed;
  background: #fff;
  border: 1px solid #1890ff;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: #1890ff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  pointer-events: none;
  z-index: 900;
  white-space: nowrap;
}
.mid-dragging { opacity: 0.4; }
.mid-drop-hover { background: #d6e4ff !important; }
.folder-add-sub { margin-left: auto; font-size: 16px; color: #1890ff; cursor: pointer; padding: 0 4px; font-weight: bold; }
.folder-add-sub:hover { color: #096dd9; }

/* Add item button (todo/list) */
.eb-add-item {
  color: #1890ff;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 2px;
}
.eb-add-item:hover { text-decoration: underline; }

/* Table cell selection */
.eb-tbl td.sel { outline: 2px solid #1890ff; outline-offset: -1px; background: #e6f4ff; }
.eb-table-block { padding: 24px 0 24px 24px; overflow: visible; }

/* Middle panel header buttons */
.mp-header-btns {
  display: flex;
  gap: 6px;
}
.mp-header-btns .btn-sm {
  font-size: 12px;
  padding: 4px 8px;
}

.note-ctx-menu {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  min-width: 120px;
  padding: 4px 0;
}
.note-ctx-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  color: #333;
}
.note-ctx-item:hover { background: #f5f5f5; }
.note-ctx-item.danger { color: #e74c3c; }
.note-ctx-item.danger:hover { background: #fef2f0; }

.note-move-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
}
.note-move-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f8f8f8;
}
.note-move-item:hover { background: #f5f5f5; }
.note-move-item.active { background: #e8f4fd; color: #1890ff; }

.main-editor-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-panel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #ccc;
  font-size: 14px;
}

/* ===== Mini Calendar (Schedule Middle Panel) ===== */
.mini-cal {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mini-cal-header span {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.mini-cal-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  padding: 2px 6px;
  border-radius: 4px;
}

.mini-cal-header button:hover { background: #f0f0f0; color: #333; }

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.mini-cal-grid .mc-weekday {
  text-align: center;
  font-size: 10px;
  color: #bbb;
  padding: 4px 0;
}

.mini-cal-grid .mc-day {
  text-align: center;
  padding: 4px 0;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  color: #555;
}

.mini-cal-grid .mc-day:hover { background: #e8f4fd; }
.mini-cal-grid .mc-day.mc-today { color: #1890ff; font-weight: 700; }
.mini-cal-grid .mc-day.mc-selected { background: #1890ff; color: #fff; border-radius: 50%; }
.mini-cal-grid .mc-day.mc-other { color: #ddd; }
.mini-cal-grid .mc-day.mc-has-event::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #1890ff;
}

/* Heatmap intensity */
.mini-cal-grid .mc-day.heat-1 { background: #9be9a8; color: #333; }
.mini-cal-grid .mc-day.heat-2 { background: #40c463; color: #fff; }
.mini-cal-grid .mc-day.heat-3 { background: #30a14e; color: #fff; }
.mini-cal-grid .mc-day.heat-4 { background: #216e39; color: #fff; }
.mini-cal-grid .mc-day.mc-selected.heat-1,
.mini-cal-grid .mc-day.mc-selected.heat-2,
.mini-cal-grid .mc-day.mc-selected.heat-3,
.mini-cal-grid .mc-day.mc-selected.heat-4 {
  box-shadow: inset 0 0 0 2px #1890ff;
}

/* ===== Schedule Right Panel ===== */
.schedule-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.schedule-day-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.schedule-event-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  transition: box-shadow 0.15s;
}

.schedule-event-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.schedule-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1890ff;
  margin-right: 12px;
  flex-shrink: 0;
}

.schedule-event-info { flex: 1; }
.schedule-event-info h4 { font-size: 13px; font-weight: 500; color: #333; margin-bottom: 2px; }
.schedule-event-info p { font-size: 12px; color: #999; }

.schedule-event-time {
  font-size: 12px;
  color: #1890ff;
  white-space: nowrap;
  margin-right: 12px;
}

.schedule-event-actions {
  display: flex;
  gap: 4px;
}

/* Schedule Form Inline */
.schedule-form-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  padding: 20px;
  margin-bottom: 16px;
}

.schedule-form-card .form-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.schedule-form-card .form-row label {
  min-width: 48px;
  font-size: 13px;
  color: #555;
}

.schedule-form-card .form-row input,
.schedule-form-card .form-row select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
}

.schedule-form-card .form-row input:focus,
.schedule-form-card .form-row select:focus {
  outline: none;
  border-color: #1890ff;
}

/* ===== Week View ===== */
.week-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  flex-shrink: 0;
  z-index: 10;
}

.week-toolbar-title {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.week-header {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
  background: #f0f0f0;
  flex-shrink: 0;
  z-index: 10;
}

.week-header-gutter {
  width: 56px;
  min-width: 56px;
  border-right: 1px solid #f0f0f0;
}

.week-header-day {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  cursor: pointer;
  border-right: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.week-header-day:last-child { border-right: none; }
.week-header-day:hover { background: #f8f9fa; }
.week-header-day.wh-today { background: #e8f4fd; }
.week-header-day.wh-selected { background: #1890ff; }
.week-header-day.wh-selected .wh-weekday,
.week-header-day.wh-selected .wh-date { color: #fff; }

.wh-weekday {
  display: block;
  font-size: 11px;
  color: #999;
}

.wh-date {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.wh-today .wh-date { color: #1890ff; }

.week-grid-scroll {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.week-grid {
  display: flex;
  position: relative;
  min-height: 100%;
}

.week-time-col {
  width: 56px;
  min-width: 56px;
  border-right: 1px solid #d9d9d9;
  flex-shrink: 0;
  background: #f0f0f0;
}

.week-time-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  font-size: 10px;
  color: #bbb;
}

.week-day-col {
  flex: 1;
  position: relative;
  border-right: 1px solid #d9d9d9;
}

.week-day-col:last-child { border-right: none; }
.week-day-col.week-day-today { background: #fafcff; }

.week-cell {
  border-bottom: none;
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: flex-start;
  font-size: 11px;
  gap: 3px;
}

.week-cell:hover { background: #f8fbff; }
.week-cell-hour { border-bottom: 1px solid #d9d9d9; }
.week-cell-filled { }

.week-cell-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  line-height: 1.3;
}
.cell-icon { flex-shrink: 0; font-size: 11px; line-height: 1.3; }
.cell-checkbox { cursor: pointer; }
.cell-checkbox.checked { color: #52c41a; }
.week-cell-multi { display: flex; gap: 1px; }
.week-cell-col { flex: 1; display: flex; align-items: flex-start; gap: 2px; padding: 2px 3px; font-size: 11px; overflow: hidden; cursor: pointer; }
.sch-dp-type-btns { display: flex; gap: 6px; }

/* ===== Schedule Progress Panel ===== */
.progress-panel { padding: 12px 16px; }
.progress-panel-header { display: flex; gap: 8px; margin-bottom: 6px; }
.progress-tab { font-size: 12px; padding: 3px 10px; border-radius: 3px; cursor: pointer; background: #f5f5f5; color: #666; }
.progress-tab.active { background: #1890ff; color: #fff; }
.progress-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; font-size: 12px; color: #555; }
.progress-nav-btn { cursor: pointer; padding: 0 4px; color: #999; user-select: none; }
.progress-nav-btn:hover { color: #1890ff; }
.progress-nav-label { font-weight: 500; }
.progress-rings { display: flex; justify-content: center; gap: 20px; margin-bottom: 12px; }
.progress-ring-item { position: relative; display: flex; flex-direction: column; align-items: center; }
.progress-ring-pct { position: absolute; top: 27px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 600; color: #333; }
.progress-list { display: flex; flex-direction: column; gap: 8px; }
.progress-item { display: flex; align-items: center; gap: 8px; }
.progress-item-text { font-size: 12px; color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.progress-bar-wrap { width: 80px; min-width: 80px; height: 10px; border-radius: 5px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 5px; transition: width 0.2s; box-sizing: border-box; }
.progress-pct { font-size: 11px; color: #999; min-width: 32px; text-align: right; }
.progress-empty { font-size: 12px; color: #bbb; text-align: center; padding: 8px 0; }

/* ===== Schedule Dropdown Editor ===== */
.sch-dropdown-panel {
  width: 300px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  padding: 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.sch-dp-row {
  margin-bottom: 12px;
}

.sch-dp-row label {
  display: block;
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.sch-dp-row input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
}

.sch-dp-row input[type="text"]:focus {
  outline: none;
  border-color: #1890ff;
}

.sch-dp-row select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
}

.sch-dp-colors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sch-dp-cdot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s;
}

.sch-dp-cdot:hover { transform: scale(1.15); }
.sch-dp-cdot.active { border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }

.sch-dp-weekdays {
  display: flex;
  gap: 4px;
}

.sch-dp-wday {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  background: #f5f5f5;
  color: #555;
  transition: background 0.1s;
}

.sch-dp-wday:hover { background: #e8f4fd; }
.sch-dp-wday.active { background: #1890ff; color: #fff; }

.sch-dp-mdays {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.sch-dp-mday {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  background: #f5f5f5;
  color: #555;
}

.sch-dp-mday:hover { background: #e8f4fd; }
.sch-dp-mday.active { background: #1890ff; color: #fff; }

.sch-dp-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.sch-dp-actions .btn { margin-left: auto; align-self: flex-end; }
.sch-dp-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sch-dp-del-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sch-dp-del-row {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #e74c3c;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}
.sch-dp-del-row:hover { background: #fdecea; }
.sch-dp-del-row.disabled {
  color: #ccc;
  cursor: default;
  pointer-events: none;
}

.sch-confirm-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sch-confirm-box {
  background: #fff;
  border-radius: 8px;
  padding: 28px 32px 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  min-width: 280px;
  text-align: center;
}
.sch-confirm-box p {
  font-size: 15px;
  margin: 0 0 20px;
  color: #333;
}
.sch-confirm-btns {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.sch-confirm-btns .btn-danger {
  background: #e74c3c;
  color: #fff;
  border: none;
}
.sch-confirm-btns .btn-danger:hover { background: #c0392b; }
