/* 权限提示遮罩层 */
.permission-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.permission-content {
  background: var(--surface-color);
  padding: 30px;
  border-radius: var(--border-radius);
  max-width: 90%;
  width: 400px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.permission-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-light);
}

.permission-steps {
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: left;
}

.permission-steps ol {
  margin: 10px 0 0 0;
  padding-left: 20px;
}

.permission-steps li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.permission-note {
  color: var(--warning-color);
  margin: 15px 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* 加载遮罩层 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  backdrop-filter: blur(5px);
}

.loading-content {
  background: var(--surface-color);
  padding: 30px;
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  min-width: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--primary-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.loading-text {
  color: var(--text-primary);
  font-size: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* PWA安装提示 */
.pwa-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(46, 125, 50, 0.95);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  z-index: 1002;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-width: 90%;
  width: 400px;
}

.pwa-prompt-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.pwa-install-btn {
  background: white;
  color: #2E7D32;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
  transition: var(--transition);
}

.pwa-install-btn:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}

.pwa-close-btn {
  background: transparent;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.pwa-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Toast通知 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 1003;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-width: 300px;
  word-wrap: break-word;
  animation: toastSlideIn 0.3s ease-out;
}

.toast-error {
  background: var(--error-color);
}

.toast-warning {
  background: var(--warning-color);
  color: #333;
}

.toast-success {
  background: var(--primary-color);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 状态指示器 */
.status-indicator {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning-color);
  color: #333;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 999;
  box-shadow: var(--shadow);
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 历史记录空状态 */
.history-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-description {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .permission-content {
    margin: 20px;
    padding: 20px;
  }
  
  .pwa-prompt {
    bottom: 10px;
    left: 5%;
    right: 5%;
    transform: none;
    width: auto;
  }
  
  .pwa-prompt-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* 深色模式调整 */
[data-theme="light"] .permission-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .loading-overlay {
  background: rgba(0, 0, 0, 0.5);
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-left-color: transparent;
  }
  
  .toast {
    animation: none;
  }
  
  .status-indicator {
    animation: none;
  }
}