:root {
  --primary: #3370ff;
  --primary-hover: #2860e1;
  --bg-body: #f7dfe8;
  --bg-surface: #ffffff;
  --text-main: #1f2329;
  --text-secondary: #646a73;
  --text-placeholder: #8f959e;
  --border-color: #dee0e3;
  --border-hover: #3370ff;
  --danger: #f54a45;
  --success: #00b365;
  --warning: #ff8800;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Global Loader */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eff3ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loader-text {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
}

/* Utilities */
.hidden { display: none !important; }

.action-notice {
  margin: 12px 28px 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.notice-success {
  color: #0a5f36;
  background: rgba(0, 179, 101, 0.12);
  border: 1px solid rgba(0, 179, 101, 0.3);
}

.notice-danger {
  color: #8e1d1a;
  background: rgba(245, 74, 69, 0.12);
  border: 1px solid rgba(245, 74, 69, 0.3);
}
.full-width { grid-column: 1 / -1; width: 100%; }

/* Auth Screen */
.auth-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #fff;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.logo-box {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.auth-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-main);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-item label {
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.form-item label small {
  color: var(--text-secondary);
  font-weight: 400;
}

.form-item input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s;
}

.form-item input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.1);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input {
  width: 100%;
  padding-right: 40px !important;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--primary);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(51, 112, 255, 0.35);
  outline-offset: 2px;
  border-radius: 999px;
}

.password-toggle-icon {
  width: 16px;
  height: 16px;
}

.password-toggle-icon-closed {
  display: none;
}

.password-toggle.is-visible .password-toggle-icon-open {
  display: none;
}

.password-toggle.is-visible .password-toggle-icon-closed {
  display: block;
}

.password-help-text {
  margin-top: -8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.password-tools {
  display: flex;
  gap: 10px;
  margin-top: -4px;
}

.password-tools .btn {
  height: 34px;
}

.secret-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
}

.secret-dialog {
  width: min(100%, 520px);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
}

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

.secret-dialog-header h3 {
  margin: 0;
  font-size: 18px;
}

.secret-dialog-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
}

.secret-dialog-text {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.secret-dialog-field {
  display: flex;
  gap: 10px;
}

.secret-dialog-field input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.secret-dialog-status {
  margin-top: 12px;
  color: var(--success);
  font-size: 13px;
}

.submit-btn {
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(51, 112, 255, 0.2);
}

.submit-btn:active {
  transform: translateY(0);
}

.btn-loading {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.error-msg {
  color: var(--danger);
  text-align: center;
  margin-top: 16px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* App Shell */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.24s ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 84px 1fr;
}

/* Sidebar */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 16px 8px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  height: 48px;
  margin-bottom: 16px;
}

.sidebar-collapse-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.sidebar-collapse-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

body.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.app-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.sidebar-collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}

body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  gap: 0;
  position: relative;
}

body.sidebar-collapsed .app-name,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .user-details {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  margin-left: 0;
  position: absolute;
  right: 10px;
  bottom: -14px;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-footer {
  justify-content: center;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(31, 35, 41, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: #eff3ff;
  color: var(--primary);
  font-weight: 500;
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ff9900;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-details strong {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.2;
}

.user-details small {
  font-size: 12px;
  color: var(--text-secondary);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1;
}

.logout-btn:hover {
  background: rgba(31, 35, 41, 0.05);
  color: var(--danger);
}

.logout-btn svg {
  width: 18px;
  height: 18px;
}

.logout-btn span {
  white-space: nowrap;
}

/* Main Content */
.main-content {
  background: var(--bg-body);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative; /* 增加 relative 定位，作为绝对定位子元素的参考 */
}

.top-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.badges {
  display: flex;
  gap: 8px;
}

.status-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e6f7ff;
  color: #0066cc;
  border: 1px solid #91d5ff;
}

.status-badge.neutral {
  background: #f5f5f5;
  color: #595959;
  border-color: #d9d9d9;
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px;
  width: 100%;
}

/* Banners */
.info-banner {
  background: #e8f3ff;
  border: 1px solid #b7dfff;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.banner-content {
  display: flex;
  gap: 12px;
  align-items: center;
}

.banner-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.banner-content h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text-main);
}

.banner-content p {
  margin: 0;
  color: var(--text-secondary);
}

.banner-actions {
  display: flex;
  gap: 12px;
}

.banner-actions input {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #b7dfff;
  border-radius: var(--radius-sm);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  background: var(--bg-surface);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.search-box {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 16px;
  height: 16px;
  color: var(--text-placeholder);
}

.search-box input {
  width: 100%;
  height: 32px;
  padding-left: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.select-box {
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-width: 120px;
  background: #fff;
}

.btn {
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: #f5f5f5;
  border-color: #d9d9d9;
}

.btn-link {
  background: transparent;
  color: var(--primary);
  border: none;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Sections */
.section-block {
  margin-bottom: 32px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Admin Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Admin Panels */
.admin-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #fafafa;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.panel-body {
  padding: 24px;
}

/* Forms in Panels */
.row-form {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.row-form input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 8px;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-form input, .grid-form select, .grid-form textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 14px;
}

.grid-form input, .grid-form select {
  height: 32px;
}

.grid-form textarea {
  height: 80px;
  resize: vertical;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.admin-subsection {
  margin-top: 20px;
}

.admin-subsection-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.file-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  position: relative;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s;
}

.file-drop-zone:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.file-drop-zone input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-drop-zone p {
  margin: 0;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 16px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.2s ease;
}

.upload-status-text {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.upload-status-text.is-active {
  color: var(--primary);
  font-weight: 600;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 2px;
  font-size: 14px;
  color: var(--text-main);
}

.toggle-field input {
  width: 18px;
  height: 18px;
}

.cover-config {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fafbfc;
}

#uploadCoverLibraryTrigger {
  justify-self: start;
  min-width: 160px;
}

.cover-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
}

.cover-preview img {
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #f0f2f5;
}

.cover-preview-meta {
  display: grid;
  gap: 4px;
}

.cover-preview-meta strong {
  font-size: 14px;
}

.cover-preview-meta span {
  font-size: 12px;
  color: var(--text-secondary);
}

.cover-library {
  margin-top: 0;
  max-height: 240px;
}

.cover-library-modal-toolbar {
  margin-bottom: 14px;
}

.cover-library-modal-tip {
  font-size: 13px;
  color: var(--text-secondary);
}

.cover-library-modal {
  max-height: 56vh;
}

#coverLibraryModal {
  width: 860px;
  max-width: min(860px, 92vw);
}

#coverLibraryModal .modal-body {
  padding-top: 18px;
}

.cover-library-item {
  width: 100%;
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  text-align: left;
}

.cover-library-item:last-child {
  border-bottom: none;
}

.cover-library-item:hover {
  background: #f5f8ff;
}

.cover-library-item.active {
  background: #eff3ff;
}

.cover-library-thumb {
  width: 108px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #f0f2f5;
}

.cover-library-title {
  font-weight: 500;
  color: var(--text-main);
}

.cover-library-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cover-library-tag {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

@media (max-width: 640px) {
  #uploadCoverLibraryTrigger {
    width: 100%;
    justify-self: stretch;
  }

  .cover-library-item {
    grid-template-columns: 88px 1fr;
  }

  .cover-library-tag {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10020;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: #fff;
  width: 600px;
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
  z-index: 10021;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

#collectionModal {
  width: min(820px, 94vw);
}

#videoEditModal {
  width: min(760px, 94vw);
}

#playbackModal.is-forced-visible {
  display: flex !important;
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(720px, 92vw);
  max-height: min(80vh, 720px);
  transform: translate(-50%, -50%) !important;
  z-index: 10030;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Admin Dashboard Grid */
.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.admin-tool-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.admin-tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.org-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.org-admin-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.org-admin-panel h4 {
  margin: 0;
  font-size: 16px;
}

#orgStructureModal {
  width: 980px;
  max-width: min(980px, 92vw);
}

#orgStructureModal .modal-header {
  padding: 24px 28px;
}

#orgStructureModal .modal-body {
  padding: 24px 28px 28px;
}

#orgStructureModal .row-form {
  margin-bottom: 0;
  align-items: center;
  flex-wrap: nowrap;
}

#orgStructureModal .row-form input[type="hidden"] {
  display: none;
}

#orgStructureModal .row-form input:not([type="hidden"]) {
  min-width: 0;
  flex: 1 1 auto;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
}

#orgStructureModal .row-form .btn {
  flex: 0 0 auto;
  min-width: 88px;
  height: 42px;
  padding: 0 18px;
  white-space: nowrap;
  font-weight: 600;
}

#orgStructureModal .list-container {
  margin-top: 0;
  max-height: 420px;
  border-radius: 14px;
  background: #fff;
}

#orgStructureModal .list-item {
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
}

#orgStructureModal .list-item > div:first-child {
  min-width: 0;
}

#orgStructureModal .list-item-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

#orgStructureModal .list-item-meta {
  font-size: 13px;
}

#orgStructureModal .list-item > div:last-child {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
  align-items: center;
  padding-top: 4px;
}

.tool-icon {
  width: 48px;
  height: 48px;
  background: #eff3ff;
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-info h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.tool-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  #orgStructureModal {
    width: min(92vw, 680px);
  }

  .org-admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #orgStructureModal .modal-header,
  #orgStructureModal .modal-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  #orgStructureModal .org-admin-panel {
    padding: 16px;
  }

  #orgStructureModal .row-form {
    flex-wrap: wrap;
  }

  #orgStructureModal .row-form input:not([type="hidden"]) {
    flex-basis: 100%;
  }

  #orgStructureModal .row-form .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 6px);
  }

  #orgStructureModal .list-item {
    flex-direction: column;
  }

  #orgStructureModal .list-item > div:last-child {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0;
  }
}

/* 播放器 Tab 样式，确保填满右侧区域 */
#playerTab {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: #000;
}

/* Dark Mode Player */
.player-page-dark {
  background: #000;
  color: #fff;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
}

.player-main {
  display: flex;
  flex-direction: column;
  background: #111;
  flex: 1;
  overflow: hidden;
}

.player-sidebar {
  width: 320px;
  background: #171717;
  border-left: 1px solid #2f2f2f;
  display: flex;
  flex-direction: column;
}

.player-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid #2f2f2f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-sidebar-header h3 {
  margin: 0;
  font-size: 15px;
  color: #f1f1f1;
}

.dark-video-wrapper {
  width: 100%;
  flex: 1;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dark-video-wrapper.has-document {
  background: linear-gradient(180deg, #101010 0%, #050505 100%);
}

.dark-video-wrapper.is-docked {
  display: grid;
  grid-template-columns: minmax(280px, var(--player-video-width, 50%)) 10px minmax(280px, 1fr);
  align-items: stretch;
  justify-content: stretch;
}

.dark-video-wrapper.is-floating-mode {
  display: block;
}

.floating-video-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  order: 1;
}

.floating-video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.floating-video-shell.is-fullscreen {
  width: 100%;
  height: 100%;
}

.floating-video-shell.is-fullscreen .floating-video-handle {
  display: none;
}

.floating-video-shell.is-docked {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.floating-video-shell.is-docked .floating-video-handle {
  display: inline-flex;
}

.floating-video-shell.is-floating {
  position: absolute;
  width: min(30vw, 360px);
  height: min(22vw, 220px);
  min-width: 240px;
  min-height: 150px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

.floating-video-shell.is-floating video {
  object-fit: cover;
}

.floating-video-shell.is-dragging,
.floating-video-shell.is-resizing {
  cursor: grabbing;
}

.floating-video-handle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: grab;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.floating-video-shell.is-docked .floating-video-handle {
  top: 12px;
  left: 12px;
  background: rgba(17, 17, 17, 0.58);
}

.floating-video-resize {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-right: 2px solid rgba(255, 255, 255, 0.86);
  border-bottom: 2px solid rgba(255, 255, 255, 0.86);
  border-bottom-right-radius: 4px;
  cursor: nwse-resize;
  z-index: 4;
  opacity: 0.9;
}

.document-viewer {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  min-width: 0;
  min-height: 0;
  order: 3;
}

.document-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.player-splitter {
  width: 10px;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 100%);
  cursor: col-resize;
  border-left: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.08);
  order: 2;
}

.player-splitter::after {
  content: '';
  display: block;
  width: 2px;
  height: 72px;
  border-radius: 999px;
  background: rgba(255,255,255,0.56);
  margin: calc(50% - 36px) auto 0;
}

body.player-resizing {
  cursor: col-resize;
  user-select: none;
}

.player-dock-hint {
  position: absolute;
  top: 22px;
  left: 22px;
  bottom: 22px;
  width: min(240px, 32%);
  border: 2px dashed rgba(114, 153, 255, 0.48);
  border-radius: 22px;
  background: rgba(74, 121, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  font-size: 14px;
  line-height: 1.6;
  z-index: 2;
  pointer-events: none;
}

.player-dock-hint.is-active {
  background: rgba(74, 121, 255, 0.18);
  border-color: rgba(141, 173, 255, 0.86);
}

.player-meta-dark {
  min-height: 78px;
  padding: 12px 16px;
  background: #161616;
  border-top: 1px solid #2b2b2b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.player-meta-main h2 {
  margin: 0;
  font-size: 22px;
  color: #fff;
}

.player-meta-main p {
  margin: 4px 0 0;
  color: #9a9a9a;
  font-size: 13px;
}

.player-meta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-select {
  min-width: 74px;
  padding: 6px 10px;
  color: #fff;
  background: #262626;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  outline: none;
}

.player-list-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: #262626;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 6px 10px;
}

.playlist-dark {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.playlist-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.playlist-item:hover {
  background: rgba(255,255,255,0.1);
}

.playlist-item.is-active {
  background: rgba(74, 121, 255, 0.22);
  outline: 1px solid rgba(113, 150, 255, 0.42);
}

.playlist-item.is-secondary {
  margin-left: 14px;
  padding-left: 16px;
  border-left: 2px solid rgba(113, 150, 255, 0.28);
}

.playlist-thumb {
  width: 120px;
  aspect-ratio: 16/9;
  background: #333;
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #303030, #1f1f1f);
  color: #b8b8b8;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.playlist-info h5 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.4;
  color: #ddd;
}

.playlist-info span {
  font-size: 12px;
  color: #888;
}

.playlist-type {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #cfd7ff;
  background: rgba(88, 119, 255, 0.16);
}

/* Tags & Lists */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  background: #f5f6f7;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-delete {
  cursor: pointer;
  color: var(--text-placeholder);
}

.tag-delete:hover {
  color: var(--danger);
}

.list-container {
  margin-top: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
}

.list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-title {
  font-weight: 500;
}

.list-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.content-admin-groups {
  display: grid;
  gap: 14px;
  padding: 12px;
}

.content-admin-group {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.content-admin-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: #faf7f9;
  border-bottom: 1px solid var(--border-color);
}

.content-admin-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #b94b74;
  background: rgba(185, 75, 116, 0.12);
}

.content-admin-group-list .list-item {
  border-bottom: 1px solid var(--border-color);
}

.content-admin-group-list .list-item:last-child {
  border-bottom: none;
}

.content-admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.content-admin-item-actions .btn-link {
  white-space: nowrap;
}

.content-admin-subitem {
  padding-left: 28px;
  background: linear-gradient(180deg, #fffdf7 0%, #fffaf0 100%);
}

.content-admin-subitem .list-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content-admin-subitem-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #9a5a00;
  background: rgba(191, 127, 0, 0.12);
}

/* Card Styling (Dynamic Content) */
.card-item {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.card-thumb {
  aspect-ratio: 16/9;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-placeholder);
  font-size: 40px;
}

.card-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
  color: var(--text-main);
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 12px;
}

.card-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-admin-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-badge {
  font-size: 12px;
  padding: 2px 6px;
  background: #f5f6f7;
  border-radius: 4px;
  color: var(--text-secondary);
}

.card-badge-accent {
  background: #e9f0ff;
  color: var(--primary);
}

.play-action {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
}

.playback-modal-toolbar {
  margin-bottom: 16px;
}

.playback-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.playback-summary-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.playback-summary-card strong {
  font-size: 16px;
  color: var(--text-main);
}

.playback-summary-card span {
  font-size: 12px;
  color: var(--text-secondary);
}

.playback-report-list {
  display: grid;
  gap: 12px;
}

.playback-report-item {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #fff;
}

.playback-report-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.playback-report-percent {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.playback-progress-track {
  width: 100%;
  height: 10px;
  margin: 12px 0 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.playback-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3370ff 0%, #6aa4ff 100%);
}

.playback-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

#videoEditTitle[readonly] {
  background: #fff7fb;
  color: var(--text-main);
}

@media (max-width: 900px) {
  .playback-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .playback-summary-grid {
    grid-template-columns: 1fr;
  }

  .floating-video-shell.is-floating {
    width: calc(100% - 32px);
    min-width: 0;
    height: 180px;
  }
}
