/* ========== 用户系统样式 ========== */

/* 登录按钮 */
.user-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  border-radius: 20px;
  text-decoration: none !important;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.user-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.user-login-btn .user-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 收藏按钮 */
.favorite-btn {
  position: fixed;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  z-index: 1000;
}

.favorite-btn:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
  transform: translateY(-2px);
}

.favorite-btn.favorited {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  border-color: #ff6b6b;
  color: white;
}

.favorite-btn .heart-icon {
  font-size: 18px;
}

.favorite-btn.bottom {
  bottom: 80px;
}

.favorite-btn.top {
  top: 100px;
}

/* 弹窗样式 */
.user-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #333;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.switch-mode {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.switch-mode a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

/* 用户菜单 */
.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
  border-radius: 12px;
  margin-bottom: 20px;
}

.user-info .avatar {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
}

.user-info .details .username {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.user-info .details .email {
  font-size: 14px;
  color: #888;
  margin-top: 4px;
}

.user-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #555;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s ease;
  width: 100%;
  border: none;
  background: none;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.user-menu .menu-item:hover {
  background: #f5f5f5;
}

.user-menu .menu-item .icon {
  font-size: 18px;
}

.user-menu .menu-item.logout {
  color: #e74c3c;
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

/* Toast提示 */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: #333;
  color: white;
  border-radius: 30px;
  font-size: 15px;
  z-index: 20000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.toast-error {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* ========== 用户中心页面样式 ========== */

.user-center {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.user-center-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
  padding: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  color: white;
}

.user-center-header .avatar {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.user-center-header h1 {
  margin: 0;
  font-size: 28px;
}

.user-center-header p {
  margin: 8px 0 0;
  opacity: 0.9;
  font-size: 15px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.stat-card .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.stat-card .value {
  font-size: 32px;
  font-weight: bold;
  color: #667eea;
}

.stat-card .label {
  color: #888;
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #f5f5f5;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
}

.search-bar button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.list-item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.list-item .info {
  flex: 1;
  min-width: 0;
}

.list-item .title {
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.list-item .site-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #667eea20;
  color: #667eea;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
}

.list-item .actions {
  display: flex;
  gap: 8px;
  margin-left: 16px;
}

.list-item .actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.list-item .actions .visit-btn {
  background: #667eea;
  color: white;
}

.list-item .actions .delete-btn {
  background: #fee;
  color: #e74c3c;
}

.list-item .actions .delete-btn:hover {
  background: #e74c3c;
  color: white;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.pagination button {
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state .icon {
  font-size: 60px;
  margin-bottom: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* 响应式 */
@media (max-width: 768px) {
  .user-center-header {
    flex-direction: column;
    text-align: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .search-bar {
    flex-direction: column;
  }
  
  .list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .list-item .actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* 收藏列表增强样式 */
.url-preview {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}
.category-tag {
    padding: 0.15rem 0.5rem;
    background: #f1f5f9;
    border-radius: 1rem;
    font-size: 0.7rem;
    color: #64748b;
    margin-left: 0.5rem;
}
