* { margin: 0; padding: 0; box-sizing: border-box; }
    body { font-family: system-ui, -apple-system, sans-serif; background: #f5f5f5; display: flex; height: 100vh; overflow: hidden; }
    
    /* Sidebar */
    .sidebar {
      width: 280px;
      background: #2c3e50;
      color: white;
      padding: 20px;
      overflow-y: auto;
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
    }
    .sidebar h2 {
      font-size: 18px;
      margin-bottom: 20px;
      padding-bottom: 10px;
      border-bottom: 2px solid #34495e;
    }
    .sidebar-scene {
      padding: 12px;
      margin-bottom: 8px;
      background: #34495e;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      border-left: 4px solid transparent;
      user-select: none;
      position: relative;
    }
    .sidebar-scene:hover {
      background: #3d5266;
      transform: translateX(5px);
    }
    .sidebar-scene.active {
      background: #3d5266;
      border-left-color: #3498db;
    }
    .sidebar-scene-number {
      font-weight: bold;
      color: #3498db;
      font-size: 14px;
    }
    .sidebar-scene-title {
      font-size: 14px;
      margin-top: 4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sidebar-empty {
      color: #7f8c8d;
      font-style: italic;
      text-align: center;
      padding: 20px 0;
    }
    #sidebarSceneList {
      flex: 1;
      overflow-y: auto;
    }
    /* Sidebar drag and drop styles */
    .sidebar-scene[draggable="true"]:hover {
      cursor: grab;
    }
    .sidebar-scene[draggable="true"]:active {
      cursor: grabbing;
    }
    .sidebar-scene.sidebar-dragging {
      opacity: 0.4;
      transform: scale(0.98);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    .sidebar-scene[draggable="true"]::before {
      content: '⋮';
      position: absolute;
      left: 4px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 16px;
      color: rgba(255, 255, 255, 0.2);
      transition: color 0.2s;
    }
    .sidebar-scene[draggable="true"]:hover::before {
      color: rgba(255, 255, 255, 0.5);
    }
    .sidebar-user-info {
      margin-top: 20px;
      padding-top: 20px;
      border-top: 2px solid #34495e;
    }
    .sidebar-username {
      font-size: 14px;
      margin-bottom: 10px;
      color: #bdc3c7;
    }
    .sidebar-logout-btn {
      width: 100%;
      background: #C53A36;
      color: white;
      border: 2px solid #A02E2B;
      padding: 10px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 15px;
      font-weight: 500;
      transition: background 0.2s, transform 0.1s, border-color 0.2s;
    }
    .sidebar-logout-btn:hover {
      background: #A02E2B;
      border-color: #7A2220;
      transform: translateY(-1px);
    }
    
    /* Main content */
    .main-content {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
    }
    .container { max-width: 1200px; margin: 0 auto; }
    h1 { margin-bottom: 30px; color: #333; }
    .actions { margin-bottom: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
    button { padding: 12px 24px; color: white; border: 2px solid transparent; border-radius: 6px; cursor: pointer; transition: background 0.2s, transform 0.1s, border-color 0.2s; font-size: 15px; font-weight: 500; }
    button:hover { transform: translateY(-1px); }
    .btn-add { background: #3A7BC8; border-color: #2E63A0; }
    .btn-add:hover { background: #2E63A0; border-color: #234D7A; }
    .btn-config { background: #8B7AB8; border-color: #6F5F96; }
    .btn-config:hover { background: #6F5F96; border-color: #5A4C7A; }
    .btn-export { background: #5A9B3A; border-color: #4A7F30; }
    .btn-export:hover { background: #4A7F30; border-color: #3A6426; }
    .btn-reset { background: #C53A36; border-color: #A02E2B; }
    .btn-reset:hover { background: #A02E2B; border-color: #7A2220; }
    .btn-edit { background: #4A90A4; border-color: #3A7A8A; padding: 5px 10px; margin-right: 5px; }
    .btn-edit:hover { background: #3A7A8A; border-color: #2A6A7A; }
    .btn-delete { background: #C53A36; border-color: #A02E2B; padding: 5px 10px; }
    .btn-delete:hover { background: #A02E2B; border-color: #7A2220; }
    .scene-list { display: grid; gap: 15px; }
    .scene-card { 
      background: white; 
      padding: 20px; 
      border-radius: 8px; 
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
      scroll-margin-top: 20px;
    }
    .scene-card:hover {
      box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    .scene-card.dragging {
      opacity: 0.5;
      transform: scale(0.95);
    }
    .scene-card.highlight {
      box-shadow: 0 0 0 3px #3498db;
      animation: highlight-pulse 1s ease-out;
    }
    @keyframes highlight-pulse {
      0%, 100% { box-shadow: 0 0 0 3px #3498db; }
      50% { box-shadow: 0 0 0 6px rgba(52, 152, 219, 0.5); }
    }
    .scene-card h3 { margin-bottom: 10px; color: #333; }
    .scene-meta { font-size: 14px; color: #666; margin: 10px 0; }
    .scene-text { margin: 15px 0; line-height: 1.6; white-space: pre-wrap; }
    .scene-notes { background: #fff9e6; padding: 10px; border-left: 3px solid #ffd700; margin-top: 10px; font-size: 14px; }
    .tag { display: inline-block; background: #e0e0e0; padding: 4px 8px; border-radius: 4px; font-size: 12px; margin-right: 5px; }
    .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; }
    .modal-content { background: white; width: 90%; max-width: 600px; margin: 20px auto; padding: 20px; border-radius: 8px; max-height: calc(100vh - 40px); overflow-y: auto; }
    .modal-content h2 { margin-bottom: 15px; font-size: 18px; }
    .form-group { margin-bottom: 10px; }
    label { display: block; margin-bottom: 3px; font-weight: 500; font-size: 14px; }
    input, textarea { width: 100%; padding: 6px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; font-size: 14px; }
    textarea { min-height: 60px; resize: vertical; }
    .modal-content button[type="submit"] { background: #3A7BC8; border-color: #2E63A0; }
    .modal-content button[type="submit"]:hover { background: #2E63A0; border-color: #234D7A; }
    .modal-content button[type="button"] { background: #6c757d; border-color: #5a6268; }
    .modal-content button[type="button"]:hover { background: #5a6268; border-color: #4e555b; }
    .drag-handle:active { cursor: grabbing; }

    /* Navigation bar */
    .top-nav {
      background: #333;
      color: white;
      padding: 0.5rem 1rem;
      position: sticky;
      top: 0;
      z-index: 1000;
    }

    .nav-content {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 1rem;
      max-width: 1200px;
      margin: 0 auto;
    }

    .logout-form {
      margin: 0;
      padding: 0;
      display: inline-block;
    }

    .username {
      font-size: 0.875rem;
      white-space: nowrap;
    }

    .btn-logout {
      background: #dc3545;
      color: white;
      border: none;
      padding: 0.375rem 0.75rem;
      border-radius: 4px;
      cursor: pointer;
      font-size: 0.875rem;
    }

    .btn-logout:hover {
      background: #c82333;
    }