* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif; background: #f0f2f5; color: #333; line-height: 1.6; min-height: 100vh; }
a { color: #1677ff; text-decoration: none; }
a:hover { color: #4096ff; }

/* Flash Messages */
.flash-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 420px; width: calc(100% - 32px); }
.flash { padding: 12px 20px; border-radius: 8px; font-size: 14px; text-align: center; animation: flashIn 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.flash-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.flash-error { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.flash-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* Auth Pages - QQ Mail Style */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; position: relative; overflow: hidden; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.auth-page::before { content: ""; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(22,119,255,0.15) 0%, transparent 70%); top: -150px; right: -150px; pointer-events: none; }
.auth-page::after { content: ""; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(118,75,162,0.12) 0%, transparent 70%); bottom: -100px; left: -100px; pointer-events: none; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.2); padding: 44px 32px 36px; position: relative; z-index: 1; }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { font-size: 28px; font-weight: 600; color: #1677ff; letter-spacing: -0.5px; }
.auth-subtitle { font-size: 14px; color: #999; margin-top: 8px; }
.auth-desc { font-size: 14px; color: #666; text-align: center; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-links { text-align: center; margin-top: 24px; font-size: 14px; }
.auth-link { color: #1677ff; font-size: 14px; }
.auth-link:hover { color: #4096ff; }
.auth-sep { color: #d9d9d9; margin: 0 8px; }
.auth-notice { text-align: center; margin-top: 20px; padding: 10px 16px; background: #fff7e6; border: 1px solid #ffd591; border-radius: 8px; font-size: 12px; color: #d46b08; line-height: 1.5; }
.auth-footer { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(255,255,255,0.4); z-index: 1; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 500; color: #333; }
.form-input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 15px; color: #333; background: #fff; transition: border-color 0.2s, box-shadow 0.2s; }
.form-input:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,0.15); }
.form-input::placeholder { color: #bfbfbf; }
.form-textarea { height: auto; padding: 10px 14px; resize: vertical; min-height: 80px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .form-input { flex: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: #1677ff; color: #fff; border-color: #1677ff; }
.btn-primary:hover { background: #4096ff; border-color: #4096ff; color: #fff; }
.btn-outline { background: #fff; color: #333; border-color: #d9d9d9; }
.btn-outline:hover { color: #1677ff; border-color: #1677ff; }
.btn-danger { background: #fff; color: #ff4d4f; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff4d4f; color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; font-size: 16px; }

/* Top Bar */
.top-bar { background: #fff; border-bottom: 1px solid #e8e8e8; padding: 0 24px; position: sticky; top: 0; z-index: 100; }
.top-bar-inner { max-width: 1200px; margin: 0 auto; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.site-title { font-size: 18px; font-weight: 600; color: #1677ff; }
.top-bar-actions { display: flex; gap: 8px; align-items: center; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 22px; font-weight: 600; }

/* Album Grid */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.album-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: box-shadow 0.2s, transform 0.2s; text-decoration: none; color: #333; }
.album-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); color: #333; }
.album-cover { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #f5f5f5; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #d9d9d9; }
.album-info { padding: 16px; }
.album-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.album-meta { font-size: 13px; color: #999; }

/* Photo Grid */
.media-grid, .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media-card, .photo-card { position: relative; border-radius: 8px; overflow: hidden; background: #f5f5f5; cursor: pointer; aspect-ratio: 1; }
.media-card img, .photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.media-card:hover img, .photo-card:hover img { transform: scale(1.05); }
.photo-manage:hover .photo-actions { display: flex; }
.photo-actions { display: none; position: absolute; top: 8px; right: 8px; gap: 4px; }

.photo-grid-manage .photo-card { aspect-ratio: auto; min-height: 160px; }
.photo-checkbox { position: absolute; top: 6px; left: 6px; z-index: 3; background: rgba(255,255,255,0.85); border-radius: 4px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photo-checkbox input { width: 16px; height: 16px; cursor: pointer; }
.photo-name { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-bar { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; padding: 10px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; font-size: 14px; position: sticky; top: 56px; z-index: 50; }
.batch-bar .checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.batch-bar .checkbox-label input { width: 16px; height: 16px; }
.batch-count { color: #666; font-size: 13px; flex: 1; }
.page-header-actions { display: flex; gap: 8px; }

.media-video-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.25); z-index: 2; transition: background 0.3s; }
.media-card:hover .media-video-overlay { background: rgba(0,0,0,0.4); }
.play-icon { font-size: 40px; color: #fff; opacity: 0.9; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.media-video-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a2e, #16213e); }
.play-icon-large { font-size: 48px; color: rgba(255,255,255,0.7); }
.lightbox-video { max-width: 90%; max-height: 90%; border-radius: 4px; }

/* Lightbox */
.lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9998; align-items: center; justify-content: center; }
.lightbox-content { max-width: 90%; max-height: 90%; object-fit: contain; border-radius: 4px; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 40px; cursor: pointer; opacity: 0.7; }
.lightbox-close:hover { opacity: 1; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state p { font-size: 16px; margin-bottom: 8px; }
.text-muted { color: #999; font-size: 14px; }
.text-danger { color: #ff4d4f; }

/* Admin */
.admin-nav { display: flex; gap: 4px; margin-bottom: 24px; background: #fff; border-radius: 8px; padding: 4px; }
.admin-nav-link { padding: 8px 20px; border-radius: 6px; font-size: 14px; color: #666; text-decoration: none; transition: all 0.2s; }
.admin-nav-link:hover { background: #f5f5f5; color: #1677ff; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 24px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-number { font-size: 36px; font-weight: 700; color: #1677ff; }
.stat-label { font-size: 14px; color: #999; margin-top: 4px; }

/* Data Table */
.data-table { width: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; font-size: 14px; }
.data-table th { background: #fafafa; font-weight: 600; color: #666; border-bottom: 1px solid #f0f0f0; }
.data-table td { border-bottom: 1px solid #f0f0f0; }
.data-table tr:last-child td { border-bottom: none; }
.action-cell { display: flex; gap: 4px; }

/* Upload Zone */
.upload-zone { border: 2px dashed #d9d9d9; border-radius: 12px; padding: 60px 20px; text-align: center; cursor: pointer; transition: all 0.2s; background: #fafafa; }
.upload-zone:hover, .upload-zone.dragover { border-color: #1677ff; background: #f0f5ff; }
.upload-hint p { margin-bottom: 8px; }
.upload-icon { font-size: 48px; line-height: 1; }
.upload-input { display: none; }
.upload-progress { margin-top: 20px; }
.progress-bar { height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #1677ff; border-radius: 3px; width: 0; transition: width 0.3s; }
.upload-result { margin-top: 16px; }
.upload-result-item { padding: 8px 12px; font-size: 13px; border-radius: 4px; margin-bottom: 4px; }
.upload-result-ok { background: #f6ffed; color: #52c41a; }
.upload-result-skipped { background: #fffbe6; color: #faad14; }

.form-actions { display: flex; gap: 8px; margin-top: 20px; }

@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .album-grid { grid-template-columns: 1fr; }
  .media-grid, .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .top-bar { padding: 0 12px; }
  .container { padding: 16px; }
  .admin-nav { flex-wrap: wrap; }
}
