/* ============================================
   全局交互组件样式
   ============================================ */

/* ---------- Video Player Modal ---------- */
.video-player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-player-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.video-player {
  width: 90%;
  max-width: 960px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.video-player-overlay.active .video-player {
  transform: scale(1);
}

.video-player-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-player-close:hover { background: rgba(255,255,255,0.2); }

.video-screen {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0a0e27, #1a1f3a);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.video-screen .play-icon {
  width: 80px;
  height: 80px;
  background: rgba(245, 166, 35, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 0 40px rgba(245, 166, 35, 0.3);
}

.video-screen .play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 24px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

.video-screen.playing .play-icon { display: none; }

.video-screen .pause-icon {
  display: none;
  gap: 6px;
}

.video-screen.playing .pause-icon {
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s;
}

.video-screen.playing:hover .pause-icon { opacity: 1; }

.pause-icon .bar {
  width: 6px;
  height: 28px;
  background: #fff;
  border-radius: 3px;
}

.video-progress-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: height 0.2s;
}

.video-progress-wrap:hover { height: 8px; }

.video-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  width: 0%;
  transition: width 0.3s linear;
  border-radius: 0 2px 2px 0;
  position: relative;
}

.video-progress-bar::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
}

.video-progress-wrap:hover .video-progress-bar::after { opacity: 1; }

.video-controls {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #111;
  gap: 16px;
}

.video-controls .time {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  font-family: monospace;
}

.video-controls .ctrl-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 4px;
  transition: color 0.2s;
}

.video-controls .ctrl-btn:hover { color: #fff; }

.video-controls .vol-bar {
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}

.video-controls .vol-fill {
  width: 70%;
  height: 100%;
  background: var(--color-accent);
}

.video-info-bar {
  padding: 16px 20px;
  background: #111;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.video-info-bar h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 4px; }

.video-info-bar .meta {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
}

/* Video paywall overlay */
.video-paywall {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 26, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
}

.video-paywall h3 { font-size: 1.25rem; font-weight: 600; }
.video-paywall p { color: rgba(255,255,255,0.6); font-size: 0.875rem; }

/* ---------- Article Detail Modal ---------- */
.article-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 26, 0.92);
  z-index: 3000;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.article-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.article-detail {
  max-width: 800px;
  margin: 40px auto;
  padding: 48px;
  background: var(--color-bg-mid);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--color-text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-detail-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.article-detail .article-header { margin-bottom: 32px; }

.article-detail .article-header .tag-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.article-detail .article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-detail .article-meta {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.article-body {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--color-text-secondary);
}

.article-body h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 32px 0 16px;
}

.article-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 24px 0 12px;
}

.article-body p { margin-bottom: 16px; }

.article-body ul, .article-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
  list-style: disc;
  color: var(--color-text-secondary);
}

.article-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(245, 166, 35, 0.04);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.article-body code {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: 'Fira Code', monospace;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

.article-nav a {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.article-nav a:hover { color: var(--color-accent); }

/* ---------- PDF Viewer ---------- */
.pdf-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pdf-viewer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.pdf-toolbar h3 { font-size: 0.9375rem; font-weight: 600; }

.pdf-toolbar .pdf-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pdf-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 32px;
  background: #2a2a2a;
}

.pdf-page {
  width: 680px;
  min-height: 960px;
  background: #fff;
  border-radius: 4px;
  padding: 60px;
  color: #333;
  font-size: 14px;
  line-height: 1.8;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.pdf-page h1 { font-size: 24px; color: #1a1a2e; margin-bottom: 8px; text-align: center; }
.pdf-page h2 { font-size: 18px; color: #1a1a2e; margin: 24px 0 12px; border-bottom: 2px solid #f5a623; padding-bottom: 6px; }
.pdf-page h3 { font-size: 15px; color: #333; margin: 16px 0 8px; }
.pdf-page .subtitle { text-align: center; color: #888; font-size: 13px; margin-bottom: 32px; }
.pdf-page p { margin-bottom: 12px; text-align: justify; }
.pdf-page .highlight { background: rgba(245, 166, 35, 0.1); padding: 12px 16px; border-radius: 6px; border-left: 3px solid #f5a623; margin: 16px 0; }
.pdf-page table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.pdf-page th, .pdf-page td { border: 1px solid #ddd; padding: 8px 12px; font-size: 13px; text-align: left; }
.pdf-page th { background: #f5f5f5; font-weight: 600; }

/* ---------- Confirm Dialog ---------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.confirm-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-dialog {
  background: var(--color-bg-mid);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.confirm-overlay.active .confirm-dialog { transform: scale(1); }

.confirm-dialog .icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 16px;
}

.confirm-dialog .icon.warning { background: rgba(251, 191, 36, 0.1); }
.confirm-dialog .icon.danger { background: rgba(248, 113, 113, 0.1); }
.confirm-dialog .icon.success { background: rgba(52, 211, 153, 0.1); }

.confirm-dialog h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }

.confirm-dialog p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.confirm-dialog .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ---------- QR Code Payment ---------- */
.qr-payment {
  text-align: center;
  padding: 20px;
}

.qr-code-box {
  width: 200px;
  height: 200px;
  background: #fff;
  border-radius: 12px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.qr-code-box .qr-pattern {
  width: 160px;
  height: 160px;
  background-image:
    linear-gradient(45deg, #333 25%, transparent 25%),
    linear-gradient(-45deg, #333 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #333 75%),
    linear-gradient(-45deg, transparent 75%, #333 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  opacity: 0.3;
  border-radius: 4px;
}

.qr-code-box .qr-logo {
  position: absolute;
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qr-timer {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 12px;
}

.qr-status {
  margin-top: 16px;
  font-size: 0.875rem;
}

.qr-status.scanning { color: var(--color-accent); }
.qr-status.success { color: #34d399; }

/* ---------- Edit Form Inside Modal ---------- */
.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.edit-form-grid .full-width { grid-column: span 2; }

.edit-form-grid .form-group { margin-bottom: 0; }

/* Rich text editor simulation */
.rich-editor {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
}

.rich-editor-toolbar {
  display: flex;
  gap: 2px;
  padding: 8px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.rich-editor-toolbar button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.15s;
}

.rich-editor-toolbar button:hover {
  background: rgba(255,255,255,0.06);
  color: var(--color-text-primary);
}

.rich-editor-toolbar button.active {
  background: rgba(245,166,35,0.1);
  color: var(--color-accent);
}

.rich-editor-body {
  min-height: 200px;
  padding: 16px;
  outline: none;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ---------- Form Validation ---------- */
.form-group.error .form-input {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.form-group.error .form-error {
  display: block;
}

.form-error {
  display: none;
  font-size: 0.75rem;
  color: #f87171;
  margin-top: 4px;
}

.form-group.success .form-input {
  border-color: #34d399;
}

/* ---------- Notification Badge ---------- */
.notif-dot {
  width: 8px;
  height: 8px;
  background: #f87171;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  animation: pulse-glow 2s infinite;
}

/* ---------- Image Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

/* ---------- Success State ---------- */
.success-state {
  text-align: center;
  padding: 40px 20px;
  animation: fadeInUp 0.5s ease;
}

.success-checkmark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  border: 2px solid rgba(52, 211, 153, 0.3);
  animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  50% { transform: scale(1.2); }
  to { transform: scale(1); }
}

.success-state h3 { font-size: 1.25rem; margin-bottom: 8px; color: #34d399; }
.success-state p { color: var(--color-text-muted); font-size: 0.875rem; margin-bottom: 24px; }

/* ---------- Skeleton Loading ---------- */
.skeleton-block {
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255,255,255,0.08) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}

.skeleton-block.w-75 { width: 75%; }
.skeleton-block.w-50 { width: 50%; }
.skeleton-block.w-30 { width: 30%; }
.skeleton-block.h-lg { height: 200px; border-radius: 12px; margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .article-detail { margin: 16px; padding: 24px; }
  .article-detail .article-header h1 { font-size: 1.375rem; }
  .pdf-page { width: 100%; padding: 32px; }
  .pdf-body { padding: 16px; }
  .video-player { width: 98%; }
  .edit-form-grid { grid-template-columns: 1fr; }
  .edit-form-grid .full-width { grid-column: span 1; }
  .confirm-dialog { padding: 24px; }
}
