* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   骨架屏系统（核心修复）
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease infinite;
  border-radius: 4px;
  color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
  user-select: none;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 16px; width: 72px; display: inline-block; vertical-align: middle; border-radius: 4px; }
.skeleton-badge { height: 22px; width: 48px; border-radius: 11px; display: inline-block; vertical-align: middle; }
.skeleton-circle { border-radius: 50%; }

/* 运营位骨架 */
.promo-skeleton { background: #f8fafc !important; border: 1px dashed #e2e8f0 !important; }
.promo-skeleton * { opacity: 0.6; }

/* 文件骨架屏网格 */
.file-skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; }
.file-skeleton-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.file-skeleton-thumb {
  width: 100%;
  height: 140px;  /* 和 .file-thumb 保持一致 */
}
.file-skeleton-line { height: 12px; margin: 12px; border-radius: 4px; }
.file-skeleton-line.short { width: 60%; margin-top: 0; }
@media (min-width: 768px) { .file-skeleton-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .file-skeleton-grid { grid-template-columns: repeat(4, 1fr); } }

/* 账号页骨架 */
.account-skeleton-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.account-skeleton-icon { width: 36px; height: 36px; border-radius: 10px; }
.account-skeleton-title { height: 18px; width: 80px; border-radius: 4px; }
.account-skeleton-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f8fafc; }
.account-skeleton-row:last-child { border-bottom: none; }
.account-skeleton-label { height: 14px; width: 60px; }
.account-skeleton-value { height: 14px; width: 100px; }

/* 内容淡入动画（带位移） */
.content-fade-in {
  animation: contentFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 运营位纯淡入（无位移，避免刷新时卡顿） */
.promo-fade-in {
  animation: promoFadeIn 0.3s ease forwards;
}
@keyframes promoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Header
   ============================================ */
.header {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge:hover {
  opacity: 0.85;
}

.badge.vip { background: #f59e0b; }
.badge.normal { background: #10b981; }
.badge.expired { background: #ef4444; }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.75rem;
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.35);
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.7rem;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.2s;
}

.btn-xs:hover {
  background: #1d4ed8;
}

/* ===== Tab 标签栏（保留用于兼容，实际已移除DOM） ===== */
.tab-group {
  display: none;
}

.tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 12px;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.tab.active {
  color: #fff;
}

.tab-indicator {
  display: none;
}

.admin-tab {
  flex: 0 0 80px;
  background: #fef3c7;
  color: #92400e;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  color: #cbd5e1;
}

.empty-state-icon svg {
  display: block;
  margin: 0 auto;
}

.empty-state-title {
  font-size: 16px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 20px;
}

.empty-state-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s;
}

.empty-state-btn:hover {
  transform: translateY(-2px);
}

.expiry-alert {
  color: #fff;
  padding: 14px 20px;
  text-align: center;
  font-size: 14px;
  position: relative;
}

.expiry-alert.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.expiry-alert.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.expiry-alert.info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.expiry-alert-btn {
  display: inline-block;
  margin-left: 12px;
  padding: 6px 16px;
  background: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.expiry-alert-btn.danger { color: #dc2626; }
.expiry-alert-btn.warning { color: #d97706; }
.expiry-alert-btn.info { color: #2563eb; }

.expiry-alert-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  z-index: 2;
}

.container {
  flex: 1;
  padding-bottom: 20px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin: 12px 16px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.panel:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.panel-title {
  font-size: 1.1rem;
  margin-bottom: 18px;
  color: #0f172a;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.sub-title {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: #334155;
  font-weight: 600;
}

/* ===== 账号信息卡片化 ===== */
.account-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin: 0 16px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.account-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.account-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-card-icon svg {
  width: 20px;
  height: 20px;
}

.account-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.account-info-grid {
  display: grid;
  gap: 12px;
}

.account-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
}

.account-info-item:last-child {
  border-bottom: none;
}

.account-info-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.account-info-value {
  font-size: 0.9rem;
  color: #1e293b;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}

input[type=text],
input[type=password],
input[type=email],
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  background: #fafbfc;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: #2563eb;
  background: #fff;
}

.dual-row {
  display: flex;
  gap: 8px;
}

.dual-row input, .dual-row select {
  flex: 1;
}

.btn {
  display: block;
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.primary-btn {
  background: #2563eb;
  color: #fff;
}

.primary-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.warn-btn {
  background: #f59e0b;
  color: #fff;
}

.warn-btn:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.btn-group {
  margin: 16px 0;
}

.result-box {
  margin-top: 16px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-box.show {
  max-height: 300px;
  opacity: 1;
}

.result-box-inner {
  padding: 16px;
  background: #eff6ff;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
}

.link-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #1e40af;
  font-weight: 600;
}

.result-text {
  font-size: 0.85rem;
  color: #334155;
  word-break: break-all;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
}

.copy-btn {
  padding: 8px 16px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #1d4ed8;
}

.copy-btn.copied {
  background: #10b981;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.filter-btn:hover:not(.active) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

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

.file-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.file-thumb {
  width: 100%;
  height: 140px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

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

.video-thumb {
  font-size: 2.2rem;
  color: #94a3b8;
}

.file-type-icon {
  width: 48px;
  height: 48px;
  color: #94a3b8;
}

.view-detail-btn {
  width: 100%;
  padding: 8px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0 0 12px 12px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 0.2s;
}

.view-detail-btn:hover {
  background: #1d4ed8;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  grid-column: 1 / -1;
  font-size: 0.9rem;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  font-size: 0.9rem;
  color: #334155;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input:checked + .slider {
  background-color: #2563eb;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

input:disabled + .slider {
  background-color: #e2e8f0;
  cursor: not-allowed;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.info-row span:first-child {
  color: #64748b;
  font-weight: 500;
}

.info-value {
  display: flex;
  align-items: center;
}

.tip {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 12px;
  line-height: 1.6;
}

.danger-tip {
  color: #ef4444;
  font-weight: 500;
}

.divider {
  height: 1px;
  background: #f1f5f9;
  margin: 20px 0;
}

.pagination {
  text-align: center;
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pagination button {
  padding: 6px 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.pagination button.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.pagination button:hover:not(.active) {
  border-color: #cbd5e1;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.85rem;
  z-index: 9999999 !important;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  min-width: 160px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.global-loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  z-index: 9998;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.global-loading-mask .loading-text {
  color: #64748b;
  font-size: 14px;
  margin: 0;
}

.file-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.file-loading p {
  color: #94a3b8;
  font-size: 14px;
}

.lightbox-wrap{position:fixed;inset:0;background:rgba(0,0,0,.85);display:none;justify-content:center;align-items:center;z-index:99999;}
.lightbox-close{position:absolute;top:16px;right:20px;font-size:40px;color:#fff;cursor:pointer;width:44px;height:44px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background .2s;}
.lightbox-close:hover{background:rgba(255,255,255,.15);}
.lightbox-media{max-width:85%;max-height:85%;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.3);}

.modal-wrap{position:fixed;inset:0;background:rgba(0,0,0,.7);display:none;justify-content:center;align-items:center;z-index:99998;padding:16px;}
.modal-card{background:#fff;border-radius:16px;max-width:460px;width:100%;max-height:82vh;overflow:auto;padding:16px;position:relative;}
.modal-close{position:absolute;top:10px;right:12px;font-size:24px;color:#94a3b8;cursor:pointer;}
.modal-media{width:100%;max-height:220px;object-fit:cover;border-radius:12px;margin-bottom:12px;background:#f1f5f9;}
.modal-info{background:#f8fafc;border-radius:12px;padding:12px;margin-bottom:12px;}
.info-item{display:flex;justify-content:space-between;padding:6px 0;font-size:.85rem;}
.info-item span:first-child{color:#64748b;}
.text-break{word-break:break-all;text-align:right;max-width:60%;}
.modal-btns{display:flex;gap:10px;}
.secondary-btn{background:#94a3b8;color:#fff;}
.secondary-btn:hover{background:#64748b;}
.danger-btn{background:#ef4444;color:#fff;}
.danger-btn:hover{background:#dc2626;}

.file-badge{position:absolute;top:8px;left:8px;background:rgba(0,0,0,.7);color:#fff;padding:3px 10px;border-radius:8px;font-size:11px;font-weight:bold;}
.file-del-btn{position:absolute;top:8px;right:8px;padding:4px 10px;font-size:12px;border:none;border-radius:8px;background:#ef4444;color:#fff;cursor:pointer;opacity:.9;z-index:2;}
.file-del-btn:hover{opacity:1;}

.file-stats{text-align:center;padding:8px 0;font-size:13px;color:#64748b;margin-bottom:12px;}
.c-blue{color:#2563eb;}
.c-red{color:#ef4444;}

.location-card {
  max-width: 480px;
  width: 90%;
  max-height: 82vh;
  overflow: auto;
}
.loc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.loc-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}
.loc-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.2s;
}
.loc-close:hover {
  background: #f3f4f6;
}
.loc-body {
  padding: 20px;
}
#locLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}
#locLoading p {
  margin-top: 12px;
  color: #6b7280;
  font-size: 14px;
}
.loc-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: locSpin 1s linear infinite;
}
@keyframes locSpin {
  to { transform: rotate(360deg); }
}
#locError {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  color: #ef4444;
}
.loc-error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.loc-cell {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.loc-cell.full {
  grid-column: 1 / -1;
}
.loc-tag {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}
.loc-val {
  font-size: 14px;
  color: #1e293b;
  font-weight: 600;
  word-break: break-all;
}
.loc-btn {
  padding: 3px 10px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
  font-weight: 500;
  vertical-align: middle;
}
.loc-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}
#locationModal {
  z-index: 100000;
}

@media (max-width: 480px) {
  .location-grid {
    grid-template-columns: 1fr;
  }
}

.loc-footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
  text-align: center;
}
.loc-disclaimer {
  font-size: 11px;
  color: #9ca3af;
  display: block;
}

.vip-limit-card {
  max-width: 360px;
  width: 90%;
  text-align: center;
  padding: 32px 24px;
}
.vip-limit-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.vip-limit-icon {
  margin-bottom: 16px;
}
.vip-limit-body h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #1f2937;
  font-weight: 600;
}
.vip-limit-body p {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}
.vip-limit-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.vip-limit-btns .btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}
.vip-limit-btns .secondary-btn {
  background: #f3f4f6;
  color: #4b5563;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.vip-limit-btns .secondary-btn:hover {
  background: #e5e7eb;
}
#vipLimitModal {
  z-index: 100001;
}

.admin-panel {
  background: #fff;
  padding: 20px;
  margin: 0 16px 16px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.admin-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}

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

.admin-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #64748b;
}

.admin-table tr:hover {
  background: #f8fafc;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.on { background: #10b981; }
.status-dot.off { background: #ef4444; }
.status-dot.warn { background: #f59e0b; }

/* ===== 桌面端 Sidebar ===== */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 240px; height: 100vh;
  background: linear-gradient(180deg, #2563eb, #3b82f6);
  z-index: 300;
  display: none;
  flex-direction: column;
  padding: 20px 0;
  box-shadow: 4px 0 16px rgba(37, 99, 235, 0.15);
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 12px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: #fff; color: #2563eb;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
}
.logo-text {
  color: #fff; font-weight: 700; font-size: 1.1rem;
  letter-spacing: 0.5px;
}
.sidebar-nav { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  margin: 4px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.nav-item svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: #fff; border-radius: 0 3px 3px 0;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.admin-nav-item { opacity: 0.9; }

/* ===== 移动端底部 Tab（毛玻璃修复版） ===== */
.bottom-tab {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.04);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 8px 12px;
  flex: 1;
}
.tab-item svg {
  width: 22px; height: 22px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.2s;
}
.tab-item.active {
  color: #2563eb;
  transform: translateY(-2px);
}
.tab-item.active svg {
  transform: translateY(-1px);
}

/* ===== 返回顶部 ===== */
.back-top {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 150;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.back-top.show {
  opacity: 1;
  visibility: visible;
}
.back-top:active {
  transform: scale(0.92);
}

/* ===== 文件页下拉刷新 ===== */
.pull-refresh-area {
  height: 0;
  overflow: hidden;
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(4px);
  border-radius: 0 0 12px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pull-refresh-area.active {
  height: 60px;
}

.pull-refresh-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.pull-refresh-area.active .pull-refresh-inner {
  opacity: 1;
  transform: translateY(0);
}

.pull-spinner {
  width: 20px;
  height: 20px;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.pull-spinner svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pull-refresh-area.ready .pull-spinner {
  color: #2563eb;
  transform: rotate(180deg);
}

.pull-refresh-area.loading .pull-spinner {
  color: #2563eb;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pull-text {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  transition: color 0.2s;
}

.pull-refresh-area.ready .pull-text {
  color: #2563eb;
}

.pull-refresh-area.loading .pull-text {
  color: #2563eb;
}

/* ===== 页面切换动画 ===== */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== 响应式布局 ===== */
@media (min-width: 768px) {
  .sidebar { display: flex; }
  .bottom-tab { display: none !important; }
  .main-content { margin-left: 240px; }
  .header { margin-left: 240px; }
  .app { max-width: none; }
  .file-grid { grid-template-columns: repeat(3, 1fr); }
  .file-thumb { height: 160px; }
}

@media (min-width: 1024px) {
  .file-grid { grid-template-columns: repeat(4, 1fr); }
  .file-thumb { height: 180px; }
}

@media (max-width: 767px) {
  .sidebar { display: none !important; }
  .bottom-tab { display: flex; }
  .main-content { margin-left: 0 !important; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .header { margin-left: 0 !important; }
  .app { max-width: 720px; }
  
  .tab-content {
    display: none;
  }
  .tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
  }
}

/* ===== VIP弹窗层级修复 ===== */
#vipLimitModal { z-index: 100001 !important; }
#locationModal { z-index: 100000 !important; }
.lightbox-wrap { z-index: 99999 !important; }
#fileDetailModal { z-index: 99998 !important; }

/* ===== 浮动客服 ===== */
.chat-widget {
  position: fixed;
  z-index: 100002;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  pointer-events: none;
}

.chat-widget > * {
  pointer-events: auto;
}

.chat-float-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chat-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.chat-float-btn:active {
  transform: scale(0.95);
}

.chat-float-btn.dragging {
  transition: none;
  cursor: grabbing;
}

.chat-float-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-float-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  display: block;
}

.chat-float-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* 聊天窗口 */
.chat-window {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-window.open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-header {
  height: 54px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.chat-header:active {
  cursor: grabbing;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  object-fit: cover;
  background: #fff;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.chat-header-title {
  font-size: 15px;
  font-weight: 600;
}

.chat-header-status {
  font-size: 11px;
  opacity: 0.85;
}

.chat-header-btns {
  display: flex;
  gap: 4px;
}

.chat-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.chat-header-btn:hover {
  background: rgba(255,255,255,0.28);
}

.chat-header-btn:active {
  background: rgba(255,255,255,0.35);
}

.chat-header-btn.text-btn {
  width: auto;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.chat-header-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #f5f6f7;
}

.chat-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* 移动端适配 */
@media (max-width: 767px) {
  .chat-float-btn {
    right: 16px;
    bottom: 76px;
    width: 52px;
    height: 52px;
  }

  .chat-float-icon svg {
    width: 24px;
    height: 24px;
  }

  .chat-window {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    transform: translateY(100%);
  }

  .chat-window.open {
    transform: translateY(0);
  }

  .chat-header {
    padding: max(14px, env(safe-area-inset-top)) 14px 14px;
    height: auto;
    min-height: 54px;
  }

  .chat-body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* 平板适配 */
@media (min-width: 768px) and (max-width: 1023px) {
  .chat-window {
    width: 380px;
    height: 550px;
  }
}

@media (max-width: 767px) {
  .back-top {
    right: 16px;
    bottom: 140px;
  }
}

/* ============================================
   App 级按压反馈
   ============================================ */
.btn, .tab-item, .nav-item, .file-card, .promo-item, 
.filter-btn, .view-detail-btn, .file-del-btn, 
.empty-state-btn, .btn-sm, .btn-xs, .copy-btn,
.promo-btn, .loc-btn, .chat-float-btn, .chat-header-btn {
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), 
              background-color 0.2s, 
              box-shadow 0.2s, 
              opacity 0.2s;
}
.btn:active, .tab-item:active, .nav-item:active, 
.filter-btn:active, .empty-state-btn:active, 
.btn-sm:active, .btn-xs:active, .copy-btn:active,
.promo-btn:active, .loc-btn:active, .chat-header-btn:active {
  transform: scale(0.94);
}
.file-card:active { transform: scale(0.97); }
.view-detail-btn:active, .file-del-btn:active { transform: scale(0.96); }
.chat-float-btn:active { transform: scale(0.90); }

/* 去除移动端点击高亮 */
button, a, .tab-item, .nav-item, .file-card, .promo-item, 
.filter-btn, .btn, .chat-float-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 硬件加速 */
.tab-content, .file-grid, .panel, .account-card, .promo-wrap {
  transform: translateZ(0);
}

/* 防 CLS */
#promoSlots { min-height: 84px; }
#fileGrid { min-height: auto; }

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
